If I uninstall apps/services on an unrooted Android device via the ADB shell (e.g. by doing pm uninstall
), where is this information stored?
Note that I'm not referring to settings within individual apps, but to their installation state.
I've read that uninstalling apps without root privileges will only remove those apps from normal user space through modifications to a configuration file (/data/system/packages.xml
), but the app files physically remain on the device to allow reinstallation. If this is true, is packages.xml
encrypted (being located in the encrypted /data
folder) or can its contents be modified even without root access?
Motivation: Access to /data
seems to require root privileges. If you soft-brick an unrooted Android device by accidentally uninstalling critical system apps (and hence modifying packages.xml
) resulting in a boot loop, is there any practical way of restoring packages.xml
to its stock configuration? Examples may include Samsung Knox or TEEGRIS services.
UPDATE: To clarify, the goal is not to wipe the device as suggested in the comments (this can be done any time from the recovery mode menu), but to find out whether or not the boot loop is caused by a persistent misconfiguration of a file residing in a secured area (persistent meaning that it cannot be reset by flashing e.g. the HOME_CSC
firmware file without wiping the entire device and losing all data). Also, the device is not rooted.
NOTE: There is an interesting comment below the answer to Can system apps be enabled/disabled directly from the filesystem? :
"It is also safe to simply remove the package-restrictions.xml file — a new 'clean' file will be recreated on next reboot." – ccpizza Oct 3, 2021 at 16:43
As far as I understand, Android 9.0 switched from Full-Disk Encryption (FDE) to File-Based Encryption (FBE), which means that encryption is done on a file-by-file basis by default.
Is it possible to delete package-restrictions.xml
(instead of modifying its content in order to restore individual app settings) from an unrooted device?