How can i keep user previous data intact for system app if android:sharedUserId is changed?

111 views Asked by At

I have a custom rom where i included an application as system app that has no android:sharedUserId declared in manifest. Recently i added some new features for which i need to use android:sharedUserId. As a result while applying update it results in failure. Because of being system app it can not be uninstalled. I also try to install over adb and it results in INSTALL_FAILED_SHARED_USER_INCOMPATIBLE. So as a work around i planned to place the update as a patch of firmware update(OTA). This time it can install the updated version which has android:sharedUserId declared in manifest. But the problem is system deletes all the data of previous version and treat the update as a fresh installation.

So my questions are as follows:

  1. Is it possible to preserve previous app data?
  2. Is there any tweeks that can apply to firmware source code so that it doesn't deleted previous data?
  3. Is there any way i can backup those data and restore it after firmware update complete?

Note: Here data includes shared preference, sqlite data, other files like image/audio/txt etc.

0

There are 0 answers