Code Monkey home page Code Monkey logo

flutter_jailbreak_detection's Introduction

flutter_jailbreak_detection

Flutter jailbreak and root detection plugin.

It uses RootBeer on Android, and IOSSecuritySuite on iOS.

Getting Started

import 'package:flutter_jailbreak_detection/flutter_jailbreak_detection.dart';

bool jailbroken = await FlutterJailbreakDetection.jailbroken;
bool developerMode = await FlutterJailbreakDetection.developerMode; // android only.

flutter_jailbreak_detection's People

Contributors

benoitskipr avatar jeroentrappers avatar kmoorejr9 avatar m7mdra avatar patuoynageek avatar tvh avatar vasilich6107 avatar xputnikx avatar yuzurihaaa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

flutter_jailbreak_detection's Issues

Huawei

in Huawei Android devices, it returns jailbroken even though definitely the device is not jailbroken.

Error in IOS

Hi,
This plugin does not work in IOS, I got the following error. Could you please take a look?

failed for URL: "cydia://package/com.example.package" - error: "This app is not allowed to query for scheme cydia"

Flutter (Channel stable, 2.5.0, on macOS 11.2.3 20D91 darwin-x64, locale en-GB)
• Flutter version 2.5.0 at /Users/xxxx/Documents/flutter2.5.0
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 4cc385b4b8 (6 months ago), 2021-09-07 23:01:49 -0700
• Engine revision f0826da7ef
• Dart version 2.14.0

Cannot build apk

After importing this pub i am unable to build apk for my project

Is this package still maintained?

I don't think this package run correctly as my normal android phone has detected as root, and also other issues saying so.
But no update for 9 months.
Can I trust this package even now ?

App crashing in rooted real device while trying to check Device is rooted or not.

on app start i am checking iOS device is rooted or not.

bool isDeviceRoot = devicePlatform == "ios"
          ? await FlutterJailbreakDetection.jailbroken
          : await FlutterJailbreakDetection.developerMode;

App crashing with below error.
-32000 Bad state: The client closed with pending request "resume".

configuration

  • Flutter 3.3.9
  • Dart 2.18.5
  • Xcode 14.3
  • Android Dolphin
  • mac os - Ventura 13.3.1

@tvh @jeroentrappers @xPutnikx @vasilich6107 @kmoorejr9 thanks in advanced.

Jailbreak detection bypass with liberty lite

I was able to use FlutterJailbreakDetection package successfully to detect jailbroken devices, however I can bypass the detection using liberty lite tool, is there any way to detect liberty lite or to fix this issue?

Could not find com.github.scottyab:rootbeer:0.1.0.

Hi, I am facing issue when building the project.

flutter_jailbreak_detection: ^1.7.0

  • What went wrong:
    Could not determine the dependencies of task ':app:processDebugResources'.

Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
Could not find com.github.scottyab:rootbeer:0.1.0.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/github/scottyab/rootbeer/0.1.0/rootbeer-0.1.0.pom
- https://jcenter.bintray.com/com/github/scottyab/rootbeer/0.1.0/rootbeer-0.1.0.pom
- https://developer.huawei.com/repo/com/github/scottyab/rootbeer/0.1.0/rootbeer-0.1.0.pom
- https://storage.googleapis.com/download.flutter.io/com/github/scottyab/rootbeer/0.1.0/rootbeer-0.1.0.pom
Required by:
project :app > project :flutter_jailbreak_detection

returns true even though the rooting app is only installed but the phone is not actually rooted.

Hello @jeroentrappers

I'm using this plugin for a personal project. During testing, I found that this plugin returns true even if a rooting app is just installed and the device is not actually rooted. I installed KingRoot to test this plugin in one of my old device which runs on Android 5.0.1.

The function that I used:
bool jailBroken = await FlutterJailbreakDetection.jailbroken;

Log:

E/RootBeer( 6294): RootBeer: isAnyPackageFromListInstalled() [249] - com.kingroot.kinguser ROOT management app detected!
E/QLog    ( 6294): RootBeer: isAnyPackageFromListInstalled() [249] - com.kingroot.kinguser ROOT management app detected!

missing namespace when upgrade gradle 8.0.0 and support flutter 3.10

