馬上加入Android 台灣中文網,立即免費下載應用遊戲。
您需要 登錄 才可以下載或查看,沒有帳號?註冊
x
- public static boolean runRootCommand(String command) {
- Process process = null;
- DataOutputStream os = null;
- try {
- process = Runtime.getRuntime().exec("su");
- os = new DataOutputStream(process.getOutputStream());
- os.writeBytes(command+"\n");
- os.writeBytes("exit\n");
- os.flush();
- process.waitFor();
- } catch (Exception e) {
- Log.d(TAG, "the device is not rooted, error message: " + e.getMessage());
- return false;
- } finally {
- try {
- if (os != null) {
- os.close();
- }
- if(process != null) {
- process.destroy();
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- return true;
- }
複製代碼 這是轉載的不知道圖片也能不能一起轉載
如果不清楚可至轉載網站查詢
轉載於:http://www.eoeandroid.com/forum.php?mod=viewthread&tid=65892
|
評分
-
查看全部評分
|