Page 1 of 1

apps protection from uninstal

Posted: 31 Dec 2018 00:37
by Rafi4
hi Martin and all
is there any way to protect from uninstal most best apps which I am using. it means before I want to uninstal any application show warning message on screen and input Dialog with password.


confirmation dialog :
are you sure you want to uninstal this application.
if yes
Actoin : input Dialog with password. if false

action : go to home screen. if correct password is entered uninstal desired application. if password is wrong

action:lock device with action "set Lock pin/password".

Re: apps protection from uninstal

Posted: 31 Dec 2018 01:57
by anuraag
Use ui event as trigger.
Event type = window opened
Package name = com.google.android.packageinstaller
Contains text = Package installer

Edit: you would also have to protect play store as app can be uninstalled from there.

Re: apps protection from uninstal

Posted: 31 Dec 2018 14:19
by Desmanto
You can protect "Package Installer", use Trigger App Task Started. Playstore too. The flow will be triggered when you try to install/uninstall something. But unfortunately there is delay about 200-500 ms (depends on device), before the accessibility dispatch the event to Automagic. So if the perpetrator is fast enough to press OK, it still can be uninstalled. The better way to protect while having plausible deniability is to use a full screen transparent widget with action button. This will render the screen unpressable and user will be confused. They can press back, and you can coupled with app task ended to hide the widget again. So they simply know they can't uninstall the app, but don't know exactly what is blocking them. Plus point, using widget considered as overlay shown, the OK button at package installer usually will be greyed (can't be press). But they still can bypass it if they are fast enough.


Remember, any protection made is usually to protect from the common user. If the perpetrator is smart enough, there are more ways to uninstall the app. They can stop automagic first (you can protect automagic too). But they can force stop it from app info, so you have to protect it too again. They can plug USB cable and uninstall it from adb. Or they can simply boot it safe mode and uninstall the app from there. Once the device has been compromised physically, basically any security has fallen apart too. Password/pattern only makes it more difficult and takes more time. Must balance between security and convenience.