yashsingh1/xdaforums huggingface dataset:
[Redmi Note 10 Pro] Frag1le:
Ok the update steps i did.

Magisk - uninstall restore images

Boot to TWRP with fastboot boot twrp.img (where decryption is working)

Backupped /data /recovery /super

Installed 12.0.13 EEAGlobal

Installed TWRP new img

Installed Magisk

Reboot to recovery (to check if TWRP sticked)

No decryption prompt, password fails

Rebooted to System

Update was succesfull to 12.0.13

Magisk/root working.

From system: adb reboot recovery -> no decryption prompt in TWRP, password fails

From system: power off, volume up+power -> no decryption prompt in TWRP, password fails.

Fastboot boot twrp.img -> decryption prompt in TWRP, decryption working

So nothing seems to have changed or i am doing something incorrect.
[Redmi Note 10 Pro] Nebrassy:
In that case, as I suspected, decryption does not work on stock except with fastboot boot, but it works fine with modded miui or custom roms
[Redmi Note 10 Pro] Frag1le:
Ok, thanks.

Atleast i have a workaround.

Is this something that could eventually work?

I've used many stock roms (e.g. OxygenOS) on other phones and this was never an issue.

Send me a BCH address in PM, i'll send you a couple of beers.
[Redmi Note 10 Pro] Nebrassy:
This is an issue for almost all xiaomi devices that were updated to Android 11, there is no known solution currently
[Redmi Note 10 Pro] mak626:
Ya sorry I forgot to mention , I use fastboot boot to get to recovery. Since we can't flash OTA through twrp it didn't serve any purpose to be there in stock ROM than to flash Magisk. So I kept stock recovery.
[Redmi Note 10 Pro] Frag1le:
Thanks for your work, check your wallet.
[Redmi Note 10 Pro] Kinley7272:
Is there a way to back up all files via TWRP. (Including data/media etc.?)
[Redmi Note 10 Pro] Nebrassy:
no, internal storage can't currently be backed up
[Redmi Note 10 Pro] Kinley7272:
Ok, thanks, do you know why?
[Redmi Note 10 Pro] Nebrassy:
Because that's not supported 🤷
[Redmi Note 10 Pro] chord314:
Is there any way to edit system file?
[Redmi Note 10 Pro] nkrishna:
Just flashed the new TWRP over Arrow OS recovery. Works fine. Has all functionalities I use.

Thank you devs for your support. Our phones won't be magnificent without you 😀
[Redmi Note 10 Pro] Damionix:
I am having the same issue with decrypting my Work profile and my Dual Apps profile. Neither works. This happens when I go and try to create a backup.
[Redmi Note 10 Pro] Nebrassy:
try setting a password for work profile that's different from the password of the main user
[Redmi Note 10 Pro] ph0t0gr4ph3r:
just updated with this newest version of twrp,

decryption works and everything essentially works flawlessly
[Redmi Note 10 Pro] mattlgm:
thank you so much! decryption now works for me when pin is set as well as when no pin/password is set
[Redmi Note 10 Pro] victorsrg:
Which partitions should I backup if I want to try out a new ROM but come back easily to where I am? Is it even possible yet? Thanks!
[Redmi Note 10 Pro] sujju:
After clean flashing a ROM, does any stuff like fcrypt disabler exist to keep the internal storage decrypted?
[Redmi Note 10 Pro] Nebrassy:
Only works on custom roms that ship vendor, so currently no, I've seen a modified vendor with encryption flags disabled somewhere though
[Redmi Note 10 Pro] Fane007:
Is the behaviour of proximity sensor on this custom rom better than on the stock rom?
[Redmi Note 10 Pro] ZainBilq:
This is recovery, not custom ROM. Check the post properly.
[Redmi Note 10 Pro] Damionix:
I would love to know this too. Ever since this whole A/B thing, I have never been able to backup and restore ROMs like it used to be. I so miss that.
[Redmi Note 10 Pro] titash.sharma@gmail.com:
Can we take persist image backup with this twrp? Please 🙏
[Redmi Note 10 Pro] Asia81:
nvm sorry, pls delete
[Redmi Note 10 Pro] PotatoSmasher:
Will there be an official release of twrp anytime soon with solved decryption issues and stability?

