Decrypt Android 10 File Based Encryption (FBE) data - Android Q&A, Help & Troubleshooting

Device: Xiaomi Mi 9
ROM: [ROM][10.0][Xiaomi Mi 9][UNOFFICIAL]Pixel Experience [AOSP[2020/04/11], ROM for the Xiaomi Mi 9
Hi,
I tried to upgrade my ROM from an older to a newer version with a clean install whilst keeping the Internal storage of my Mi9.
The Device has been encrypted with FBE protected with a pattern.
While performing the upgrade TWRP did sucessfully decrypt the data.
Now after performing the update the phone was only able to boot into TWRP (3.3.1-62) and wasn't able to decrypt /data/media/0
I also tried do decrypt via adb shell with
Code:
twrp decrypt 563258
following the TWRP commandline guide
Code:
[123] [⭘↓←]
[456] [⭘↦↑]
[789] [⭘⭳⭘]
but this also failed.
Only way to make the phone boot again was to format data partition in TWRP.
Unfortunately I did not save my backups on a different device, so to say all my backups and data is on the encrypted drive, which I can't access anymore.
Before wiping I saved an image of /dev/block/sda31 which is the data partition I'd like to recover.
I am also able to access the keys or data at following locations:
Code:
/data/misc/vold/keystore/
/data/misc/vold/user_keys/ce
/data/misc/vold/user_keys/de
/data/unencrypted/key
/data/system_de/0/spblob
So my question now is how to regain access to my data.
So far I tried several approaches, none of these lead to success.
My hope is that there is a possibility to mount the image, using the available encryption keys. But that's at this point beyond my technical skills, so maybe here is someone with another idea how to do this.

Related

[Q] ICS - Encryption

Hello guys.
I know there's no way to make CWM work with encrypted memory and SD and also there's no way to decrypt.
So, any other encryption solution that allows backups?
Using android's encryption feature, what to do in case of problems?
Any way to recover?
What happens if the system bricks and a recovery is needed?
What happens flashing a non disruptive update? Is a wipe needed?
Thank you so much!
Flashing to an encrypted ICS gs2/i9100
ultradj83 said:
Hello guys.
I know there's no way to make CWM work with encrypted memory and SD and also there's no way to decrypt.
So, any other encryption solution that allows backups?
Using android's encryption feature, what to do in case of problems?
Any way to recover?
What happens if the system bricks and a recovery is needed?
What happens flashing a non disruptive update? Is a wipe needed?
Thank you so much!
Click to expand...
Click to collapse
There are two options I've found that will work for flashing encrypted ICS, one is TWRP, which you would use instead of CWM, which would allow you to enter your password & flash what ever ROM you wanted like you were working with an unencrypted phone. But it's not (yet?) available for gs2/i9100.
The other option (original post here ) outlines how to do this from the command line of a computer with the Android SDK installed. I've spelled it out to include Android SDK installation since I didn't have that installed already when I had to do this.
Download, Install & configure Android SDK
Run SDK Manager
install "Android SDK Platform-tools"
Add <whatever>/android-sdk/platform-tools/ to path
in a command prompt / terminal window type "abd" to Check that your path includes the correct folders in the SDK (I had to do this manually on Win7)
On Phone
Reboot phone into Recovery mode
in CWM format cache partition
from your PC use adb to mount /sdcard as tmpfs:
Code:
adb shell mount -t tmpfs none /sdcard
put your ROM on the (fake) sdcard
Code:
adb push <your rom> /sdcard
Use the recovery to flesh the ROM as usual
Once you reboot the device will ask for you password as normal then finish the app installation/configuration after reboot. I was able to do this upgrading from CM9.0.0 RC1 to CM9.1. All data was preserved. Phone seems to be behaving itself but I only did this an hour ago so still too soon to tell.
Props to orcruin for sharing this. :highfive:
Ed

[Q] (mini)vold support for TWRP

Hi,
I have a picassowifi and the TWRP build doesn't have encryption support (the decrypt data button doesn't appear).
As such, I'm forced to use CWM and use 'vdc cryptfs checkpw' to access the /data partition.
However, I've grown fond of TWRP and I'd like to be able to decrypt the /data partition under it.
I've tried to unpack the TWRP image, decompress the ramdisk (initrd) and copied across /sbin/minivold from the CWM correspondent. I've also updated init.rc but minivold refuses to start (no errors of any kind).
Would someone be able to point me to the right direction in getting (mini)vold running under TWRP?
Thank you.

