Skip to main content
@capgo/capacitor-is-root Auth & Security Open source

Is Root Capacitor plugin

Detect rooted Android or jailbroken iOS devices to enhance app security

Install

bun add @capgo/capacitor-is-root bunx cap sync
npm, pnpm or yarn
  • npm install @capgo/capacitor-is-root
  • pnpm add @capgo/capacitor-is-root
  • yarn add @capgo/capacitor-is-root

Guide

How to use Is Root in Capacitor

Test on device

Download the Capgo app, then scan the QR code.

Is Root plugin preview QR code

Using @capgo/capacitor-is-root

Capacitor Is Root Plugin for detecting rooted (Android) or jailbroken (iOS) devices.

Install

bun add @capgo/capacitor-is-root
bunx cap sync

bunx cap sync copies the plugin's native code into your native projects. Run it again after every plugin upgrade.

Import

import { IsRoot } from '@capgo/capacitor-is-root';

API at a glance

Method Description
isRooted Performs the default root/jailbreak detection checks.
isRootedWithBusyBox Extends the default detection with BusyBox specific checks (Android only).
detectRootManagementApps Detects if known root management applications are present (Android only).
detectPotentiallyDangerousApps Detects potentially dangerous applications commonly found on rooted devices (Android only).
detectTestKeys Detects debug/test build tags (Android only).
checkForBusyBoxBinary Checks whether a BusyBox binary exists on the device (Android only).
checkForSuBinary Checks whether a su binary is present (Android only).
checkSuExists Detects if the su binary can be executed (Android only).
checkForRWPaths Detects world writable system paths (Android only).
checkForDangerousProps Detects dangerous system properties (Android only).
checkForRootNative Executes RootBeer native checks (Android only).
detectRootCloakingApps Detects applications that can hide root (Android only).
isSelinuxFlagInEnabled Checks the SELinux enforcement state (Android only).
isExistBuildTags Detects test build tags on the OS image (Android only).
doesSuperuserApkExist Detects if superuser APKs are installed (Android only).
isExistSUPath Checks for known su binary locations (Android only).
checkDirPermissions Detects writable directories that should be protected (Android only).
checkExecutingCommands Executes which su style commands to detect root (Android only).
checkInstalledPackages Detects suspicious installed packages (Android only).
checkforOverTheAirCertificates Detects tampered OTA certificates (Android only).
isRunningOnEmulator Detects common emulator fingerprints (Android only).
simpleCheckEmulator Performs a lightweight emulator check (Android only).
simpleCheckSDKBF86 Detects x86 emulator fingerprints (Android only).
simpleCheckQRREFPH Detects QC reference phone builds (Android only).
simpleCheckBuild Detects build host anomalies (Android only).
checkGenymotion Detects Genymotion emulator fingerprints (Android only).
checkGeneric Detects generic emulator fingerprints (Android only).
checkGoogleSDK Detects Google SDK emulator fingerprints (Android only).
togetDeviceInfo Returns device information collected during detection.
isRootedWithEmulator Extends the default detection with emulator heuristics (Android only).
isRootedWithBusyBoxWithEmulator Extends the BusyBox detection with emulator heuristics (Android only).

Examples

isRooted()

Performs the default root/jailbreak detection checks.

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()

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

import { IsRoot } from '@capgo/capacitor-is-root';

const result = await IsRoot.isRootedWithBusyBox();
console.log(result);

detectRootManagementApps()

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

import { IsRoot } from '@capgo/capacitor-is-root';

const result = await IsRoot.detectRootManagementApps();
console.log(result);

detectPotentiallyDangerousApps()

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

import { IsRoot } from '@capgo/capacitor-is-root';

const result = await IsRoot.detectPotentiallyDangerousApps();
console.log(result);

detectTestKeys()

Detects debug/test build tags (Android only).

import { IsRoot } from '@capgo/capacitor-is-root';

const result = await IsRoot.detectTestKeys();
console.log(result);

checkForBusyBoxBinary()

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

import { IsRoot } from '@capgo/capacitor-is-root';

const result = await IsRoot.checkForBusyBoxBinary();
console.log(result);

The table above lists the 31 core methods. Listener and version helpers, and the full contract of each method, are documented in the GitHub repository.

Full reference

Keep going from Using @capgo/capacitor-is-root

If you are using Using @capgo/capacitor-is-root to plan native plugin work, connect it with @capgo/capacitor-is-root for the implementation detail in @capgo/capacitor-is-root, Getting Started for the implementation detail in Getting Started, Capgo Plugin Directory for the product workflow in Capgo Plugin Directory, Capacitor Plugins by Capgo for the implementation detail in Capacitor Plugins by Capgo, and Adding or Updating Plugins for the implementation detail in Adding or Updating Plugins.

FAQ

Is Root plugin FAQ

How do I install the Is Root plugin in a Capacitor app?

Run "bun add @capgo/capacitor-is-root" (or "npm install @capgo/capacitor-is-root"), then run "bunx cap sync" so the iOS and Android projects pick up the native code. Import it from "@capgo/capacitor-is-root" in your app code.

Does @capgo/capacitor-is-root work with React, Vue and Angular?

Yes. Is Root is a Capacitor package, so it works with any web framework that runs inside Capacitor, including Ionic, React, Vue, Angular, Svelte and plain JavaScript.

Which Capacitor version does @capgo/capacitor-is-root support?

Capgo plugins follow Capacitor's major version: use the plugin major version that matches your Capacitor major version (for example plugin v8 with Capacitor 8). The compatibility table in the GitHub README lists the maintained versions.

Is @capgo/capacitor-is-root free and open source?

Yes. The source code is public on GitHub at https://github.com/Cap-go/capacitor-is-root/ and the package is free to install from npm. Bug reports and pull requests are welcome.

Can I update code that uses Is Root without an App Store review?

Installing or upgrading the plugin changes native code, so it needs a new store build. After that, JavaScript, HTML and CSS changes that call the plugin can ship instantly with Capgo live updates.

Ship Is Root changes without waiting for app review

Once the plugin is in your store build, Capgo live updates push your JavaScript, HTML and CSS changes to users in minutes.

Start with Capgo