开始入门
复制一个包含安装步骤和该插件的完整 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.
安装
标题:安装您可以使用我们的AI辅助设置来安装插件。使用以下命令将Capgo技能添加到您的AI工具中:
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins然后使用以下提示:
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-is-root` plugin in my project.如果您更喜欢手动设置,请运行以下命令并按照以下平台特定的说明进行操作:
bun add @capgo/capacitor-is-rootbunx cap syncimport { IsRoot } from '@capgo/capacitor-is-root';isRooted
Section titled “是否是Root设备”执行默认的Root/Jailbreak检测检查。
这是基本Root/Jailbreak检测的推荐方法。 它运行了平台上最可靠的检测算法的组合。 支持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
Section titled “isRootedWithBusyBox”在Android设备上扩展了默认检测,添加了BusyBox特定的检查。
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.isRootedWithBusyBox();detectRootManagementApps
Section titled “检测Root管理应用”检测是否存在已知的Root管理应用(仅限Android)。
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.detectRootManagementApps();detectPotentiallyDangerousApps
Section titled “检测潜在危险应用”检测到可能存在危险的应用程序,通常出现在根设备(Android)上。
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.detectPotentiallyDangerousApps();detectTestKeys
检测测试密钥检测调试/测试构建标签(Android)
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.detectTestKeys();checkForBusyBoxBinary
检查BusyBox二进制文件是否存在(Android)复制到剪贴板
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.checkForBusyBoxBinary();checkForSuBinary
检查是否存在二进制文件(Android)复制到剪贴板 su 检测测试密钥
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.checkForSuBinary();checkSuExists
检测“checkSuExists”检测是否存在 su 可执行的二进制文件(仅限 Android)。
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.checkSuExists();checkForRWPaths
检测世界可写的系统路径(仅限 Android)。复制到剪贴板
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.checkForRWPaths();checkForDangerousProps
复制到剪贴板执行 RootBeer 原生检查(仅限 Android)。
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.checkForDangerousProps();checkForRootNative
复制到剪贴板复制到剪贴板
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.checkForRootNative();detectRootCloakingApps
标题:检测根目录掩蔽应用检测可以隐藏根目录的应用(仅限 Android)。
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.detectRootCloakingApps();isSelinuxFlagInEnabled
标题:检查 SELinux 是否启用检查 SELinux 强制执行状态(仅限 Android)。
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.isSelinuxFlagInEnabled();isExistBuildTags
标题:检测 OS 镜像中的测试构建标签检测 OS 镜像中的测试构建标签(仅限 Android)。
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
标题:isExistSUPath检查已知 su 二进制位置(仅限 Android)。
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.isExistSUPath();checkDirPermissions
标题:checkDirPermissions检测应受保护的可写目录(仅限 Android)。
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.checkDirPermissions();checkExecutingCommands
标题:checkExecutingCommands执行 which su 样式命令以检测 root(仅限 Android)。
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设备上的OTA证书
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.checkforOverTheAirCertificates();isRunningOnEmulator
检测模拟器指纹检测Android设备上的模拟器指纹
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.isRunningOnEmulator();simpleCheckEmulator
轻量级模拟器检测检测Android设备上的轻量级模拟器
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.simpleCheckEmulator();simpleCheckSDKBF86
Section titled “simpleCheckSDKBF86”仅在 Android 上检测 x86 模拟器指纹
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.simpleCheckSDKBF86();simpleCheckQRREFPH
Section titled “simpleCheckQRREFPH”仅在 Android 上检测 QC 参考手机构建
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”仅在 Android 上检测 Genymotion 模拟器指纹
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”检测Google SDK 模拟器指纹(仅限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
Section titled “isRootedWithEmulator”扩展了默认检测,包括模拟器逻辑(仅限Android)。
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.isRootedWithEmulator();isRootedWithBusyBoxWithEmulator
标题:"isRootedWithBusyBoxWithEmulator"仅在 Android 上扩展 BusyBox 检测,使用模拟器 heuristics。
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
标题:"设备信息"在检测期间收集的设备信息。
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. Re-run the sync when the public API changes upstream.
继续从入门
继续从入门如果您正在使用 入门 to plan dashboard and API operations, connect it with 使用@capgo/capacitor-is-root 使用@capgo/capacitor-is-root API Overview 为API概述的实现细节, 简介 为简介的实现细节, API密钥 为API密钥的实现细节,和 设备 为设备的实现细节。