android RootTooles 分享
发布日期:2021-06-29 15:24:36 浏览次数:2 分类:技术文章

本文共 1261 字,大约阅读时间需要 4 分钟。

RootTools 共享的root代码lib.jar 分析
下载地址:
使用jar-lib-java.exe 打开jar文件,可以看到java源码
RootTools 类里面接口:

Set<String> getPath() 获取系统环境变量PATH值
ArrayList<Mount> getMounts() 获取所有挂载点
offerBusyBox(Activity activity) 应用市场搜索busybox
Intent offerBusyBox(Activity activity, int requestCode) 带返回值
offerSuperUser 搜索SuperUser应用
rootAvailable 判断是否有su,可执行root操作
busyboxAvailable 判断是否存在busybox
accessGiven 判断是否允许了应用root权限
EnoughSpaceOnSdCard(long updateSize) 是否有足够的空间
remount(String file, String mountType) 重新挂载某文件
installBinary(Context context, int sourceId, String destName, String mode) 安装文件,路径还需要查询确认
sendShell(String[] commands, int sleepTime, Result result)执行命令,返回结果
sendShell(String[] commands, int sleepTime) 不需要结果
sendShell(String command, Result result) 命令之间不需要sleep
sendShell(String command) 直接执行
getSpace(String path)获取路径使用空间

Remounter 类:
remount(String file, String mountType) 重新挂载
findMountPointRecursive先查找挂载点
Mount类:
拼出参数列表
InternalMethods类:
InternalMethods instance() 获取实例
doExec(String[] commands) 执行命令
returnPath 返回系统路径PATH值
getMounts 获取所有挂载点
Installer 
installBinary(int sourceId, String destName, String mode)
将资源sourceId 复制到context.getFilesDir().getCanonicalPath(); 下的destname,改变mode为mode
Executer类:
sendShell(String[] commands, int sleepTime, IResult result) 执行命令,返回执行结果

转载地址:https://codegg.blog.csdn.net/article/details/50058017 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:分享自己的一些android util 源文件
下一篇:java中文数字转换成阿拉伯数字

发表评论

最新留言

逛到本站,mark一下
[***.202.152.39]2024年04月30日 12时59分08秒