静默安装APK通过编程系统的应用程序(不带根)不带、应用程序、系统、APK

2023-09-12 07:03:01 作者:最美不过初见

我的系统级应用程序与Android:sharedUserId =android.uid.system(UID:1000)。

I have system-level app with android:sharedUserId="android.uid.system" (UID: 1000).

设备的根源并非是! INSTALL_PACKAGES许可包含的体现。

Device is not rooted! INSTALL_PACKAGES permission is included to Manifest.

我可以安装下载的* .apk文件默默地?

Can I install downloaded *.apk silently?

推荐答案

I`ve发现的问题。

I`ve found the issue.

新增 android.permission.INSTALL_PACKAGES 的权限。 在我公司签订使用 signapk.jar 与I`ve从我的设备制造商获得证书我的应用程序。 在现在这个应用程序可以安装其他使用时安装/.../ 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".

它的工作原理!

P.S。 更新应用程序只用分装不`吨取代现有的应用程序与新的,但回报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:

使用时安装-r /.../ app.apk 先删除使用应用程序时卸载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.