Quote:
Originally Posted by Meltus
Try this, i can confirm it works fine
Code:
try {
Process process = Runtime.getRuntime().exec("su");
DataOutputStream os = new DataOutputStream(process.getOutputStream());
{
os.writeBytes("reboot\n");
os.flush();
process.waitFor();
}
} catch (IOException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
}
|
It works on some, doesn't work on others. Seems to be something with how the phone is rooted, or how permissions are set, not exactly sure. Either way, just because it works for you doesn't mean it will work for everyone, however the code up there is probably a very good example for an implementation.
Some apps like ROM Manager have their reboot written using the NDK, so that may be a reason why they can reboot whereas other apps which try to reboot fail.
Samsung Galaxy i7500 (CM7) -> HTC Desire (CM7) -> Samsung Galaxy S (CM9) -> Samsung Galaxy S3 (CM10.1) -> Sony Xperia ZL (stock/rooted)
Asus Transformer TF101 (CM9) -> Galaxy Tab 7.7 WiFi (stock/rooted) -> Galaxy Tab 7.7 3G (PA) + Toshiba AT201 (stock)
Font Changer - change your default system font (now works on MIUI too)
Clipboard Contents - extend your clipboard's functionality
VM Heap Tool - change the size of the heap for your device
|