From my understanding these partitions contain the encrypted user data (apps, files, you name it), and some “metadata” needed for the decryption once the OS starts. Coming from the PC/Linux world i’m used to being able to to this to a disk or partition, encrypted or not, and then do the reverse to put everything back as it was. I can’t neccessarily decrypt the img.gz images, but “putting them back as they were” should in theory work. That is, if things in android work like they do in linux which to my experience they all too ofted do not
Writing this here not as a solution for now, but a question if anyone knows if this will work? I know the disk image will potentially be huge (almost as large as the complete storage device), but by using gzip the image hopefully should be compressed by quite a bit since I don’t have a lot of data on it.
EDIT: I am so incredibly mad at myself right now. I was about to reflash and test if my userdata could be restored (dd-ing to a gzip file worked like a charm). But as I was cleaning up some stuff on my PC, I realized I had put the files in the wrong folder, which I realized the exact moment I hit delete in my file manager (which no, doesn’t put it in a recycle bin)… Sooooo frustrating, but luckily there wasn’t more than a couple of days worth of setup on it so far.
Yes, I was afraid that might happen, but the image only ended up being about 10-12 GB if I remember correctly. But this was on a fairly new phone, so my guess would be that although the drive was encrypted, most of the blocks on the device had not been written to yet, an so still contained 0s. Might do a retest of this in the near or far-ish future though.
Yes and no, I ran it from a Recovery with adb enabled, where I think you are root by default (?)
Anyways, it’s important to run it from recovery, when the partitions you are copying (userdata, metadata) are unmounted, or else the OS might write to the partition while you copy from it, making your copy unusable for anything. Not sure if that was a good explanation, but you should really take a look into the dd command and partition backups before doing this at all.