In Linux, you can read data a device encrypted e.g. with LUKS by doing cryptsetup luksOpen
and mounting the volume. What is the equivalent for this in Android, i.e. what specification for encryption is used and what is the syntax to decrypt a device, e.g. my /data
partition? I suppose that Android uses my lock screen PIN as the encryption key, correct?
Reason I ask: While attempting to debloat my Samsung A40FN with stock Android 9.0 Pie, I seem to have accidentally uninstalled some app required for Android to boot properly, resulting in a boot loop/soft brick (I can still enter recovery and download mode). As I've learned, uninstalling apps by pm uninstall
does not actually delete the apps from the device, but just removes them from my (unrooted) user space by modifying entries in /data/system/packages.xml
- which is by default encrypted by Android one a lock screen PIN is set up.
In order to rescue my data, it was suggested to flash the device (i.e. reinstall all packages) using the HOME_CSC
firmware file instead of CSC
, which supposedly keeps the data partition from getting wiped. However, this seems futile as the apps responsible for this mess will remain disabled as long as I don't reset /data/system/packages.xml
. And to do that, I need to decrypt the data partition first.
Rooting the device does not seem to be an option as this supposedly wipes the data partition by design (is this true?). But isn't there a much simpler way to do something analogous to cryptsetup luksOpen
and just copy my data?
Some information:
FRP lock: Off
OEM lock: On (L)
Bootloader level: U3