Android 判断手机是否已经ROOT
来源:互联网 发布:教育机构域名注册 编辑:程序博客网 时间:2024/04/20 01:30
/**
* 判断手机是否已经ROOT
* @return 手机是否已经ROOT
* @throws IOException
* @throws InterruptedException
*/
public static boolean hasRooted() throws IOException, InterruptedException{
Process process = null;
DataOutputStream out = null;
try {
process = Runtime.getRuntime().exec("su");
out = new DataOutputStream(process.getOutputStream());
out.writeBytes("\n");
out.writeBytes("exit\n");
out.flush();
process.waitFor();
} catch (IOException e) {
// TODO Auto-generated catch block
Log.d("Test", "Unexpected error - Here is what I know: "+e.getMessage());
return false;
} finally {
try {
if (out != null)
out.close();
process.destroy();
} catch (Exception e) {
e.printStackTrace();
}
}
return true;
}
* 判断手机是否已经ROOT
* @return 手机是否已经ROOT
* @throws IOException
* @throws InterruptedException
*/
public static boolean hasRooted() throws IOException, InterruptedException{
Process process = null;
DataOutputStream out = null;
try {
process = Runtime.getRuntime().exec("su");
out = new DataOutputStream(process.getOutputStream());
out.writeBytes("\n");
out.writeBytes("exit\n");
out.flush();
process.waitFor();
} catch (IOException e) {
// TODO Auto-generated catch block
Log.d("Test", "Unexpected error - Here is what I know: "+e.getMessage());
return false;
} finally {
try {
if (out != null)
out.close();
process.destroy();
} catch (Exception e) {
e.printStackTrace();
}
}
return true;
}
- Android中判断手机是否已经Root
- Android中判断手机是否已经Root
- Android 判断手机是否已经ROOT
- 判断android设备(如手机)是否已经ROOT的方法
- android 判断手机是否Root
- android判断手机是否root
- android判断手机是否root
- Android 判断手机是否root
- 判断android手机是否root过。
- 判断手机是否root
- 检测安卓手机是否已经Root
- Android判断是否root
- Android判断是否root
- android 判断是否root
- 判断手机是否已经连网函数
- Android 判定手机是否root
- 判断手机是否ROOT 代码实现+ Android 操作系统 获取Root权限 原理解析
- 判断手机是否有root权限
- linux 搭建FTP服务器详细配置
- Spring-RowMapper
- 解决RemoteMediaPool并发的问题
- DebianLNMP一键安装包Debian6系统下的Nginx/PHP5.3/MySQL最快.最新.最省资源!
- 申请苹果开发者帐号流程
- Android 判断手机是否已经ROOT
- 关键字 mutable (c++)
- epoll服务器开发详解
- ubuntu12.10 gmake 命令找不到
- 深入浅出设计模式(一)
- select函数
- 编译后错误提示为pls-00103:出现符号""在需要下列之一时:begin case declare
- ubuntu SVN服务器的配置
- 输出为货币形式:$198,并将$198反向解析成整数198