本文介绍了通过系统应用程序以编程方式静默安装 apk(无需 root)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有 android:sharedUserId="android.uid.system" (UID: 1000) 的系统级应用.
I have system-level app with android:sharedUserId="android.uid.system" (UID: 1000).
设备没有root!INSTALL_PACKAGES 权限包含在清单中.
Device is not rooted! INSTALL_PACKAGES permission is included to Manifest.
我可以静默安装下载的 *.apk 吗?
Can I install downloaded *.apk silently?
推荐答案
我发现了问题.
- 添加了
android.permission.INSTALL_PACKAGES
"权限. - 我使用
signapk.jar
"和我从设备制造商处获得的证书签署了我的应用程序. - 现在这个应用程序可以使用没有su"的
pm install/.../app.apk
"安装其他应用程序.
- Added "
android.permission.INSTALL_PACKAGES
" permission. - I signed my application using "
signapk.jar
" with certificate that I`ve got from manufacturer of my device. - And now this app can install others using "
pm install /.../app.apk
" without "su".
有效!
附言仅使用pm install"更新应用程序不会用新的应用程序替换现有应用程序,而是返回 exit_value = 0.因此更新有两种方法:
P.S. Updating application using just "pm install" doesn`t replace existing application with new one, but returns exit_value = 0. So to update there are two ways:
- 使用
pm install -r/.../app.apk
"; - 首先使用
pm uninstall com.mydomain.myapp
"删除应用程序(您需要android.permission.DELETE_PACKAGES
"权限),然后安装新的应用程序.立>
- use "
pm install -r /.../app.apk
"; - firstly delete app using "
pm uninstall com.mydomain.myapp
" (you need "android.permission.DELETE_PACKAGES
" permission) and then install new one.
这篇关于通过系统应用程序以编程方式静默安装 apk(无需 root)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!