yashsingh1/xdaforums huggingface dataset:
[Magisk] zgfg:
Find Cepheus and try custom recovery from this storage:

Recovery for Xiaomi devices - Browse Files at SourceForge.net

List of relevant recovery in one place

sourceforge.net

Seems they have TWRP v3.7.0 from 2022

Xiaomi.eu provides (debloated MIUI - consider to switch to). And they install from custom recovery. Hence that TWRP on the storage shall work with your MIUI 12 / A 11 (latest Xiaomi.eu ROMs for Mi 9 series)

Look also into this thread (about those customer recoveries):

[TWRP][OFRP][PBRP] List of relevant recovery in one place

https://sourceforge.net/projects/recovery-for-xiaomi-devices/files/ I compiled this list because i think it will be useful. Updates are monitored each day. Welcome, friends! https://xiaomi.eu/community/threads/installing-a-custom-recovery.67841/

xiaomi.eu

And (for future, to consider switching to Xiaomi.eu):

MIUI 12.0 - MIUI 12.0/12.1/12.2/12.5 STABLE RELEASE

STABLE RELEASE RULES WHEN POSTING 1. If a ROM is not published DONT ASK ABOUT ITS ETA 2. If a ROM is not published DONT ASK why! 3. If a ROM is available, download it and use it 4. If a ROM has bugs, post the bug to the bug section if the BUG is not already listed 5. If you use any form of...

xiaomi.eu

Since Mi 9 is on End Of Support, there will be no official ROMs from Xiaomi, hence neither Xiaomi.eu debloated versions. Still, you could consider taking their latest MUI 12.5. Xiaomi.eu are good ROMs👍

Post #1 in that thread describes how to install
[Magisk] HippoMan:
With my version of TWRP (3.7.0_11), "system" only means the /system partition. It separately handles /boot, /vendor, and /data.

But perhaps this is device-specific.
[Magisk] jons99:
yeah sorry I think I was wrong it meant just the system partition but it also said it's only a problem if his gonna take ota updates which he won't so might as well?
[Magisk] Arese75:
TWRP 3.5.2 that I installed didn't ask for my unlock pin (I set up an unlock pattern in android)

Like you said, when I open the phone's storage on the PC it's connected to, all the folder names are random characters.

So that means it cannot decrypt data and internal memory and I won't be able to install Magisk using this old TWRP.

Ok thanks for posting all those links, it helps a lot.

I was able to find a TWRP 3.7.0 for Cepheus

I downloaded the .img file and now I'm going to flash this new TWRP and hopefully, it will be able to decrypt my phone's data.

Once TWRP 3.7.0 is installed, I might consider your advice and install Xiaomi.eu rom

And then once I flashed the Xiaomi.eu rom, hopefully, I will be able to install Magisk.apk directly from TWRP 3.7.0

Working on this now, will keep you updated.

Thanks for the help and for the links, really appreciate it
[Magisk] Arese75:
I'm getting an error when trying to flash TWRP 3.7.0.

I'm thinking it's because I already installed TWRP 3.5.2?

I rebooted my phone to MIUI, turned off the phone, and booted up in fastboot mode and still doesn't work. It says volume full, any idea how to fix this?

EDIT: I ran the old TWRP 3.5.2 in read only mode yesterday, so when I rebooted my phone, the stock rom replaced TWRP 3.5.2 from recovery with its stock recovery.

I just restarted my phone holding down power+volume up and MIUI recovery booted up, not TWRP.

So I'm guessing that means that TWRP 3.5.2 was removed from recovery, unsure why I can't install the custom TWRP 3.7.0 then.

When searching online for the volume full error, people mentioned trying to flash the wrong TWRP, but I re-downloaded a 2nd time the file for Mi9 Cepheus so I'm positive I'm flashing the right TWRP. Still doesn't work though.

Maybe I should try the Orangefox.zip file? But unsure how to flash a zip file via fastboot

EDIT 2:

I re-downloaded the official TWRP 3.5.2 to compare sizes

Official TWRP 3.5.2= 65,536 kb

Custom TWRP 3.7.0= 66,096 kb

Could TWRP 3.7.0 file be larger than my phone's recovery partition?

I downloaded the orangefox zip, extracted the "recovery.img" and its size is 65,536 kb.

Seems like that one could work

