I want to check my device is rooted or not. When I try this code below in real device is not rooted, its ok. But Non rooted emulator break in this line
if (new File(path).exists())
return true;
"/system/xbin/su" path is exists.
private static boolean isRooted() {
String[] paths = { "/system/app/Superuser.apk", "/sbin/su", "/system/bin/su", "/system/xbin/su", "/data/local/xbin/su", "/data/local/bin/su", "/system/sd/xbin/su",
"/system/bin/failsafe/su", "/data/local/su", "/su/bin/su"};
for (String path : paths) {
if (new File(path).exists())
return true;
}
return false;
}
Genymotion or Android studio's emulator always break in code block.
Is all android emulators rooted?