[RECOVERY][3.4.0-10][cepheus]Official/Unofficial TWRP for Xiaomi Mi 9 (Stable)

Search This thread

j3l11234

New member
Oct 10, 2010
2
2
Try latest stable orange fox recovery

On Android 11 (or MIUI 12.5, or whatever) my file names are all gibberish​


  • Android 11 decryption is supported with respect to custom ROMs.
  • However, there are issues with MIUI ROMs based on Android 11, and with ROMs that use the new keymaster 4.1. With such ROMs, decryption may not work at all in recovery mode - but in some cases, decryption may work if you "hotboot" the recovery image (eg, "fastboot boot recovery.img").
  • This is not an OrangeFox problem, so do not ask us to "fix" the problem.
 

RedWave31

Senior Member
May 9, 2007
684
285
Samsung Galaxy S21 Ultra
Hello,

A small "up" about the previous message.
My USB-C Port was burnt and the whole daughter card is new.
I found myself with an unlocked, registered Mi 9, a standard recovery and a 10.EEA MIUI 12.0 ROM.

I had previously made and got a full backup of a 3.4.0.10 recovery with a Xiaomi.eu 12.5 / 21.3.3, which I'm currently restoring, that might have been patched somewhere using the weekly bootfix.zip

I'm having real trouble with MIUI 12.6 and ROM 21.4.7 sticking aside the recovery.

ANOTHER WARNING : Phone self-wiped, self-locked to bootloader (no key combination possible), removed all recoveries this afternoon after the Google Messages App failed
.

A device warning after a new Fastboot saveup shows that Xiaomi was the one that did remotely wipe my phone. I'm in a really, really bad mood about that, Xiaomi. Be careful about system apps from now on.

TLDR : Step-by-Step Solution on a wiped phone restaured to factory settings.


I'm also having troubleshooting the problem with two recoveries:
- twrp-3.4.0_10-cepheus-mauronofrio (useless, old?)
- twrp-3.5.2_9-0-cepheus

AND troubleshooting a possible VBMETA problem with two files:
- TWRP_Stable_to_Weekly_BootFix_v1.0 (useless, old)
- OF_avb_patcher_mauronofrio.zip (new in OP)

Your Problems look like this?
- Boot into 3.5.2 Recovery NOT using the fastboot boot twrp.img method (as usual)
- Flash ROM 21.4.7
- Flash OF_avb_patcher
- Reflash 3.5.2_9 into recovery slot

!! /data/media doesn't erase when I try a full wipe, that's my only clue as of now.

Should I use the Fastboot boot twrp3.5.2.img method (or the fastboot twrp3.4.0_10)
- Then flash....

Sorry for needing some help here, I'm usually up to date on those changes but those last two got me LOST.

EDIT 1:
- Using XiaomiToolV2 in "brick mode" gets me back to step 1. I believe it's under my eyes with the vbmeta, just fatigue !

