怎麼查安卓是否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許可權管理之類的