Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

86 changes: 69 additions & 17 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,72 +1,124 @@
## 1.2.0+1
## 1.0.0

Initial release, forked from
[jailbreak_root_detection](https://github.com/w3connext/jailbreak_root_detection) 1.2.0+1 and
republished as `jailbreak_root_detection_plus`.

### Renamed identifiers

The Dart API is unchanged — `JailbreakRootDetection.instance` and all of its members keep their
names and behaviour. Migrating from `jailbreak_root_detection` requires:

* `import 'package:jailbreak_root_detection_plus/jailbreak_root_detection_plus.dart';`
* The Android Kotlin package is now `com.w3conext.jailbreak_root_detection_plus`.
* The method channel is now `jailbreak_root_detection_plus`, so this package can be installed
alongside the original without colliding.

### Android build changes

* Migrates to built-in Kotlin. The plugin no longer applies the Kotlin Gradle Plugin
(`kotlin-android`), which is required to build with Android Gradle Plugin 9.0+.
See https://docs.flutter.dev/release/breaking-changes/migrate-to-built-in-kotlin
* Updates the Android Gradle Plugin to 9.0.1, Kotlin to 2.3.20 and Gradle to 9.1.0.
* Raises `compileSdk` from 34 to 36 and the Java/Kotlin JVM target from 11 to 17 (AGP 9 requires JDK 17).
* Keeps the Android `minSdk` at 21.
* Updates RootBeer from 0.1.1 to 0.1.2.
* Drops `android.enableJetifier` and the `package` attribute from `AndroidManifest.xml`, both
removed in AGP 9.
* Note: on AGP 9+ with Flutter 3.44-3.46 you must set `android.builtInKotlin=false` and
`android.newDsl=false` in `android/gradle.properties`. Flutter 3.47+ needs no flags.
See the "Android build requirements" section in the README.

### iOS build changes

* Supports both Swift Package Manager and CocoaPods.
* Declares the `FlutterFramework` Swift package dependency in
`ios/jailbreak_root_detection_plus/Package.swift`, required by Flutter 3.44+ for Swift Package
Manager plugins.
* Raises the iOS deployment target from 12.0 to 13.0, matching Flutter 3.44's minimum.
* Updates IOSSecuritySuite from 1.9.10 to the latest available on each channel: `2.3.0` for Swift
Package Manager, `2.2.0` for CocoaPods (2.3.0 was never published to the CocoaPods trunk).

### Requirements

Flutter 3.44 / Dart 3.12 or newer.

---

<details>
<summary>Inherited history from <code>jailbreak_root_detection</code></summary>

### 1.2.0+1

* Improve Android and SDK Compatibility Without Over-Upgrading
* Acknowledgements: Thanks to @vicajilau for their PRs 🙏

## 1.2.0
### 1.2.0

* Added support for 16 KB page sizes
* Upgraded compileSdk and Gradle version
* Added background execution support
* Added null-safety support in `ExternalStorageCheck.kt`
* Acknowledgements: Thanks to @n0ks, @maeddin, @vicajilau, @anderscheow, and @bjlf12 for their PRs 🙏

## 1.1.6
### 1.1.6

* fix: TARGET_OS_SIMULATOR is deprecated in swift

## 1.1.5
### 1.1.5

* check has property namespace for Android

## 1.1.4
### 1.1.4

* Enhance security by adding more suspicious paths in iOS

## 1.1.3
### 1.1.3

* Add function is debugger on iOS and Android

## 1.1.2
### 1.1.2

* Check debugger on android

## 1.1.1
### 1.1.1

* Fixed bug pixel

## 1.1.0
### 1.1.0

* Add method `checkForIssues`

## 1.0.0
### 1.0.0

* Remove the function 'checkPSelectFlag' for the reverse engineering checker

## 0.0.7
### 0.0.7

* Update version IOSSecuritySuite to 1.9.10

## 0.0.6
### 0.0.6

* Change logic check detect frida to jvm

## 0.0.5
### 0.0.5

* Change library for check detect frida

## 0.0.4
### 0.0.4

* Config jniLibs by "armeabi-v7a", "arm64-v8a", "x86", "x86_64"

## 0.0.3
### 0.0.3

* Config ndk abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64"

## 0.0.2
### 0.0.2

* Remove config application in AndroidManifest.xml

## 0.0.1
### 0.0.1

* Uses RootBeer + DetectFrida for Android root detection and IOSSecuritySuite for iOS jailbreak detection.

</details>
69 changes: 64 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
# jailbreak_root_detection
# jailbreak_root_detection_plus

[![pub package](https://img.shields.io/pub/v/jailbreak_root_detection.svg)](https://pub.dartlang.org/packages/jailbreak_root_detection)
[![pub package](https://img.shields.io/pub/v/jailbreak_root_detection_plus.svg)](https://pub.dev/packages/jailbreak_root_detection_plus)

Uses [RootBeer](https://github.com/scottyab/rootbeer) + DetectFrida for Android root detection and [IOSSecuritySuite (~> 1.9.10)](https://github.com/securing/IOSSecuritySuite/tree/1.9.10) for iOS jailbreak detection.
Uses [RootBeer](https://github.com/scottyab/rootbeer) + DetectFrida for Android root detection and [IOSSecuritySuite (~> 2.3.0)](https://github.com/securing/IOSSecuritySuite/tree/2.3.0) for iOS jailbreak detection.

A fork of [jailbreak_root_detection](https://github.com/w3connext/jailbreak_root_detection), updated for
Android Gradle Plugin 9 and Flutter 3.44+. See [Migrating from jailbreak_root_detection](#migrating-from-jailbreak_root_detection).

## Getting started

In your flutter project add the dependency:

```yaml
jailbreak_root_detection: "^1.2.0+1"
jailbreak_root_detection_plus: "^1.0.0"
```

## Usage
Expand All @@ -23,6 +26,8 @@ Running on an emulator or simulator may cause false positives — for example, t
### Android

```dart
import 'package:jailbreak_root_detection_plus/jailbreak_root_detection_plus.dart';

final isNotTrust = await JailbreakRootDetection.instance.isNotTrust;
final isJailBroken = await JailbreakRootDetection.instance.isJailBroken;
final isRealDevice = await JailbreakRootDetection.instance.isRealDevice;
Expand All @@ -31,6 +36,22 @@ final checkForIssues = await JailbreakRootDetection.instance.checkForIssues;
final isDevMode = await JailbreakRootDetection.instance.isDevMode;
```

### Android build requirements

Requires Flutter 3.44 or newer, and `minSdk` 21 or higher.

This plugin has migrated to [built-in Kotlin](https://developer.android.com/build/migrate-to-built-in-kotlin):
it no longer applies the Kotlin Gradle Plugin itself, which is what Android Gradle Plugin 9.0+ requires.

| Your Android setup | What you need to do |
| --- | --- |
| AGP 8.x | Nothing. Flutter applies the Kotlin Gradle Plugin for this plugin automatically. |
| AGP 9+ on Flutter 3.44–3.46 | Set `android.builtInKotlin=false` and `android.newDsl=false` in `android/gradle.properties`. Flutter's own project template already does this. |
| AGP 9+ on Flutter 3.47+ | Nothing. Both `android.builtInKotlin=true` and `false` work. |

If you see *"The 'org.jetbrains.kotlin.android' plugin is no longer required for Kotlin support since AGP 9.0"*,
you are on AGP 9 with Flutter 3.44–3.46 and `android.builtInKotlin=true`; either set it to `false` or upgrade to Flutter 3.47+.

### iOS

- Update `Info.plist`
Expand All @@ -48,15 +69,53 @@ final isDevMode = await JailbreakRootDetection.instance.isDevMode;
```

```dart
import 'package:jailbreak_root_detection_plus/jailbreak_root_detection_plus.dart';

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 bundleId = 'my-bundle-id'; // Ex: final bundleId = 'com.w3conext.jailbreakRootDetectionPlusExample'
final isTampered = await JailbreakRootDetection.instance.isTampered(bundleId);
```

### iOS build requirements

Requires iOS 13.0 or higher. Both Swift Package Manager and CocoaPods are supported — no extra
configuration is needed for either.

`IOSSecuritySuite` resolves to the newest release available on your dependency manager: `2.3.0`
under Swift Package Manager, `2.2.0` under CocoaPods (2.3.0 has not been published to the CocoaPods
trunk). 2.3.0 adds jailbreak detection checks, so Swift Package Manager builds detect slightly more.

## Migrating from jailbreak_root_detection

The Dart API is unchanged: `JailbreakRootDetection.instance` and all of its members keep their
names and behaviour. Only the identifiers changed.

1. Swap the dependency in `pubspec.yaml`:

```yaml
dependencies:
- jailbreak_root_detection: ^1.2.0+1
+ jailbreak_root_detection_plus: ^1.0.0
```

2. Update your imports:

```dart
-import 'package:jailbreak_root_detection/jailbreak_root_detection.dart';
+import 'package:jailbreak_root_detection_plus/jailbreak_root_detection_plus.dart';
```

3. Check the [Android build requirements](#android-build-requirements) table if you are on AGP 9+.

The method channel was renamed to `jailbreak_root_detection_plus` and the Android Kotlin package to
`com.w3conext.jailbreak_root_detection_plus`, so both packages can be installed in the same app
without colliding.

### Reference

- https://github.com/anish-adm/trust_fall
- https://github.com/w3connext/jailbreak_root_detection
58 changes: 30 additions & 28 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,56 +1,58 @@
group 'com.w3conext.jailbreak_root_detection_plus'
version '1.0-SNAPSHOT'

buildscript {
ext.kotlin_version = '1.8.22'
}
ext.kotlin_version = '2.3.20'
repositories {
google()
mavenCentral()
}

plugins {
id 'com.android.library'
id 'org.jetbrains.kotlin.android'
dependencies {
classpath 'com.android.tools.build:gradle:9.0.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

allprojects {
repositories {
gradlePluginPortal()
google()
mavenCentral()
}
}

group 'com.w3conext.jailbreak_root_detection'

apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

android {
if (project.android.hasProperty("namespace")) {
namespace 'com.w3conext.jailbreak_root_detection'
}

compileSdkVersion 34

compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

kotlinOptions {
jvmTarget = "11"
}
namespace 'com.w3conext.jailbreak_root_detection_plus'
compileSdk 36

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
//test.java.srcDirs += 'src/test/kotlin'
}

defaultConfig {
minSdkVersion 21
minSdk 21
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
lintOptions {

lint {
disable 'InvalidPackage'
}
}

kotlin {
compilerOptions {
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
}
}

dependencies {
implementation "androidx.annotation:annotation:1.9.1"
implementation 'com.scottyab:rootbeer-lib:0.1.1'
implementation 'com.scottyab:rootbeer-lib:0.1.2'
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3"
}
}
5 changes: 1 addition & 4 deletions android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
org.gradle.jvmargs=-Xmx1536M
org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError
android.useAndroidX=true
android.enableJetifier=true
AGPVersion=8.3.0
kotlin_version=1.9.0
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#Wed Aug 06 10:02:34 MYT 2025
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
14 changes: 1 addition & 13 deletions android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1 @@
pluginManagement {
repositories {
gradlePluginPortal()
google()
mavenCentral()
}
plugins {
id 'com.android.library' version "${AGPVersion}"
id 'org.jetbrains.kotlin.android' version "${kotlin_version}"
}
}

rootProject.name = 'jailbreak_root_detection'
rootProject.name = 'jailbreak_root_detection_plus'
4 changes: 1 addition & 3 deletions android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.w3conext.jailbreak_root_detection">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.INTERNET" />

Expand Down
2 changes: 1 addition & 1 deletion android/src/main/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.18.1)

project("jailbreak_root_detection")
project("jailbreak_root_detection_plus")

set(can_use_assembler TRUE)

Expand Down
Loading