Getting thir error when upgrade to flutter 3.10

A problem occurred configuring project ':flutter_jailbreak_detection'.
> Could not create an instance of type com.android.build.api.variant.impl.LibraryVariantBuilderImpl.
   > Namespace not specified. Please specify a namespace in the module's build.gradle file like so:

* Try:
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Exception is:
org.gradle.api.ProjectConfigurationException: A problem occurred configuring project ':flutter_jailbreak_detection'.

Need to upgrade Android embedding to V2

Flutter throws the following when building with versions greater than 2.4.0 (try with latest beta channel).

The plugin flutter_jailbreak_detection uses a deprecated version of the Android embedding.
To avoid unexpected runtime failures, or future build failures, try to see if this plugin supports the Android V2 embedding. Otherwise, consider removing it since a future release of Flutter will remove these deprecated APIs.
If you are plugin author, take a look at the docs for migrating the plugin to the V2 embedding: https://flutter.dev/go/android-plugin-migration.

This plugin needs to be updated use the V2 embedding method described here:

https://flutter.dev/go/android-plugin-migration

Execution failed for task ':flutter_jailbreak_detection:compileDebugKotlin'. > 'compileDebugJavaWithJavac' task (current target is 1.8) and 'compileDebugKotlin' task (current target is 17) jvm target compatibility should be set to the same Java version.

Execution failed for task ':flutter_jailbreak_detection:compileDebugKotlin'.

'compileDebugJavaWithJavac' task (current target is 1.8) and 'compileDebugKotlin' task (current target is 17) jvm target compatibility should be set to the same Java version.

isDevMode() method bug

Hello, the implementation of the method isDevMode*() has a bug:

    private fun isDevMode(): Boolean {
        return Settings.Secure.getInt(
            context.contentResolver,
            Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, 0
        ) != 0
    }

should be:

    private fun isDevMode(): Boolean {
        return Settings.Global.getInt(
            context.contentResolver,
            Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, 0
        ) != 0
    }

jcenter to mavenCentral

Currently, I have problems to use this package, because it still uses jcenter in build.gradle.

It would be awesome, if you replace that dependency with mavenCentral.

Thank you very much.

Detect jailbreak was wrong on mac M1

I have deploy my flutter app that using flutter_jailbreak_detection to detect jailbreak on Appstore. When I use my macbook M1 to install app it detect that my device is jailbreaked.

