はじめから始める
このプラグインのインストール手順とフル マークダウン ガイドまでの全てのステップを含むセットアップの質問をコピーしてください。
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」デバイス上のBusyBoxバイナリが存在するかどうかを確認します (Android専用)。
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.checkForBusyBoxBinary();checkForSuBinary
「checkForSuBinary」セクションデバイス上の su バイナリが存在するかどうかを確認します (Android専用)。
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.checkForSuBinary();checkSuExists
「checkSuExists」セクションバイナリが実行可能であるかどうかを検出します (Android専用)。 su クリップボードにコピー
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.checkSuExists();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
「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 Android でのスタイル コマンドを実行して root を検出する (Android 限定).
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.checkExecutingCommands();checkInstalledPackages
「checkInstalledPackages」セクションAndroid での疑わしいインストール パッケージを検出する (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
「isRunningOnEmulator」セクションAndroid用の一般的なエミュレータの指紋を検出します。
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.isRunningOnEmulator();simpleCheckEmulator
「simpleCheckEmulator」セクションAndroid用の軽量エミュレータチェックを実行します。
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.simpleCheckEmulator();simpleCheckSDKBF86
「simpleCheckSDKBF86」セクションAndroid用のx86エミュレータの指紋を検出します。
import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.simpleCheckSDKBF86();simpleCheckQRREFPH
「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”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();Type Reference
Section titled “Type Reference”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;}ソース オブ トゥルース
このページはプラグインの公開 __CAPGO_KEEP_0__ がアップストリームで変更された場合に再度 Sync を実行してください。 src/definitions.ts. Re-run the sync when the public API changes upstream.
Getting Started から続けて
ソース オブ トゥルースCapgoを使用している場合 Getting Started ダッシュボードとAPIの操作を計画するには、 Capgoの@capgo/capacitor-is-rootを使用 Capgoの@capgo/capacitor-is-rootのネイティブ機能について API Overview for the implementation detail in API Overview, Capgoのキーの実装詳細について Capgoのキーの実装詳細について、 API Keys for the implementation detail in API Keys, and Getting Started デバイスの実装詳細について。