Skip to content

Getting Started

GitHub
Terminal window
bun add @capgo/capacitor-is-root
bunx cap sync
import { IsRoot } from '@capgo/capacitor-is-root';

Performs the default root/jailbreak detection checks.

This is the recommended method for basic root/jailbreak detection. It runs a combination of the most reliable detection heuristics for the platform. Works on both Android and 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');
}

Extends the default detection with BusyBox specific checks (Android only).

import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.isRootedWithBusyBox();

Detects if known root management applications are present (Android only).

import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.detectRootManagementApps();

Detects potentially dangerous applications commonly found on rooted devices (Android only).

import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.detectPotentiallyDangerousApps();

Detects debug/test build tags (Android only).

import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.detectTestKeys();

Checks whether a BusyBox binary exists on the device (Android only).

import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.checkForBusyBoxBinary();

Checks whether a su binary is present (Android only).

import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.checkForSuBinary();

Detects if the su binary can be executed (Android only).

import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.checkSuExists();

Detects world writable system paths (Android only).

import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.checkForRWPaths();

Detects dangerous system properties (Android only).

import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.checkForDangerousProps();

Executes RootBeer native checks (Android only).

import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.checkForRootNative();

Detects applications that can hide root (Android only).

import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.detectRootCloakingApps();

Checks the SELinux enforcement state (Android only).

import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.isSelinuxFlagInEnabled();

Detects test build tags on the OS image (Android only).

import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.isExistBuildTags();

Detects if superuser APKs are installed (Android only).

import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.doesSuperuserApkExist();

Checks for known su binary locations (Android only).

import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.isExistSUPath();

Detects writable directories that should be protected (Android only).

import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.checkDirPermissions();

Executes which su style commands to detect root (Android only).

import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.checkExecutingCommands();

Detects suspicious installed packages (Android only).

import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.checkInstalledPackages();

Detects tampered OTA certificates (Android only).

import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.checkforOverTheAirCertificates();

Detects common emulator fingerprints (Android only).

import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.isRunningOnEmulator();

Performs a lightweight emulator check (Android only).

import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.simpleCheckEmulator();

Detects x86 emulator fingerprints (Android only).

import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.simpleCheckSDKBF86();

Detects QC reference phone builds (Android only).

import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.simpleCheckQRREFPH();

Detects build host anomalies (Android only).

import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.simpleCheckBuild();

Detects Genymotion emulator fingerprints (Android only).

import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.checkGenymotion();

Detects generic emulator fingerprints (Android only).

import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.checkGeneric();

Detects Google SDK emulator fingerprints (Android only).

import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.checkGoogleSDK();

Returns device information collected during detection.

Provides additional context and metadata about the device that was gathered during the root detection process. Useful for debugging and logging purposes.

import { IsRoot } from '@capgo/capacitor-is-root';
const deviceInfo = await IsRoot.togetDeviceInfo();
console.log('Device info:', deviceInfo);

Extends the default detection with emulator heuristics (Android only).

import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.isRootedWithEmulator();

Extends the BusyBox detection with emulator heuristics (Android only).

import { IsRoot } from '@capgo/capacitor-is-root';
await IsRoot.isRootedWithBusyBoxWithEmulator();

Result returned by root/jailbreak detection methods.

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;
}

Device information collected during detection.

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;
}

This page is generated from the plugin’s src/definitions.ts. Re-run the sync when the public API changes upstream.

If you are using Getting Started to plan dashboard and API operations, connect it with Using @capgo/capacitor-is-root for the native capability in Using @capgo/capacitor-is-root, API Overview for the implementation detail in API Overview, Introduction for the implementation detail in Introduction, API Keys for the implementation detail in API Keys, and Devices for the implementation detail in Devices.