S3 I9300 CM13 TWRP 3.0.2-0 not able to decrypt and mount data partition

Samsung S3 intl. 9300 running CM.13.0-20160429-NIGHTLY-i9300
Recovery: TWRP 3.0.2-0
Due to corporate regulations, phone needs to be encrypted. This was only possible via ADB command line:
cd system/bin
su
vdc cryptfs enablecrypto wipe pin <pin>
Phone works ok, but I am not able to apply new builds, as TWRP is not able to decrypt it. It asks for PIN but then is not able to mount /data partition.
Any suggestions how to fix it? I am not clear if this is a bug in TWRP or CM and if any other RECOVERY like CWM could handle encryption properly.
There have been some ideas about changing partition size also to make GUI encryption work again, but this did not work for me. I also found somwhere a source code change for this but finally I am not a developer and not too deep into how encryption works on this device.
I also wonder if there is a command line to disable encryption just for the update as work around. Apreciate your valuable comments!

Huawei Mate 10 Lite - partition backup (no root, no unlocked bootloader)

Hi,
has someone experience with making backup of user data partition? (dd, adb pull mmcblk0 or something else.. read-only mode) I need backup whole disk (include empty space). I need to do some deleted data recovery, therefore i can't use normal data backup.
Bootloader is not unlocked, phone is not rooted I need "not destructive" root, because traditional unlocking wipe all user data ...) I have access to settings (USB debugging etc ...).
In past there exists on some phones temp-root (exploit) and with ADB was possible create raw image.
I find out there is also temp-unlock https://www.youtube.com/watch?v=7L1v7KtSg78 (ttool pro utility)
Maybe this is the solution way? (in next step install TWRP and then make backup)

TWRP restore from adb shell command line?

I have tried to install Lineage but so far I have not had any luck. I was able to get the install to work after modifying a file to remove the "assert" lines, but once the install is completed, I am stuck in a boot loop and am no longer able to use TWRP from the phone as the touchscreen isn't working after booting into recovery.
It seems that it is possible to restore a backup in TWRP from the command line, but the twrp command line guide isn't real helpful for me.
restore PARTITION-TO-RESTORE BACKUP-NAME :
restore PARTITION-TO-RESTORE from existant BACKUP-NAME:
PARTITION-TO-RESTORE, multiples selection allowed:
S: system,
D: data,
C: cache,
R: recovery,
B: boot,
A: and-sec,
E: sd-ext,
M: skip md5 check.
BACKUP-NAME: could be full path or name of twrp backup in current twrp backup folder.
Backup can't be encrypted.
So I am guessing that I have to mount the microsd first and then provide the path to the backup in the format that TWRP requires to restore that backup. Anyone have any input on how this could be done?
Since the touch doesn't work in TWRP, it's likely that the ROM.zip wasn't good for this model either.
Read old archives that better explain the use of commands in twrp.
OpenRecoveryScript - RootzWiki
web.archive.org
OpenRecoveryScript | TeamWin
OpenRecoveryScript
web.archive.org
ze7zez said:
Since the touch doesn't work in TWRP, it's likely that the ROM.zip wasn't good for this model either.
Read old archives that better explain the use of commands in twrp.
OpenRecoveryScript - RootzWiki
web.archive.org
OpenRecoveryScript | TeamWin
OpenRecoveryScript
web.archive.org
Click to expand...
Click to collapse
Thanks for the reply. I just found another way to get TWRP working by attempting to use Huanwei's multi download software and even though it ultimately failed, I was still able to use TWRP from the phone again. Unfortunately even though the phone is supposed to be a supported model, I still can't use anything bu the stock firmware as trying to install other ROM's just results in Error 7. I just recently purchased it, but I think there is something different about it so I can't install any other ROMS.
It would be a lot less guessing if there was an example like in the older documentation...
restore /sdcard/TWRP/BACKUPS/*serialno*/myrom (Would restore all partitions found in "myrom")
restore /sdcard/TWRP/BACKUPS/*serialno*/myrom DM (Would restore only the data partition in "myrom" and skip MD5 checking)
so I could have done resotre /sdcard/TWRP/BACKUPS/*/*
with no extra switches.

Categories

Resources