使用@capgo/capacitor-is-root
Capacitor 根权限插件,用于检测安卓设备是否被root或iOS设备是否被越狱
安装
bun add @capgo/capacitor-is-root
bunx cap sync
此插件暴露的内容
isRooted- 执行默认的root/jailbreak检测检查。isRootedWithBusyBox- 在安卓设备上扩展默认检测,使用BusyBox进行特定检查。detectRootManagementApps- 检测安卓设备上已知的root管理应用程序是否存在。detectPotentiallyDangerousApps- 检测安卓设备上常见的危险应用程序,通常出现在root设备上。
示例使用
isRooted
执行默认的root/jailbreak检测检查。
import { IsRoot } from '@capgo/capacitor-is-root';
const { result } = await IsRoot.isRooted();
if (result) {
console.log('Device is rooted/jailbroken');
} else {
console.log('Device is not rooted/jailbroken');
}
isRootedWithBusyBox
扩展了默认检测,包含BusyBox特定检查(仅限Android)。
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.isRootedWithBusyBox();
detectRootManagementApps
检测已知的根管理应用程序是否存在(仅限Android)。
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.detectRootManagementApps();
detectPotentiallyDangerousApps
检测常见于根设备上的危险应用程序(仅限Android)。
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.detectPotentiallyDangerousApps();
全局参考
- GitHub: https://github.com/Cap-go/capacitor-is-root/
- 文档:/docs/plugins/is-root/
继续使用@capgo/capacitor-is-root
如果您正在使用 使用@capgo/capacitor-is-root 来规划原生插件工作,连接它与 @capgo/capacitor-is-root 为 @capgo/capacitor-is-root 的实现细节 开始使用 为 Getting Started 的实现细节 Capgo 插件目录 为 Capgo 插件目录中的产品工作流程 Capacitor 由 Capgo 提供的插件 为 Capacitor 由 Capgo 提供的插件的实现细节,并 添加或更新插件 为添加或更新插件的实现细节