EDIT 2 : Solution on an unlocked "empty/new" machine
1.Fasboot boot twrp352
2.(Recovery) Flash vbmeta
3.(Recovery) Return Bootloader
4. Fastboot flash Recovery twrp 352
5. Reboot Recovery
6. (Recovery) Flash 12.6 4.8 Rom + vbmetapatcher (ok)
7. Return Bootloader
8. Fastboot flash Recovery twrp 352
9. (Recovery) Flash vbmeta (((or adb sideload vbmeta_patcher_2.zip)
10. Reboot system

WORKS!
- Magisk under test
- (Recovery) Flashed Magisk22.zip
- (Recovery) Flashed TWRP352
- (Recovery) Flashed vbmeta
- (Recovery) Reboot System

Decryption works !

EDIT 2
Something is wrong again, decryption doesn't work.
- Wiped whole phone COMPLETELY
- Used the TWRP 3.5.2 + vbmeta extensively
- Installed MIUI 12.6 210407 (unavailable as of now)
- Disconnected from MIUI Cloud!
- Installed Magisk 22.1

HINTS:
- That awfuuuuul boot audio is in /system/media/bootaudio.mp3 >>> DELEEEEETE
Thanks !
 
Last edited:

njin33r

New member
Jul 4, 2019
2
0
hi- my phone doesn't boot after I restored from a backup. The backup contained system, vendor images and data, boot partitions. The phone gets stock on the phone is starting... screen. After looking at a boot logcat, it looks like the cause is that it fails decrypting:

Code:
06-25 21:03:43.257   602   602 D vold    : fscrypt_unlock_user_key 0 serial=0 token_present=0
06-25 21:03:43.259   602   602 D vold    : Skipping non-key .
06-25 21:03:43.259   602   602 D vold    : Skipping non-key ..
06-25 21:03:43.259   602   602 D vold    : Trying user CE key /data/misc/vold/user_keys/ce/0/current
06-25 21:03:43.264   577   577 I hwservicemanager: getTransport: Cannot find entry [email protected]::IKeymasterDevice/default in either framework or device manifest.
06-25 21:03:43.264   602   602 I vold    : List of Keymaster HALs found:
06-25 21:03:43.264   602   602 I vold    : Keymaster HAL #1: Keymaster HAL: 4 from QTI SecurityLevel: TRUSTED_ENVIRONMENT HAL: [email protected]::IKeymasterDevice/default
06-25 21:03:43.264   602   602 I vold    : Using Keymaster HAL: 4 from QTI for encryption.  Security level: TRUSTED_ENVIRONMENT, HAL: [email protected]::IKeymasterDevice/default
06-25 21:03:43.264   602   602 E vold    : Failed to read from /data/misc/vold/user_keys/ce/0/current/keymaster_key_blob: No such file or directory
06-25 21:03:43.264   602   602 E vold    : Failed to find working ce key for user 0
06-25 21:03:43.264   602   602 E vold    : Couldn't read key for 0
What's weird though is that when I boot into recovery twrp has no problem at all decrypting the data. And also I don't understand why that keymaster_key_blob it didn't find wouldn't be in the backup... What are the circumstances under which this can happen?
 

gnegne

Senior Member
Hi,

after trial and error lots of ideas the following worked for me backing up the encrypted data partition.
I am currently using MIUI V12.5.1.0 RFAEUXM
  1. downloaded latest TWRM from twrp-3.6.0_9-0-cepheus.img (older versions referenced in the first post may also work)
  2. started twrp without installing it with fastboot -> "fastboot boot twrp-3.6.0_9-0-cepheus.img" from the windows command line
  3. after TWRP started the PIN was requested to decrypt data partition, after that inbuild file manager showed directories of data partition properly
  4. backup of data partition succeeded (did not try out restore yet ;-) )
best,

Ypo

I had some 255 error messages at the beginning caused by a second profile I used in MIUI. Watch out for "user / profile 10" entries / folders in the log. These folders were not deleted properly when deleting the second profile in MIUI, so I deleted them manually using the TWRP inbuild file manager. Addtionally I had to delete the folder '/data/extm'.
 
  • Like
Reactions: g_seva

PieroAnt

Senior Member
Jul 8, 2017
323
115
Messina
I would like some advice on how to backup and restore from twrp with Android 11. From what I understand by reading on the net, you need to backup only the DATA and EFS folders. To restore you must first reinstall the rom and after starting the system startup procedure, restart in recovery and restore the aforementioned folders.
Can anyone confirm if this method works?

I had previously tried to make a full backup but the restore procedure got stuck and I had to reinstall all over again.
 

Meneldur

Senior Member
Feb 16, 2011
740
181
OnePlus 5
Xiaomi Mi 9
Hi, after putting the latest version of twrp for cepheus twrp-3.6.1_9-0, it just goes back to the bootloader.
anyone else with this error?
I had that problem but I solved it with TWRP official instructions.
After flashing recovery using fastboot, right after rebooting you must enter recovery again using the vol-up button. This way, TWRP can patch boot image and stay alive.
 

Meneldur

Senior Member
Feb 16, 2011
740
181
OnePlus 5
Xiaomi Mi 9
I would like some advice on how to backup and restore from twrp with Android 11. From what I understand by reading on the net, you need to backup only the DATA and EFS folders. To restore you must first reinstall the rom and after starting the system startup procedure, restart in recovery and restore the aforementioned folders.
Can anyone confirm if this method works?

I had previously tried to make a full backup but the restore procedure got stuck and I had to reinstall all over again.
I know it's annoying and time consuming but in my experience it's always better to start fresh and clean when installing new ROMs.
 

Top Liked Posts