is Root - Android android.os

Android examples for android.os:Environment

Description

is Root

Demo Code

import java.io.File;

public class Main {

  public static boolean isRoot() {
    boolean flag = false;

    try {//from   w  ww.j a  va 2s . c o m
      if ((!new File("/system/bin/su").exists())
          && (!new File("/system/xbin/su").exists())) {
        flag = false;
      } else {
        flag = true;
      }
    } catch (Exception e) {

    }
    return flag;
  }

}

Related Tutorials