Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

cordova-plugin-iroot-v2

joebalan-git54MIT3.2.1TypeScript support: included

Jailbreak/Root Detection Plugin for Apache Cordova with Proxy Detection for iOS

ecosystem:cordova, cordova-android, cordova-ios, cordova, jailbreak, jailbroken, cydia, detection, detector, root, rooted, rootBeer, android, ios, iroot, plugin

readme

version Android iOS License BuyMeCoffee

Jailbreak/Root Detection Plugin for Apache Cordova

Use this plugin to add an extra layer of security for your app by detecting if the device was rooted (on android) or jailbreaked (on iOS).

Install

cordova plugin add cordova-plugin-iroot

Upgrade

cordova plugin rm cordova-plugin-iroot
cordova plugin add cordova-plugin-iroot
cordova prepare

postInstall

iOS

To avoid errors like

-canOpenURL: failed for URL: "cydia://package/com.example.package" - error: "This app is not allowed to query for scheme cydia"

don’t forget to add "cydia" in LSApplicationQueriesSchemes key of info.plist. Otherwise canOpenURL will always return false.

<xxx>
  <key>LSApplicationQueriesSchemes</key>
  <array>
      <string>cydia</string>
  </array>
</xxx>

Usage in Javascript

// available => iOS + Android
IRoot.isRooted(successCallback, failureCallback);

// available => Android
IRoot.isRootedWithBusyBox(successCallback, failureCallback);
  • successCallback(result:boolean) is called with true if the device is Jailbroken/rooted, otherwise false.
  • failureCallback(error:string) is called if there was an error determining if the device is Jailbroken/rooted.

Info

Based on:

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

ToDo's

  1. Cyanogenmod.superuser

    If the Cyanogenmod ROM is installed, the cyanogenmod.superuser activity may be in the com.android.settings package. This can be detected by listing the activities within com.android.settings.

  2. Su

    Execute su and then id to check if the current user has a uid of 0 or if it contains (root). shell@android:/ $ su shell@android:/ # id uid=0(root) gid=0(root) groups=1003(graphics),1004(input),1007(log),1009(mount),1011(adb),1015(sdcard_rw),1028(sdcard_r)

  3. Busybox

    If a device has been rooted, more often then not Busybox has been installed as well. Busybox is a binary that provides many common linux commands. Running Busybox is a good indication that a device has been rooted. root@android:/ # busybox df Filesystem 1K-blocks Used Available Use% Mounted on tmpfs 958500 32 958468 0% /dev tmpfs 958500 0 958500 0% /mnt/secure tmpfs 958500 0 958500 0% /mnt/asec tmpfs 958500 0 958500 0% /mnt/obb

  4. Check library
  5. Frida detect
  6. Magestic detect

changelog

Jailbreak/Root Detection Plugin for Apache Cordova

Version History

3.1.0

3.0.0

  • bump rootbeer from 0.0.8 to 0.0.9

BREAKING CHANGES:

  • support "cordova" version ">=10.0.0"
  • support "cordova-android" version ">=9.0.0"
  • support "cordova-ios" version ">=6.0.0"

v2.1.0

v2.0.0

BREAKING CHANGES:

  • remove nodeJS stuff
  • remove cordova hooks
  • remove ENABLE_BUSYBOX_CHECK plugin preference
  • remove isRootedRedBeerWithoutBusyBoxCheck function
  • add new internal checks
    • add simple emulator check
    • add simple magisk check (full implementation will be finished soon in rootbeer library)
  • update documentation / Typings
  • update gradle configuration
  • bump rootbeer from 0.0.7 to 0.0.8

v0.7.0-0.8.0

  • Add new optional install variable ENABLE_BUSYBOX_CHECK
  • Fixed Android Check: IRoot.isRooted()
  • Add additional iOS checks. Merged PR#8
  • Updated Types (index.d.ts)

BREAKING CHANGES

  • Add/rename new Android Check: IRoot.isRootedRedBeer()
  • Add/rename new Android Check: IRoot.isRootedRedBeerWithoutBusyBox()

Updates/Upgrades

  • bump rootbeer from 0.0.6 to 0.0.7

v0.6.0

Bug Fixes

  • add `iroot.d.ts'
  • small fix in www/iroot.js

v0.5.0

Updates/Upgrades

  • bump rootbeer from 0.0.4 to 0.0.6