国产探花免费观看_亚洲丰满少妇自慰呻吟_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; }}
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 临沭县| 子洲县| 尤溪县| 探索| 扎兰屯市| 龙岩市| 达拉特旗| 河西区| 建湖县| 喀喇沁旗| 邓州市| 灯塔市| 都匀市| 腾冲县| 邵阳县| 天台县| 兴安盟| 磴口县| 广宁县| 海晏县| 琼海市| 荔浦县| 松溪县| 西乡县| 沾益县| 屯留县| 桂阳县| 沂水县| 延寿县| 丰县| 凌云县| 南部县| 灵川县| 黄浦区| 麦盖提县| 石屏县| 宁强县| 辉县市| 枣阳市| 泌阳县| 阜南县|