{"id":18964925,"url":"https://github.com/abdelrahmanbonna/security_plus","last_synced_at":"2025-04-19T12:50:49.293Z","repository":{"id":226456238,"uuid":"657309896","full_name":"abdelrahmanbonna/security_plus","owner":"abdelrahmanbonna","description":"Flutter Plugin to handle all security needs","archived":false,"fork":false,"pushed_at":"2024-12-09T13:52:05.000Z","size":338,"stargazers_count":4,"open_issues_count":2,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-29T08:03:42.500Z","etag":null,"topics":["development-mode","emulator","external-storage","flutter","jailbreak","root"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abdelrahmanbonna.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-22T19:28:54.000Z","updated_at":"2024-12-09T11:19:42.000Z","dependencies_parsed_at":"2024-03-07T17:54:26.833Z","dependency_job_id":"e63a9034-80bf-4428-8cd4-9f44934ae9aa","html_url":"https://github.com/abdelrahmanbonna/security_plus","commit_stats":null,"previous_names":["abdelrahmanbonna/security_plus"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abdelrahmanbonna%2Fsecurity_plus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abdelrahmanbonna%2Fsecurity_plus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abdelrahmanbonna%2Fsecurity_plus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abdelrahmanbonna%2Fsecurity_plus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abdelrahmanbonna","download_url":"https://codeload.github.com/abdelrahmanbonna/security_plus/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249201117,"owners_count":21229004,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["development-mode","emulator","external-storage","flutter","jailbreak","root"],"created_at":"2024-11-08T14:27:05.771Z","updated_at":"2025-04-19T12:50:49.273Z","avatar_url":"https://github.com/abdelrahmanbonna.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Security Plus\n\nA comprehensive Flutter security plugin that provides advanced security features for your Flutter applications, including root detection, emulator detection, and various security checks.\n\n[![pub package](https://img.shields.io/pub/v/security_plus.svg)](https://pub.dev/packages/security_plus)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n## Features\n\n- 🛡️ **Advanced Root Detection**\n  - Multiple detection layers\n  - Frida anti-tampering protection\n  - Magisk detection\n  - SuperSU detection\n  - Common root app detection\n\n- 📱 **Emulator Detection**\n  - Comprehensive emulator environment checks\n  - Build properties analysis\n  - Hardware characteristics verification\n\n- 🔒 **Security Checks**\n  - Development mode detection\n  - Mock location detection\n  - External storage checks\n  - Runtime integrity verification\n  - System tampering detection\n\n## Installation\n\nAdd this to your package's `pubspec.yaml` file:\n\n```yaml\ndependencies:\n  security_plus: ^3.0.1\n```\n\n## Platform Setup\n\n### Android\n\n1.Add the following permissions to your AndroidManifest.xml file:\n\n```xml\n\u003cmanifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\u003e\n    \u003cuses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/\u003e\n    \u003cuses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/\u003e\n\u003c/manifest\u003e\n```\n\n2.Add permission_handler for runtime permission management:\n\n```yaml\ndependencies:\n  permission_handler: ^10.4.3\n```\n\n### iOS\n\nAdd the following to your Info.plist file:\n\n```xml\n\u003ckey\u003eNSLocationWhenInUseUsageDescription\u003c/key\u003e\n\u003cstring\u003eThis app needs access to location when open to verify device security.\u003c/string\u003e\n```\n\n## Usage\n\n### Import the package\n\n```dart\nimport 'package:security_plus/security_plus.dart';\nimport 'package:permission_handler/permission_handler.dart';\n```\n\n### Handle Permissions and Security Checks\n\n```dart\nFuture\u003cvoid\u003e checkDeviceSecurity() async {\n  // Request location permission first\n  if (Platform.isAndroid) {\n    final status = await Permission.location.request();\n    if (!status.isGranted) {\n      // Handle permission denied\n      return;\n    }\n  }\n\n  // Perform security checks\n  try {\n    final isRooted = await SecurityPlus.isRooted;\n    final isEmulator = await SecurityPlus.isEmulator;\n    final isDevelopmentMode = await SecurityPlus.isDevelopmentModeEnable;\n    final isMockLocation = await SecurityPlus.isMockLocationEnabled;\n    final isExternalStorage = await SecurityPlus.isOnExternalStorage;\n\n    // Handle security check results\n    if (isRooted || isEmulator || isMockLocation) {\n      // Handle security risks\n    }\n  } catch (e) {\n    // Handle errors\n  }\n}\n```\n\n### Individual Security Checks\n\n#### Root Detection\n\n```dart\ntry {\n  bool isRooted = await SecurityPlus.isRooted;\n  if (isRooted) {\n    // Handle rooted device\n  }\n} catch (e) {\n  // Handle errors\n}\n```\n\n#### Emulator Detection\n\n```dart\ntry {\n  bool isEmulator = await SecurityPlus.isEmulator;\n  if (isEmulator) {\n    // Handle emulator detection\n  }\n} catch (e) {\n  // Handle errors\n}\n```\n\n#### Development Mode Check\n\n```dart\ntry {\n  bool isDevelopmentMode = await SecurityPlus.isDevelopmentModeEnable;\n  if (isDevelopmentMode) {\n    // Handle development mode\n  }\n} catch (e) {\n  // Handle errors\n}\n```\n\n#### Mock Location Check\n\n```dart\ntry {\n  bool isMockLocation = await SecurityPlus.isMockLocationEnabled;\n  if (isMockLocation) {\n    // Handle mock location\n  }\n} catch (e) {\n  // Handle errors\n}\n```\n\n#### External Storage Check\n\n```dart\ntry {\n  bool isOnExternalStorage = await SecurityPlus.isOnExternalStorage;\n  if (isOnExternalStorage) {\n    // Handle external storage detection\n  }\n} catch (e) {\n  // Handle errors\n}\n```\n\n## Security Features\n\n### Root Detection Mechanisms\n\nThe plugin employs multiple layers of root detection:\n\n1. **RootBeer Integration**: Uses the advanced RootBeer library for base root detection\n2. **Frida Detection**: Actively searches for Frida-related processes and libraries\n3. **File System Checks**: Scans for common root-related files and directories\n4. **Package Analysis**: Detects known root management applications\n5. **Runtime Integrity**: Checks for system modifications and hooks\n\n### Anti-Tampering Protection\n\n- Process monitoring for known tampering tools\n- Library injection detection\n- System property verification\n- Runtime integrity checks\n\n## Example\n\nCheck out the [example](example) directory for a complete sample application demonstrating all features.\n\n## Platform Support\n\n| Android | iOS |\n|:-------:|:---:|\n|    ✅    |  🚧  |\n\n## Contributing\n\nContributions are welcome! If you find a bug or want a feature, please open an issue.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Author\n\nCreated and maintained by [Abdelrahman Bonna](https://github.com/abdelrahmanbonna).\n\n## Acknowledgments\n\n- [RootBeer](https://github.com/scottyab/rootbeer) - For root detection capabilities\n- The Flutter team and community for their amazing work\n\n## Disclaimer\n\nThis plugin provides security features but should not be considered as the sole security measure for your application. Always implement multiple layers of security and keep your security measures up to date.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabdelrahmanbonna%2Fsecurity_plus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabdelrahmanbonna%2Fsecurity_plus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabdelrahmanbonna%2Fsecurity_plus/lists"}