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,试着上架商店,已申请,不知道能不能上…
相关文章推荐
- 使用C++实现JNI接口需要注意的事项
- Android IPC进程间通讯机制
- Android Manifest 用法
- [转载]Activity中ConfigChanges属性的用法
- Android之获取手机上的图片和视频缩略图thumbnails
- Android之使用Http协议实现文件上传功能
- Android学习笔记(二九):嵌入浏览器
- android string.xml文件中的整型和string型代替
- i-jetty环境搭配与编译
- android之定时器AlarmManager
- android wifi 无线调试
- Android Native 绘图方法
- Android java 与 javascript互访(相互调用)的方法例子
- android 代码实现控件之间的间距
- android FragmentPagerAdapter的“标准”配置
- Android"解决"onTouch和onClick的冲突问题
- android:installLocation简析
- android searchView的关闭事件