Or do i have to go with this one for now?
[Redmi Note 10 Pro] PotatoSmasher:
I think you'd have to do it with commands in terminal in twrp
[Redmi Note 10 Pro] arundnzrs01:
TWRP shows 0B internal storage after format data. MTP shows no internal storage and I cannot install anything from even the SDcard after that because the partition cannot be mounted.
[Redmi Note 10 Pro] MarkusOSx:
Must be fixed on v3.5.1
[Redmi Note 10 Pro] nnamless:
I have a problem with Backup and Restore on USB-OTG drive. TWRP loose the connection to the drive. First i thought it is a contact problem but if i use OFOX it works.
[Redmi Note 10 Pro] mathan7:
data partition cannot accesss
[Redmi Note 10 Pro] jmturner:
Hi folks! First, thanks, Nebrassy for gettin TWRP going on this phone!

I'm using 3.5.1 10.0 and so far have been unsuccessful at restoring any backups I make. The restore appears to succeed but upon boot I get a boot loop before going back to recovery. Are others having this issue?
[Redmi Note 10 Pro] jeryll:
- if you are trying to restore backups of encrypted data, you'll most likely fail with restore

- the only way how to use restore backup function properly AFAIK is to use decrypted storage/data and before backup remove any lockscreen protection (pin, pattern, password) from android, check this for more hints as what to expect (it is written for other phone, but most of it applied also on sweet)
[Redmi Note 10 Pro] somerandomhash:
Thanks for the thread it was useful to read and know :)
[Redmi Note 10 Pro] Nebrassy:
New build is up

Fixed adb sideload

Fixed fastbootd

Fixed vibration

Fixed decryption on stock while flashed
[Redmi Note 10 Pro] i.snehal.kiran:
SIR

time to make TWRP official for this device..:)
[Redmi Note 10 Pro] fermateus:
Thanks
[Redmi Note 10 Pro] 2spirit:
Great job ! Thanks for the update ;-)
[Redmi Note 10 Pro] taco9:
Installed latest version of this recovery then flashed xiaomi.eu 12.5.3 rom but it will only reboot into recovery. This error msg from the log: reason=fs_mgr_mount_all

Any idea how to resolve this?

edit: resolved after flashing and formatting data again before rebooting into system.
[Redmi Note 10 Pro] ain_gt:
how to install this twrp permanently on sweet?
[Redmi Note 10 Pro] mite_jan:
same for me i was already on eu , update was released after installing it keeps bootlooping in twrp with some

rescue trigger command

well i dont want to format data every time an update is released​
[Redmi Note 10 Pro] Pumpkinotto:
Hello Nebrassy,

firstly I'd like to thank you for the great work you put toward this project.

That said I'm having issues regarding the FBE decryption, I'll try to describe the problem as well as I can:

I have a Custom Rom installed (PixelExperience) and had OrangeFoxRecovery with which I was able to set up the phone in the first place (clean install of custom rom).

Now I wanted to update to the latest release of PE ROM and to do so I went to the recovery to flash the .zip, but internal storage showed empty and OrangeFox didn't ask for a decryption password so I figured it was a problem with the recovery.

I later found your distribution of TWRP and installed it (V3.5.2) and it did ask me for a password so I felt it worked, but now to the actual issue:

the correct password (aka my unlock PIN which does actually unlock the phone when booted in system) does not unlock the phone, and even removing the password at all doesn't work, I also tried using "default_password" together with the former procedure.

I have no multiple users, my user is [0] and also the name is reporting correctly.

I've read the whole thread and saw how various people had similar issues but usually they were tied either to STOCK ROM (mine's custom) or simply to the prompt not appearing but indeed working when it did appear.

I've tried installing both v3.5.1-1 and v3.5.1-2 to see if it would make any difference but it didn't.

