提交 3a21fc30 编写于 作者: M Mengjie Cai 提交者: GitHub

Merge pull request #64 from jp1017/patch-3

see 10/19 log
......@@ -23,6 +23,23 @@ public class DeviceUtils {
private DeviceUtils() {
throw new UnsupportedOperationException("u can't instantiate me...");
}
/**
* 判断设备是否 root
* @return the boolean
*/
public static boolean isDeviceRooted() {
String su = "su";
String[] locations = {"/sbin/", "/system/bin/", "/system/xbin/", "/system/sd/xbin/", "/system/bin/failsafe/",
"/data/local/xbin/", "/data/local/bin/", "/data/local/"};
for (String location: locations) {
if (new File(location + su).exists()) {
return true;
}
}
return false;
}
/**
* 判断设备是否root
......@@ -119,4 +136,4 @@ public class DeviceUtils {
}
return model;
}
}
\ No newline at end of file
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册