Advertisement
motafoca

root

Aug 24th, 2011
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. public static boolean runChmod777(String myfile) {
  2. Process process = null;
  3. try {
  4. process = Runtime.getRuntime().exec("su -c chmod 0777 myfile");
  5. process.waitFor();
  6. } catch (Exception e) {
  7. Log.d("*** DEBUG ***", "Unexpected error - Here is what I know: "+e.getMessage());
  8. return false;
  9. }
  10. finally {
  11. try {
  12. process.destroy();
  13. } catch (Exception e) {
  14. // nothing
  15. }
  16. }
  17. return true;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement