yashsingh1/xdaforums huggingface dataset:
[Magisk] mGforCe:
Yes, am sure...

I had to use EDL on Redmi 3S ( had 2 of those). Guess while flashing new custom rom, recovery etc some how via fastboot I relocked the bootloader or so. So was not able to unlock nor able to boot into rom. Custom recovery was there and allowed to flash files but no boot.

Trust me, when it comes to flash rom, would consider myself quite experienced..but still this happened.

Had to Google and find a way to make EDL cable by shorting some wires etc.

It took me a few days (nights) and multiple attempts...but finally was able to use EDL to reset phone, get stock rom and then used the same to exchange and get new phone!!
[Magisk] mGforCe:
This, a mix of few things from here and phone was bricked.
[Magisk] zgfg:
But you didn't need a paid assistance for authorized EDL?
[Magisk] pndwal:
Redmi Note 3 was apparently the first Xiaomi device needing Mi Unlock / registration / unlock wait period (early 2016) for both security reasons and to curb the practice of unscrupulous resellers purchasing Xiaomi devices from China to reselling unofficially outside of China. These were being loaded with Google Apps (despite not having Google certification) as well as languages above MIUI's English and Chinese, calling ROMs “MIUI Global”, and later even injecting adware and spamware into the firmware.

https://www.xda-developers.com/xiaomi-edl-unbrick-authorized-mi-accounts/

NB. This article addresses "brick-gate", Ie. issue causing devs to abandon custom support especially for MediaTek Xiaomi devices.

Your mid 2016 Redmi 3S device was affected by these new unlocking requirements, but not by the EDL / Download mode lock-down move. That was introduced a while later when resellers found they were able to circumvent the above measures and still flash their customised ROMs on locked devices using EDL / Download modes.

Tighter region controls and other security related changes have also been made since.

My understanding is that Authorised Account has been (officially) needed for EDL flashing in 2018+ devices, so seems this change affects Redmi Note 5 and later(?). Simple test-point shorts etc were all that was required for QC EDL / MTK Download modes before that.

I was also aware of an unofficial bypass for Authorised Account EDL requirement for a few devices where modders have been able to patch and make available device specific firehose files (initially only Redmi Note 5 Pro and a handful of devices). It now seems (happily) that patched firehose file / bypass is available for hundreds of devices, but not all. Something here:

https://www.droidwin.com/fix-mi-account-authorization-unbrick-xiaomi-edl-mode/

and here:

https://www.mohasanteck.com/2021/12/patched-firehose-file.html

🤠 PW
[Magisk] mGforCe:
Hmm...luckily with my other phones (in family) Redmi 5 Pro, 7 Pro and 9 Pro, have been playing safely and not tweaking a lot. So, fortunately didn't have had any need to explore EDL.

Yes, Redmi 3S is old one and had no such paid requirmeent. I had to use custom EDL cable and then use QPST tool.
[Magisk] humpty321:
@zgfg @pndwal @shoey63

Thank you all for your support! Unfortunately I'm not on the same level of knowledge as you are and therefore I'm uncertain, what to do next.

Yes, the LineageOS zip contains a payload.bin of almost 1 GB. I didn't know this was important.
[Magisk] humpty321:
Here is the result of the commands you gave:
[Magisk] zgfg:
From this, your device is A/B with Recovery integrated to Boot (the same I have on my Xiaomi 11Lite 5G NE)
[Magisk] zgfg:
Ok, so search on XDA to find a thread with payload-dumper (maybe it was under Asus or One Plus, don't recall and doesn't matter)

It's a PC tool, read the OP posts (maybe there was also a readme.txt, I don't remember now, answering from the mobile)

With the tool you will extract your payload.bin into several img files. One of them should be boot.img (from the LOS).

As pndwal mentioned, patch that boot.img and use instead of the patched stock boot.img.

You can also try first with temporarily booting, before flashing permanently
[Magisk] 73sydney:
https://xdaforums.com/t/magisk-general-support-discussion.3432382/post-86522157

and from my pixel days with platform-tools installed:

to temp (test) boot:

fastboot boot magisk_patched_boot.img

to flash if temp (test) booting ok:

fastboot flash boot magisk_patched_boot.img
[Magisk] humpty321:
Nice and easy to understand recipe you gave me!

I was able using that tool to dump the boot.img from the LinegeOS zip, made Magisk patch it and after it looked fine when I had booted it non-permanently I flashed it permanently. So far all seems fine.

But there is still one question lingering in my mind: might it turn out to be a problem, that I had flashed the recovery from LineageOS first of all?
[Magisk] pndwal:
As I said:

AFAIK this is the case where boot.img is absent in LOS A11+ archives. Some unofficial builds still include discreet boot.img however. PW
[Magisk] pndwal:
How did you obtain that? - I'm guessing it should have been fine if official, however this will have been replaced now by your patched / flashed boot image which we've established contains the recovery binary... (Any magisk-patched recovery from your experiments with Magisk in recovery will be gone also)...

Additional thoughts: If LOS supplies that recovery separately, I'm guessing it is either a patch-boot.img solution or a complete boot.img... the latter would remove Magisk if flashed now, and it's likely a patch-boot.img solution would either fail or do the same if it also patches hybrid 2SI ramdisk...

In short, l'd leave things as they are.

The exception would be if you want to use TWRP instead of LOS recovery. This is done by some users (for decryption etc), and I believe LOS provide methods also, but would require attention to detail as we have both recovery and Magisk in hybrid 2SI ramdisk. PW
[Magisk] pndwal:
Canyies original 'Alpha Discussion' group name has changed recently several times.. it is now 间谍 家家酒 ('spy house wine'; apparently after a popular game)...

I put some details in Alpha thread, but OP there keeps insisting that the endorsed Alpha Discussion group is OT!-???

Spoiler content hidden.

👀 PW
[Magisk] Homeboy76:
...There is no ,share, link but can join from TG Magisk Alpha release thread by disguised entrance.... Click pinned Message re rick Astley's "Never Gonna Give You UP'', and then the youtn, be Url...

:ROFLMAO:
[Magisk] zgfg:
As we found out, you have no separate Recovery partition - your Recovery is integrated to Boot

Since you have already installed LOS and after that, now, flashed its boot.img patched by Magisk - that's now what you have in the Boot partition.

Hence, I would not mind

Anyway, did you try now to boot to Recovery (usually Pow+Vol Up or there is an option in Magisk app)?

I guess, it would boot to the LOS Recovery - if supplied by LOS as integrated to their boot.img

That should have been left there even after you patched Magisk to the same Boot
[Magisk] zgfg:
Btw, I have that case on my Xiaomi 11 Lite 5G NE - Recovery is also integrated to Boot and device is also A/B. All like him

Iit's possible to have custom Recovery and Magisk, both patched into the same boot.img

First, you cannot:

fastboot flash recovery TWRP.img

bcs there is no Recovery partition

Instead, you must boot temporarily:

fastboot boot TWRP.img

Then, inside TWRP (in my case, I did with SHRP and Orange Fox custom recoveries since there is no good TWRP for my phone) there is an option to permanently install the custom recovery itself (or to flash its img to Ramdisk)

After that you have your custom recovery installed permanently but you lost Magisk (since Boot partition was just overwritten)

Now you simply backup the Boot, reboot to System, patch the backed-up boot.emmc.win by Magisk app and flash that patched boot img (from Fastboot or from TWRP)

After that you have both, TWRP and Magisk, both in the same Boot.

Normal booting boots to System (Android) with Magisk instaled; booting with Vol Up boots to that custom recovery

And when Magisk is updated, just patch again with the new Magisk - or even Direct install (update) works fine: it updates Magisk and leaves the custom recovery

However, I'm on A11 - did not upgrade to A12 (=MIUI 13 bcs there is no custom recovery supporting the new encryption scheme, and there are some issues with MIUI 13 as reported by users)
[Magisk] pndwal:
Yup, seems all pixels on 2SI (RV Android 10+) use that setup w/ 'Hybrid' ramdisk as do most other 2SI A/B devices. (Previous SAR A/B used recovery ramdisk in boot - officially called USES_RECOVERY_AS_BOOT).

Also appears that John only means 'Hybrid' ramdisk for A/B devices lacking recovery partitions however, as some with recovery_a/_b (OnePlus 8T etc) and A only with recovery partition will have both dedicated boot and recovery ramdisks.

Not possible any other way! 😜 ...

Also, as I mentioned, some LOS users also swap out LOS recovery and install TWRP (OrangeFox?) etc...

Yup, official TWRPme instructions for most A/B devices make these methods clear...

Aside from ,zip installation from booted recovery, TWRP (and others?) has had two alternative integrated methods for permanent .img flashing for a while now.

Interestingly, as I've noted here recently, Install to Inactive Slot, where "out-of-the-box OTA installation works seamlessly and Magisk can be preserved after the installation" (as long as John's instructions are followed carefully) has recently been fixed for Pixels. (Doc updates pending.)

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

I believe this should work again for other A/B devices, but I'm not 100% sure... You may like to try / confirm this when you next get an OTA update. 😛

Yup, another example of why Johns move to in app / fastboot magisk installation as the preferred and fully supported method was well advised and fortuitous...

You can't have properly working custom recovery and Android 12 / 13 ATM as Devs have real lives and family/ kids etc too and Dees Troy and helpers, under the pump for some time now, are forever battling changing Android architecture / Android Booting Shenanigans... Makes John (& collaborators) look like a dynamo!

🙂 PW
[Magisk] Raskaipika:
Hi community, I need your help urgently:

I'm unable to boot my phone and my phone is continuously booting to the recovery after flash magisk from the bootloader, the process that I did was the next:

- The last Saturday, I updated my Xiaomi Mi A2 Official LineageOs 18.1 via OTA (09042022), reboot the phone and wait to the system, once time that I was at the system, I rebooted the phone to the bootloader, from there, with fastboot, I booted the twrp.img to be able to flash the recovery using the option "Install Recovery RamDisk" and everything worked ok.

- Once the phone boots to the system, I rebooted again to the bootloader and with the proper command, I rebooted to the recovery, from the recovery with the adb shell, I extracted the boot_b partition (active at that moment) to patch it with the magisk app, again, reboot to the system.

- Using magisk app (lastest stable version) I patched the boot_b.img extracted with TWRP, renamed it (the magisk .img file generated) to boot_b.img and rebooted to the bootloader again, and fromm there, I flashed the boot_b like ever, with the command "fastboot flash boot_b ./boot_b.img".

Once time the phone rebooted, the phone boots to the recovery ever and I have to shutdown it from the recovery.

Is there anything that I can make to fix this???, I'm ****ed right now without my phone.

Thanks in advance guys, for your time and help.

P.S.: This time, I did all the process from my linux TabPC (2-1 convertible) instead of my Windows PC like ever, I don't know if the last command (fastboot flash boot_b ./boot_b.img) is the problem here, I comment it because I don't know if the command from a linux terminal is the same than in a PowerShell terminal. Of course, if you need something, like logs or similar, I can give you if you tell me how to obtain it from the recovery (adb shell), and one more thing, the phone is detected form the PCs (Linux and Windows) and adb&fastboot are working.
[Magisk] zgfg:
Not sure exactly your case but if you previously had Magisk and some modules, and you didn't disable or uninstall those that are potentially no more compatible with the new ROM, that would be the common case for bootloop

You can check Wiki from the Magisk GitHub, there are couple of ways to try (more details there), depending on device and ROM:

- TWRP and disable suspicious module(s) by putting a file named disable

- adb wait-for-device shell magisk --remove-modules while booting

- boot to Android Safe mode then normal boot

Or wipe Data :(
[Magisk] Raskaipika:
Thank you for the info, I will take a look to the wiki and maybe, I can do something tofix my problem, well, the first thing that I will trey will be to boot at secure mode that seems the easiest way to check if I can fix it.

I will post here again when I will finish, thanks again.
[Magisk] pndwal:
Is that a delta true Over-the-air update (Small size / incremental)? Or full ROM downloaded 'OTA'?

This is confusing; is Mi A2 an A/B partitioned SAR device? - as Launch Version is Android 8.1 seems it should be an A Only legacy ramdisk device...

It is sounding like you may possibly have modules incompatible with updated OS, or other issue...

See if you are able to boot to safe mode (read this: https://topjohnwu.github.io/Magisk/faq.html#q-i-installed-a-module-and-it-bootlooped-my-device-help and this comment and issue (re. Xiaomi safe mode): https://github.com/topjohnwu/Magisk/issues/4624#issuecomment-1077747785

Failing this, generally, 'fastboot flash boot boot.img' will work for any device with boot ramdisk, flashing current partition. (Not sure why you use boot_b method.) Using this, or by trying your command with boot_b, you should be able to restore your un-patched boot image to restore boot to system...

Also, a complete dirty ROM flash should likewise restore boot.

Please give details about A/B partitioning and OTA type... PW
[Magisk] Raskaipika:
1º Question: Well, I think that is a Full ROM, with a size among 600 and 700 MB.

2º Question: Yes, the Xiaomi Mi A2 is an A/B device, and when I've patched the boot image with Magisk (each time that I've done it after each OTA), the magisk app has the SAR device.

Well, I've tried the command to disable the magisk modules but that didn't work, magisk not present or found :-(

I will try to boot the lineageos recovery, or the TWRP, but one more question, if flashing the boot partition doesn't works, can I do something to try to boot or do I have to reflash my phone and lost my data, config...?

P.S.: I got a boot backup from the TWRP backup from the last flashing, should I try to restore it before making other thing?
[Magisk] pndwal:
Yes, so seems it's non-delta type... You should be OK flashling over Magisk (not restoring images first). - For delta type (used over the air for stock; only patch files, requiring bit perfect previous images) you must restore unpatched images before OTA.

Ah yes; - I knew A9 SAR is mandatory & supports A/B, but I now see it was optional w/ earlier Android also.

https://source.android.com/devices/bootloader/partitions/system-as-root

You could try backup it's complete (includes all necessary partitions)... But did you try just fastboot flashing back un-patched boot.img as I suggested?... Or dirty flash (w/o data wipe) complete ROM again?... PW
[Magisk] Raskaipika:
GOOD NEWS!!!!!!

I've restored the boot backup from TWRP recovery and then reboot the phone without luck, but then from the bootloader I've flashed the lineageos recovery for my OS version (04092022) and when I've rebooted the phone, the smartphone has booted without problems.

This time I've flashed the boot partition from bootloader with the command "fastboot flash boot ./lineage..." instead of "fastboot flash boot_b ./lineage...."

Yes, the LineageOS has a recovery file to download when you install the system and the OTA updates install it too each time that you update the system, because of that, each time that I update the phone with a new OTA (each Saturday for my phone), I've to install the TWRP modded recovery (Nebrassy's modded version with FBE support), extract it from the recovery, patched with magisk app and flash the recovery patched by magisk from the bootloader.

Thanks guys for your help, I will update to the lastest version (from yesterday and repeat all the process that I did weekly) and check if everything works again like ever, with TWRP modded version and magisk support.
[Magisk] zgfg:
Generally, you don't need to specify boot_a or boot_b when flashing - fastboot knows well which slot is currently active (while you could make a mistake and flash to the wrong one)
[Magisk] zgfg:
For those who want to hide USB debugging from Momo, and still want to use ADB:

Momo checks the prop init.svc.adbd

The prop can have two states, stopped or running.

Normally, when adb daemon is running, state is running and Momo complains about USB debugging

You can mock Momo by resetting the prop (it's not read-only prop)

setprop init.svc.adbd stopped

By setting the prop to stopped, Momo will no more complain that USB debugging is enabled

However, you can still use ADB - adb command will seamlessly restart the daemon (hence, after using ADB, you will need to reset init.svc.adbd back to stopped if you again want to mock Momo)

---

Now, to put init.svc.adbd to the stopped state automatically upon reboot, I utilized the service.d script from the installed USNF module:

/data/adb/modules/safetynet-fix/service.d

by adding an additional late prop reset (must be upon the ADB daemon is started, otherwise the daemon when starting will overwrite the prop to running):

resetprop init.svc.adbd stopped

---

(Alternatively, you could all together disable USB debugging from Developer menu and reboot - but then, whenever you really need ADB, you will have to reopen Developer menu, re-enable USB debugging and reboot before running ADB

With the trick as above, you have ADB ready to use but with Momo not complaining that USB debugging is enabled)

---

Screenshots attached

Screenshot demonstrating that ADB still works was taken from the other phone, connected by two-sided USB-c cable, by using the Magisk module ADB and Fastboot for Android NDK (but I can use ADB also from a PC, just I was lazy to go to the desk, start PC, etc)
[Magisk] pndwal:
Well done... A load off!...

Incidentally, you could likely use Magisk's inbuilt Install to Inactive Slot, where "out-of-the-box OTA installation works seamlessly and Magisk can be preserved after the installation" (as long as John's instructions are followed carefully) for future OS updates since device is A/B... It's recently been fixed (Doc updates pending).

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

You may like to try / confirm this works... PW
[Magisk] Raskaipika:
Hello again, well, I can confirm that now works like a charm (like ever did) and I've been able to update to the last version available (form yesterday), install the TWRP modded with FBE and apply Magisk without problems.

I confirm too, that the problem was caused by me, let me explain, like I've said at my first post requesting help from the gurus of this forum, the last week, I did the process for first time from my Linux PC, and everything was related with the permissions of the boot.img patched by magisk when I copied it from the phone to my PC using the GUI of the PC. For a reason that I don't know, the file has the wrong permissions, and when I've checked them comparing against with the recovery downloaded from Internet, they were different, doing a "chmod 664" to the twrp patched by masgisk BEFORE to flash it, was the trick.

About the option that you mention, use the "Install to inactive Slot", I can't use it, because like I've said, I've to reflash the recovery each time that I install an OTA update, because LineageOS install a recovery too that I don't like because it has not cool features like TWRP and the most important thing, doesn't have a FBE compatibility, if this won't be the case, I will make use / try of the restored feature of Magisk.

One more time, THANK YOU SO MUCH guys for your time and help.

Kind of regards.

P.S.: I only want to share that each time that I apply an OTA from LineageOS, I don't uninstall Magisk or disable the modules, I apply the OTA directly and this method has worked for me ever, with this smartphone and with the Xiaomi Mi A1 (mother's phone) that is an A/B device too, but this is FDE instead.
[Magisk] zgfg:
Be cautious with the modules. If you have a Magisk module that was developed for the particular ROM version (eg, could be Smali), after the ROM update and reinstalling the Magisk it could cause bootloop.

