Use this plugin to check if the android device running the app is rooted.
cordova plugin add cordova-plugin-root-detection
or
cordova plugin add https://github.com/trykovyura/cordova-plugin-root-detection.git
rootdetection.isDeviceRooted(successCallback, errorCallback);
successCallback
is called with true if the device is rooted, otherwise falseerrorCallback
is called if there was an error determining if the device is rootedvar successCallback = function (result) {
var isDevicesRooted = result == 1;
};
var errorCallback = function (error) {
console.error(error);
};
rootdetection.isDeviceRooted(successCallback, errorCallback);
Android only.
MIT License