1. Check path 1


public boolean c(a) {
        String[] strArr = {"/system/bin/"."/system/xbin/"."/system/sbin/"."/sbin/"."/vendor/bin/"};
        int i = 0;
        while (i < 5) {
            try {
                if (new File(strArr[i] + "su").exists()) {
                    return true;
                }
                i++;
            } catch (Exception e) {
            }
        }
        return false;
    }

 public String o(a) {
        return a("ro.kernel.qemu"."0");
    }
Copy the code

2. Check path 2


  public static boolean a(a) {
        String[] strArr = {"/system/xbin/"."/system/bin/"."/system/sbin/"."/sbin/"."/vendor/bin/"."/su/bin/"};
        try {
            int length = strArr.length;
            for (int i = 0; i < length; i++) {
                String str = strArr[i] + "su";
                if (new File(str).exists()) {
                    String a = a(new String[]{"ls"."-l", str});
                    f.b("cyb"."isRooted=" + a);
                    if (TextUtils.isEmpty(a) || a.indexOf("root") == a.lastIndexOf("root")) {
                        return false;
                    }
                    return true; }}}catch (Exception e) {
        }
        return false;
    }
Copy the code

3. Check attributes


public static boolean checkRootMethod1(a) {
        if (PatchProxy.isSupport(new Object[0], null, changeQuickRedirect, true.3217.new Class[0], Boolean.TYPE)) {
            return ((Boolean) PatchProxy.accessDispatch(new Object[0], null, changeQuickRedirect, true.3217.new Class[0], Boolean.TYPE)).booleanValue(a); } String str = Build.TAGS;returnstr ! = null && str.contains("test-keys");
    }
Copy the code

4. Check path 3


public static boolean checkRootMethod2(a) {
    if (PatchProxy.isSupport(new Object[0], null, changeQuickRedirect, true.3218.new Class[0], Boolean.TYPE)) {
        return ((Boolean) PatchProxy.accessDispatch(new Object[0], null, changeQuickRedirect, true.3218.new Class[0], Boolean.TYPE)).booleanValue(a); }try {
        if (new File("/system/bin/su").exists() | |new File("/system/xbin/su").exists()) {
            return true; }}catch (Exception e) {
    }
    return false;
}
Copy the code

5. Check the package name


public static boolean checkRootMethod3(a) {
    if (PatchProxy.isSupport(new Object[0], null, changeQuickRedirect, true.3219.new Class[0], Boolean.TYPE)) {
        return ((Boolean) PatchProxy.accessDispatch(new Object[0], null, changeQuickRedirect, true.3219.new Class[0], Boolean.TYPE)).booleanValue(a); }try {
        if (new File("/system/app/Superuser.apk").exists()) {
            return true; }}catch (Exception e) {
    }
    return false;
}
Copy the code