TeamWin / android_device_xiaomi_raphael

TWRP Source for Xiaomi Mi 9T Pro/ Redmi K20 Pro raphael
14 stars 12 forks source link

TWRP cannot decrypt files after flashing ROM #1

Open Redsandro opened 3 years ago

Redsandro commented 3 years ago

Device codename: raphael (Xiaomi Mi 9T Pro) TWRP version: twrp-3.5.0_9-0-raphael.img

After flashing xiaomi.eu_multi_HMK20ProMI9TPro_21.2.24_v12-11.zip I can no longer decrypt my data, so I can no longer restore my backup.

WHAT STEPS WILL REPRODUCE THE PROBLEM?

  1. Have MIUI 12.0 Android 10
  2. Fastboot to TWRP 3.5.0_9-0-raphael
  3. Create backup
  4. Flash MIUI 12.5 Android 11 (I think, not entirely sure what's in the aforementioned file)
  5. Fastboot to TWRP 3.5.0_9-0-raphael

WHAT IS THE EXPECTED RESULT?

TWRP starts and ask for decryption pattern

WHAT HAPPENS INSTEAD?

No decryption password is asked. Manually entering adb shell twrp decrypt '******' (docs) results in error message.

Attempting to decrypt data partition or user data via command line.
Failed to decrypt data.

ADDITIONAL INFORMATION

I cannot boot into ROM. I can only hold volume_down + home to get into fastboot.

Redsandro commented 3 years ago

@bigbiff This might not be TWRP related. Since I dirty flashed Android 11 over Android 10 and can now only boot into TWRP, is there any file from the old ROM I can manually push to restore decryption and restore the backup?

bigbiff commented 3 years ago

Encryption for A11 is a WIP. They have updated keymaster protocol and TWRP needs to be adjusted as necessary. The reason I moved this from the TWRP project is there may need to be blob updates required for encryption on this device.

Redsandro commented 3 years ago

Thank you @bigbiff.

The internal data is untouched still encrypted using A10. Are there any A10 files from old ROM I can manually push so TWRP can read the A10-based encryption for internal storage again?

bigbiff commented 3 years ago

I am not aware since I don't have this device.

GiGaFotress commented 3 years ago

use fastboot hotboot same version twrp can decrypt , every time need do it again fastboot boot recovery.img

But I didn't use twrp backup,I use Xiaomi's own backup

https://wiki.orangefox.tech/en/guides/encryption

poor english

Redsandro commented 3 years ago

@GiGaFotress you mean extract recovery.img from the previous ROM.tar.gz? How can I boot into TWRP then?

fastboot boot recovery.img
fastboot boot twrp.img
GiGaFotress commented 3 years ago

no,like this do not need rom file fastboot boot twrp-3.5.0_9-0-raphael.img

Redsandro commented 3 years ago

Thank you.

I tried the twrp version that used to work like that, but it did not work anymore after I flashed the new ROM.

From your informative link I read something else:

You flashed a firmware zip, either directly, or via flashing a MIUI ROM, and the firmware version is incompatible with your device's current encryption (solution = format your data partition and/or flash a firmware zip that is compatible with your encryption)

I should look for a firmware-only zip and flash that using TWRP if it allows me to flash firmware while data is encrypted.