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 twrp decrypt 563258 following the TWRP commandline guide

[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:


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.

  • you must roll-back to previous ROM because decryption depends on ROM version. consider backup important apps only with Migrate
    – alecxs
    Apr 24, 2020 at 13:39
  • At this moment I do have to assume, that there is no copy of this particular version available. There is one but its part of the encrypted data, kind of cynical... I asked on xda weather there is somebnody with a copy of that build / version but it does not seem like there will be fortune on that issue.
    – edipp
    Apr 26, 2020 at 3:17
  • to be more precise it depends on stock ROM (because of vendor + modem) where encryption differ between android 7,8,9,10. it looks like android 9 is right base for you, try different MIUI versions based on android 9
    – alecxs
    Apr 26, 2020 at 9:02
  • So far I'm very happy that there is someone helping with enthusiasm. I do think, that Android 10 should be the right base, and I tried flahsing different Stock ROMs of MIUI via Recovery but I'm still failing at the decryption. so maybe you've got another idea, or I'm doing sth wrong... miui_CEPHEUSGlobal_V11.0.4.0.QFAMIXM_5e4cc092fa_10.0 miui_CEPHEUSEEAGlobal_V11.0.5.0.QFAEUXM_b75c33b811_10.0 miui_CEPHEUSEEAGlobal_V11.0.6.0.QFAEUXM_1647340073_10.0 miui_CEPHEUSEEAGlobal_V11.0.7.0.QFAEUXM_c540795d64_10.0 miui_CEPHEUSEEAGlobal_V11.0.8.0.QFAEUXM_39255ef3ce_10.0
    – edipp
    May 8, 2020 at 19:09

1 Answer 1


If I'm not mistaken, each element in the grid is only used once, therefore your PIN should be 56328 because the last 5 isn't actually used.

  • good point thx!
    – alecxs
    Aug 28, 2021 at 23:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .