cordova-plugin-root-detection
Version:
Cordova Plugin for detecting if the device running the app is rooted.
43 lines (29 loc) • 853 B
Markdown
Use this plugin to check if the android device running the app is rooted.
```
cordova plugin add https://github.com/trykovyura/cordova-plugin-root-detection.git
```
```js
rootdetection.isDeviceRooted(successCallback, errorCallback);
```
- => `successCallback` is called with true if the device is rooted, otherwise false
- => `errorCallback` is called if there was an error determining if the device is rooted
- returns '1' if device is rooted else '0'
```js
var successCallback = function (result) {
var isDevicesRooted = result == 1;
};
var errorCallback = function (error) {
console.error(error);
};
rootdetection.isDeviceRooted(successCallback, errorCallback);
```
Android only.
MIT License