public class RootDetection extends CordovaPlugin {
@Override public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
if (action.equals("isDeviceRooted")) {
try {
callbackContext.success(isDeviceRooted() ? 1 : 0);
return true;
} catch (Exception e) {
callbackContext.error("N/A");
return false;
}
}
return false;
}
}