How to remove App installed trusted CA cert on uninstalling the App

天大地大妈咪最大 提交于 2019-11-30 06:11:47
Alireza Rahimi

you cant get the broadcast of package getting uninstalled for your own package. this may lead to inconsistency in the system. see this answer

Lookout Mobile has blogged about this due to the DigiNotar events, and provided some pretty good (read: lengthy) instructions which you can find here.

The gist of it is that you need to pull /system/etc/security/cacerts.bks and then remove the CAs from the store, then push the store back to the device and reboot. Their instructions require that you have Bouncy Castle (for decrypting the store), root access, and a working adb connection. I'm not sure if this applies to all versions of Android or not, but my guess would be that the location of the CA store hasn't changed in quite some time (if ever).

As far as i know there is only a broadcast that tells that uninstall has completed ACTION_PACKAGE_REMOVED.

After uninstalling the app MyCertApp the event ACTION_PACKAGE_REMOVED is broadcasted. The code that handles ACTION_PACKAGE_REMOVED in MyCertApp is alredy gone at that time.

You can do the post-processing only with a second independant app that is still there and that can unistall itself after receiving that MyCertApp is gone.

The other hypotetical solution may be that your app has a menu-item "uninstall MyCertApp". I donot know if it is possible for an app to uninstall itselt

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