搜尋套件、儲存庫與 APP 分類

套件詳情v1.2.3

jailbreak_root_detection

使用 RootBeer + DetectFrida 進行 Android 根檢測,使用 IOSSecuritySuite 進行 iOS 越獄檢測。

AndroidiOS
近 30 天下載
2.3萬
喜歡數
71
Pub 分數
150

安裝套件

flutter pub add jailbreak_root_detection

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

一個 Flutter 套件,使用可信庫在 Android 上偵測 root 存取權限,在 iOS 上偵測越獄狀態:Android 使用 RootBeer,iOS 使用 IOSSecuritySuite。它提供統一的 API 來檢查裝置完整性,協助開發者保護應用程式免受篡改環境的影響。此套件可透過簡單的新增指令輕鬆整合至 Flutter 項目,並支援兩大主要行動平台。非常適合用於保護銀行或驗證系統等敏感應用程式。

適用情境

  • 保護金融應用程式免受越獄/越獄設備的影響
  • 防止未經授權的應用程式修改
  • 增強驗證流程中的安全性
  • 檢測被入侵的設備環境
  • 強制執行安全執行條件

主要特色

  • 結合 RootBeer 和 DetectFrida 用於 Android
  • 使用 IOSSecuritySuite 用於 iOS
  • 跨平台檢測支援
  • Flutter 的簡單整合
  • 輕量且可靠
  • 即時設備完整性檢查

適合對象

  • 注重安全的行動應用程式
  • 需要高完整性驗證的應用程式
  • 金融與企業級應用
  • 開發防竄改功能的開發者
  • 針對 Android 和 iOS 的專案

使用建議

  • 可能在某些模擬器上觸發誤報
  • 需要在兩個平台上執行原生代碼
  • 僅限根目錄/越獄檢測
  • 未包含執行時緩解措施
  • 依賴第三方程式庫的更新

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

jailbreak_root_detection

pub package license

Detects rooted, jailbroken, tampered and otherwise untrusted devices from Flutter.

Uses RootBeer + Magisk and Frida checks for Android root detection, and IOSSecuritySuite (~> 1.9.10) for iOS jailbreak detection.

Requirements

Minimum
Flutter 3.44.0
Dart SDK 3.12.0
Android minSdk 21, compileSdk 34, Java/Kotlin 17
iOS 11.0

The iOS side ships as a Swift Package (Swift Package Manager). A CocoaPods podspec is still included, so both dependency managers work.

Getting started

Add the dependency to your pubspec.yaml:

dependencies:
  jailbreak_root_detection: "^1.2.3"

Or:

flutter pub add jailbreak_root_detection
iOS setup

To let the plugin probe for jailbreak-related URL schemes, add them to ios/Runner/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>

Without this entry iOS blocks the canOpenURL checks and jailbreak detection is less accurate.

Android setup

No extra configuration required.

Usage

import 'package:jailbreak_root_detection/jailbreak_root_detection.dart';

final detector = JailbreakRootDetection.instance;

// One combined verdict — the usual entry point.
final isNotTrust = await detector.isNotTrust;
if (isNotTrust) {
  // Block, warn, or degrade functionality.
}
API
Member Returns Android iOS Description
isNotTrust Future<bool> ✅ ✅ Combined verdict: jailbroken/rooted, not a real device, or (Android) installed on external storage. Returns true if any check throws.
isJailBroken Future<bool> ✅ ✅ Rooted (RootBeer, Frida, Magisk) on Android; jailbroken on iOS.
isRealDevice Future<bool> ✅ ✅ false on an emulator or simulator.
isDebugged Future<bool> ✅ ✅ A debugger is attached to the process.
isDevMode Future<bool> ✅ — Developer options are enabled.
isOnExternalStorage Future<bool> ✅ — The app is installed on external storage.
isTampered(String bundleId) Future<bool> — ✅ The app bundle/signature has been modified.
checkForIssues Future<List<JailbreakIssue>> ✅ ✅ All detected issues in one call.

Android-only members throw a MissingPluginException on iOS and vice versa, so guard them with Platform.isAndroid / Platform.isIOS:

if (Platform.isAndroid) {
  final isOnExternalStorage = await detector.isOnExternalStorage;
  final isDevMode = await detector.isDevMode;
}

if (Platform.isIOS) {
  const bundleId = 'com.w3conext.jailbreakRootDetectionExample';
  final isTampered = await detector.isTampered(bundleId);
}
checkForIssues

checkForIssues runs every check the platform supports and returns only the problems it found — an empty list means the device looks clean.

final issues = await detector.checkForIssues;
for (final issue in issues) {
  print('issue: $issue');
}
JailbreakIssue Android iOS Meaning
jailbreak ✅ ✅ Device is rooted or jailbroken.
notRealDevice ✅ ✅ Running on an emulator or simulator.
debugged ✅ ✅ A debugger is attached.
fridaFound ✅ ✅ The Frida instrumentation framework was detected.
devMode ✅ — Developer options are enabled.
onExternalStorage ✅ — App is installed on external storage.
proxied — ✅ An HTTP proxy is configured.
reverseEngineered — ✅ Reverse-engineering tooling was detected.
cydiaFound — ✅ Cydia was detected.
tampered — — Reported only by isTampered(bundleId), not by checkForIssues.
unknown ✅ ✅ An issue this Dart version doesn't recognise. Android currently reports Magisk detection here.

Handle unknown as untrusted rather than ignoring it.

Important: test on real devices only

This package must be tested on a physical device.

Running on an emulator or simulator may cause false positives — for example, detection may incorrectly report that the device is jailbroken or rooted.

Example

See example/lib/main.dart for a complete app that runs every check and prints the results.

Reference

License

MIT

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。