Uses RootBeer + DetectFrida for Android root detection and IOSSecuritySuite (~> 1.9.10) for iOS jailbreak detection.
In your flutter project add the dependency:
jailbreak_root_detection: "^1.1.6"final isNotTrust = await JailbreakRootDetection.instance.isNotTrust;
final isJailBroken = await JailbreakRootDetection.instance.isJailBroken;
final isRealDevice = await JailbreakRootDetection.instance.isRealDevice;
final isOnExternalStorage = await JailbreakRootDetection.instance.isOnExternalStorage;
final checkForIssues = await JailbreakRootDetection.instance.checkForIssues;
final isDevMode = await JailbreakRootDetection.instance.isDevMode;- Update
Info.plist
<key>LSApplicationQueriesSchemes</key>
<array>
<string>undecimus</string>
<string>sileo</string>
<string>zbra</string>
<string>filza</string>
<string>activator</string>
<string>cydia</string>
</array>final isNotTrust = await JailbreakRootDetection.instance.isNotTrust;
final isJailBroken = await JailbreakRootDetection.instance.isJailBroken;
final isRealDevice = await JailbreakRootDetection.instance.isRealDevice;
final checkForIssues = await JailbreakRootDetection.instance.checkForIssues;
final bundleId = 'my-bundle-id'; // Ex: final bundleId = 'com.w3conext.jailbreakRootDetectionExample'
final isTampered = await JailbreakRootDetection.instance.isTampered(bundleId);For production apps, you can disable all native logging:
// Call early in your app to disable all logging
await JailbreakRootDetection.instance.setLogging(false);How it works:
- The logging is disabled by default
- The flag is in-memory and resets on app restart
Complete removal in release:
To completely remove logging from your production binary, add the ProGuard rules to your app's android/app/build.gradle:
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}This plugin includes android/proguard-rules.pro which strips all logging calls from the final APK.