Ottenere il privilegio di root


/ Published in: Java
Save to your folder(s)

Ottenere il privilegio di root


Copy this code and paste it in your HTML
  1.  
  2. try {
  3. p = Runtime.getRuntime().exec("su");
  4.  
  5. DataOutputStream os = new DataOutputStream(p.getOutputStream());
  6. os.writeBytes("echo \"Do I have root?\" >/system/sd/temporary.txt\n");
  7. os.writeBytes("exit\n");
  8. os.flush();
  9.  
  10. try {
  11. p.waitFor();
  12. if(p.exitValue() != 255)
  13. toastMessage("root");
  14. else
  15. toastMessage("not root");
  16. } catch(InterruptedException e) {
  17. toastMessage("not root");
  18. }
  19. } catch(IOException e) {
  20. toastMessage("not root");
  21. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.