By the activity of the thread I'd say your v3.5.2 fixed all the issues related to FBE but it seems like in my case it ain't doing the trick.

I'll DM you the files I'm guessing you need to figure out what's really happening (logcat.txt, dmesg.txt, recovery.log, the ones you asked another user for).

I shall really thank you in advance for your time and effort

DETAILS:

PREVIOUS ROM: STOCK MIUI 12.5 (if I remember correctly)

ROM: PixelExperience_Plus_sweet-11.0-202110526-1312-OFFICIAL

BUILD: RQ2A.210505.303

PREVIOUS RECOVERY: OrangeFox-R11.1_2-Beta-sweet

RECOVERY: TWRP-3.5.2-sweet-Nebrassy

NOTES:

I have not tried to format /data because I'd like to just upgrade my custom rom and not to clean install a new one.

In addition I think it might still develop the problem after formatting everything and clean installing because it would be the exact same procedure I already performed

(only difference being the original recovery which performed the flash, but from my comprehension of the system it shall make no difference at all, I might be wrong tho)

Thanks again
[Redmi Note 10 Pro] Pumpkinotto:
To anybody who has my same problem I did find a workaround to be able to install the update regardless of encryption.

As only /sdcard is encrypted by downloading the Update through OTA my ROM (PixelExperience) placed the .zip at /data/system_updates which is outside the encryption region thus allowing me to flash the file through TWRP.

NOTE: also system, vendor, and the other partitions used to host the ROM are not encrypted, that's why it was still possible to flash the update
[Redmi Note 10 Pro] harsha555:
TWRP is getting overwritten by stock recovery, anybody have solution to make the twrp no to be removed automatically?
[Redmi Note 10 Pro] Laptapper:
For me it's working if first flashing twrp with pc and then not rebooting normal! Boot twrp instead with hardware buttons
[Redmi Note 10 Pro] andynx1:
If you're on the stock miui, then install TWRP then reboot, TWRP gets over-written.

I wanted TWRP to install a custom ROM. So, I installed TWRP, then flashed a custom ROM without re-booting into stock miui. That way, TWRP isn't over-written.
[Redmi Note 10 Pro] BenDavid:
1. boot into fastboot mode

2. "fastboot boot twrp-recovery.img"

3. install twrp-recovery.img on the recovery partition

4. reboot into recovery

5. reboot into system

6. done

I don't know whether MIUI is interfering with these steps or not. On custom ROMs it's the way.
[Redmi Note 10 Pro] ramc_92:
I've had the same problem.. I'm on Arrow OS and wanted to change to crDroid.. Both TWRP and OrangeFox were not showing up the sdcard and the passcode for decryption failed, removing the security also didn't do much.. I was able to switch between TWRP and OrangeFox using an SD card (thanks to that dedicated slot!). OrangeFox has the option to disable encryption. With that, even after repeated reboots, I still am able to access the sdcard folder and flash stuff... that's my mileage..
[Redmi Note 10 Pro] harsha555:
Yes, true, it doesn't work properly with stock miui. Will wait for next update then. Thank you! :)
[Redmi Note 10 Pro] harsha555:
Will try Orangefox now. (y)
[Redmi Note 10 Pro] iooxda:
Hi Group,

I noticed that there are no installation instructions in the OP. I am new to Xiaomi devices. I am looking at going directly from stock to Lineage with Magisk via TWRP.

Could someone who has successfully installed and used this TWRP provide instructions on how to install this TWPR? The lineage thread says "Reboot to recovery" as the second step but I need to know how to unlock the device and install TWRP before I can proceed to install the Lineage ROM.

Thank you!
[Redmi Note 10 Pro] andynx1:
To unlock the bootloader, follow this video. It's for the F3, but it's exactly the same.

Then install TWRP in the normal way. Put the custom ROM on the phone SD card (before you start), and don't reboot back into stock miui otherwise miui will overwrite TWRP. Install your custom ROM directly after installing TWRP.
[Redmi Note 10 Pro] iooxda:
Thank you for this video. This is pretty helpful for a user not coming from the Xiaomi world.

