Silent install apk programmatically by system app (without root)

自古美人都是妖i 提交于 2019-11-27 17:06:58

I`ve found the issue.

  1. Added "android.permission.INSTALL_PACKAGES" permission.
  2. I signed my application using "signapk.jar" with certificate that I`ve got from manufacturer of my device.
  3. And now this app can install others using "pm install /.../app.apk" without "su".

It works!

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:

  • 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.

No, you cannot. Simply having the same UID isn't enough. You must also be signed with the same key as the ROM itself.

Silently installing apps, or updates to your own app, isn't allowed for security reasons.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!