欢迎访问悦橙教程(wld5.com),关注java教程。悦橙教程  java问答|  每日更新
页面导航 : > > 文章正文

获取root权限,root权限,Process p; t

来源: javaer 分享于  点击 30420 次 点评:141

获取root权限,root权限,Process p; t


Process p; try {     p = Runtime.getRuntime().exec("su");     DataOutputStream os = new DataOutputStream(p.getOutputStream());     os.writeBytes("echo \"Do I have root?\" >/system/sd/temporary.txt\n");    os.writeBytes("exit\n");     os.flush();     try {        p.waitFor();         if(p.exitValue() != 255)            toastMessage("root");        else            toastMessage("not root");        } catch(InterruptedException e) {         toastMessage("not root");     } } catch(IOException e) {     toastMessage("not root"); }
相关栏目:

用户点评