It looked like this guy struggled a but, he had to install different versions of the Unlock tool to get it to work. Which version is recommended for this device? Could someone share a reliable link to a version that has worked?

Also, in the first step he entered his MUI account into the phone, do you need to create an account somewhere externally before entering it into the phone or does entering the account into the phone create it as well?

Also, is there any way to unlock the phone without Windows? Are there any Linux options?

When you say install TWRP the normal way, what is normal for this device. Are we installing to a recovery partition or to a boot partition?

Do I do a:

fastboot boot path/to/twrp.img

then

db push path/to/twrp.zip /sdcard

then flash the zip

or

fastboot flash recovery twrp.img

Perhaps Nebrassy could you write a few lines on how to install the TWRP in the OP?
[Redmi Note 10 Pro] Nebrassy:
the latter
[Redmi Note 10 Pro] powerofone:
Please help. Installed TWRP. Did

1. Format Data

2. Wipe Dalvik & Cache

3. Tried installing ROM

Pls see attached for error. Pls advise how to fix. Thanks
[Redmi Note 10 Pro] Laptapper:
After formating data with yes you have to boot in recovery again and then flashing

Wiping cache dalvik and then again data format yes

Reboot system
[Redmi Note 10 Pro] Jeerjrs:
After performing the reboot, flash the rom, do the wipes, and then you have to format data again? I do it but I get a message that there is no system installed is normal?
[Redmi Note 10 Pro] Laptapper:
Sometimes you have to make it completely twice. For me only once but also some people started system even it says theres no system and it was ok
[Redmi Note 10 Pro] sujju:
Reading through various posts, I got a little confused - can someone confirm if the latest version supports decrypting internal storage? Thanks!
[Redmi Note 10 Pro] Koerschgen:
Decrypting internal storage works without problems here.

TWRP 3.5.2

Never had any problems with TWRP at all.
[Redmi Note 10 Pro] jeehuu91:
I think i found a workaround for that.

Just go to Reboot and Reboot to Recovery. I hope that helps.
[Redmi Note 10 Pro] jeehuu91:
Just reboot the recovery and try to flash the rom again.

Got to Reboot > Recovery

I hope that helps.
[Redmi Note 10 Pro] iooxda:
Hi Group,

I am trying to automate some common TWRP tasks. I see TWRP has command line support here: https://twrp.me/faq/openrecoveryscript.html.

I would like to launch the TWRP terminal and run a shell script when TWRP starts. If this isn't possible then I would like to just run a twrp command or series of commands when TWRP starts.

Earlier Nebrassy mentioned:

as either the place to put the script or the twrp command. Does anyone know how this works?

I tried MANY different combinations of the following:

/cache/recovery/command/test.sh
/cache/recovery/command.sh
/cache/recovery/twrp install
/cache/recovery/command/install
/cache/recovery/install
/cache/recovery/install with the file contents "twrp install *.zip"

I can't get the syntax correct, nothing seems to start when I launch TWPR. Nebrassy or others with experience can you explain a bit more how I can run a script automatically when TWPR starts?

Other than that FAQ page I linked above and two vague references there doesn't seem to be any otherreference to the "Open Recovery Script" system and how it works in TRWP.

Thank you.
[Redmi Note 10 Pro] kazi69:
Is it possible to add auto decrypt function?
[Redmi Note 10 Pro] iooxda:
Hi,

I have run into some problems with my recovery. I am no longer able to decrypt the data partition. I am seeing several errors:

even though Lineage is installed and there is a valid data partition.

If I try to flash Magisk I get:

...and Magisk does install however when I boot recovery it no longer automatically asks for a password to decrypt the data partition. If I try to use the decrypt data button I get:

I also get this error if I try to wipe the data partition.

I did try to format data several times, wiped data, cache, davilk, install firmware and flash LineageOS. The OS installs properly, I can setup a password which it asks for when booting into the OS but my recovery can no longer decrypt data. It used to prompt for the password automatically.

