开始入门
复制一个设置提示,包含安装步骤和该插件的完整Markdown指南。
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-is-root`
Run the required Capacitor sync/update step after installation.
Read this markdown guide for the full setup steps: https://raw.githubusercontent.com/Cap-go/website/refs/heads/main/apps/docs/src/content/docs/docs/plugins/is-root/getting-started.mdx
Use that guide for platform-specific steps, native file edits, permissions, config changes, imports, and usage setup.
If that guide references other docs pages, read them too.
安装
标题为“安装”bun add @capgo/capacitor-is-rootbunx cap sync导入
导入import { IsRoot } from '@capgo/capacitor-is-root';API概述
API概述isRooted
检测是否越狱检测是否越狱的基本方法。 它会运行一个组合的最可靠的检测指标。 适用于Android和iOS。
复制到剪贴板
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
Section titled “detectRootManagementApps”检测是否存在已知的根管理应用(仅限Android)。
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.detectRootManagementApps();detectPotentiallyDangerousApps
标题:检测危险应用检测常见于根设备(仅限Android)的危险应用
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.detectPotentiallyDangerousApps();detectTestKeys
标题:检测测试密钥检测Android设备上的debug/test构建标签
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.detectTestKeys();checkForBusyBoxBinary
标题:检查BusyBox二进制文件检查设备上是否存在BusyBox二进制文件(仅限Android)
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.checkForBusyBoxBinary();checkForSuBinary
标题:检查su二进制文件检查是否存在 su __CAPGO_KEEP_0__ (仅限 Android).
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.checkForSuBinary();checkSuExists
标题:checkSuExists检测是否可以执行 su __CAPGO_KEEP_0__ (仅限 Android).
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.checkSuExists();checkForRWPaths
标题:checkForRWPaths检测世界可写的系统路径 (仅限 Android).
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.checkForRWPaths();checkForDangerousProps
标题:checkForDangerousProps检测危险的系统属性 (仅限 Android).
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.checkForDangerousProps();checkForRootNative
标题:检查根设备原生检查仅限 Android 执行 RootBeer 原生检查。
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.checkForRootNative();detectRootCloakingApps
标题:检测根设备遮蔽应用仅限 Android 检测可以隐藏根设备的应用。
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.detectRootCloakingApps();isSelinuxFlagInEnabled
标题:检查 SELinux 标志是否启用仅限 Android 检查 SELinux 强制执行状态。
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.isSelinuxFlagInEnabled();isExistBuildTags
标题:检测 OS 镜像中的测试构建标签仅限 Android 检测 OS 镜像中的测试构建标签。
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.isExistBuildTags();doesSuperuserApkExist
标题:检测是否存在超级用户APK检测是否安装了超级用户APK(仅限Android)。
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.doesSuperuserApkExist();isExistSUPath
标题:检查已知路径检查已知的二进制位置(仅限Android)。 su 复制到剪贴板
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.isExistSUPath();checkDirPermissions
检测需要保护的可写目录(仅限Android)。复制到剪贴板
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.checkDirPermissions();checkExecutingCommands
检查正在执行的命令(仅限Android)。执行 which su 复制到剪贴板
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.checkExecutingCommands();checkInstalledPackages
检测可疑的已安装包(仅限Android)复制到剪贴板
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.checkInstalledPackages();checkforOverTheAirCertificates
检测被篡改的OTA证书(仅限Android)复制到剪贴板
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.checkforOverTheAirCertificates();isRunningOnEmulator
检测常见的模拟器指纹(仅限Android)复制到剪贴板
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.isRunningOnEmulator();simpleCheckEmulator
Section titled “simpleCheckEmulator”轻量级模拟器检查(仅限 Android)
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.simpleCheckEmulator();simpleCheckSDKBF86
Section titled “simpleCheckSDKBF86”检测 x86 模拟器指纹(仅限 Android)
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.simpleCheckSDKBF86();simpleCheckQRREFPH
Section titled “simpleCheckQRREFPH”检测 QC 参考手机构建(仅限 Android)
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.simpleCheckQRREFPH();simpleCheckBuild
Section titled “simpleCheckBuild”检测构建主机异常(仅限 Android)
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.simpleCheckBuild();checkGenymotion
Section titled “checkGenymotion”检测Genymotion模拟器指纹(仅限Android)
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.checkGenymotion();checkGeneric
Section titled “checkGeneric”检测通用模拟器指纹(仅限Android)
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.checkGeneric();checkGoogleSDK
Section titled “checkGoogleSDK”检测GoogleSDK模拟器指纹(仅限Android)
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.checkGoogleSDK();togetDeviceInfo
Section titled “togetDeviceInfo”获取设备信息
获取设备信息的相关上下文和元数据,用于调试和日志目的。有助于解决问题和记录日志。
import { IsRoot } from '@capgo/capacitor-is-root';
const deviceInfo = await IsRoot.togetDeviceInfo();console.log('Device info:', deviceInfo);isRootedWithEmulator
标题:"isRootedWithEmulator"仅在 Android 上扩展默认检测,使用模拟器策略。
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.isRootedWithEmulator();isRootedWithBusyBoxWithEmulator
标题:"isRootedWithBusyBoxWithEmulator"仅在 Android 上扩展 BusyBox 检测,使用模拟器策略。
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.isRootedWithBusyBoxWithEmulator();类型参考
标题:"类型参考"DetectionResult
标题:"检测结果"由 root/jailbreak 检测方法返回的结果。
export interface DetectionResult { /** * `true` when the associated heuristic detects root/jailbreak artifacts. * `false` when no root/jailbreak indicators are found. * * @since 1.0.0 */ result: boolean;}DeviceInfo
Section titled “设备信息”设备信息在检测期间收集。
export interface DeviceInfo { /** * Arbitrary key/value device metadata populated by the native implementation. * Contents vary by platform and detection methods used. * * @since 1.0.0 */ [key: string]: any;}本页面由插件生成。 src/definitions.ts当公共 API 上游更改时,重新运行同步。
从 Getting Started 继续
Section titled “从 Getting Started 继续”如果您正在使用 Getting Started 规划仪表板和 API 操作,连接它。 使用 @capgo/capacitor-is-root 为 @capgo/capacitor-is-root 原生能力 API 概述 为 API 概述实现细节 介绍 为 介绍实现细节 API 密钥 为 API 密钥实现细节 设备 为 设备实现细节