EDIT3: I was able to flash fox and boot onto fox recovery but it cannot decrypt my data as I still need to install the fox zip file from my phone as per Fox installation instructions All the filename are random. I'm going to try to set a Pin code instead of a pattern
[Magisk] Arese75:
I went in MIUI and removed pattern unlock and fingerprint.

I didn't set a pin code so there's no more security on the phone thinking data wouldn't be encrypted then.

Flashed again fox, booted up in Fox recovery, still can't decrypt my phone's data.

Don't know what else to do at this point. At the bottom of the list, that's the fox zip file I'm supposed to install via Fox recovery
[Magisk] pndwal:
Official TWRPME instructions usually tell you how to bypass ROM / system protection overwriting altered partitions incl. recovery... Usually just need to boot directly to TWRP first so TWRP can make initial config changes needed to prevent ROM doing that...

Could well be your problem... Usually sizes match AFAIK... I'd try extracting stock recovery as .img if others are .img to check stock recovery size too...

You very likely need latest build to match ROM base and have proper functions...

🙂 PW
[Magisk] pndwal:
I believe device will remain encrypted regardless of plan/pattern until you clean flash ROM with correct settings to disable encryption or at least formatted /data partition...

Am I correct that you haven't yet flashed Magisk?... @zgfg had this issue (TWRP not asking for pin/pattern) after updating Magisk (per posts in last pages here), but we haven't been able to pinpoint the exact cause...

Guess you didn try after doing initial boot after flashing directly to TWRP rather than to system now?... Not doing so many affect initial configuration as mentioned, and may be critical for decryption. 🤔... PW
[Magisk] Arese75:
I haven't done many manipulations.

- flashed TRWP 3.5.2 (no pin asked) data not decrypted

- flashed Fox recovery 3.7.0 (no pin asked) data not decrypted

Haven't done anything else, and haven't attempted to install Magisk yet since the data is not decrypted

That's where I am at the moment.