Pls fix this issue :(

Build on Android fails: Could not resolve com.github.scottyab:rootbeer:0.1.0

There seems to be an issue with the flutter build for Android using this plugin:

Could not GET 'https://jitpack.io/io/flutter/x86_64_debug/1.0.0-xxx/x86_64_debug-1.0.0-xxx.pom'. Received status code 521 from server: 
   > Could not resolve com.github.scottyab:rootbeer:0.1.0.
     Required by:
         project :app > project :flutter_jailbreak_detection

Any idea what could fix this issue?

Getting binary absent logs

Hi there when the following code

if(!kIsWeb){
    bool broken = await JailBreak.check();
    if(broken){
      Get.toNamed(AppRoutes.jailBrokenScreen);
    }
  }
class JailBreak{
  static Future<bool> check() async {
    bool jailbroken;
    try {
      jailbroken = await FlutterJailbreakDetection.jailbroken;
    } on PlatformException {
      return true;
    }
    return jailbroken;
  }
}

I am getting

I/RootBeer(15986): LOOKING FOR BINARY: /data/local/su Absent :(
I/RootBeer(15986): LOOKING FOR BINARY: /data/local/bin/su Absent :(
I/RootBeer(15986): LOOKING FOR BINARY: /data/local/xbin/su Absent :(
I/RootBeer(15986): LOOKING FOR BINARY: /sbin/su Absent :(
I/RootBeer(15986): LOOKING FOR BINARY: /su/bin/su Absent :(
I/RootBeer(15986): LOOKING FOR BINARY: /system/bin/su Absent :(
I/RootBeer(15986): LOOKING FOR BINARY: /system/bin/.ext/su Absent :(
I/RootBeer(15986): LOOKING FOR BINARY: /system/bin/failsafe/su Absent :(
I/RootBeer(15986): LOOKING FOR BINARY: /system/sd/xbin/su Absent :(
I/RootBeer(15986): LOOKING FOR BINARY: /system/usr/we-need-root/su Absent :(
I/RootBeer(15986): LOOKING FOR BINARY: /system/xbin/su Absent :(
I/RootBeer(15986): LOOKING FOR BINARY: /cache/su Absent :(
I/RootBeer(15986): LOOKING FOR BINARY: /data/su Absent :(
I/RootBeer(15986): LOOKING FOR BINARY: /dev/su Absent :(
I/RootBeer(15986): LOOKING FOR BINARY: /product/bin/su Absent :(
I/RootBeer(15986): LOOKING FOR BINARY: /apex/com.android.runtime/bin/su Absent :(
I/RootBeer(15986): LOOKING FOR BINARY: /apex/com.android.art/bin/su Absent :(
I/RootBeer(15986): LOOKING FOR BINARY: /system_ext/bin/su Absent :(
I/RootBeer(15986): LOOKING FOR BINARY: /odm/bin/su Absent :(
I/RootBeer(15986): LOOKING FOR BINARY: /vendor/bin/su Absent :(
I/RootBeer(15986): LOOKING FOR BINARY: /vendor/xbin/su Absent :(

Is this fine ?

Disable logging from RootBeer

Is there a way to disable the verbose, debug, and info logging that appears in Android LogCat from RootBeer?

Examples:
V RootBeer: RootBeer: checkForDangerousProps() [123] - ro.debuggable = [1] detected!
I RootBeer: RootBeer: LOOKING FOR BINARY: /su/bin/su Absent :(

Could not find com.github.scottyab:rootbeer:0.08

Hi, I'm facing an issue on building project.
Version:
flutter_jailbreak_detection: ^1.5.0

  • What went wrong:
    Could not determine the dependencies of task ':app:processDebugResources'.

Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
Could not find com.github.scottyab:rootbeer:0.0.8.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/github/scottyab/rootbeer/0.0.8/rootbeer-0.0.8.pom
- https://jcenter.bintray.com/com/github/scottyab/rootbeer/0.0.8/rootbeer-0.0.8.pom
- https://developer.huawei.com/repo/com/github/scottyab/rootbeer/0.0.8/rootbeer-0.0.8.pom
- https://storage.googleapis.com/download.flutter.io/com/github/scottyab/rootbeer/0.0.8/rootbeer-0.0.8.pom
Required by:
project :app > project :flutter_jailbreak_detection

Required links

I get this error:
-canOpenURL: failed for URL: "undecimus://" - error: "The operation couldn’t be completed. (OSStatus error -10814.)"
-canOpenURL: failed for URL: "sileo://" - error: "The operation couldn’t be completed. (OSStatus error -10814.)"
-canOpenURL: failed for URL: "zbra://" - error: "The operation couldn’t be completed. (OSStatus error -10814.)"
-canOpenURL: failed for URL: "filza://" - error: "The operation couldn’t be completed. (OSStatus error -10814.)"
-canOpenURL: failed for URL: "activator://" - error: "The operation couldn’t be completed. (OSStatus error -10814.)"

when I use this example:

bool _jailbreak = false;
bool _developerMode = false;

@OverRide
void initState() {
initPlatformState();
super.initState();
}

// Platform messages are asynchronous, so we initialize in an async method.
Future initPlatformState() async {
bool jailbreak;
bool developerMode;
// Platform messages may fail, so we use a try/catch PlatformException.
try {
jailbreak = await FlutterJailbreakDetection.jailbroken;
developerMode = await FlutterJailbreakDetection.developerMode;
} catch (_) {
jailbreak = true;
developerMode = true;
}

// If the widget was removed from the tree while the asynchronous platform
// message was in flight, we want to discard the reply rather than calling
// setState to update our non-existent appearance.
if (!mounted) return;

setState(() {
  _jailbreak = jailbreak;
  _developerMode = developerMode;
});

}

why are required wich I don’t need.

Flutter 3.10.5 • channel stable • https://github.com/flutter/flutter.git
Tools • Dart 3.0.5 • DevTools 2.23.1

ios not detect dev mode

I tested it on a real device, iphone, and enabled developer mode, but checking didn't find it was running in developer mode.

ViperOS is considered a root?

I used google translate, sorry for my writing.

I wanted to know if ViperOS is considered a root.

In case "await FlutterJailbreakDetection.isJailBroken;" it is returning false

image

fatal error: 'flutter_jailbreak_detection/flutter_jailbreak_detection-Swift.h' file not found

Error when i build app in iOS with version 1.7.0 and 1.6.0. This is flutter doctor

[✓] Flutter (Channel stable, 2.2.3, on macOS 11.5.2 20G95 darwin-x64, locale
en-VN)
• Flutter version 2.2.3 at /Users/Downloads/flutter
• Framework revision f4abaa0735 (8 weeks ago), 2021-07-01 12:46:11 -0700
• Engine revision 241c87ad80
• Dart version 2.13.4

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
• Android SDK at /Users/Library/Android/sdk
• Platform android-30, build-tools 30.0.2
• ANDROID_HOME = /Users/Library/Android/sdk
• Java binary at: /Library/Internet
Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java
• Java version Java(TM) SE Runtime Environment (build 1.8.0_301-b09)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.5.1, Build version 12E507
• CocoaPods version 1.10.1

[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[!] Android Studio (version 2020.3)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
✗ Unable to find bundled Java version.
• Try updating or re-installing Android Studio.

[✓] IntelliJ IDEA Ultimate Edition (version 2020.1.2)
• IntelliJ at /Applications/IntelliJ IDEA.app
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] VS Code (version 1.57.0)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.25.0

[✓] Connected device (3 available)
• 😘😘😘😘😘😘😘 (mobile) • 031c178e656ca6968226de750b4dd4167ddff346 • ios
• iOS 14.6
• macOS (desktop) • macos •
darwin-x64 • macOS 11.5.2 20G95 darwin-x64
• Chrome (web) • chrome •
web-javascript • Google Chrome 92.0.4515.159

! Doctor found issues in 1 category.

Jailbreak detection bypass with Frida, Magisk DenyList and Liberty Lite tools

Hi,

VAPT(Vulnerability Assessment and Penetration Testing) team able to do bypass the root detection/Jailbroken devices.

Using latest flutter_jailbreak_detection package
flutter_jailbreak_detection: ^1.8.0

Is it possible to detect Frida , Magisk DenyList and Liberty Lite tools using flutter_jailbreak_detection package?

Steps to Root Detection Bypass using Frida tool:
• Install Frida using command - pip install Frida
• Then using https://github.com/frida/frida/releases/ repo download Frida Server for our case it was ARM
• Then push Frida server to device using command - adb push frida-server /data/local/tmp/
• Take shell to device using command - adb shell and go to /data/local/tmp directory.
• Now run Frida server using command ./frida-server
• Now, if everything works and Frida server is on we can dump all running processes using command - frida-ps -U
• Then I bypassed root detection using command - frida --codeshare dzonerzy/fridantiroot -f com.xxxxx.xxxxxx -U
• Hence we were able to bypass root detection.

Android app

IOS app

Disable log of RootBeer

Add a way to disable the log of RootBeer

val rootBeer = RootBeer(context)
rootBeer.setLogging(false)
result.success(rootBeer.isRooted)

It will be usefull if logging is optional

Upgrade kotlin version

Error when upgrade flutter 3.3.0, please upgrade

* What went wrong:
The Android Gradle plugin supports only Kotlin Gradle plugin version 1.5.20 and higher.
The following dependencies do not satisfy the required version:
project ':flutter_jailbreak_detection' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.31

Could not resolve com.github.scottyab:rootbeer:0.1.0.

For the past few days, I have been unable to build the APK for my application due to the following error:

Could not resolve com.github.scottyab:rootbeer:0.1.0.
Required by:
project :app > project :flutter_jailbreak_detection

I have been using this package for over 8 months without any issues, and the error seems to have appeared out of nowhere. I am currently using the latest version, 1.10.0, but the error also occurs with versions 1.8.0 and 1.9.0. Does anyone know how to resolve this issue? Any help would be greatly appreciated.

Flutter 3.3.10

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.