Skip to content

QuickBirdEng/jailbreak_root_detection

 
 

Repository files navigation

jailbreak_root_detection

pub package

Uses RootBeer + DetectFrida for Android root detection and IOSSecuritySuite (~> 1.9.10) for iOS jailbreak detection.

Getting started

In your flutter project add the dependency:

jailbreak_root_detection: "^1.1.6"

Usage

Android

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;

iOS

  • 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);

Disabling Logging (Security)

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.

Reference

Packages

No packages published

Languages

  • Kotlin 36.3%
  • Swift 26.2%
  • C++ 14.2%
  • Dart 10.5%
  • C 4.9%
  • Ruby 4.1%
  • Other 3.8%