Stop uninstallation of application

后端 未结 3 741
慢半拍i
慢半拍i 2020-12-14 14:01

i create an app and install it on phone. now i want to add a feature that my app should not uninstall from the phone. so i think if one of the following issues could be solv

3条回答
  •  情书的邮戳
    2020-12-14 14:17

    Yes, this can be done.

    Create a new firmware image for a phone, include your app in the /system/app directory and, since this directory is read-only during runtime, the app cannot be uninstalled. i.e. it is pre-installed.

    Otherwise no, this cannot be done. However, with a non-system app, the system does notify other applications after your app has been uninstalled via a PACKAGE_REMOVED broadcast.

    So it's possible to determine that your app was uninstalled, but — without flashing the whole phone with a new firmware — there is no way to prevent your application from being uninstalled. Which is a good thing.

提交回复
热议问题