{"id":26261860,"url":"https://github.com/kauemurakami/flutter_tamper_detector","last_synced_at":"2025-12-28T10:05:14.322Z","repository":{"id":281927350,"uuid":"946790477","full_name":"kauemurakami/flutter_tamper_detector","owner":"kauemurakami","description":"[Package Flutter] Flutter Tamper Detector is a security plugin for Flutter that detects and prevents tampering. It identifies if the device is rooted, if hooking tools like Frida, Xposed, or Cydia Substrate are present, or if the device is an emulator. It can automatically close the app to protect integrity and security.","archived":false,"fork":false,"pushed_at":"2025-03-11T21:53:53.000Z","size":25,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-11T22:25:12.225Z","etag":null,"topics":["cydia","dart","flutter","flutter-hooks","flutter-package","flutter-platform-channel","flutter-root","flutter-security","frida","kotlin","platform-channels","security","security-app","xposed"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kauemurakami.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":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-11T17:18:30.000Z","updated_at":"2025-03-11T22:00:32.000Z","dependencies_parsed_at":"2025-03-11T22:35:22.645Z","dependency_job_id":null,"html_url":"https://github.com/kauemurakami/flutter_tamper_detector","commit_stats":null,"previous_names":["kauemurakami/flutter_tamper_detector"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kauemurakami%2Fflutter_tamper_detector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kauemurakami%2Fflutter_tamper_detector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kauemurakami%2Fflutter_tamper_detector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kauemurakami%2Fflutter_tamper_detector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kauemurakami","download_url":"https://codeload.github.com/kauemurakami/flutter_tamper_detector/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243500787,"owners_count":20300775,"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":["cydia","dart","flutter","flutter-hooks","flutter-package","flutter-platform-channel","flutter-root","flutter-security","frida","kotlin","platform-channels","security","security-app","xposed"],"created_at":"2025-03-14T00:16:24.143Z","updated_at":"2025-12-28T10:05:14.315Z","avatar_url":"https://github.com/kauemurakami.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Star on GitHub](https://img.shields.io/github/stars/kauemurakami/flutter_tamper_detector.svg?style=flat\u0026logo=github\u0026colorB=deeppink\u0026label=stars)](https://github.com/kauemurakami/flutter_tamper_detector)\n# flutter_tamper_detector\n\nflutter_tamper_detector is a Flutter security plugin designed to detect and prevent application tampering. It checks if the device is rooted, if tools like Frida, Xposed, or Cydia Substrate are being used, or if the app is running on an emulator. With this information, you can implement security measures in your Flutter app, such as terminating the application or blocking execution.\n\n## Getting Started\n\n```\n$ flutter pub add flutter_tamper_detector\n```\nor add in your dependencies\n```\ndependencies:\n  flutter_tamper_detector: \u003clatest\u003e\n```\n\n## Usage\n\nSimple and easy to use!\u003cbr/\u003e\n\n```dart\nimport 'package:flutter_tamper_detector/flutter_tamper_detector.dart';\n```\nNow just use the functions directly with our main class `FlutterTamperDetector`:\u003cbr/\u003e\n\n```dart\nbool isEmulator = await FlutterTamperDetector.isEmulator();\nbool isRooted   = await FlutterTamperDetector.isRooted();\nbool isHooked   = await FlutterTamperDetector.isHooked();\nbool isDebug    = await FlutterTamperDetector.isDebug();\nbool installedFromPlayStore = await FlutterTamperDetector.isInstalledFromPlaystore();\n```\nThen you can make some decision in your app according to your needs, for example, the app if it is running on a rooted device.\u003cbr/\u003e\n```dart\n Future\u003cvoid\u003e checkIfRooted() async {\n    bool isRooted = await FlutterTamperDetector.isRooted();\n\n    if (isRooted) {\n      print('Device is rooted...');\n      // TODO: your logic here\n    } else {\n      print('Device is not rooted.');\n    }\n  }\n```\nOr, if you want to automatically terminate the app process when any of the functions are true, you can use the `exitProcessIfTrue: true` parameter.\u003cbr\u003e\nThis way, the application will terminate the process immediately without the need for a decision structure in your Flutter code.\u003cbr/\u003e\nOnly for `isInstalledFromPlaystore` we have a different parameter that is similar to the previous one but this time, we want to take action if the return is false, and not true, so we use `exitProcessIfFalse: true` if the app was not installed directly from the store. (in debug this will always return false)\n```dart\nbool isEmulator = await FlutterTamperDetector.isEmulator(exitProcessIfTrue: true);\nbool isRooted   = await FlutterTamperDetector.isRooted(exitProcessIfTrue: true);\nbool isHooked   = await FlutterTamperDetector.isHooked(exitProcessIfTrue: true);\nbool isDebug    = await FlutterTamperDetector.isDebug(exitProcessIfTrue: true);\nbool installedFromPlayStore = await FlutterTamperDetector.isInstalledFromPlaystore(exitProcessIfFalse: true);\n```\nWe also have a new parameter for the `isRooted` and `isHooked` functions `uninstallIfTrue` that can be passed to use the \"attacking\" phone's own root to uninstall the app with administrator permissions automatically. (This can only be tested on rooted devices)\u003cbr/\u003e\n```dart\nbool isRooted   = await FlutterTamperDetector.isRooted(uninstallIfTrue: true);\nbool isHooked   = await FlutterTamperDetector.isHooked(uninstallIfTrue: true);\n```\nIf you use both parameters as true, the uninstallation process is called first, if you just want to exit the app just use `exitProcessIfTrue`\u003cbr/\u003e\nSee more details in [`/example`](https://github.com/kauemurakami/flutter_tamper_detector/tree/main/example)\u003cbr/\u003e\n\nNow we also have the functionality to prevent screenshots and not leave the application visible when it is in the app menu (when you minimize it to switch apps for example) resulting in a black screen.\u003cbr/\u003e\n```dart\nawait FlutterTamperDetector.appSecuritySettings();\n```\n\n## Use native\nIf you want to stop the process before even entering the Flutter engine, I will provide an example using the same classes here in the package for you to implement directly in the `onCreate` of our `MainActivity.kt`, this way we close the application and end the process before even entering the Flutter engine. Suggestion received via Linkedin from: *Adrian Kohls*\u003cbr\u003e\nAccess -\u003e [native_tamper_detector](https://github.com/kauemurakami/native_tamper_detector)\n\n## ProGuard/R8\nIf your Flutter app is configured to use ProGuard or R8 (code minification enabled), some flutter_tamper_detector classes may be obfuscated or removed.\u003cbr/\u003e\nTo avoid this, add the following rules to your proguard-rules.pro file (located in `android/app/proguard-rules.pro` in your project):\u003cbr/\u003e\n```proguard\n# Keeps all classes from the native package\n-keep class com.deebx.flutter_tamper_detector.** { *; }\n\n# Prevents class names from being changed\n-keepnames class com.deebx.flutter_tamper_detector.**\n```\nSee more details in [`/example`](https://github.com/kauemurakami/flutter_tamper_detector/tree/main/example).\n\n## How test\n 1 - Run on a emulator\u003cbr/\u003e\n 2 - Run on a device rooted (ex with [magisk](https://github.com/topjohnwu/Magisk))\u003cbr/\u003e\n 3 - Run on a device that has frida on it, for example, you can test this by following the [official frida documentation](https://frida.re/docs/android/), after completing the steps described there, run the application.\u003cbr/\u003e\n Don't worry, after that you will be able to remove Frida from your device.\u003cbr/\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkauemurakami%2Fflutter_tamper_detector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkauemurakami%2Fflutter_tamper_detector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkauemurakami%2Fflutter_tamper_detector/lists"}