0

How can I prevent uninstalling selected applications by mistake? can I add a user application to device administrator for example?

0

No, you cannot add any app as a device administrator unless it has provisions for it. What you can do is convert those apps as system apps. The process requires root access. Follow:

You can alternatively, albeit with root access, disable the component com.android.packageinstaller.UninstallerActivity. (Elixir 2 can do that easily.) That component shows the the dialog to uninstall the app. If you prevent the appearance of that you won't be able to uninstall the app through GUI.

In absence of root access, consider disabling the Package Installer app. It is a system app which handles installation (sideloaded apps) and uninstallation of apps through GUI. It can be disabled from Settings → Apps → (three-dots line → Show System) or (All Apps) → Package Installer → Disable.

One side effect of disabling Package Installer completely or its aforesaid component is that you won't be able to uninstall any app through Settings app either (Play Store is exception). Re-enable Package Installer to uninstall any app from Settings app again.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.