はじめから始める
このプラグインのセットアッププロンプトとインストール手順、そしてマークダウンガイドを含むセットアッププロンプトをコピーしてください。
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.
インストール
「インストール」というセクションCapgoのAI-Assisted Setupを使用してプラグインをインストールできます。AIツールにCapgoスキルを追加するには、以下のコマンドを実行してください。
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.Manual Setupを使用する場合は、以下のコマンドを実行してプラグインをインストールし、以下のプラットフォーム固有の指示に従ってください。
bun add @capgo/capacitor-is-rootbunx cap syncインポート
「インポート」のセクションimport { IsRoot } from '@capgo/capacitor-is-root';APIの概要
「APIの概要」のセクションisRooted
「isRooted」のセクションデフォルトの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
「isRootedWithBusyBox」のセクションAndroid専用のBusyBox固有のチェックをデフォルトの検出に拡張します。
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.isRootedWithBusyBox();detectRootManagementApps
「detectRootManagementApps」セクションAndroid専用の知名度の高いroot管理アプリの存在を検出します。
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.detectRootManagementApps();detectPotentiallyDangerousApps
「detectPotentiallyDangerousApps」セクションAndroid専用のrootデバイスでよく見られる危険なアプリを検出します。
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.detectPotentiallyDangerousApps();detectTestKeys
「detectTestKeys」セクションAndroid専用のデバッグ/テストビルドタグを検出します。
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.detectTestKeys();checkForBusyBoxBinary
「checkForBusyBoxBinary」セクションデバイス上のAndroid専用のBusyBoxバイナリが存在するかどうかを確認します。
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.checkForBusyBoxBinary();checkForSuBinary
「checkForSuBinary」セクションAndroid専用のバイナリが存在するかどうかを確認します。 su クリップボードにコピー
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.checkForSuBinary();checkSuExists
Android専用のバイナリが実行可能であるかどうかを検出します。クリップボードにコピー su 「checkForRWPaths」セクション
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.checkSuExists();checkForRWPaths
Section titled “checkForRWPaths”Detects world writable system paths (Android only).
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.checkForRWPaths();checkForDangerousProps
「checkForDangerousProps」セクションAndroid専用の危険なシステムプロパティを検出します。
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.checkForDangerousProps();checkForRootNative
「checkForRootNative」セクションAndroid専用のRootBeerネイティブチェックを実行します。
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.checkForRootNative();detectRootCloakingApps
「detectRootCloakingApps」セクションAndroid専用のrootを隠すアプリケーションを検出します。
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.detectRootCloakingApps();isSelinuxFlagInEnabled
「isSelinuxFlagInEnabled」セクションAndroid専用のSELinuxの強制実行状態を確認します。
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.isSelinuxFlagInEnabled();isExistBuildTags
「isExistBuildTags」セクションOS イメージ (Android 限定) におけるテストビルドタグを検出します。
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.isExistBuildTags();doesSuperuserApkExist
「doesSuperuserApkExist」セクションAndroid 限定で、スーパーユーザー APK がインストールされているかどうかを検出します。
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.doesSuperuserApkExist();isExistSUPath
「isExistSUPath」セクションAndroid 限定で、知られている su バイナリの場所を確認します。
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.isExistSUPath();checkDirPermissions
「checkDirPermissions」セクションAndroid での書き込み可能なディレクトリを検出して保護する (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
セクション「checkInstalledPackages」Android での疑わしいインストールされたパッケージを検出する。
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.checkInstalledPackages();checkforOverTheAirCertificates
セクション「checkforOverTheAirCertificates」Android での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
エミュレータを検出する軽量チェックのセクション (Android用)コピー
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.simpleCheckEmulator();simpleCheckSDKBF86
コピーQC参考電話のビルドを検出するセクション (Android用)
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.simpleCheckSDKBF86();simpleCheckQRREFPH
エミュレータを検出するx86の簡単なチェックエミュレータを検出する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”Android用のGoogle SDK エミュレータの指紋を検出します。
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
Section titled “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
「デバイス情報」セクション検出中に収集されたデバイス情報
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.tspublic API がアップストリームで変更されたときに再度 Sync を実行してください。
Getting Started から続けて
「Getting Started から続けて」セクションCapgoを使用している場合 Getting Started ダッシュボードとAPIの作業を計画するには、APIに接続してください Capacitorを使用してnative capabilityを実装するには@capgo/capacitor-is-rootを使用します for the native capability in Using @capgo/capacitor-is-root, Capacitorを使用してnative capabilityを実装するには@API/__CAPGO_KEEP_1__-is-rootを使用します for the implementation detail in API Overview, Capacitorを使用してnative capabilityを実装するには@__CAPGO_KEEP_0__/__CAPGO_KEEP_1__-is-rootを使用します __CAPGO_KEEP_0__のキー Capacitorを使用してnative capabilityを実装するには@API/__CAPGO_KEEP_1__-is-rootを使用します for the implementation detail in API Keys, and Getting Started デバイスの実装詳細について。