//关机代码
try {
Process p=Runtime.getRuntime().exec("su");
DataOutputStream out=new DataOutputStream(p.getOutputStream());
Runtime.getRuntime().exec("reboot -p");
out.flush();
p.waitFor();
} catch (Exception e) {}
//重启代码
try {
Process p=Runtime.getRuntime().exec("su");
DataOutputStream out=new DataOutputStream(p.getOutputStream());
Runtime.getRuntime().exec("reboot");
out.flush();
p.waitFor();
} catch (Exception e) {}
//重启Recovery
try {
Process p=Runtime.getRuntime().exec("su");
DataOutputStream out=new DataOutputStream(p.getOutputStream());
Runtime.getRuntime().exec("reboot recovery");
out.flush();
p.waitFor();
} catch (Exception e) {}
//重启Bootloader
try {
Process p=Runtime.getRuntime().exec("su");
DataOutputStream out=new DataOutputStream(p.getOutputStream());
Runtime.getRuntime().exec("reboot bootloader");
out.flush();
p.waitFor();
} catch (Exception e) {}
版权声明:本文为博主原创文章,转载请附上原文出处链接和本声明。
本文链接:https://www.aidemx.cn/?p=157
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
喜欢就支持以下吧
请登录后发表评论
注册
社交帐号登录