I'm wondering if this could be caused by the fact that I used both recoveries in read-only mode?
[Magisk] pndwal:
Not sure, but thinking it may be wise to disallow modifications w/ stock ROMs for reasons you gave, but AFAIK most custom ROMs still happily allow system modification, and OTAs from system should still work too as these are (always?) full OTA packages as opposed to stock delta (incremental) updates (that require bit perfect previous images/partitions to generate update w/ only the small delta differential data (changed blocks) OTAs)... 🙃 PW
[Magisk] J.Michael:
When I installed Magisk on a Samsung tablet, there was a "wipe data / factory reset" that I think was to reset /data to unencrypted. Is that an option in Miui?
[Magisk] zgfg:
That OF photo shows (it's all blurred) Code base date 2020

If so, it's even older than TWRP v3.5 2 from 2021

Custom recoveries released before A11 was released cannot decrypt A11 FBE (File Based Encryption) on the Storage. TWRP.me released v3.6.x in 2022 (a year or so after vA11 was released), finally announcing on their site that since that version they support A11 FBE - but seems they stopped supporting and releasing for your Cepheus

Try just temporarily boot to that TWRP v3.7.0 from Xiaomi.eu by (there is no "flash recovery" but just "boot" instead):

fastboot boot <TWRP.img file>

If it boots to TWRP, then install the Magisk from
[Magisk] zgfg:
I believe your Mi 9 Recovery partition (like on my Mi 9T) should be 64 MB = 64 x 1024 = 65536 KB = 65536 x 1024 = 67,108,864 bytes
[Magisk] Arese75:
I used the link you sent me and I also posted a screenshot

Recovery for Xiaomi devices - Browse /cepheus at SourceForge.net

List of relevant recovery in one place

sourceforge.net

2nd file at the bottom doesn't work it's too large, so I tried the orangeFox file dated 2022-10-27.

Are you sure TRWP is supposed to decrypt MIUI phones?

Because on Foxrecovery website it says that MIUI encrypts the data and they provide another solution

So I formatted /sdcard with Fox recovery, and rebooted strait into recovery, because MIUI encrypt the data at first launch.

When I did that, the data wasn't encrypted I could see my data, but because I hadn't booted MIUI yet, all folders weren't created yet (DCIM, etc)

The only folder I could see was FOX. So I transfered the fox recovery zip file into my phone's storage and installed it.

Then rebooted and straight into recovery and installed Magisk (renamed file .zip) and it seemed to work.

The only issue is that I installed Magisk before MIUI first boot so I don't know if it worked. I booted MIUI, went through the first set up, and I don't see magisk app but I read online that sometimes you need to install the apk manually.

So I downloaded magisk manager apk and installed it, click on Magisk install, then there 2 steps I'm not sure what to do.

- Options: Patch vbmeta in boot image or Recovery mode

- Method: select and patch file

Unsure what file I'm supposed to select

Do you think my phone is rooted now?
[Magisk] zgfg:
Unofficial TWRPs released for MIUI, ported to particular device and targeting particular Android version should decrypt (although they might have some other issues, here or there)

Answering you from my daily Mi 11 Lite 5G NE (Lisa) with MIUI 14 / A13. Unofficial TWRP from Xiaomi.eu works excellent on Lisa

I have Mi 9T (my old/second phone now), with MIUI 12.5 / A11 and till 2022 or so I used some unofficial OF, SHRP and/or so, and they worked. Then I switched to the official TWRP v3.7.0 (when it was released) and since then I happily used it.

(Decryption and everything worked until last weekend when I had problems with installing Magisk Canary 26103 and something went messed up - but that's another story)

Xiaomi.eu releases so called Fastboot, Recovery and Hybrid ROMs

First must be unzipped and flashed from Fastboot by calling the provided bat scripts

Second must be flashed from custom Recovery - hence that custom Recovery must in first place work on that phone and on the corresponding MIUI version

Third can be installed both ways (for users convenience).

I didn't check but on that link I sent you for Xiaomi.eu MIUI 12.x, look into the table on the first post, find Cepheus (first column) and check does it say in the last column say Recovery type ROM. If so, it requires custom Recovery for installation (and b deduction, it should be that unofficial TWRP v3.7.0 - but that file there is indeed few hundred bytes too big?!)
[Magisk] zgfg:
Edit:

Please upload the screenshot from your Magisk app to see what does it say about the (installed?) Magisk version

Initial screen, on top
[Magisk] J.Michael:
You should be able to tell if Magisk is installed. Run the Magisk manager app and look at the opening screen. There are two panels. The top panel describes the version of Magisk that the manager can detect.

If you have been flashing magisk.zip using recovery, then you do not need to patch and flash, Magisk was installed when the zip was processed by TWRP.

When you talked about flashing magisk.zip, then downloading the apk, did you mean downloading the apk from your PC to your phone? (You should not have downloaded a new copy of the apk file from github, you should have used the same file that you renamed to zip.)

You did not attribute that large quote about MIUI / OrangeFox / encryption. Whether it says you have an option to keep your device unencrypted seems to depend on the version of Android with which the device was launched. I would have thought that it was more important to know the version of Android currently installed. Wait for a MIUI owner to tell you whether unencrypted is an option.
[Magisk] Arese75:
@zgfg Man I'm sorry but why are you giving me a lesson about what is a fastboot or recovery or hybrid rom? What does has to do with me?

Why are you telling that 64 MB = 64 x 1024 = 65536 KB = 65536 x 1024 = 67,108,864 bytes?

How does knowing what 64MB equals 67,108,864 bytes is helping right now?

You've been talking nonsense since earlier just saying random things that have nothing to do with the actual discussion. Like I've never seen someone write so many things that are 95% not in relation to the actual discussion.

I managed to make it work not thanks to you, you've confused me more than anything else, seriously consider stopping "helping people" or maybe consider only helping when you actually know the answer.

- I flashed Fox recovery, went to OTA & ROM settings and ticked "disable forced encryption"

- I flashed the latest xiaomi.eu rom for Mi9

- First boot up in xiaomi.eu, complete the initial setup

- Once the initial setup was completed, I rebooted into Fox recovery, this time FOX recovery wasn't replaced, and boom data on /sdcard is not encrypted!

Now I can install Magisk
[Magisk] Arese75:
Yeah so my previous attempt (installing Magisk right after formating /sdcard and before first MIUI launch didn't work.

When I installed Magisk Manager on the phone, on the home screen, next to installed it said N/A so probably didn't work.

But it's all good, see my previous message above, I flashed a new rom and in Fox recovery I ticked "disable forced encryption"

During the rom installation process, in the log screen, a line said, encryption disabled. When I launched the phone with the new xiaomi.eu rom, MIUI didn't encrypt data. I'm now able to see /sdcard data in Fox recovery

Thanks for the help though, you at least answered and addressed my previous message.
[Magisk] zgfg:
I was not telling you any nonsense but tried to help you.

Anyway, you are not happy with and I will no more waste time on

Btw, I counted the bytes to see how/why the that TWRP file is too big (indeed it is)

And the story about Xiaomi.eu installation methods were that you can see that there are unofficial custom recoveries that support those Xiaomi phones for whom Xiaomi.eu releases their ROMs (and thousands of users use that)

Anyway, you know better, enjoy. Bye
[Magisk] jons99:
you need to patch in recovery mode and you need to patch the boot.img you extracted from the rom your using
[Magisk] zgfg:
For Xiaomi it says Ramdisk No but nevertheless:

- patch BOOT IMG (not recovery IMG file)

- do not tick Recovery option

- flash in Fastboot to Boot (not Recovery partition)

Guides elsewhere. Discussed here many times. Btw, I went on my two Xiaomi phones through official and unofficial versions of MIUI 10 - 14 (A9 - A13) Magisk Stable and Canary, Delta and Alpha (even Magisk Lite when it was actual) and it always worked that way (if I didn't do that hundred of times, say that I didn't do at all)

Including Mi 9T (with MIUI 12 / A 11 as he has on Mi 9)
[Magisk] Arese75:
After flashing magisk via recovery, upon restarting I had the app on my home screen and when I opened it I got this

I clicked ok, then direct install or something like that, it said it was the recommended option

It installed something, then when it rebooted, the screen is stuck on the MIUI logo

Leaving it think for now but it looks frozen. Unsure what happened, I followed the prompts on the screen.
[Magisk] pndwal:
As above, recovery mode = Magisk in ramdisk in /recovery partition... Option only shows on A-only devices launched w/ Android 9 (A-only legacy SAR) and will be checked by default...

This mode is required for many such 2018, 2019 devices, but not for any Xiaomi devices I'm aware of (since bootloader inexplicably supports Magisk boot mode, ie Magisk in randisk in /boot partition despite OEM supplying no such ramdisk, and Magisk now adds needed generic ramdisk parts), so Xiaomi users should (always?) deselect recovery mode and patch, flash and use Magisk in standard boot mode...

Ramdisk = No (no factory ramdisk in /boot partition) will remain despite Magisk added ramdisk present... 🙃 PW
[Magisk] jons99:
try flashing magisk 25.2 in twrp
[Magisk] jons99:
I think it just means the phone has a recovery partition look at the zenfone 9 guide for example

https://xdaforums.com/t/rooting-zenfone-9-with-magisk.4484715/
[Magisk] Arese75:
Lol I think it bricked my phone.

Phone no longer starts and can't boot into recovery.

Fastboot mode still works so I guess I'll have to restart everything from the begining, fastboot flash Fox recovery, disable forced encryption, flash xiaomi.eu rom and then try to install magisk 25.2 instead of 26.1

What a pain, this became a lot more difficult than what it used to be.
[Magisk] jons99:
you can try in fastboot to "fastboot boot twrp.img" and flash magisk 25.2 from a flash drive
[Magisk] zgfg:
Do you have Xiaomi and did you play with patching and flashing Magisk to Xiaomi, particularly to their older model released around 2018 till 2020?

If not, please allow that we who do have Xiaomi phone(s) and who have installed maybe hundred times Magisk to Xiaomi (and already discussed here - I think I mentioned that case already in 2019 or 2020 in this thread when I first time installed Magisk to Mi 9T where Magisk app said Ramdisk No but still installing to Boot and without Recovery option, etc worked excellent - and at that time there were also 'experts' here without Xiaomi phone but who knew 'better' that what I wrote could not be 'correct') know better😁

And that we can better recommend to the other Xiaomi users (who have similar old Xiaomi phones where Magisk says Ramdisk No) what and how to patch and flash
[Magisk] jons99:
yeah no I don't own a xiaomi phone and I'm sure you can do a better job helping this guy you should tell him what he should do and I never said I know better than anyone I probably know less than most I was just trying to help
[Magisk] zgfg:
Off the record and if you dare to try, don't quote me back (no time to read and to follow/answer timely):

https://xiaomi.eu/community/threads...evant-recovery-in-one-place.57730/post-697248
[Magisk] TKruzze:
Why, after the way he rebuffed you, would you even consider offering further assistance? I'd just mute him (as I already have), and move on.
[Magisk] pndwal:
Well @zgfg didn't deserve that, and the linked info goes to the connection that @Arese75 actually asked about but missed entirely...

Sometimes when we're trying to see beyond the obvious we all miss the obvious and make wrong assumptions... Try to see thing from the perspective of others folks... Make allowances when others haven't... Apologise if you realise you did that... That's what makes the world go round, and the XDA world is no different...

Just 2 cents worth... PW
[Magisk] Arese75:
Done my phone is rooted.

Actually it was so much easier to do it directly via Magisk, no one here thought about mentioning it?

- I copied the boot.img from the xiaomi.eu rom zip file to my phone's storage

- Open Magisk, click install, and select patch a file file under Method and select the boot.img file

- Patch boot.img

- Copy patched image to PC

- Reboot phone to fastboot and flash the patched image to my phone

Seriously guys? All that nonsense about TWRP, encryption, partition size, and lessons about what 64MB equals in KB for that?

It just took me 5min as soon as I stopped following your advice and looked at more reliable resources. Ultimately it was my bad listening to you guys. Back in the days XDA used to be populated with extremely knowledgeable people and that's why I came here to seek help but I guess things have changed.

Thanks for turning a 5min job into a 48 hours hassle
[Magisk] zgfg:
No one mentioned?!

Look at the screenshot below with my first answer to you on Friday:

https://xdaforums.com/t/magisk-general-support-discussion.3432382/post-88694555

But then YOU ANSWERED that it's complicated and you rather wanted to install Magisk the old school way by flashing through TWRP, saying that it would be EASIER FOR YOU.

Your answer on Friday (and a screenshot below):

https://xdaforums.com/t/magisk-general-support-discussion.3432382/post-88694627
[Magisk] zgfg:
I was constantly repeating you that with the ancient, pre-A11 custom recoveries like TWRP 3.5.2 (or OFox from 2020) you cannot (and you did not) decrypt A11 FBE

And now you don't need TWRP 3.6 to install Magisk anymore but in the case of future bootloops due to some Magisk module (if you in the future come to that point) it would be a big help to have TWRP installed that decrypts A11 Data, that you can then trivially disable the problematic module from TWRP by managing /data/adb/modules/... to unbrick that type of bootloop

Without TWRP it requires booting to Android Safe mode (on some phones not easy and may not work as required, there is also another method with adb that also doesn't work on many phones), and then the only method to unbrick that type of bootloop would be Factory resetting the phone (to wipe Data, including the problematic module). But after Factory reset you have to reinstall everything

To the other side, using TWRP and simply disabling/removing module(s) by managing /data/adb/modules folder is a peace of cake solution for that kind of problem (and sooner or later it may happen when you would actively use Magisk, ie when you would start installing and playing with various Magisk modules)
[Magisk] pndwal:
What a crock...

Your first post mentioned some tutorial that didn't mention vbmeta and other items now covered in official instructions, which you linked and had clearly already read, so you should have known that old flash from custom recovery "installation method is deprecated and is maintained with minimum effort. YOU HAVE BEEN WARNED!"

However the first response you got did in fact state that this approach is unnecessary!:

Next, more mostly covering in-App patch/fastboot flash method w/ extra details:

Then you said:

So obviously you had decided/wanted to persist with custom recovery installation! 🙄

----
​

People responded because they wanted to help, offered relevant info, and technical misunderstandings were also corrected...

You had said:

Several members commented that size could be an issue. Also, this

certainly clarified that 66,096 kb must be too big as "should be 64 MB = 65536 KB". Only the last "= 67,108,864 bytes" might have been superfluous, however you responded:

As I said,

----
​

Well thanks so much for putting us straight... @zgfg shouldn't have bothered recommending XiaomiEU cos it didn't help at all, and we should all refrain from responding with ill informed, irrelevant and confusing answers, advice taken. 👍

Some advice for you: Stop missing the point... You're clearly not dumb; Show gratitude... You did initially... Perhaps you let frustration get to you...

You may have been dead right... 🙄 PW
[Magisk] jons99:
yesterday I told you that you can patch the boot img you extracted from the rom you probably didn't read it

https://xdaforums.com/t/magisk-general-support-discussion.3432382/page-2826#post-88698307

anyway you should be more polite to users trying to help you they obviously wasn't trying to make you mess up with magisk and yeah patching the boot img is the recommended way to root and it's explained in every how to root guide