- public static boolean isRooted() {
- File f = null;
- boolean isRooted = false;
- final String kSuSearchPaths[] = { "/system/bin/", "/system/xbin/",
- "/system/sbin/", "/sbin/", "/vendor/bin/" };
- try {
- for (int i = 0; i < kSuSearchPaths.length; i++) {
- f = new File(kSuSearchPaths<i> + "su");
- if (f != null && f.exists()) {
- sLogger.d(">>> rooted file -- " + f.getPath());
- isRooted = true;
- break;
- }
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- return isRooted;
- }
复制代码 |
|