I am not sure what happened, this phone has been working without problems and I have been able to flash many different ROMs, Magisk, format data several times previously but something happened this last time.

Even though Lineage is still installed.

Any ideas on how I can recover from this? If I do this, shouldn't it fix the problem:

What is this default password it it is asking for. Does this default password exist somewhere outside of the data partition? Why can the OS decrypt the data but recovery can't?

How can I get recovery to prompt for a password again automatically when I boot into it?

I am running 3.5.2_11-Nebrassy version.
[Redmi Note 10 Pro] iooxda:
Okay I have tried many different attempts. Different ROMs, formatting data, wiping cache, data etc. I also tried booting from the two older older Nebrassy TWRP images from fastboot etc. Nothing works, TWRP never prompts to decrypt the data anymore and I can't decrypt it manually either. I see this message as soon as I boot into TWRP so this is the root cause:

From the /tmp/recovery.log there is more detail:

I:Setting up '/data' as data/media emulated storage.
I:Can't probe device /dev/block/sda34
I:Unable to mount '/data'
I:Actual block device: '/dev/block/sda34', current file system: 'f2fs'
I:Can't probe device /dev/block/sda34
I:Unable to mount '/data'
I:Actual block device: '/dev/block/sda34', current file system: 'f2fs'
I:Settings storage is '/data/media'
I:PrepDecrypt::File Based Encryption (FBE) is present.
I:PrepDecrypt::SETPATCH=false, skip_initramfs flag, or ro.boot.fastboot found.
I:PrepDecrypt::crypto.ready=1
I:PrepDecrypt::Script complete. Device ready for decryption.
Cannot log to file /dev/fscklogs/log
I:Successfully decrypted metadata encrypted data partition with new block device: '/dev/block/dm-5'
I:File Based Encryption is present
fscrypt_initialize_systemwide_keys returned fail
fscrypt_initialize_systemwide_keys returned fail
fscrypt_initialize_systemwide_keys returned fail
E:Unable to decrypt FBE device
E:fde::get_crypt_ftr_and_key::Unexpected value for crypto key location:
E:Error getting crypt footer and keyE:Could not get footerFailed to decrypt data.
Unable to decrypt with default password. You may need to perform a Format Data.

These two look like the key log entries:

fscrypt_initialize_systemwide_keys returned fail

E:fde::get_crypt_ftr_and_key::Unexpected value for crypto key location:

E:Error getting crypt footer and keyE:Could not get footerFailed to decrypt data.

I can see there are key files mentioned in the metadata partion. If I format data and install a new ROM, I get the same results, always failed to decrypt FBE device. It doesn't matter if the ROM has a password set or not. Any ideas on what has happened or how to recover from this? Nebrassy?
[Redmi Note 10 Pro] Nebrassy:
Flash stock, lock the bootloader and unlock it again
[Redmi Note 10 Pro] cldkrs:
How to install?
[Redmi Note 10 Pro] inglar2k:
@Nebrassy, what does it mean "E: Unable to decrypt FBE device"?

ROM has been installed successfully and working properly, but why this error appears in log?

Install process is standard, format data -> reboot to recovery -> wipes -> reboot to recovery -> install zips

Spoiler content hidden.
[Redmi Note 10 Pro] Supermatt01:
Does the system need to be unencrypted for this to work? Or should I turn off boot verification? If so, how is that done?
[Redmi Note 10 Pro] rzfndrkt:
hi. i have stock miui rkfeuxm 12.5.4 global stable and when i install this twrp 3.5.2, after i reboot the phone. the stock recovery overwrite this twrp
[Redmi Note 10 Pro] WhereIsMyROM:
I am also facing the same issue as @rzfndrkt i.e. TWRP is being overwritten by stock MIUI recovery.

Here is the process that I followed:

1) Unlock bootloader

2) Flash recovery using minimal adb (Command: fastboot flash recovery recovery.img)

3) Boot to TWRP after successfully flashing

But as soon as i try to boot into system and then again to recovery I am welcomed by MIUI recovery instead of TWRP.

