enhanced_jailbreak_root_detection

A Flutter security plugin for detecting jailbroken/rooted devices, hooking frameworks, debuggers, emulators, proxies, and app tampering on Android and iOS—powered by type-safe Pigeon bindings and Swift Package Manager (SPM) support.

License: MIT


Features

Check Android iOS Description
isJailBroken Yes Yes RootBeer + Magisk/KernelSU/APatch/Zygisk/LSPosed + Anti-Frida (Android); IOSSecuritySuite + Rootless /var/jb (iOS)
isRealDevice Yes Yes Detects emulators and simulators
isDebugged Yes Yes Detects attached debuggers
isProxied Yes Yes Detects HTTP/HTTPS proxy configuration
isTampered(bundleId) Yes Yes Verifies APK signing SHA-256 or package name (Android) / bundle ID & signature (iOS)
isDevMode Yes false Detects Android Developer Mode
isOnExternalStorage Yes false Detects installation on external storage
checkForIssues Yes Yes Returns List<JailbreakIssue> of all detected issues
isNotTrust Yes Yes Convenience check combining jailbreak/root, emulator, and external storage

Installation

Add to your pubspec.yaml:

dependencies:
  enhanced_jailbreak_root_detection: ^0.0.4

iOS (CocoaPods & Swift Package Manager)

  • Swift Package Manager: Supported out of the box via ios/enhanced_jailbreak_root_detection/Package.swift.
  • CocoaPods: Supported via ios/enhanced_jailbreak_root_detection.podspec.

Android

  • Minimum SDK: 21+
  • Uses Kotlin + JNI/C++ (antifrida.cpp, syscall.S). No extra setup required.

Quick Start

import 'package:enhanced_jailbreak_root_detection/enhanced_jailbreak_root_detection.dart';

final detection = EnhancedJailbreakRootDetection.instance;

// Quick trust check
final isNotTrust = await detection.isNotTrust;
if (isNotTrust) {
  // Block or warn user
}

// Detailed issue list
final List<JailbreakIssue> issues = await detection.checkForIssues;
for (final issue in issues) {
  print('Detected: $issue');
}

// Individual checks
final isJailBroken = await detection.isJailBroken;
final isRealDevice = await detection.isRealDevice;
final isProxied = await detection.isProxied;
final isDebugged = await detection.isDebugged;

// Tampering check
// iOS: pass your bundle ID
// Android: pass your package name OR 64-char hex APK signing cert SHA-256
final isTampered = await detection.isTampered('com.example.app');

Architecture

  • Dart:
    • lib/enhanced_jailbreak_root_detection.dart — Public barrel entrypoint
    • lib/src/enhanced_jailbreak_root_detection.dart — Plugin API
    • lib/src/models/jailbreak_issue.dart — JailbreakIssue enum
    • lib/src/messages.g.dart — Pigeon-generated bindings
  • Platform:
    • pigeons/jailbreak_root_detection.dart — Pigeon schema (@HostApi())
    • android/ — Kotlin + C++ (RootBeer, MagiskChecker, AntiFridaChecker, ProxyCheck, TamperCheck)
    • ios/enhanced_jailbreak_root_detection/ — Swift Package (JailbreakRootDetectionPlugin, UIDevice+JailBroken, FridaChecker, CydiaChecker, ReverseEngineeringChecker)

Why enhanced_jailbreak_root_detection?

  • Modern Bypass Defense: Goes beyond basic su / Cydia.app checks—detects KernelSU, APatch, Zygisk, LSPosed, Frida, and iOS Rootless Jailbreaks (/var/jb/, Sileo, Zebra, ElleKit).
  • Cross-Platform Parity: Supports isProxied (MITM/proxy detection) and isTampered (APK signing SHA-256 / package name on Android; bundle ID & signature on iOS) on both platforms.
  • Type-Safe & Future-Proof: Built on Pigeon (@HostApi()) instead of raw MethodChannel strings, with full Swift Package Manager (SPM) and CocoaPods support.

Frequently Asked Questions (FAQ)

How do I detect rooted Android devices using KernelSU, APatch, or Magisk?

Call EnhancedJailbreakRootDetection.instance.isJailBroken or checkForIssues(). On Android, this combines RootBeer, native C++ syscall anti-Frida checks, and /data/adb/* + /proc/self/mountinfo + /proc/self/maps inspection for Magisk, KernelSU, APatch, Zygisk, and LSPosed.

Does this plugin support iOS Rootless Jailbreaks (Dopamine, Palera1n) and Swift Package Manager?

Yes. It checks /var/jb/ rootless paths (Sileo, Zebra, ElleKit) alongside classic jailbreak indicators, and ships with a Package.swift for Swift Package Manager (SPM) as well as CocoaPods.

How do I verify app tampering on Android and iOS?

Call EnhancedJailbreakRootDetection.instance.isTampered(bundleIdOrSha256). On iOS, pass your bundle ID. On Android, pass your expected package name or your 64-character hex APK signing certificate SHA-256.


Contributing & Community Standards

Contributions are welcome! Please review our project standards before opening an issue or pull request:


License & Credits