使用busybox在后台安装apk [英] install apk in background using busybox

查看:44
本文介绍了使用busybox在后台安装apk的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以在有root权限的设备上使用busybox在后台安装apk吗???

can i install apk in background using busybox on rooted device ???

我看到类似的东西,但它不起作用

i see something like that but it doesn't work

process install;
CommandCapture command = new CommandCapture(0, "chmod 777 /data/app");
RootTools.getShell(true).add(command).waitForFinish(); 
CommandCapture command2 = new CommandCapture(0, "chmod 777 /system/xbin/busybox");
RootTools.getShell(true).add(command2).waitForFinish();
install = Runtime.getRuntime().exec("/system/xbin/busybox install " + Environment.getExternalStorageDirectory() + "/Download/" + "xxx.apk /data/app/xxx.apk");

推荐答案

如果你在 root shell 中运行 su -c pm install myapp.apk,你应该可以在后台安装(注意'pm') 部分.这与busybox无关,你可以使用任何shell,当然不需要更改/data/app的权限.

If you run su -c pm install myapp.apk in a root shell, you should be able install in the background (note the 'pm') part. This has nothing to do with busybox, you can use any shell and you certainly don't need to change permission of /data/app.

这篇关于使用busybox在后台安装apk的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