karandpr / cordova-plugin-android-rootbeer

A wrapper plugin for rootbeer library. This library is used to detect root on Android Devices.
Apache License 2.0
7 stars 7 forks source link

Cordova RootBeer

This is a simple wrapper plugin for RootBeer library by @scottyab for android. You can access 13 functions of the library.

Link to Scott's library .

Installation

Cordova:

cordova plugin add cordova-plugin-android-rootbeer

Ionic:

ionic cordova plugin add cordova-plugin-android-rootbeer

Functions

Syntax

window.cdvRootBeer.isRooted(successCallback, errorCallback);

Success Callbacks

The responses on successCallbacks are either true or false. NB, these are string values not boolean values. e.g.

window.cdvRootBeer.isRooted(function(res){
// res will be true for rooted device.
// res will be false for non-rooted device.
}, errorCallback)
Methods True False
checkForBusyBoxBinary true false
checkForSuBinary true false
checkSuExists true false
checkForRWPaths true false
checkForDangerousProps true false
checkForRootNative true false
detectRootCloakingApps true false
detectRootManagementApps true false
detectPotentiallyDangerousApps true false
detectTestKeys true false
isSelinuxFlagInEnabled true false
isRooted true false
isRootedWithoutBusyBoxCheck true false

Method Description


checkForBusyBoxBinary: This essentially checks for busybox binary in known locations like /bin , /xbin & /sbin.


checkForSuBinary : Checks for su binary in known locations.


checkSuExists : Checks for native root in a different manner.


checkForRWPaths : Checks if paths are writable . Especially important if you have /system is rw.


checkForDangerousProps: Checks for dangerous props in build. Custom ROMs include some props which enable ease of rooting. Especially ro.debuggable.


checkForRootNative : Yet another root check. Checks for root natively, which is harder against root cloaks.


detectRootCloakingApps : Detects Root cloaking apps like rootcloak, & hide my root .Also Xposed and Substrate which are frameworks which help in cloaking.


detectRootManagementApps: Detects Root management Apps like SuperSU, Superuser (noshufou),Superuser (koush)


detectPotentiallyDangerousApps : Detect apps like Lucky Patcher ,ROM Manager & App Quarantine. The list is quite limited though.


detectTestKeys : Detects if ROM build has test-keys


isSelinuxFlagInEnabled : Checks if SE Linux is Enforcing. Thats it.


isRooted: IsRooted is amalgamation of the methods above.

isRootedWithoutBusyBoxCheck : Same as above , just without busybox check. Some phone manufacturers bundle busybox with their firmware.

Issues

Post the issues related to this library here . Do provide the device details as below.