[CLOSED] Decrypting Xiaomi Mi10T Pro Internal Storage

Status
Not open for further replies.
Search This thread

Leonniar

Senior Member
Sep 23, 2021
83
4
Hello guys,
I run into a problem recently were my device won't boot. I tried a plethora of different solutions but nothing worked, I will have to factory reset to fix the issue.
My problem right now is that I can't access my files to make a backup. On my computer the device is connected and recognized but I can't access it's files. I also have TWRP and in TWRP Recovery it's unable to mount the Internal Storage and it shows up as 0MB. After a lot of research what seems to be the problem is that my files are encrypted, I don't know why this is (I guess for protection) but I didn't have any problems before. To my understanding if the phone is booted up you can access the files but if it can't boot then they stay encrypted. The encryption key should still be in my phone since I haven't formated it.
So how can I decrypt my data so that I can backup my files ? there must be a way for cases like this when something happens and the device can't boot, since the key is in the device it's self and I have the phone I should be able to, I also have access to every single account (google, xiaomi etc.) that is associated with this smartphone. If for security reasons that is not possible, would an authorized repair center be able to do it with proof of purchase and ownership ?
I am not 100% sure of my os version but it was 12.5.x.x, I have the unofficial twrp 3.5.0_10-beta. USB Debugging is enabled. Any other information you might need I can provide!

Thanks a lot everyone !
 
Solution
Code:
I:Unable to decrypt metadata encryption
E:Unexpected value for crypto key location
E:Error getting crypt footer and key
Code:
I:operation_start: 'Repair Partition'
Repairing Data using fsck.f2fs...
I:Repair command: /system/bin/fsck.f2fs /dev/block/sda34
        Info: No support kernel version!
Info: Segments per section = 1
Info: Sections per zone = 1
Info: sector size = 4096
Info: total sectors = 28051451 (109575 MB)
        Invalid SB CRC offset: 1205917355
        Can't find a valid F2FS superblock at 0x0
        Invalid SB CRC offset: 876348585
        Can't find a valid F2FS superblock at 0x1
/system/bin/fsck.f2fs /dev/block/sda34 process ended with ERROR: 255
Unable to repair Data.
you have formatted userdata...

Leonniar

Senior Member
Sep 23, 2021
83
4
Just finished, keeps showing xiaomi logo and rebooting. No fastboot no recovery no miui logo.

I noticed it removed the custom recovery, trying to boot into recovery works
 

Leonniar

Senior Member
Sep 23, 2021
83
4
I did the flash_all_except_storage.bat. When I first run it I think it failed, I got up to get some water and didn't see it but cmd closed and I think it's not supposed to do that, also it did not reboot on it's own. Then I remembered we added a line to the batch file:
Code:
setlocal enabledelayedexpansion
so I removed that and watched the whole process no errors whatsoever, after it was done device rebooted ny it's self and got me here

Safemode won't boot either

Tried running flash_all and it failed again, couldn't see where but definitely after flashing metadata
 
Last edited:

alecxs

Forum Moderator
Staff member
Feb 17, 2016
3,667
5
1,532
gitlab.com
still on USB 2.0 port? after metadata only cust exaid boot recovery is missing, and sec is erased. so flash these partitions manually. you can have a look into the batch file.

for TWRP don't forget to disable avb/dm-verity
Code:
fastboot flash --disable-verity --disable-verification vbmeta images\vbmeta.img
 
Last edited:

Leonniar

Senior Member
Sep 23, 2021
83
4
Yes still on the same, let me try.
The "disable avb/dm-verity" is for flashing TWRP right ? I mean I don't have to do it now right ?

Edit:
Nope, didn't work. Still restarting. I didn't erase sec because in the batch file it was commented out
 
Last edited:

Leonniar

Senior Member
Sep 23, 2021
83
4
You mean re-format data to f2fs ? I am guessing not, just do format data through TWRP since default recovery only has wipe option and already tried that and didn't work. I don't mind erasing data, I didn't put in anything anyway hahaha. I will make sure everything works, I'll root properly make sure that works as well and then I can use it again finally
 

Leonniar

Senior Member
Sep 23, 2021
83
4
I think you'd better go to an authorized repair center for help.
Thanks but i'd rather fix it my self, I actually really like messing with things and repairing them. PCs, Consoles, Phones. Anything I can mod I do hahaha. So by fixing it my self I also learn about how this things work and when I have sufficient knowledge I can help other people as well!
 

Leonniar

Senior Member
Sep 23, 2021
83
4
Flashed TWRP, Formatted data. TWRP console when formatting shows:
Code:
You may need to reboot recovery to be able to use /data again
Formatting metadata using mke2fs...
Done.
MTP: If MTP cannot be used, please reboot to your TWRP or ROM to create /data/media
If the /sdcard directory is empty, please manually select /data/media to view the file!
Updating partition details...
Failed to mount '/vendor' (Invalid argument)
Failed to mount '/odm' (Invalid argument)
...done

Also device still keeps restarting
 
Last edited:

alecxs

