国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

檢測安卓手機是否已經Root

2019-11-09 17:38:13
字體:
來源:轉載
供稿:網友

檢測安卓手機是否已經Root

/** * 反編譯支付寶SDK得到的判斷root的方法,并增加了對‘/su/bin/’目錄的判斷 * Created by cyb on 2016/12/15 0015. */public class SystemInfo { public static boolean isRooted(){ // nexus 5x "/su/bin/" String[] paths = { "/system/xbin/", "/system/bin/", "/system/sbin/", "/sbin/", "/vendor/bin/", "/su/bin/" }; try{ for(int i = 0; i < paths.length; i++){ String path = paths[i] + "su"; if(new File(path).exists()){ String execResult = exec(new String[] { "ls", "-l", path }); Log.d("cyb", "isRooted=" + execResult); if(TextUtils.isEmpty(execResult) || execResult.indexOf("root") == execResult.lastIndexOf("root")){ return false; } return true; } } }catch (Exception e){ e.PRintStackTrace(); } return false; } private static String exec(String[] exec){ String ret = ""; ProcessBuilder processBuilder = new ProcessBuilder(exec); try { Process process = processBuilder.start(); BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(process.getInputStream())); String line; while( (line = bufferedReader.readLine()) != null){ ret += line; } process.getInputStream().close(); process.destroy(); } catch (Exception e) { e.printStackTrace(); } return ret; }}
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 司法| 伊春市| 白沙| 嘉义县| 涪陵区| 长海县| 岳阳市| 宜州市| 中江县| 阳东县| 遂宁市| 五家渠市| 玉田县| 崇信县| 株洲县| 永年县| 太康县| SHOW| 新田县| 台东县| 突泉县| 怀化市| 武安市| 大兴区| 德昌县| 水城县| 随州市| 隆回县| 瑞昌市| 阜平县| 盘锦市| 唐海县| 莲花县| 潮安县| 永昌县| 甘孜县| 台中县| 水富县| 连州市| 冀州市| 桃江县|