简体   繁体   中英

Prevent uninstall and factory reset android

I have tried to search for it but couldn't find a proper solution. So Posting question here to seek help.

Our essential requirement is that child cannot uninstall the app or cannot perform a factory reset on the device without admin permission. Basically similar to the Family Link app .

We are unsure how to make this possible and looking for an expert to help us out with this.

Use of Device Admin have been deprecated and Android provides very limited functionality starting from Android 10. Application management permissions are part of Device Owner and Profile Owner deployment models in Android. You need to set your app as Device Owner, use below API :

For blocking Application uninstallation: https://developer.android.com/reference/android/app/admin/DevicePolicyManager#setUninstallBlocked(android.content.ComponentName,%20java.lang.String,%20boolean)

To prevent Factory Reset : https://developer.android.com/reference/android/os/UserManager#DISALLOW_FACTORY_RESET

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM