Jailbreak/Root Detection Plugin for Capacitor
The most complete doc is available here: https://capgo.app/docs/plugins/is-root/
npm install @capgo/capacitor-is-root
npx cap syncisRooted()isRootedWithBusyBox()detectRootManagementApps()detectPotentiallyDangerousApps()detectTestKeys()checkForBusyBoxBinary()checkForSuBinary()checkSuExists()checkForRWPaths()checkForDangerousProps()checkForRootNative()detectRootCloakingApps()isSelinuxFlagInEnabled()isExistBuildTags()doesSuperuserApkExist()isExistSUPath()checkDirPermissions()checkExecutingCommands()checkInstalledPackages()checkforOverTheAirCertificates()isRunningOnEmulator()simpleCheckEmulator()simpleCheckSDKBF86()simpleCheckQRREFPH()simpleCheckBuild()checkGenymotion()checkGeneric()checkGoogleSDK()togetDeviceInfo()isRootedWithEmulator()isRootedWithBusyBoxWithEmulator()getPluginVersion()- Interfaces
Capacitor Is Root Plugin for detecting rooted (Android) or jailbroken (iOS) devices.
This plugin provides comprehensive detection methods to identify if a device has been rooted or jailbroken, which can be important for security-sensitive applications.
Most methods are Android-only and use various heuristics to detect root access.
The basic isRooted() method works on both Android and iOS.
isRooted() => Promise<DetectionResult>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.
Returns: Promise<DetectionResult>
Since: 1.0.0
isRootedWithBusyBox() => Promise<DetectionResult>Extends the default detection with BusyBox specific checks (Android only).
Returns: Promise<DetectionResult>
detectRootManagementApps() => Promise<DetectionResult>Detects if known root management applications are present (Android only).
Returns: Promise<DetectionResult>
detectPotentiallyDangerousApps() => Promise<DetectionResult>Detects potentially dangerous applications commonly found on rooted devices (Android only).
Returns: Promise<DetectionResult>
detectTestKeys() => Promise<DetectionResult>Detects debug/test build tags (Android only).
Returns: Promise<DetectionResult>
checkForBusyBoxBinary() => Promise<DetectionResult>Checks whether a BusyBox binary exists on the device (Android only).
Returns: Promise<DetectionResult>
checkForSuBinary() => Promise<DetectionResult>Checks whether a su binary is present (Android only).
Returns: Promise<DetectionResult>
checkSuExists() => Promise<DetectionResult>Detects if the su binary can be executed (Android only).
Returns: Promise<DetectionResult>
checkForRWPaths() => Promise<DetectionResult>Detects world writable system paths (Android only).
Returns: Promise<DetectionResult>
checkForDangerousProps() => Promise<DetectionResult>Detects dangerous system properties (Android only).
Returns: Promise<DetectionResult>
checkForRootNative() => Promise<DetectionResult>Executes RootBeer native checks (Android only).
Returns: Promise<DetectionResult>
detectRootCloakingApps() => Promise<DetectionResult>Detects applications that can hide root (Android only).
Returns: Promise<DetectionResult>
isSelinuxFlagInEnabled() => Promise<DetectionResult>Checks the SELinux enforcement state (Android only).
Returns: Promise<DetectionResult>
isExistBuildTags() => Promise<DetectionResult>Detects test build tags on the OS image (Android only).
Returns: Promise<DetectionResult>
doesSuperuserApkExist() => Promise<DetectionResult>Detects if superuser APKs are installed (Android only).
Returns: Promise<DetectionResult>
isExistSUPath() => Promise<DetectionResult>Checks for known su binary locations (Android only).
Returns: Promise<DetectionResult>
checkDirPermissions() => Promise<DetectionResult>Detects writable directories that should be protected (Android only).
Returns: Promise<DetectionResult>
checkExecutingCommands() => Promise<DetectionResult>Executes which su style commands to detect root (Android only).
Returns: Promise<DetectionResult>
checkInstalledPackages() => Promise<DetectionResult>Detects suspicious installed packages (Android only).
Returns: Promise<DetectionResult>
checkforOverTheAirCertificates() => Promise<DetectionResult>Detects tampered OTA certificates (Android only).
Returns: Promise<DetectionResult>
isRunningOnEmulator() => Promise<DetectionResult>Detects common emulator fingerprints (Android only).
Returns: Promise<DetectionResult>
simpleCheckEmulator() => Promise<DetectionResult>Performs a lightweight emulator check (Android only).
Returns: Promise<DetectionResult>
simpleCheckSDKBF86() => Promise<DetectionResult>Detects x86 emulator fingerprints (Android only).
Returns: Promise<DetectionResult>
simpleCheckQRREFPH() => Promise<DetectionResult>Detects QC reference phone builds (Android only).
Returns: Promise<DetectionResult>
simpleCheckBuild() => Promise<DetectionResult>Detects build host anomalies (Android only).
Returns: Promise<DetectionResult>
checkGenymotion() => Promise<DetectionResult>Detects Genymotion emulator fingerprints (Android only).
Returns: Promise<DetectionResult>
checkGeneric() => Promise<DetectionResult>Detects generic emulator fingerprints (Android only).
Returns: Promise<DetectionResult>
checkGoogleSDK() => Promise<DetectionResult>Detects Google SDK emulator fingerprints (Android only).
Returns: Promise<DetectionResult>
togetDeviceInfo() => Promise<DeviceInfo>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.
Returns: Promise<DeviceInfo>
Since: 1.0.0
isRootedWithEmulator() => Promise<DetectionResult>Extends the default detection with emulator heuristics (Android only).
Returns: Promise<DetectionResult>
isRootedWithBusyBoxWithEmulator() => Promise<DetectionResult>Extends the BusyBox detection with emulator heuristics (Android only).
Returns: Promise<DetectionResult>
getPluginVersion() => Promise<{ version: string; }>Get the native Capacitor plugin version.
Returns: Promise<{ version: string; }>
Since: 1.0.0
Result returned by root/jailbreak detection methods.
| Prop | Type | Description | Since |
|---|---|---|---|
result |
boolean |
true when the associated heuristic detects root/jailbreak artifacts. false when no root/jailbreak indicators are found. |
1.0.0 |
Device information collected during detection.
This plugin was inspired by the work in https://github.com/WuglyakBolgoink/cordova-plugin-iroot