Forum Moderator
Staff member
Feb 17, 2016
3,667
5
1,532
gitlab.com
I recommend to not modify anything until device is fully working. if you flash_all.bat and format cache, userdata, metadata from fastboot, it is completely stock.
 

Leonniar

Senior Member
Sep 23, 2021
83
4
I can't re run flash_all batch file. I get "Missmatching image and device error" The rom is for this device so I commented the check out and then I got something like: "if 0 GTR 1 set anticheck="Current device antirollback version is greater than this pakcage"" and it exits again. But the device version is 100% not greater, can't be anyway. The version I am trying to flash is the latest RJDxxEUXM version, any other version has a different version name and the OEM updater could not find any update either (from when the device was working) so no update was automatically installed either
 

alecxs

Forum Moderator
Staff member
Feb 17, 2016
3,667
5
1,532
gitlab.com
cannot make any sense of the mount errors vendor + odm except you have upgraded to Android 12 and forgot to mention - in that case you need other TWRP. there are only unofficial builds so far.

TWRP 3.5.0 whyle
https://forum.xda-developers.com/t/...or-mi-10t-mi-10t-pro-redmi-k30s-ultra.4187427

TWRP 3.5.2 master
https://forum.xda-developers.com/t/...or-mi-10t-mi-10t-pro-redmi-k30s-ultra.4319809

TWRP 3.6.2 skkk
https://forum.xda-developers.com/t/4187427/post-87608077

TWRP 3.7.0 skkk
https://forum.xda-developers.com/t/recovery-twrp-3-7-0-unofficial-mi-10t-pro.4518491
 

Leonniar

Senior Member
Sep 23, 2021
83
4
This is the one I have flashed. I previously used TWRP 3.5.0 whyle version but that was when I originally rooted my device more than 16 months ago and I was 100% not running android 12 then. Should I go back to that version maybe?

I don't know how the device would have updated to android 12, I didn't flash any other rom and I don't think android can update on it's own. Is there a way to check ? If somehow I ended up with android 12 maybe I should flash the latest MIUI update for this phone that's on android 12 as well ?
 

alecxs

Forum Moderator
Staff member
Feb 17, 2016
3,667
5
1,532
gitlab.com
you can check current ROM from TWRP see #28

edit: on this thread there was a patched vbmeta.img at least. don't know why the --disable-verity and/or --disable-verification flags failed, but flashing vbmeta.img.empty probably does the same job.
 
Last edited:

Leonniar

Senior Member
Sep 23, 2021
83
4
Yep, still "RKQ1.200826.002/V12.5.4.0.RJDEUXM" as expected, the same as first time, the same one I keep/try flashing.

"ro.build.version.release=11", to my understanding that means android 11, so no android 12 either

Edit:
Could it be a problem with flash_all.bat failing so many times ? Because I've tried to run it like 10 times so far and it only run without errors once, and another time when it crashed after metadata.
 
Status
Not open for further replies.

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    TWRP will ask for lock screen credentials used for decrypting userdata partition. on FBE encryption the partition is mounted and even with no credentials provided one should at least see encrypted files.

    In your case it's bit more complicated as that device uses FBE + metadata encryption. while in TWRP provide recovery.log to see what is going on. (share link to pastebin.com with expiration date 1 month)
    Code:
    adb pull /tmp/recovery.log

    Note: there exist no relation between (FDE) encryptable= and (FBE) fileencryption= flags, these flags aren't interchangeable.
    https://github.com/mhmdeve/twrp_dev...-twrp/recovery/root/system/etc/twrp.fstab#L18
    1
    no clue what is the problem with that batch file..

    either comment out first two lines with notepad (prefix REM) or add these first line maybe?

    Code:
    @echo off
    setlocal enabledelayedexpansion
    REM fastboot %* getvar product 2>&1 | findstr /r /c:"^product: *apollo" || echo Missmatching image and device
    REM fastboot %* getvar product 2>&1 | findstr /r /c:"^product: *apollo" || exit /B 1

    btw: you can select terminal output with mouse, copy with Enter key, and paste the text in [CODE]tags[/CODE] here. screenshots are hard to read on mobile.
    1
    Yep, still "RKQ1.200826.002/V12.5.4.0.RJDEUXM" as expected, the same as first time, the same one I keep/try flashing.

    "ro.build.version.release=11", to my understanding that means android 11, so no android 12 either

    Edit:
    Could it be a problem with flash_all.bat failing so many times ? Because I've tried to run it like 10 times so far and it only run without errors once, and another time when it crashed after metadata.

    Just a tip: if you had bootloop and automatically entered fastboot, better boot into fastboot mode manually on your own again, either with the power button method or fastboot command method.

    Everytime after a flashing process, whether success or failed, and would need to flash something in fastboot, reboot to fastboot mode manually to avoid some unexpected processing remnants when automatically entering fastboot mode.

    Reboot PC and unplug USB cable then plug it back.
    Change an USB cable might also help.

    Also, if the ROM folder name is long, rename it short like "ROM". Sometimes there's issue without this renaming. Put it in as the location like: "F:\ROM\"
    This is probably the reason when you flash the fastboot ROM, but it finished in an instant. I see it was told.

    I don't have this phone, but it may help in some way.