Android--手机root获取与判断应用是否获取
import android.util.Log; import java.io.DataOutputStream; import java.io.File; /** * 判断手机是否ROOT */ public class isRoot{ public static int root() { int root = 0; try { if ((!new File("/system/bin/su").exists()) && (!new File("/system/xbin/su").exists())) { root = 0; } else { root = 1; } } catch (Exception e) { } return root; } /** * * 判断应用是否有root权限 */ public static synchronized boolean getRootAhth() { Process process = null; DataOutputStream os = null; try { process = Runtime.getRuntime().exec("su"); os = new DataOutputStream(process.getOutputStream()); os.writeBytes("exit\n"); os.flush(); int exitValue = process.waitFor(); if (exitValue == 0) { return true; } else { return false; } } catch (Exception e) { Log.d("*** DEBUG ***", "Unexpected error - Here is what I know: " + e.getMessage()); return false; } finally { try { if (os != null) { os.close(); } process.destroy(); } catch (Exception e) { e.printStackTrace(); } } } }
低调大师中文资讯倾力打造互联网数据资讯、行业资源、电子商务、移动互联网、网络营销平台。
持续更新报道IT业界、互联网、市场资讯、驱动更新,是最及时权威的产业资讯及硬件资讯报道平台。
转载内容版权归作者及来源网站所有,本站原创内容转载请注明来源。
- 上一篇
C++泛型线性查找算法——find
C++泛型线性查找算法——find 《泛型编程和STL》笔记及思考。 线性查找可能是最为简单的一类查找算法了。他所作用的数据结构为一维线性的空间。这篇文章主要介绍使用 C++ 实现泛型算法 find的过程。 C 版本 首先介绍 C find 算法的实现,用以引入 C++ 版本。 char *find1(char *first,char *last,int c) { while(first != last && *first != c) ++first; return first; } 该版本的算法循环检查每个元素,尾后指针(last)作为结束标识。 使用举例如下: char A[N]; ... char *result = find1(A,A + N,c); if(result == A + N) printf("search failed\n"); else printf("found it"); C 实现的 find 算法实现很简单,但使用范围很局限,只能应用于字符数组中对指定字符的查找。 C++ 版本 由于 C 版本 find 的使用范围局限性,在 C++ 中,我...
- 下一篇
welcome to bugkuctf(详解)——Bugku
刚刚做了bugku的题目现在整理一下 写出解题思路希望能够帮助到那些需要帮助的人 所有的wp都是以一题一篇的形式写出 主要是为了能够让读者更好的阅读以及查找 希望你们不要责怪共勉 Challenge 388 Solves welcome to bugkuctf 100 http://120.24.86.145:8006/test1/作者pupil 解题思路这一题我一开始的时候使用的是hackbar并没有任何反应所以最后选择使用burp 那么解题思路就以burp来写了 首先使用burp进行抓包处理就好 可以看到源代码我大概的说一下其中的含义 1.三个传参 2.$user存在且不为空 3.读取$user文件内容为welcome to the bugkuctf 4.$file要求为hint.php将其导入 其实比较熟悉就知道两个点可以利用了php://input与php://filter 这里需要使用的是php://input 当传进去的参数作为文件名变量去打开文件时可以将参数php://传进 同时post方式传进去值作为文件内容供php代码执行时当做文件内容读取 我们再利用php...
相关文章
文章评论
共有0条评论来说两句吧...
文章二维码
点击排行
-
Docker使用Oracle官方镜像安装(12C,18C,19C)
- Springboot2将连接池hikari替换为druid,体验最强大的数据库连接池
- CentOS8编译安装MySQL8.0.19
- Docker快速安装Oracle11G,搭建oracle11g学习环境
- SpringBoot2配置默认Tomcat设置,开启更多高级功能
- MySQL8.0.19开启GTID主从同步CentOS8
- CentOS7,8上快速安装Gitea,搭建Git服务器
- Jdk安装(Linux,MacOS,Windows),包含三大操作系统的最全安装
- SpringBoot2编写第一个Controller,响应你的http请求并返回结果
推荐阅读
最新文章
- CentOS关闭SELinux安全模块
- Hadoop3单机部署,实现最简伪集群
- CentOS6,7,8上安装Nginx,支持https2.0的开启
- SpringBoot2全家桶,快速入门学习开发网站教程
- SpringBoot2更换Tomcat为Jetty,小型站点的福音
- Springboot2将连接池hikari替换为druid,体验最强大的数据库连接池
- CentOS8,CentOS7,CentOS6编译安装Redis5.0.7
- MySQL8.0.19开启GTID主从同步CentOS8
- Docker快速安装Oracle11G,搭建oracle11g学习环境
- SpringBoot2整合Redis,开启缓存,提高访问速度