I'm implementing a demo on silently uninstall an app from device.
In adb shell, I can use pm uninstall packagename to do the task, but when I wrote code, I got some permission denied error.
I've been googling for a while, and found that to get DELETE_PACKAGES permission, I have to sign my app with the same certificate as the system does.
So, can anyone give me some tips on how to do this? Or, is there anyway I can do to make my app running as system service?
You can't do this, unless you are building your own firmware (ROM). If you are, just take the key that signs the ROM and sign your apk with it. If you have a rooted phone, you can also copy the apk in /system/app
to get the permission.
Far better than a silent uninstall is somehow bricking the app. There's a few ways that this could be done, but basically keep track of the first day they used it, and make the program not work. Alternatively, it could be set up to work until a certain day, after which it will no longer work. This question answers how to do this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With