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

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

檢測安卓手機是否已經Root

2019-11-09 16:35:34
字體:
來源:轉載
供稿:網友

檢測安卓手機是否已經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; }}
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 家居| 辽阳县| 宁城县| 开封县| 柳林县| 自贡市| 钦州市| 秦皇岛市| 黄浦区| 韶山市| 泾源县| 丹东市| 连云港市| 林口县| 虹口区| 红桥区| 改则县| 三台县| 吉隆县| 临颍县| 股票| 八宿县| 北碚区| 井冈山市| 凉城县| 阿鲁科尔沁旗| 桂平市| 广汉市| 玉林市| 威远县| 巴南区| 清丰县| 长宁区| 阿鲁科尔沁旗| 友谊县| 繁峙县| 义乌市| 潜山县| 胶南市| 集贤县| 博湖县|