检测root环境代码

1.检测路径

1public boolean c() { 2 String[] strArr = {"/system/bin/", "/system/xbin/", "/system/sbin/", "/sbin/", "/vendor/bin/"}; 3 int i = 0; 4 while (i < 5) { 5 try { 6 if (new File(strArr[i] + "su").exists()) { 7 return true; 8 } 9 i++; 10 } catch (Exception e) { 11 } 12 } 13 return false; 14 } 15 16 public String o() { 17 return a("ro.kernel.qemu", "0"); 18 }

2.检测路径2

1 public static boolean a() { 2 String[] strArr = {"/system/xbin/", "/system/bin/", "/system/sbin/", "/sbin/", "/vendor/bin/", "/su/bin/"}; 3 try { 4 int length = strArr.length; 5 for (int i = 0; i < length; i++) { 6 String str = strArr[i] + "su"; 7 if (new File(str).exists()) { 8 String a = a(new String[]{"ls", "-l", str}); 9 f.b("cyb", "isRooted=" + a); 10 if (TextUtils.isEmpty(a) || a.indexOf("root") == a.lastIndexOf("root")) { 11 return false; 12 } 13 return true; 14 } 15 } 16 } catch (Exception e) { 17 } 18 return false; 19 }

3.检测属性

1public static boolean checkRootMethod1() { 2 if (PatchProxy.isSupport(new Object[0], null, changeQuickRedirect, true, 3217, new Class[0], Boolean.TYPE)) { 3 return ((Boolean) PatchProxy.accessDispatch(new Object[0], null, changeQuickRedirect, true, 3217, new Class[0], Boolean.TYPE)).booleanValue(); 4 } 5 String str = Build.TAGS; 6 return str != null && str.contains("test-keys"); 7 }

4. 检测路径3

1public static boolean checkRootMethod2() { 2 if (PatchProxy.isSupport(new Object[0], null, changeQuickRedirect, true, 3218, new Class[0], Boolean.TYPE)) { 3 return ((Boolean) PatchProxy.accessDispatch(new Object[0], null, changeQuickRedirect, true, 3218, new Class[0], Boolean.TYPE)).booleanValue(); 4 } 5 try { 6 if (new File("/system/bin/su").exists() || new File("/system/xbin/su").exists()) { 7 return true; 8 } 9 } catch (Exception e) { 10 } 11 return false; 12}

5.检测包名

1public static boolean checkRootMethod3() { 2 if (PatchProxy.isSupport(new Object[0], null, changeQuickRedirect, true, 3219, new Class[0], Boolean.TYPE)) { 3 return ((Boolean) PatchProxy.accessDispatch(new Object[0], null, changeQuickRedirect, true, 3219, new Class[0], Boolean.TYPE)).booleanValue(); 4 } 5 try { 6 if (new File("/system/app/Superuser.apk").exists()) { 7 return true; 8 } 9 } catch (Exception e) { 10 } 11 return false; 12}
点赞
收藏

评论区

加载中...

相关推荐

MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1

文章目录问题用navicat导入数据时,报错:原因这是因为当前的MySQL不支持datetime为0的情况。解决修改sql\mode:sql\mode:SQLMode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。全局s

Oracle 分组与拼接字符串同时使用

SELECTT.,ROWNUMIDFROM(SELECTT.EMPLID,T.NAME,T.BU,T.REALDEPART,T.FORMATDATE,SUM(T.S0)S0,MAX(UPDATETIME)CREATETIME,LISTAGG(TOCHAR(

MySQL部分从库上面因为大量的临时表tmp_table造成慢查询

背景描述Time:20190124T00:08:14.70572408:00User@Host:@Id:Schema:sentrymetaLast_errno:0Killed:0Query_time:0.315758Lock_

手写Java HashMap源码

HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程22

2020年前端实用代码段,为你的工作保驾护航

有空的时候,自己总结了几个代码段,在开发中也经常使用,谢谢。1、使用解构获取json数据let jsonData  id: 1,status: "OK",data: 'a', 'b';let  id, status, data: number   jsonData;console.log(id, status, number )

CentOS6.7 i686上安装JDK7

内核版本:root@heima01javaunameaLinuxheima012.6.32573.el6.i6861SMPThuJul2312:37:35UTC2015i686i686i386GNU/Linux发行版本:root@heima01java