您的位置:首页 > 运维架构 > Shell

ShellUtil使用实例之重启管理器

2016-03-25 23:41 751 查看

ShellUtil的使用实例之重启管理器

基本原理还是ShellUtil的使用,详情请看上篇文章

Android WIFI密码查看器实例(在获取Root权限下查看系统文件)

本文主要介绍使用Shell调用关机,重启,快速重启,刷机模式,引导模式的方法,直接看代码吧

首先看一下App的实例(因为功能特殊,不方便演示了,只有主界面



关机

public void ShutDown(View view) {
ShellUtils.execCommand("reboot -p", true);
}


重启

public void Reboot(View view) {
ShellUtils.execCommand("reboot", true);
}


快速重启

public void FastReboot(View view) {
ShellUtils.execCommand("busybox killall system_server", true);
}


进入刷机模式

public void Recovery(View view) {
ShellUtils.execCommand("reboot recovery", true);
}


进入引导模式

public void FastBoot(View view) {
ShellUtils.execCommand("reboot bootloader", true);
}


Apk下载地址

源码已开源到Github,试着上架商店,已申请,不知道能不能上…
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  android shell 实例 管理