<span style="white-space:pre"> </span>/**
* 判断设备是否Root
*
* @return
*/
public static boolean checkRoot() {
try {
Process process = Runtime.getRuntime().exec(
"/system/bin/ls -l /system/bin/su /system/xbin/su");
BufferedReader reader = new BufferedReader(new InputStreamReader(
process.getInputStream()));
String line = reader.readLine();
reader.close();
process.destroy();
return (line != null && line.length() > 9)
&& (line.charAt(9) == 'x' || line.charAt(9) == 't');
} catch (Exception e) {
return false;
}
android check root
最新推荐文章于 2024-12-30 17:23:42 发布