One should better disable that module(s) before updating

However, if you have TWRP that supports Data encryption, you can easily fix it (by placing a file named disable to the module's folder), but without TWRP you might have problems to get rid of
[Magisk] pndwal:
I'm reading reports that late MIUI devices no longer directly boot to Safe Mode using old key combo. Users report need to boot to Recovery mode, then select Safe Mode from the menu...

This means that Magisk cannot detect the standard Safe Mode key combo and modules are not disabled even when Safe Mode has been activated, so users cannot use this method to restore boot when modules are incompatible.

@zgfg, please could you confirm this w/ Mi 11 Lite 5g?

👀 PW
[Magisk] asripath:
Tried recently on Raphael to boot into safemode with keycombo was not successful...saw your post about key press after miui logo...did not try that...ended up installing magisk bootloop protector module as it seemed to be a better sure solution
[Magisk] pndwal:
(Raphael = Xiaomi Redmi K20 Pro/Mi 9T Pro)

Thanks.

Seems this may apply to earlier models than Mi 11 also after MIUI updates.

Old method / Magisk Safe Mode detection works for me (with carefully attention to keypress timing; Safe Mode can be triggered without Magisk detection otherwise), but I haven't taken update to MIUI 12.5.2.0 yet... Still on 12.0.4.0.

I have @huskydg's Bootloop Protector also... May be a life saver for late MIUI users especially. 👍 PW

FWIW, I just added this to issue:

https://github.com/topjohnwu/Magisk/issues/4624#issuecomment-1101071004
[Magisk] pndwal:
See you got into group yesterday...

FWIW, Canyie is admin (group name), nu11ptr is UTF-� 😉 PW
[Magisk] asripath:
fwiw...

not on miui...

currently on custom rom...

sparkos 12.1
[Magisk] pndwal:
... wondering if it's more of an Android 12 change then... My Mi Pad 4 on LOS 18.1 still uses old key combo... LOS 19 is still immature for this, but I'll test (A12) eventually... PW
[Magisk] zgfg:
Are you referring to MIUI 13?

Also, from your description it looks like it may need stock Recovery

Hence, I have Xiaomi 11 Lite 5G NE (Lisa, not Renoir without "NE"), with MIUI 12.5.7 (did not upgrade to MIUI 13) and custom recovery

Safe mode works normal for me (Vol- boots directly to Safe Mode) and disables all Magisk modules
[Magisk] pndwal:
I read of users w/ Mi 11 Pro and others where key combo doesn't work, and they now have S/M via Recovery.

I saw 11 Pro and 11 Lite have LV A11, so I assumed it may be a MIUI 12.5 thing... Now it seems these may be updated to A12 (MIUI 13), and that it's affecting those w/ custom A12 ROMs also. (It doesn't affect My Mi Pad 4 w/ A11, LOS 18.1.)

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

Thanks for confirming key combo still works on Xiaomi 11 Lite 5G NE / Mi 11 LE with MIUI 12.5 / A11. 👍 PW
[Magisk] zgfg:
For the matter of fact I screwed up the whole phone with the Safe Mode. Lost home screen organization and folders on, widgets, now I see that half of my photos got lost somewhere (they do not appear in Gallery neither can see them by MiXPlorer in DCIM folder), etc.

Already wasted 1,5 hr to fix this is, still just finding more and more issues

Bull****, not Safe Mode