@ capgo/ 电容- is- root
从您的 Capacitor app 中检测出植入式Android 设备, 和 jabroken iPhone, 这样您就可以保护已损坏设备的付款、内容和账户 .
🤖 建筑与AI编码代理? 安装 Capgo 技能 所以克劳德代码,代码,光标,副驾驶,或双子座CLI知道如何安装和使用
@capgo/capacitor-is-root在您的电容应用程序中:npx skills add Cap-go/capgo-skills。然后问你的经纪人: 添加@capgo/capor-is-root到我的Capacitor应用上,并把它接上 代理设置指南 • 妇女 主机磁共振
检测 机器人根, (中文(简体) ), iOS 越狱,以及 模拟环境 (当你选择加入) 从你的控制器应用. @capgo/capacitor-is-root 暴露一个跨平台的入站点加上颗粒Android检查,这样你就可以调谐银行,fintech,企业,以及其他安全敏感产品的风险.
主要特点
- 一张支票数字 :
isRooted()运行两个平台的默认根或越狱检查. - iOS 越狱检查:在应用沙盒外寻找越狱文件并进行测试.
- Android 根 Beer 检查数字 :
checkForSuBinary(), (中文(简体) ),checkForDangerousProps(), (中文(简体) ),checkForRWPaths(), (中文(简体) ),detectTestKeys()还有更多. - Android上的应用检测数字 :
detectRootManagementApps(), (中文(简体) ),detectPotentiallyDangerousApps()财务报告和审定财务报表detectRootCloakingApps()。 。 。 . - 忙碌的框意识数字 :
isRootedWithBusyBox()在Android上添加 BusyBox检查. - 平台: iOS和Android. 互联网档案馆的存檔,存档日期2013-12-21. Android使用"根比尔". 网络上没有意义.
它检测到什么
| 信号 | 平台 | 如何检查 |
|---|---|---|
| 根/ 越狱 | Android 和 iOS 软件 | isRooted() (建议默认) |
| 模拟器 | 只有机器人 | isRunningOnEmulator(), (中文(简体) ), isRootedWithEmulator(), (中文(简体) ), isRootedWithBusyBoxWithEmulator(),或个人 simpleCheck* 编号 : check* 模拟器助手 |
| 更深的根信号 | 只有机器人 | RootBeer支持的助手和内部检查(见下文) |
打开 iOS系统, (中文(简体) ), isRooted() 是支持的跨平台 API。 模拟器构建总是报告不中断监狱(false) (中文(简体) ).
打开 机器人,大多数方法只有Android. isRooted() 组合 根比尔 capgo内部检查很紧张 模拟检测是 没有 默认部分 isRooted(); 使用 isRootedWithEmulator() 或者说 isRunningOnEmulator() 当你想要那个信号时.
为什么应用它
- 减少欺诈和虐待 在损坏的设备上,攻击者可以钩上API或绕过本地控制.
- 支持遵守和风险政策 这需要知道当一个设备 扎根, 监狱破裂,或运行在一个模拟器.
- 门敏感流量 (支付,PII,高价值行动) 带有明确的设备信任决定,而不是假设OS沙盒完好无损.
此插件与服务器侧验证、 证书针和您自己的威胁模型对等 。 这是一个客户端的信号,而不是一个独立的安全边界.
引擎盖底下的是什么
iOS系统 isRooted()
仅在物理设备上运行( 模拟器返回) false) (中文(简体) ). 检查按顺序进行; 任何正结果返回断层 :
- 已知越狱 路径和应用程序 (Cydia, MobileSubstrate, SSH, Frida, Cycript, 和相关路径).
- 限制文件读取 (可以打开可疑路径
fopen) (中文(简体) ). - 在沙盒外写作 (测试在下面写)
/private/) (中文(简体) ). cydia://網址 通过canOpenURL。 。 。 .- 可疑的符号链接 下级
/Applications财务报告和审定财务报表/var/stash/...。 。 。 .
如果没有一个触发器 总分 运行( 阈值) 3个) (中文(简体) ). 点来自URL/Cydia检查,隐藏的越狱文件,捆绑的plix异常,可疑过程(例如MobileCydia,Cydia,afpd), /etc/fstab 大小、 符号链接检查、 缺少可执行路径、 端口27042 的Frida、 已装入图像的FridaGadget 以及调试器附件(P_TRACED) (中文(简体) ). 基于分叉的检查是存在的,但目前总是返回虚假的.
机器人 isRooted()
回返 true 若为 无论是 根比尔 isRooted() 或者说 队长 InternalRootDetection.isRooted() 报告指标:
| 内部检查 | 它要找的东西 |
|---|---|
isExistBuildTags | ro.build.tags 包含 test-keys |
doesSuperuserApkExist | 磁盘上已知的超级用户 APK 路径 |
isExistSUPath | su 共同地点下的二进制 |
checkDirPermissions | 可写系统 dirs 或可读 /data |
checkExecutingCommands | which su 样式命令执行 |
checkInstalledPackages | 黑名单软件包, 只使用根的应用程序, Cydia 底盘 |
checkforOverTheAirCertificates | 失踪 /etc/security/otacerts.zip |
不包括模拟器 默认 isRooted()。 。 。 . isRootedWithEmulator() 添加 isRunningOnEmulator() (用于包括Genymotion和Google SDK图像在内的普通模拟器的模型,板子,制造商,指纹,和产品heuristics).
仅可选的 Android API
当您需要更精细的遥测或自定义策略( 检测方法返回) 时使用此选项 { result: boolean }:
- 组合 :
isRootedWithBusyBox(), (中文(简体) ),isRootedWithBusyBoxWithEmulator() - 根比尔 :
detectRootManagementApps(), (中文(简体) ),detectPotentiallyDangerousApps(), (中文(简体) ),detectTestKeys(), (中文(简体) ),checkForBusyBoxBinary(), (中文(简体) ),checkForSuBinary(), (中文(简体) ),checkSuExists(), (中文(简体) ),checkForRWPaths(), (中文(简体) ),checkForDangerousProps(), (中文(简体) ),checkForRootNative(), (中文(简体) ),detectRootCloakingApps(), (中文(简体) ),isSelinuxFlagInEnabled() - 内部( 单独曝光 ):
isExistBuildTags(), (中文(简体) ),doesSuperuserApkExist(), (中文(简体) ),isExistSUPath(), (中文(简体) ),checkDirPermissions(), (中文(简体) ),checkExecutingCommands(), (中文(简体) ),checkInstalledPackages(), (中文(简体) ),checkforOverTheAirCertificates() - 模拟助手 :
isRunningOnEmulator(), (中文(简体) ),simpleCheckEmulator(), (中文(简体) ),simpleCheckSDKBF86(), (中文(简体) ),simpleCheckQRREFPH(), (中文(简体) ),simpleCheckBuild(), (中文(简体) ),checkGenymotion(), (中文(简体) ),checkGeneric(), (中文(简体) ),checkGoogleSDK() - 除错元数据 :
togetDeviceInfo()返回在 Android 上构建和收集的 OS 字段
限制( 读此)
所有检测是 高压. 固执地攻击者在被植入或被囚禁的装置上可以隐藏二进制、钩子本地代码或结果. 假阳性与假阴性是可能的. 处理 result: true 作为您应用政策的风险信号, 而不是妥协的证据, 永远不能替代服务器侧认证和授权.
快速使用
import { IsRoot } from '@capgo/capacitor-is-root';
// Cross-platform root / jailbreak check
const { result } = await IsRoot.isRooted();
if (result) {
console.warn('Device may be rooted or jailbroken');
}
// Android: include emulator in the same pass as root checks
const emulatorAware = await IsRoot.isRootedWithEmulator();
// Android: emulator only
const { result: onEmulator } = await IsRoot.isRunningOnEmulator();
以下生成完整的 API 引用 src/definitions.ts。 。 。 .
文档
这里有最完整的医生: capego.app/docs/插件/is-rout/
兼容性
| 插件版本 | 电容兼容性 | 维护 |
|---|---|---|
| 联合国 | 联合国 | ✅ |
| 页:1 | 页:1 | 应要求 |
| 页:1 | 页:1 | ❌ |
| 页:1 | 页:1 | ❌ |
说明: 此插件的主要版本沿用了Capacitor的主要版本. 使用匹配您的 Capacitor 安装的版本( 如 Capacitor 8 的插件 v8) 。 只有最新的主要版本得到积极维护.
安装
您可以使用我们的 AI 辅助设置安装插件 。 使用以下命令将 Capgo 技能添加到您的 AI 工具 :
npx skills add https://github.com/cap-go/capacitor-skills --skill capacitor-plugins
然后使用下列提示:
Use the `capacitor-plugins` skill from `cap-go/capacitor-skills` to install the `@capgo/capacitor-is-root` plugin in my project.
如果您更喜欢手动设置,请通过运行以下命令来安装插件,并遵循下面的平台特定指令:
npm install @capgo/capacitor-is-root
npx cap sync
安卓包能见度(API 30+)
当您的应用目标为 Android 11( API 30) 或更高时, 包过滤限制其它应用 PackageManager 除非它们被宣布为 <queries> 元素或自动可见(例如,您自己的软件包、共享您的UID的应用程序以及某些预先安装的系统软件包)。 此插件传送到 <queries> 其 RootBeer 和内部安装的包装检查所需的条目, 以及清单合并将它们添加到您的应用程序中。 您不需要重复这些声明, 除非您用自己的包查看来扩展检测范围 .
detectPotentiallyDangerousApps() 不添加 <queries> 对于 RootBeer 危险应用软件包的条目,该插件会省略(ROM管理器和盗版应用程序). 除非主机应用程序声明,否则这些安装无法被看到。 显示插件的插件已经从该列表中宣告了我们要检测的选中软件包( 例如) com.ramdroid.appquarantine 以及EdXposed经理.
内部安装的包装检查也离开 org.adblockplus.android 未申报的,即使列于 ROOT_ONLY_APPLICATIONSAdblock Plus是当今的普通应用,所以让它可见就可以算入根入入根入根入根入根.
iOS系统
不需要配置 。 可以选择的是,插件还可以通过由"越狱"包管理者注册的URL计划来检测出一次越狱. iOS 只回答您的应用程序中宣布的策略, 所以添加您想要检查的选项到 Info.plist数字 :
<key>LSApplicationQueriesSchemes</key>
<array>
<string>cydia</string>
<string>sileo</string>
<string>zbra</string>
<string>filza</string>
</array>
未申报的计划会被忽略. 其他的检查(有根有根和根无根的越狱档案,沙盒完整性,被注入的库)不需要这样的设置.
API 密码
isRooted()isRootedWithBusyBox()detectRootManagementApps()detectPotentiallyDangerousApps()detectTestKeys()checkForBusyBoxBinary()checkForSuBinary()checkSuExists()checkForRWPaths()checkForDangerousProps()checkForRootNative()detectRootCloakingApps()isSelinuxFlagInEnabled()isExistBuildTags()doesSuperuserApkExist()isExistSUPath()checkDirPermissions()checkExecutingCommands()checkInstalledPackages()checkforOverTheAirCertificates()isRunningOnEmulator()simpleCheckEmulator()simpleCheckSDKBF86()simpleCheckQRREFPH()simpleCheckBuild()checkGenymotion()checkGeneric()checkGoogleSDK()togetDeviceInfo()isRootedWithEmulator()isRootedWithBusyBoxWithEmulator()getPluginVersion()- 接口
用于检测植入(Android)或jailbroken(iOS)设备的电源插件.
此插件提供了全面的检测方法, 以识别设备是否已经存在 对安全敏感应用可能很重要.
大多数方法都是只使用Android,并使用各种休克来检测根存取.
基础 isRooted() 方法在Android和iOS上都有作用.
是旋转 ()
isRooted() => Promise<DetectionResult>
执行默认的根/断壁检测检查.
这是建议的基本根/断膜检测方法. 它为平台运行了最可靠的检测热能组合. 工作在Android和iOS两个方面.
回返情况: Promise<DetectionResult>
自: 1.0.0 (单位:千美元)
以 BusyBox () 旋转
isRootedWithBusyBox() => Promise<DetectionResult>
用 BusyBox 特定检查(仅限Android)来延长默认检测.
回返情况: Promise<DetectionResult>
探测到RootManagementApps ()
detectRootManagementApps() => Promise<DetectionResult>
检测是否存在已知的根管理应用程序(只有Android).
回返情况: Promise<DetectionResult>
检测到可能具有危险性的 Apps ()
detectPotentiallyDangerousApps() => Promise<DetectionResult>
检测到在植入装置上通常发现的潜在危险应用(仅安卓).
回返情况: Promise<DetectionResult>
检测 Keys ()
detectTestKeys() => Promise<DetectionResult>
检测调试/测试构建标记(仅限Android).
回返情况: Promise<DetectionResult>
检查BusyBoxBinary ()
checkForBusyBoxBinary() => Promise<DetectionResult>
检查设备上是否存在 BusyBox 二进制( 只有Android) .
回返情况: Promise<DetectionResult>
检查SuBinary ()
checkForSuBinary() => Promise<DetectionResult>
检查是否 su 二进制存在(只有Android).
回返情况: Promise<DetectionResult>
检查Suexists ()
checkSuExists() => Promise<DetectionResult>
检测是否 su 二进制可以被执行(只有Android).
回返情况: Promise<DetectionResult>
检查RWPaths ()
checkForRWPaths() => Promise<DetectionResult>
检测出世界可写系统路径( 只有Android) .
回返情况: Promise<DetectionResult>
检查危险Props ()
checkForDangerousProps() => Promise<DetectionResult>
探测到危险的系统属性(仅Android).
回返情况: Promise<DetectionResult>
选中此项( C)
checkForRootNative() => Promise<DetectionResult>
执行RootBeer本土检查(仅限Android).
回返情况: Promise<DetectionResult>
探测到 RootCloaking Apps ()
detectRootCloakingApps() => Promise<DetectionResult>
检测能隐藏root(只有Android)的应用程序.
回返情况: Promise<DetectionResult>
已忽略
isSelinuxFlagInEnabled() => Promise<DetectionResult>
检查 SELinux 执行状态(只有Android).
回返情况: Promise<DetectionResult>
已存在 BuildTags ()
isExistBuildTags() => Promise<DetectionResult>
检测测试在OS图像上构建标记(仅限Android).
回返情况: Promise<DetectionResult>
does SuperuserApkExist () (中文(简体) )
doesSuperuserApkExist() => Promise<DetectionResult>
检测是否安装了超级用户APK(仅限Android).
回返情况: Promise<DetectionResult>
存在SUPath( )
isExistSUPath() => Promise<DetectionResult>
检查已知 su 二进制位置( 只有Android) .
回返情况: Promise<DetectionResult>
检查
checkDirPermissions() => Promise<DetectionResult>
检测到应当被保护的可写目录( 只有Android) .
回返情况: Promise<DetectionResult>
检查执行命令( C)
checkExecutingCommands() => Promise<DetectionResult>
执行 which su 样式命令以检测根(只有Android).
回返情况: Promise<DetectionResult>
已安装的套件( C)
checkInstalledPackages() => Promise<DetectionResult>
检测出已安装的可疑软件包( 只有Android) .
回返情况: Promise<DetectionResult>
检查过航空器证书( C)
checkforOverTheAirCertificates() => Promise<DetectionResult>
探测器篡改了OTA证书(仅限Android).
回返情况: Promise<DetectionResult>
isRunning On模拟器( )
isRunningOnEmulator() => Promise<DetectionResult>
检测出常见的仿真器指纹(只有Android).
回返情况: Promise<DetectionResult>
简单的检查模拟器( )
simpleCheckEmulator() => Promise<DetectionResult>
执行轻量级模拟器检查(仅限Android).
回返情况: Promise<DetectionResult>
简单检查SDKBF86 ()
simpleCheckSDKBF86() => Promise<DetectionResult>
检测出x86仿真指纹(仅限Android).
回返情况: Promise<DetectionResult>
简单检查QREFPH ()
simpleCheckQRREFPH() => Promise<DetectionResult>
检测QC参考电话构建(仅Android).
回返情况: Promise<DetectionResult>
简单检查构建 ()
simpleCheckBuild() => Promise<DetectionResult>
探测器构建主机异常(仅限Android).
回返情况: Promise<DetectionResult>
检查Genymotion ()
checkGenymotion() => Promise<DetectionResult>
检测出Genymotion模拟器指纹(仅限Android).
回返情况: Promise<DetectionResult>
检查Generic ()
checkGeneric() => Promise<DetectionResult>
检测出通用仿真器指纹(仅Android).
回返情况: Promise<DetectionResult>
检查 GoogleSDK ()
checkGoogleSDK() => Promise<DetectionResult>
检测出谷歌SDK模拟器指纹(仅限Android).
回返情况: Promise<DetectionResult>
获取DeviceInfo ()
togetDeviceInfo() => Promise<DeviceInfo>
返回检测时收集的设备信息.
提供关于原设备的额外上下文和元数据 在根检测过程中收集。 用于调试 和伐木目的.
回返情况: Promise<DeviceInfo>
自: 1.0.0 (单位:千美元)
is Rooted With Emotor () 自动调试器
isRootedWithEmulator() => Promise<DetectionResult>
以模拟器heuristics(只有Android)扩展默认检测.
回返情况: Promise<DetectionResult>
以 BusyBox With Emotor () 旋转
isRootedWithBusyBoxWithEmulator() => Promise<DetectionResult>
以模拟器heuristics(仅限Android)扩展 BusyBox 检测.
回返情况: Promise<DetectionResult>
获取 PluginVersion ()
getPluginVersion() => Promise<{ version: string; }>
获取本地 Capacitor 插件版本 .
回返情况: Promise<{ version: string; }>
自: 1.0.0 (单位:千美元)
接口
检测结果
以根/断壁检测方法返回结果.
| Prop | 类型 | 说明 | 自兹 |
|---|---|---|---|
result | boolean | true 当相关的休眠检测出 根/断壳器. false 当找不到根/断裂指标时. | 1.0.0 (单位:千美元) |
设备信息
探测时收集的设备信息.
贷项
此插件的灵感来自 https://github.com/WuglyakBolgoink/cordova-plugin-iroot 页面存档备份,存于互联网档案馆