I have successfully followed the above steps to flash TWRP in my Redmi Note 4 and Poco F1 without any issues.

I also tried to follow certain tutorials one of which said to do the following procedure:

1) Unlock bootloader

2) Then use minimal adb to and type fastboot boot recovery.img and then in TWRP->Advanced->Flash current recovery. But this option is simply missing. Maybe the option has been removed (not sure).

Please help @Nebrassy . I really hate MIUI and want to use custom ROMs.

BTW mine is Indian unit of Redmi Note 10 pro (I think its called sweetin).

Also, please let me know if I missed something or if any more info is needed.

Thanks

Ayush
[Redmi Note 10 Pro] Laptapper:
Please try ro flash twrp via adb (before that: developer settings usb debug on)

After Flashing don't restart via adb, instead use hardware buttons to reboot in recovery

Then afterwards directly format data in twrp with yes, reboot twrp, flashing ROM gapps magisk...

Format data with yes again and reboot, ignore failures, reboot give time
[Redmi Note 10 Pro] anur@g:
All what you did is right. But once you boot into twrp flash dm verity disabler zip. You won't get any issues like recovery being replaced or phone not booting at all.
[Redmi Note 10 Pro] WhereIsMyROM:
Thank you @Laptapper and @anur@g for your prompt responses.

I tried the procedure you mentioned but now there is a new problem, after TWRP is flashed (from adb) and I boot into recovery via hardware buttons and format data (with yes), I can no longer see my internal storage on my pc which means i cannot copy ROMs, Gapps etc.

I also tried rebooting to recovery after format data and the result is same, still my internal storage is not detected

I even deleted Dalvik/ART cache, Cache, Data and then again did format data and then rebooted to recovery only to find that nothing changed 🥲

Ok I will try that once my internal storage is detected somehow.

A few observations:

When I format data, on the terminal the first thing it shows is "E: Unable to decrypt FBE device" (I don't have any pin or password, just our regular swipe to unlock)

"Unable to find partition for path '/system_root' " (I get this message only if I format data and reboot to recovery via inbuilt reboot to recovery option)

I honestly can't understand why is this happening.

Thank you

Ayush
[Redmi Note 10 Pro] Laptapper:
Try to use a sd card for ROM gapp... files

Or usb otg
[Redmi Note 10 Pro] WhereIsMyROM:
Thanks for the super quick responses @Laptapper

So I tried flashing ROM from sd card as you suggested and I get an error. I have attached a pic of error.

I am going to try OrangeFox and let you know if that works or not.

Please let me know if you need any more info.

EDIT:

I tried OrangeFox just now and it works without any errors. I successfully flashed crdroid and flamegapps. So I can confirm that nothing is wrong with my device. But I still cannot understand why TWRP doesn't work. It is my favorite recovery and I would really like to use it.

Thank you

Ayush
[Redmi Note 10 Pro] ZainBilq:
Super Partition or something is damaged. You need to flash stock or any other MIUI ROM which has fix for not damaging partition.

Cheers!
[Redmi Note 10 Pro] WhereIsMyROM:
Thank you for your response @ZainBilq

Ok.

But out of curiosity, why doesn't OrangeFox show any errors, tried it just now and successfully flashed CrDroid and FlameGapps. I mean if a partition is damaged or something then shouldn't OrangeFox also throw errors since it uses codebase from TWRP.

Thanks a lot.

Cheers!
[Redmi Note 10 Pro] Laptapper:
You'll have to reboot twrp after format data

Which twrp version?
[Redmi Note 10 Pro] fmrogonhantu:
ive got issue when flashing zip file.twrp will restart when im trying to flash any zip file

then it shows internal and sd card 0mb? when trying to boot to system it says no os installed.

it works just fine before.
[Redmi Note 10 Pro] WhereIsMyROM:
I already tried rebooting to TWRP after format as I mentioned in my previous comments.

TWRP version: TWRP-3.5.2-sweet-Nebrassy.img
[Redmi Note 10 Pro] dave_id:
I'm looking for a guide to install this TWRP (unlocked device)