diff --git a/.idea/jailbreak_root_detection.iml b/.idea/jailbreak_root_detection_plus.iml similarity index 100% rename from .idea/jailbreak_root_detection.iml rename to .idea/jailbreak_root_detection_plus.iml diff --git a/.idea/modules.xml b/.idea/modules.xml index 885e558..0952a0a 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -2,8 +2,8 @@ - - + + \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index c436897..0fd744a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,59 @@ -## 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. + +--- + +
+Inherited history from jailbreak_root_detection + +### 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 @@ -11,62 +61,64 @@ * 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. + +
diff --git a/README.md b/README.md index 681b97a..482f7ac 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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; @@ -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` @@ -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 diff --git a/android/build.gradle b/android/build.gradle index fa154b7..ab9cd48 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -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" -} \ No newline at end of file +} diff --git a/android/gradle.properties b/android/gradle.properties index 53227b1..fbee1d8 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -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 \ No newline at end of file diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index a75c511..d0b6781 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -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 diff --git a/android/settings.gradle b/android/settings.gradle index 1e230db..a913532 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -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' diff --git a/android/src/main/AndroidManifest.xml b/android/src/main/AndroidManifest.xml index 07da773..b07e428 100644 --- a/android/src/main/AndroidManifest.xml +++ b/android/src/main/AndroidManifest.xml @@ -1,6 +1,4 @@ - + diff --git a/android/src/main/cpp/CMakeLists.txt b/android/src/main/cpp/CMakeLists.txt index 0c35714..6e9c6a8 100644 --- a/android/src/main/cpp/CMakeLists.txt +++ b/android/src/main/cpp/CMakeLists.txt @@ -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) diff --git a/android/src/main/kotlin/com/w3conext/jailbreak_root_detection/JailbreakRootDetectionPlugin.kt b/android/src/main/kotlin/com/w3conext/jailbreak_root_detection_plus/JailbreakRootDetectionPlugin.kt similarity index 90% rename from android/src/main/kotlin/com/w3conext/jailbreak_root_detection/JailbreakRootDetectionPlugin.kt rename to android/src/main/kotlin/com/w3conext/jailbreak_root_detection_plus/JailbreakRootDetectionPlugin.kt index 899bcbb..4cb6601 100644 --- a/android/src/main/kotlin/com/w3conext/jailbreak_root_detection/JailbreakRootDetectionPlugin.kt +++ b/android/src/main/kotlin/com/w3conext/jailbreak_root_detection_plus/JailbreakRootDetectionPlugin.kt @@ -1,14 +1,14 @@ -package com.w3conext.jailbreak_root_detection +package com.w3conext.jailbreak_root_detection_plus import android.content.Context import com.anish.trust_fall.emulator.EmulatorCheck import com.anish.trust_fall.externalstorage.ExternalStorageCheck import com.anish.trust_fall.rooted.RootedCheck import com.scottyab.rootbeer.util.QLog -import com.w3conext.jailbreak_root_detection.debuger.Debugger -import com.w3conext.jailbreak_root_detection.devmode.DevMode -import com.w3conext.jailbreak_root_detection.frida.AntiFridaChecker -import com.w3conext.jailbreak_root_detection.magisk.MagiskChecker +import com.w3conext.jailbreak_root_detection_plus.debuger.Debugger +import com.w3conext.jailbreak_root_detection_plus.devmode.DevMode +import com.w3conext.jailbreak_root_detection_plus.frida.AntiFridaChecker +import com.w3conext.jailbreak_root_detection_plus.magisk.MagiskChecker import io.flutter.embedding.engine.plugins.FlutterPlugin import io.flutter.plugin.common.MethodCall import io.flutter.plugin.common.MethodChannel @@ -32,7 +32,7 @@ class JailbreakRootDetectionPlugin : FlutterPlugin, MethodCallHandler { override fun onAttachedToEngine(flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) { appContext = flutterPluginBinding.applicationContext - channel = MethodChannel(flutterPluginBinding.binaryMessenger, "jailbreak_root_detection") + channel = MethodChannel(flutterPluginBinding.binaryMessenger, "jailbreak_root_detection_plus") channel.setMethodCallHandler(this) } diff --git a/android/src/main/kotlin/com/w3conext/jailbreak_root_detection/debuger/Debugger.kt b/android/src/main/kotlin/com/w3conext/jailbreak_root_detection_plus/debuger/Debugger.kt similarity index 89% rename from android/src/main/kotlin/com/w3conext/jailbreak_root_detection/debuger/Debugger.kt rename to android/src/main/kotlin/com/w3conext/jailbreak_root_detection_plus/debuger/Debugger.kt index 3bbe256..256a884 100644 --- a/android/src/main/kotlin/com/w3conext/jailbreak_root_detection/debuger/Debugger.kt +++ b/android/src/main/kotlin/com/w3conext/jailbreak_root_detection_plus/debuger/Debugger.kt @@ -1,4 +1,4 @@ -package com.w3conext.jailbreak_root_detection.debuger +package com.w3conext.jailbreak_root_detection_plus.debuger import android.content.Context import android.provider.Settings diff --git a/android/src/main/kotlin/com/w3conext/jailbreak_root_detection/devmode/DevMode.kt b/android/src/main/kotlin/com/w3conext/jailbreak_root_detection_plus/devmode/DevMode.kt similarity index 85% rename from android/src/main/kotlin/com/w3conext/jailbreak_root_detection/devmode/DevMode.kt rename to android/src/main/kotlin/com/w3conext/jailbreak_root_detection_plus/devmode/DevMode.kt index e9d69e8..aa5e49d 100644 --- a/android/src/main/kotlin/com/w3conext/jailbreak_root_detection/devmode/DevMode.kt +++ b/android/src/main/kotlin/com/w3conext/jailbreak_root_detection_plus/devmode/DevMode.kt @@ -1,4 +1,4 @@ -package com.w3conext.jailbreak_root_detection.devmode +package com.w3conext.jailbreak_root_detection_plus.devmode import android.content.Context import android.provider.Settings diff --git a/android/src/main/kotlin/com/w3conext/jailbreak_root_detection/frida/AntiFridaBlocklist.kt b/android/src/main/kotlin/com/w3conext/jailbreak_root_detection_plus/frida/AntiFridaBlocklist.kt similarity index 92% rename from android/src/main/kotlin/com/w3conext/jailbreak_root_detection/frida/AntiFridaBlocklist.kt rename to android/src/main/kotlin/com/w3conext/jailbreak_root_detection_plus/frida/AntiFridaBlocklist.kt index a358e96..5215637 100644 --- a/android/src/main/kotlin/com/w3conext/jailbreak_root_detection/frida/AntiFridaBlocklist.kt +++ b/android/src/main/kotlin/com/w3conext/jailbreak_root_detection_plus/frida/AntiFridaBlocklist.kt @@ -1,4 +1,4 @@ -package com.w3conext.jailbreak_root_detection.frida +package com.w3conext.jailbreak_root_detection_plus.frida import android.util.Log diff --git a/android/src/main/kotlin/com/w3conext/jailbreak_root_detection/frida/AntiFridaChecker.kt b/android/src/main/kotlin/com/w3conext/jailbreak_root_detection_plus/frida/AntiFridaChecker.kt similarity index 96% rename from android/src/main/kotlin/com/w3conext/jailbreak_root_detection/frida/AntiFridaChecker.kt rename to android/src/main/kotlin/com/w3conext/jailbreak_root_detection_plus/frida/AntiFridaChecker.kt index e569ec7..fe1246a 100644 --- a/android/src/main/kotlin/com/w3conext/jailbreak_root_detection/frida/AntiFridaChecker.kt +++ b/android/src/main/kotlin/com/w3conext/jailbreak_root_detection_plus/frida/AntiFridaChecker.kt @@ -1,8 +1,8 @@ -package com.w3conext.jailbreak_root_detection.frida +package com.w3conext.jailbreak_root_detection_plus.frida import android.content.Context import android.util.Log -import com.w3conext.jailbreak_root_detection.rooted.SuperUserUtility +import com.w3conext.jailbreak_root_detection_plus.rooted.SuperUserUtility import java.io.BufferedReader import java.io.File import java.io.InputStreamReader diff --git a/android/src/main/kotlin/com/w3conext/jailbreak_root_detection/frida/AntiFridaNativeLoader.kt b/android/src/main/kotlin/com/w3conext/jailbreak_root_detection_plus/frida/AntiFridaNativeLoader.kt similarity index 90% rename from android/src/main/kotlin/com/w3conext/jailbreak_root_detection/frida/AntiFridaNativeLoader.kt rename to android/src/main/kotlin/com/w3conext/jailbreak_root_detection_plus/frida/AntiFridaNativeLoader.kt index 9ac90ee..34e5166 100644 --- a/android/src/main/kotlin/com/w3conext/jailbreak_root_detection/frida/AntiFridaNativeLoader.kt +++ b/android/src/main/kotlin/com/w3conext/jailbreak_root_detection_plus/frida/AntiFridaNativeLoader.kt @@ -1,4 +1,4 @@ -package com.w3conext.jailbreak_root_detection.frida +package com.w3conext.jailbreak_root_detection_plus.frida import androidx.annotation.Keep diff --git a/android/src/main/kotlin/com/w3conext/jailbreak_root_detection/frida/AntiFridaUtility.kt b/android/src/main/kotlin/com/w3conext/jailbreak_root_detection_plus/frida/AntiFridaUtility.kt similarity index 96% rename from android/src/main/kotlin/com/w3conext/jailbreak_root_detection/frida/AntiFridaUtility.kt rename to android/src/main/kotlin/com/w3conext/jailbreak_root_detection_plus/frida/AntiFridaUtility.kt index e40a00d..0530840 100644 --- a/android/src/main/kotlin/com/w3conext/jailbreak_root_detection/frida/AntiFridaUtility.kt +++ b/android/src/main/kotlin/com/w3conext/jailbreak_root_detection_plus/frida/AntiFridaUtility.kt @@ -1,4 +1,4 @@ -package com.w3conext.jailbreak_root_detection.frida +package com.w3conext.jailbreak_root_detection_plus.frida import android.util.Log import java.io.File diff --git a/android/src/main/kotlin/com/w3conext/jailbreak_root_detection/magisk/MagiskChecker.kt b/android/src/main/kotlin/com/w3conext/jailbreak_root_detection_plus/magisk/MagiskChecker.kt similarity index 86% rename from android/src/main/kotlin/com/w3conext/jailbreak_root_detection/magisk/MagiskChecker.kt rename to android/src/main/kotlin/com/w3conext/jailbreak_root_detection_plus/magisk/MagiskChecker.kt index c5739a5..9e3ff8e 100644 --- a/android/src/main/kotlin/com/w3conext/jailbreak_root_detection/magisk/MagiskChecker.kt +++ b/android/src/main/kotlin/com/w3conext/jailbreak_root_detection_plus/magisk/MagiskChecker.kt @@ -1,4 +1,4 @@ -package com.w3conext.jailbreak_root_detection.magisk +package com.w3conext.jailbreak_root_detection_plus.magisk import java.io.File diff --git a/android/src/main/kotlin/com/w3conext/jailbreak_root_detection/rooted/SuperUserUtility.kt b/android/src/main/kotlin/com/w3conext/jailbreak_root_detection_plus/rooted/SuperUserUtility.kt similarity index 97% rename from android/src/main/kotlin/com/w3conext/jailbreak_root_detection/rooted/SuperUserUtility.kt rename to android/src/main/kotlin/com/w3conext/jailbreak_root_detection_plus/rooted/SuperUserUtility.kt index b2b48aa..e646a85 100644 --- a/android/src/main/kotlin/com/w3conext/jailbreak_root_detection/rooted/SuperUserUtility.kt +++ b/android/src/main/kotlin/com/w3conext/jailbreak_root_detection_plus/rooted/SuperUserUtility.kt @@ -1,4 +1,4 @@ -package com.w3conext.jailbreak_root_detection.rooted +package com.w3conext.jailbreak_root_detection_plus.rooted import android.util.Log import java.io.BufferedReader diff --git a/example/.gitignore b/example/.gitignore index 24476c5..6c31954 100644 --- a/example/.gitignore +++ b/example/.gitignore @@ -5,9 +5,11 @@ *.swp .DS_Store .atom/ +.build/ .buildlog/ .history .svn/ +.swiftpm/ migrate_working_dir/ # IntelliJ related diff --git a/example/README.md b/example/README.md index 21c7dcd..10fc758 100644 --- a/example/README.md +++ b/example/README.md @@ -1,6 +1,6 @@ -# jailbreak_root_detection_example +# jailbreak_root_detection_plus_example -Demonstrates how to use the jailbreak_root_detection plugin. +Demonstrates how to use the jailbreak_root_detection_plus plugin. ## Getting Started diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index 704f1a4..2b59682 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -1,40 +1,12 @@ plugins { id "com.android.application" - id "kotlin-android" + // The Flutter Gradle Plugin must be applied after the Android Gradle plugin. id "dev.flutter.flutter-gradle-plugin" } -def localProperties = new Properties() -def localPropertiesFile = rootProject.file('local.properties') -if (localPropertiesFile.exists()) { - localPropertiesFile.withReader('UTF-8') { reader -> - localProperties.load(reader) - } -} - -def flutterVersionCode = localProperties.getProperty('flutter.versionCode') -if (flutterVersionCode == null) { - flutterVersionCode = '1' -} - -def flutterVersionName = localProperties.getProperty('flutter.versionName') -if (flutterVersionName == null) { - flutterVersionName = '1.0' -} - android { - compileSdkVersion 36 - ndkVersion "27.0.12077973" - namespace 'com.w3conext.jailbreak_root_detection_example' - - compileOptions { - sourceCompatibility JavaVersion.VERSION_11 - targetCompatibility JavaVersion.VERSION_11 - } - - kotlinOptions { - jvmTarget = '11' - } + namespace "com.w3conext.jailbreak_root_detection_plus_example" + compileSdk 36 sourceSets { main.java.srcDirs += 'src/main/kotlin' @@ -42,13 +14,11 @@ android { defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId "com.w3conext.jailbreak_root_detection_example" - // You can update the following values to match your application needs. - // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration. - minSdkVersion 24 - targetSdkVersion flutter.targetSdkVersion - versionCode flutterVersionCode.toInteger() - versionName flutterVersionName + applicationId "com.w3conext.jailbreak_root_detection_plus_example" + minSdk flutter.minSdkVersion + targetSdk 36 + versionCode flutter.versionCode + versionName flutter.versionName } buildTypes { @@ -58,6 +28,17 @@ android { signingConfig signingConfigs.debug } } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 + } +} + +kotlin { + compilerOptions { + jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17 + } } flutter { diff --git a/example/android/app/src/debug/AndroidManifest.xml b/example/android/app/src/debug/AndroidManifest.xml index 4942eec..399f698 100644 --- a/example/android/app/src/debug/AndroidManifest.xml +++ b/example/android/app/src/debug/AndroidManifest.xml @@ -1,5 +1,4 @@ - + - LSApplicationQueriesSchemes - - undecimus - sileo - zbra - filza - activator - cydia - diff --git a/example/lib/main.dart b/example/lib/main.dart index 4a3034c..7222ab8 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -1,7 +1,7 @@ import 'dart:io'; import 'package:flutter/material.dart'; -import 'package:jailbreak_root_detection/jailbreak_root_detection.dart'; +import 'package:jailbreak_root_detection_plus/jailbreak_root_detection_plus.dart'; void main() { runApp(const MyApp()); @@ -64,7 +64,7 @@ class _MyAppState extends State { } } if (Platform.isIOS) { - const bundleId = 'com.w3conext.jailbreakRootDetectionExample'; + const bundleId = 'com.w3conext.jailbreakRootDetectionPlusExample'; final isTampered = await JailbreakRootDetection.instance.isTampered(bundleId); print('isTampered: $isTampered'); diff --git a/example/pubspec.lock b/example/pubspec.lock index f5b9ccf..e6c5c2a 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -21,10 +21,10 @@ packages: dependency: transitive description: name: characters - sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 + sha256: faf38497bda5ead2a8c7615f4f7939df04333478bf32e4173fcb06d428b5716b url: "https://pub.dev" source: hosted - version: "1.4.0" + version: "1.4.1" clock: dependency: transitive description: @@ -75,13 +75,13 @@ packages: description: flutter source: sdk version: "0.0.0" - jailbreak_root_detection: + jailbreak_root_detection_plus: dependency: "direct main" description: path: ".." relative: true source: path - version: "1.2.0+1" + version: "1.0.0" leak_tracker: dependency: transitive description: @@ -118,26 +118,26 @@ packages: dependency: transitive description: name: matcher - sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2 + sha256: dc0b7dc7651697ea4ff3e69ef44b0407ea32c487a39fff6a4004fa585e901861 url: "https://pub.dev" source: hosted - version: "0.12.17" + version: "0.12.19" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec + sha256: "9c337007e82b1889149c82ed242ed1cb24a66044e30979c44912381e9be4c48b" url: "https://pub.dev" source: hosted - version: "0.11.1" + version: "0.13.0" meta: dependency: transitive description: name: meta - sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c + sha256: "1741988757a65eb6b36abe716829688cf01910bbf91c34354ff7ec1c3de2b349" url: "https://pub.dev" source: hosted - version: "1.16.0" + version: "1.18.0" path: dependency: transitive description: @@ -195,10 +195,10 @@ packages: dependency: transitive description: name: test_api - sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00" + sha256: "949a932224383300f01be9221c39180316445ecb8e7547f70a41a35bf421fb9e" url: "https://pub.dev" source: hosted - version: "0.7.6" + version: "0.7.11" vector_math: dependency: transitive description: @@ -216,5 +216,5 @@ packages: source: hosted version: "14.2.5" sdks: - dart: ">=3.8.0-0 <4.0.0" - flutter: ">=3.18.0-18.0.pre.54" + dart: ">=3.12.0 <4.0.0" + flutter: ">=3.44.0" diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 01d9564..576998d 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -1,12 +1,12 @@ -name: jailbreak_root_detection_example -description: Demonstrates how to use the jailbreak_root_detection plugin. +name: jailbreak_root_detection_plus_example +description: Demonstrates how to use the jailbreak_root_detection_plus plugin. # The following line prevents the package from being accidentally published to # pub.dev using `flutter pub publish`. This is preferred for private packages. publish_to: 'none' # Remove this line if you wish to publish to pub.dev environment: - sdk: '>=3.5.0 <4.0.0' + sdk: ^3.12.0 # Dependencies specify other packages that your package needs in order to work. # To automatically upgrade your package dependencies to the latest versions @@ -18,9 +18,9 @@ dependencies: flutter: sdk: flutter - jailbreak_root_detection: + jailbreak_root_detection_plus: # When depending on this package from a real application you should use: - # jailbreak_root_detection: ^x.y.z + # jailbreak_root_detection_plus: ^x.y.z # See https://dart.dev/tools/pub/dependencies#version-constraints # The example app is bundled with the plugin so we use a path dependency on # the parent directory to use the current plugin's version. @@ -46,6 +46,8 @@ dev_dependencies: # The following section is specific to Flutter packages. flutter: + config: + enable-swift-package-manager: true # The following line ensures that the Material Icons font is # included with your application, so that you can use the icons in diff --git a/example/test/widget_test.dart b/example/test/widget_test.dart index e93e634..69aed92 100644 --- a/example/test/widget_test.dart +++ b/example/test/widget_test.dart @@ -8,7 +8,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:jailbreak_root_detection_example/main.dart'; +import 'package:jailbreak_root_detection_plus_example/main.dart'; void main() { testWidgets('Verify Platform version', (WidgetTester tester) async { diff --git a/ios/.gitignore b/ios/.gitignore index 0c88507..6dfa151 100644 --- a/ios/.gitignore +++ b/ios/.gitignore @@ -35,4 +35,6 @@ Icon? /Flutter/Generated.xcconfig /Flutter/ephemeral/ -/Flutter/flutter_export_environment.sh \ No newline at end of file +/Flutter/flutter_export_environment.sh +.build/ +Package.resolved diff --git a/ios/Assets/.gitkeep b/ios/Assets/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/ios/Classes/JailbreakRootDetectionPlugin.h b/ios/Classes/JailbreakRootDetectionPlugin.h deleted file mode 100644 index 3d0fd55..0000000 --- a/ios/Classes/JailbreakRootDetectionPlugin.h +++ /dev/null @@ -1,4 +0,0 @@ -#import - -@interface JailbreakRootDetectionPlugin : NSObject -@end diff --git a/ios/Classes/JailbreakRootDetectionPlugin.m b/ios/Classes/JailbreakRootDetectionPlugin.m deleted file mode 100644 index b43e0ab..0000000 --- a/ios/Classes/JailbreakRootDetectionPlugin.m +++ /dev/null @@ -1,15 +0,0 @@ -#import "JailbreakRootDetectionPlugin.h" -#if __has_include() -#import -#else -// Support project import fallback if the generated compatibility header -// is not copied when this plugin is created as a library. -// https://forums.swift.org/t/swift-static-libraries-dont-copy-generated-objective-c-header/19816 -#import "jailbreak_root_detection-Swift.h" -#endif - -@implementation JailbreakRootDetectionPlugin -+ (void)registerWithRegistrar:(NSObject*)registrar { - [SwiftJailbreakRootDetectionPlugin registerWithRegistrar:registrar]; -} -@end diff --git a/ios/jailbreak_root_detection.podspec b/ios/jailbreak_root_detection.podspec deleted file mode 100644 index da34bee..0000000 --- a/ios/jailbreak_root_detection.podspec +++ /dev/null @@ -1,24 +0,0 @@ -# -# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. -# Run `pod lib lint screen_protector.podspec --verbose --no-clean` to validate before publishing. -# Run `pod install --repo-update --verbose` to uppdate new version. -# -Pod::Spec.new do |s| - s.name = 'jailbreak_root_detection' - s.version = '1.0.1' - s.summary = 'Check Jailbreak and Rooted for Android and iOS.' - s.description = <<-DESC -Check Jailbreak and Rooted for Android and iOS. - DESC - s.homepage = 'https://github.com/w3connext/jailbreak_root_detection' - s.license = { :file => '../LICENSE' } - s.author = 'w3connext' - s.source = { :path => '.' } - s.source_files = 'Classes/**/*' - s.dependency 'Flutter' - s.dependency 'IOSSecuritySuite', '~> 1.9.10' - s.platform = :ios, '11.0' - s.swift_version = ["4.0", "4.1", "4.2", "5.0", "5.1", "5.2", "5.3", "5.4", "5.5"] - # Flutter.framework does not contain a i386 slice. - s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' } -end diff --git a/ios/jailbreak_root_detection_plus.podspec b/ios/jailbreak_root_detection_plus.podspec new file mode 100644 index 0000000..a2dd5ac --- /dev/null +++ b/ios/jailbreak_root_detection_plus.podspec @@ -0,0 +1,22 @@ +# +# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. +# Run `pod lib lint jailbreak_root_detection_plus.podspec` to validate before publishing. +# +Pod::Spec.new do |s| + s.name = 'jailbreak_root_detection_plus' + s.version = '1.0.0' + s.summary = 'Check Jailbreak and Rooted for Android and iOS.' + s.description = <<-DESC +Check Jailbreak and Rooted for Android and iOS. + DESC + s.homepage = 'https://github.com/anderscheow/jailbreak_root_detection_plus' + s.license = { :file => '../LICENSE' } + s.author = 'anderscheow' + s.source = { :path => '.' } + s.source_files = 'jailbreak_root_detection_plus/Sources/jailbreak_root_detection_plus/**/*.swift' + s.dependency 'Flutter' + s.dependency 'IOSSecuritySuite', '~> 2.2' + s.platform = :ios, '13.0' + s.swift_version = '5.9' + s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' } +end diff --git a/ios/jailbreak_root_detection_plus/Package.swift b/ios/jailbreak_root_detection_plus/Package.swift new file mode 100644 index 0000000..0bd5277 --- /dev/null +++ b/ios/jailbreak_root_detection_plus/Package.swift @@ -0,0 +1,25 @@ +// swift-tools-version: 5.9 +import PackageDescription + +let package = Package( + name: "jailbreak_root_detection_plus", + platforms: [ + .iOS(.v13), + ], + products: [ + .library(name: "jailbreak-root-detection-plus", targets: ["jailbreak_root_detection_plus"]), + ], + dependencies: [ + .package(name: "FlutterFramework", path: "../FlutterFramework"), + .package(url: "https://github.com/securing/IOSSecuritySuite", from: "2.3.0"), + ], + targets: [ + .target( + name: "jailbreak_root_detection_plus", + dependencies: [ + .product(name: "FlutterFramework", package: "FlutterFramework"), + .product(name: "IOSSecuritySuite", package: "IOSSecuritySuite"), + ] + ), + ] +) diff --git a/ios/Classes/CydiaChecker.swift b/ios/jailbreak_root_detection_plus/Sources/jailbreak_root_detection_plus/CydiaChecker.swift similarity index 95% rename from ios/Classes/CydiaChecker.swift rename to ios/jailbreak_root_detection_plus/Sources/jailbreak_root_detection_plus/CydiaChecker.swift index 1ecf84c..12f4a46 100644 --- a/ios/Classes/CydiaChecker.swift +++ b/ios/jailbreak_root_detection_plus/Sources/jailbreak_root_detection_plus/CydiaChecker.swift @@ -1,6 +1,6 @@ // // CydiaChecker.swift -// jailbreak_root_detection +// jailbreak_root_detection_plus // // Created by M on 23/1/2566 BE. // diff --git a/ios/Classes/Extension/UIDevice+JailBroken.swift b/ios/jailbreak_root_detection_plus/Sources/jailbreak_root_detection_plus/Extension/UIDevice+JailBroken.swift similarity index 100% rename from ios/Classes/Extension/UIDevice+JailBroken.swift rename to ios/jailbreak_root_detection_plus/Sources/jailbreak_root_detection_plus/Extension/UIDevice+JailBroken.swift diff --git a/ios/Classes/FridaChecker.swift b/ios/jailbreak_root_detection_plus/Sources/jailbreak_root_detection_plus/FridaChecker.swift similarity index 93% rename from ios/Classes/FridaChecker.swift rename to ios/jailbreak_root_detection_plus/Sources/jailbreak_root_detection_plus/FridaChecker.swift index dc7ebf0..e725177 100644 --- a/ios/Classes/FridaChecker.swift +++ b/ios/jailbreak_root_detection_plus/Sources/jailbreak_root_detection_plus/FridaChecker.swift @@ -1,6 +1,6 @@ // // FridaChecker.swift -// jailbreak_root_detection +// jailbreak_root_detection_plus // // Created by M on 23/1/2566 BE. // diff --git a/ios/Classes/JailbreakRootDetection.swift b/ios/jailbreak_root_detection_plus/Sources/jailbreak_root_detection_plus/JailbreakRootDetection.swift similarity index 97% rename from ios/Classes/JailbreakRootDetection.swift rename to ios/jailbreak_root_detection_plus/Sources/jailbreak_root_detection_plus/JailbreakRootDetection.swift index bdf0e56..0b1761e 100644 --- a/ios/Classes/JailbreakRootDetection.swift +++ b/ios/jailbreak_root_detection_plus/Sources/jailbreak_root_detection_plus/JailbreakRootDetection.swift @@ -1,11 +1,12 @@ // // JailbreakRootDetection.swift -// jailbreak_root_detection +// jailbreak_root_detection_plus // // Created by M on 24/1/2566 BE. // import Foundation +import UIKit import IOSSecuritySuite class JailbreakRootDetection { diff --git a/ios/Classes/ReverseEngineeringChecker.swift b/ios/jailbreak_root_detection_plus/Sources/jailbreak_root_detection_plus/ReverseEngineeringChecker.swift similarity index 99% rename from ios/Classes/ReverseEngineeringChecker.swift rename to ios/jailbreak_root_detection_plus/Sources/jailbreak_root_detection_plus/ReverseEngineeringChecker.swift index 1f4d85a..6710fbb 100644 --- a/ios/Classes/ReverseEngineeringChecker.swift +++ b/ios/jailbreak_root_detection_plus/Sources/jailbreak_root_detection_plus/ReverseEngineeringChecker.swift @@ -1,6 +1,6 @@ // // ReverseEngineeringChecker.swift -// jailbreak_root_detection +// jailbreak_root_detection_plus // // Created by M on 9/11/2566 BE. // diff --git a/ios/Classes/SwiftJailbreakRootDetectionPlugin.swift b/ios/jailbreak_root_detection_plus/Sources/jailbreak_root_detection_plus/SwiftJailbreakRootDetectionPlugin.swift similarity index 97% rename from ios/Classes/SwiftJailbreakRootDetectionPlugin.swift rename to ios/jailbreak_root_detection_plus/Sources/jailbreak_root_detection_plus/SwiftJailbreakRootDetectionPlugin.swift index 71d030c..9543711 100644 --- a/ios/Classes/SwiftJailbreakRootDetectionPlugin.swift +++ b/ios/jailbreak_root_detection_plus/Sources/jailbreak_root_detection_plus/SwiftJailbreakRootDetectionPlugin.swift @@ -10,7 +10,7 @@ public class SwiftJailbreakRootDetectionPlugin: NSObject, FlutterPlugin { } public static func register(with registrar: FlutterPluginRegistrar) { - let channel = FlutterMethodChannel(name: "jailbreak_root_detection", binaryMessenger: registrar.messenger()) + let channel = FlutterMethodChannel(name: "jailbreak_root_detection_plus", binaryMessenger: registrar.messenger()) let jailbreakRootDetection = JailbreakRootDetection() diff --git a/jailbreak_root_detection.iml b/jailbreak_root_detection_plus.iml similarity index 100% rename from jailbreak_root_detection.iml rename to jailbreak_root_detection_plus.iml diff --git a/lib/jailbreak_root_detection.dart b/lib/jailbreak_root_detection_plus.dart similarity index 99% rename from lib/jailbreak_root_detection.dart rename to lib/jailbreak_root_detection_plus.dart index 0736dfa..da717e5 100644 --- a/lib/jailbreak_root_detection.dart +++ b/lib/jailbreak_root_detection_plus.dart @@ -55,7 +55,7 @@ enum JailbreakIssue { class JailbreakRootDetection { /// The method channel used to interact with the native platform. @visibleForTesting - final methodChannel = const MethodChannel('jailbreak_root_detection'); + final methodChannel = const MethodChannel('jailbreak_root_detection_plus'); static final JailbreakRootDetection _instance = JailbreakRootDetection(); diff --git a/pubspec.yaml b/pubspec.yaml index a54607b..8f6704b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,11 +1,11 @@ -name: jailbreak_root_detection +name: jailbreak_root_detection_plus description: Uses RootBeer + DetectFrida for Android root detection and IOSSecuritySuite for iOS jailbreak detection. -version: 1.2.0+1 -homepage: https://github.com/w3connext/jailbreak_root_detection +version: 1.0.0 +homepage: https://github.com/anderscheow/jailbreak_root_detection_plus environment: - sdk: '>=3.5.0 <4.0.0' - flutter: ">=2.5.0" + sdk: ^3.12.0 + flutter: ">=3.44.0" dependencies: flutter: @@ -34,10 +34,11 @@ flutter: plugin: platforms: android: - package: com.w3conext.jailbreak_root_detection + package: com.w3conext.jailbreak_root_detection_plus pluginClass: JailbreakRootDetectionPlugin ios: - pluginClass: JailbreakRootDetectionPlugin + pluginClass: SwiftJailbreakRootDetectionPlugin + sharedDarwinSource: false # To add assets to your plugin package, add an assets section, like this: # assets: