怎么查安卓是否root
1. Android怎么判断当前应用是否有root权限
【Android】Android 代码判断是否获取ROOT权限
方法比较简单,直接粘贴代悔差码
public 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();
}
}
}
2. 怎么看出手机是否ROOT
分析如下:
如果手机已经root了,手机基本上会显示一些信息来证明手机已经获取了root权限,反之就是没有。
方式一:
授权管理软件的安装,这个如果不是自己本人的安装或者仅仅是刷入rom就有的话,那这个图标也可以代表手机已经获取了root权限。这个软件会根据不同的ROOT工具有所区别,大致名字都是supersu权限管理之类的