2

i have some methods for root detection.

final boolean t1 = canExecuteCommand("/system/bin/which su");
final boolean t2 = canExecuteCommand("which su");

private static boolean canExecuteCommand(String command)
{
    boolean executedSuccesfully;
    try {
      Runtime.getRuntime().exec(command);
      executedSuccesfully = true;
    } catch (Exception e) {
      executedSuccesfully = false;
    }

    return executedSuccesfully;
}

Everything works fine until Android 6. From that version A6 return TRUE on t1 and t2. My device is not rooted. I updated device from A5 to A6 using system update.

Why is return true from A6? Thanks.

Mnio
  • 93
  • 1
  • 8
  • There are 4-5 methods available to detect root. Check once [here](http://stackoverflow.com/questions/1101380/determine-if-running-on-a-rooted-device) – Madhukar Hebbar Apr 14 '16 at 10:35
  • I have implemented all of them. But only these 2 tests not work from A6 (Lenovo A7000). – Mnio Apr 14 '16 at 10:44

0 Answers0