Magisk v22.0 Patch Image - Magisk in Recover - Xiaomi Mi 9T (davinci) not being installed - Magisk

Hopefully someone can help me out here:
I'm on Mi 9T (davinici) with xiaomi.eu-cROM 12.1.2 (Stable) and OrangeFox Beta R11.0 Recovery. Bootloader is obviously unlocked.
I followed the guide for Magisk v22.0 and installed the apk first, opened it and it says
"Ramdisk No"
Alright, so I have to patch the recovery.img.
In Orangefox Recovery I open the Terminal and extract recovery.img with
Code:
dd if=/dev/block/bootdevice/by-name/recovery of=/sdcard/recovery.img
Reboot to system and I chose "Install" in Magisk, "Recovery Mode" is already selected, click "Next" and I select the newly created file "recovery.img". Magisk does it's thing and I have "magisk_patched_cOdEy.img" in my Download folder which I pull with adb.
I reboot to fastboot mode and
Code:
fastboot flash recovery magisk_patched_cOdEy.img
which works w/o problems and reboot again.
But when I open Magisk it still says it's not installed.
So, I check the guide under Magisk in Recovery, where it gets really confusing, but from what I got is that I need to start the phone with recovery button combo (Power+VolUp for Mi 9T) pushed and release at splash screen so Magisk is activated. I try this multiple times since it's really hard with the timing (milliseconds too long it kicks me into fastboot mode. idk why).
Can someone figure out what went wrong/what I did wrong? Never had problems with earlier Magisk versions.
Follow up question: There's some warning about going back to stock recovery will brick your phone in installation. Does that include installing OrangeFox again? I'm 95% sure it doesn't, but would be nice to know before I do it.

Some Xiaomi devices have their bootloaders set up so that it will accept an initramfs that was manually added to the boot image. Therefore, on these devices you'll need to patch the boot image even though there's no ramdisk. Try that.

Didgeridoohan said:
Some Xiaomi devices have their bootloaders set up so that it will accept an initramfs that was manually added to the boot image. Therefore, on these devices you'll need to patch the boot image even though there's no ramdisk. Try that.
Click to expand...
Click to collapse
Can I reinstall OrangeFox or TWRP recovery then?
I'll report back, when I tried it.
edit: So this actually works and I was able to enter TWRP recovery again after flashing.
edit 2: Now WiFi is not working anymore. fml.
edit 3: For anyone stumbling over this thread. Nothing worked, I had to do a compelte wipe and then flash Magisk "the old way", by renaming the .apk into a .zip and flashing it in recovery. That did the trick without any probems and I'm rooted now after quite a hassle.

yeah, I stumbled upon it. And I'm having the same/a very similar issue. I was very happy with Magisk up to v22 when the problems began.
I'm still at DerpFest based on Android 9.0 (from 2019 ) and TWRP-3.4.0.0.I had Magisk running since it was 19.4, upgraded it multiple times already. So didn't think much about updating to 22. Then, it said the same: no ramdisk. Pitty. OK, so I went ahead and let Magisk patch the TWRP.img I still got on my phone and flashed the patched TWRP onto recovery. Upon booting, Magisk is there, but no wifi, no sound, no light sensor, ... LTE works, though .
Anyways, I just want to get my old setup back, so I thought, I just flash the original TWRP again. According to the Magisk documentation, if I don't press any button, it should boot to Android without Magisk. Well, it always boots into Android+Magisk disregarding that. If I flash the original TWRP.img back, I always end up in TWRP. So, the order is: boot.img -> magisk-modified-recovery.img -> (boot.img?) -> system. How can I get the behaviour Magisk advertises?
And yes, I tried uninstalling Magisk (via uninstall.zip meythod), which said it would uninstall, but actually didn't. I also flashed different boot images (a backup I had in TWRP, the original boot.img I've found in the DerpFest zip...) to no avail.
So, Immortal68, which of the many wipes one can do did result in the old behaviour? And: now that you have Magisk22, does it say "Ramdisk: yes" again?

Related

Magisk Canary + Pixel 4 XL + Android 11 = stuck at boot

I hope this is the right place to ask, pardon me if not:
Issue: After upgrading to Android 11, the patched boot image causes bootloop, when patched using Magisk Canary
Phone/setup: Pixel 4 XL, updated today to Android 11 using OTA, which strangely enough worked just fine. Previously used the usual Magisk build, but grabbed Canary for this stuff. I'm flashing using latest ADB tools via download straight from Google + using original Pixel cable which so far has worked great with fastboot. Fastboot devices -l reports the phone.
Approach:
Flash-all.bat without -w, boots fine, all in order = boots fine, all in order
Extract boot.img, move to phone
Download latest Canary build straight from github front page, moditfy boot.img, transfer image to pc
ADB reboot bootloader, fastboot flash boot modified-image
Outcome: Stuck in boot - makes it to the "G" logo with the spinning line below. Left like that for 20 minutes, no change.
Approach two:
Flash-all.bat without -w, boots fine, all in order = boots fine, all in order
Extract boot.img, move to phone
Moditfy boot.img, transfer image to pc
ADB reboot bootloader, fastboot flash boot_a modified-image, fastboot flash boot_b modified-image
Outcome: Stuck in boot - makes it to the "G" logo with the spinning line below. Left like that for 20 minutes, no change.
Any idea what I'm doing wrong?
EDIT: Solution here! https://forum.xda-developers.com/showpost.php?p=83499831&postcount=23
delanvital said:
I hope this is the right place to ask, pardon me if not:
Issue: After upgrading to Android 11, the patched boot image causes bootloop, when patched using Magisk Canary
Phone/setup: Pixel 4 XL, updated today to Android 11 using OTA, which strangely enough worked just fine. Previously used the usual Magisk build, but grabbed Canary for this stuff. I'm flashing using latest ADB tools via download straight from Google + using original Pixel cable which so far has worked great with fastboot. Fastboot devices -l reports the phone.
Approach:
Flash-all.bat without -w, boots fine, all in order = boots fine, all in order
Extract boot.img, move to phone
Download latest Canary build straight from github front page, moditfy boot.img, transfer image to pc
ADB reboot bootloader, fastboot flash boot modified-image
Outcome: Stuck in boot - makes it to the "G" logo with the spinning line below. Left like that for 20 minutes, no change.
Approach two:
Flash-all.bat without -w, boots fine, all in order = boots fine, all in order
Extract boot.img, move to phone
Moditfy boot.img, transfer image to pc
ADB reboot bootloader, fastboot flash boot_a modified-image, fastboot flash boot_b modified-image
Outcome: Stuck in boot - makes it to the "G" logo with the spinning line below. Left like that for 20 minutes, no change.
Any idea what I'm doing wrong?
Click to expand...
Click to collapse
Pixel 4a here, just tried to follow OTA instructions and ended up bootlooped until I paused it. After resuming it rebooted but the update didn't take and magisk was uninstalled. I did have the safetynet fingerprint module installed so probably this caused an issue? Not sure it relates exactly to your problem but thought I'd chime in with a similar problem and model.
EDIT:
After this reboot where I lost magisk I retried the OTA and it succeeded. I then tried to flash the patched boot.img in fastboot but it failed now I'm endlessly bootlooping.
EDIT 2:
tried a couple things but couldn't get 11 to boot so I flashed back to 10 but wiped my userdata so I'm done messing around for awhile I think 11 just is a no go for now.
ReservedName said:
Pixel 4a here, just tried to follow OTA instructions and ended up bootlooped until I paused it. After resuming it rebooted but the update didn't take and magisk was uninstalled. I did have the safetynet fingerprint module installed so probably this caused an issue? Not sure it relates exactly to your problem but thought I'd chime in with a similar problem and model.
Click to expand...
Click to collapse
On Android 10, when booting Magisk in the core only mode, I would still fail the ctsProfile. I would never complete safetynet 100%. I am not sure what should be possible, but it seems some ppl can make it pass safetynet on Android 10 by running Magisk in core only mode. When upgrading to Android 11, and before flashing any boot.img, but after installing Canary build, I would still fail the ctsProfile part of the satefy net. I wonder if that somehow impacts.
If wonder if the issue is linked to the fingerprint. I also have the fingerprint module (where it allows apps to believe it's using a fingerprint, but in fact it's my face). I will try and remove all the modules, then uninstall Magisk, then reinstall Canary build. Cheers mate.
delanvital said:
I hope this is the right place to ask, pardon me if not:
Issue: After upgrading to Android 11, the patched boot image causes bootloop, when patched using Magisk Canary
Phone/setup: Pixel 4 XL, updated today to Android 11 using OTA, which strangely enough worked just fine. Previously used the usual Magisk build, but grabbed Canary for this stuff. I'm flashing using latest ADB tools via download straight from Google + using original Pixel cable which so far has worked great with fastboot. Fastboot devices -l reports the phone.
Approach:
Flash-all.bat without -w, boots fine, all in order = boots fine, all in order
Extract boot.img, move to phone
Download latest Canary build straight from github front page, moditfy boot.img, transfer image to pc
ADB reboot bootloader, fastboot flash boot modified-image
Outcome: Stuck in boot - makes it to the "G" logo with the spinning line below. Left like that for 20 minutes, no change.
Approach two:
Flash-all.bat without -w, boots fine, all in order = boots fine, all in order
Extract boot.img, move to phone
Moditfy boot.img, transfer image to pc
ADB reboot bootloader, fastboot flash boot_a modified-image, fastboot flash boot_b modified-image
Outcome: Stuck in boot - makes it to the "G" logo with the spinning line below. Left like that for 20 minutes, no change.
Any idea what I'm doing wrong?
Click to expand...
Click to collapse
Same here, and after the Glogo, if I restart I get ""no valid slot to boot". Flashing unpatched boot.img gets me back in, but there doesn't seem to be a way to root 11 release build?
Works fine on my Pixel 4 xl. I'm using a patched boot img. Make sure you use the correct boot img
cgo72123 said:
...if I restart I get ""no valid slot to boot". Flashing unpatched boot.img gets me back in...
Click to expand...
Click to collapse
Google Store Pixel 4a here. I have the exact same experience. Tried:
2. Uninstall Magisk -> Install OTA -> Install Inactive Slot -> bootloops 3 times and settles on previous boot slot, Android 10, no Magisk
3. Patch Boot.img -> flash-all.bat -> fastboot flash boot magisk_patched.img -> fastboot bootloop with the message "no valid slot to boot"
Can confirm re-flashing stock boot.img or running the full update script successfully boots Android 11, no root of course
Pixel 4 XL user here. I updated to Android 11 last night. Same thing happened to me. Waiting for an update to Magisk for Android 11
ChocoboX said:
Pixel 4 XL user here. I updated to Android 11 last night. Same thing happened to me. Waiting for an update to Magisk for Android 11
Click to expand...
Click to collapse
I noticed a new buildof Magisk available in the manager. New modified boot image has a slightly different filesize. Tried fastboot boot magisk_patched.img but still stuck on G and the moving line below. I wonder what is different compared to the 4xl users who has no problems...
Just want to point out that a common cause for issues when updating from one Android version to another is incompatible mods.
Make sure that no Magisk modules are installed that could be causing issues. Uninstalling the modules before updating, uninstalling Magisk, manually deleting the module directories in /data/adb/modules (or the whole modules directory) or wiping /data would all be ways of accomplishing this...
This might not be true for everyone, but it's quite likely.
Edit: Oh yeah... And don't install TWRP. Only booting it seems to be fine though.
I got it to work !!! Pixel 4 XL user. Might work on other Pixel phones / non-Pixel phones as well.
You need to download Magisk Canary apk first.
Try this post https://www.xda-developers.com/latest-magisk-canary-release-adds-support-for-android-11/
Here is the trick, you need to set the update channel in the settings to Canary Debug. Just Canary won't work and won't show any updates!
Then you will see immediately that a new version is available for manager and Magisk. Update the manager first. Then install Magisk to boot.img. Flash and there you go. I even got modules working and GPay works and even the CTS profile works! previously that failed on me (despite trying the settings recommended and Terminus commands with Busybox)
does not work
ChocoboX said:
I got it to work !!! Pixel 4 XL user. Might work on other Pixel phones / non-Pixel phones as well.
You need to download Magisk Canary apk first.
Try this post https://www.xda-developers.com/latest-magisk-canary-release-adds-support-for-android-11/
Here is the trick, you need to set the update channel in the settings to Canary Debug. Just Canary won't work and won't show any updates!
Then you will see immediately that a new version is available for manager and Magisk. Update the manager first. Then install Magisk to boot.img. Flash and there you go. I even got modules working and GPay works and even the CTS profile works! previously that failed on me (despite trying the settings recommended and Terminus commands with Busybox)
Click to expand...
Click to collapse
i have the same versions but do not see the Canary Debug.
currently it is not working
There's only been one Canary channel for some time (and it's the debug release, even though it doesn't say so in the Manager). If anyone is using a Manager that has both a "Canary" and a "Canary Debug" channel they're using an old build of the Manager. And on such a build, the regular "Canary" channel won't work since it no longer exists.
chaim said:
i have the same versions but do not see the Canary Debug.
currently it is not working
Click to expand...
Click to collapse
Ok, I found the correct link to download Magisk Canary apk
https://forum.xda-developers.com/pixel-4-xl/how-to/android-11-beta-1-jun-2020-t4113249
It's an older version but once you switch to Canary Debug it should show correct updates. For there things worked for me.
Also, I'm attaching a link to download the Magisk boot image for Android 11 directly, in case you want to skip this whole process. Just flash it with Fast Boot
https://1drv.ms/u/s!Ark6wHh1kVRCg9NyWPCCeqtpfT4XUA?e=oRse0J
Does Soli work or do you need to download that module too?
rester555 said:
Does Soli work or do you need to download that module too?
Click to expand...
Click to collapse
What is Soli? Sorry for the dumb question. I can try and see.
It's the RF based motion sensor in the front of the phone that turns on active display and swipes in front of the display to control the phone.
rester555 said:
It's the RF based motion sensor in the front of the phone that turns on active display and swipes in front of the display to control the phone.
Click to expand...
Click to collapse
I'm in the US already so it works without a problem for me. I also tried to install Enable Soli from GitHub and it installed and phone booted. Not sure how to test it further for you.
Just so that there's no confusion...
The correct (and only) place to get the Magisk installation zips and Manager apks is always going to be on John's GitHub.
Here's the (current) link to the up-to-date Canary Manager:
https://raw.githubusercontent.com/topjohnwu/magisk_files/canary/app-debug.apk
But, if in doubt, always go to the above linked GitHub to get the latest downloads.
Downloading from anywhere else might mean that you are installing an altered (possibly maliciously) root Manager. Don't take the risk...
magisk_patched.img
what command do you use to flash it
i use:
./fastboot flash boot magisk_patched.img
and i gets stuck in bootloop
chaim said:
can anyone upload the magisk_patched.img for pixel 4xl
Click to expand...
Click to collapse
While I don't mind sharing my patched.img, just remember that TJW always recommends that users should patch their own boot.img so as to avoid any potential problems. Having said that, here you go :good:
https://drive.google.com/file/d/15fWU492AQ3eBJCgMGWe2wgc5J2b4MSPu/view?usp=drivesdk

Oneplus 7T bootloop for new magisk (with solution for booploop)

So, i updated magisk (version 21? EDIT: manager was set to upda te to beta, but 20.4 also bootloops :/ ). Before rebooting, also installed to inactive slot, cause.... If you can do it after a OTA update, why not doing it normally, right? Bootloop. Have to press both the power button and VOL up for it to turn off. Usually just the long press on power buttton would do the trick.
Oneplus 7T OOS 10.012 EU
SOLUTION for the bootloop:
- Installed TWRP 3.4.0.2
- Because it cannot access data partition nor transfer files via USB, i did adb push -p local-pc-file-here /tmp
- So, i installed OOS 10.0.13 from there and it booted fine, however without magisk even tough i installed it from /tmp as well right after the ROM install without reboot.
- Tried to reinstall magisk from TWRP (had to reinstall it too, as OOS deleted it), but it bootlooped again. So, i'll wait for a boot file with it.
Executing Magisk-uninstaller-20201003.zip on TWRP did NOT work, cause it couldn't mount the necessary partitions.
EDIT: I have no magisk modules, so i don't know why all of this mess :/
If magisk was already installed on the inactive slot before you patched it, the boot image gets corrupted (at least it always does on my 7T). Really shouldn't use the ota patch feature if you're not installing an ota
Allen77777 said:
If magisk was already installed on the inactive slot before you patched it, the boot image gets corrupted (at least it always does on my 7T). Really shouldn't use the ota patch feature if you're not installing an ota
Click to expand...
Click to collapse
Gotcha! All good now. BTW, if anyone needs, there's a patched boot file on 7T's forum for 10.0.13 EU.
I have the same issue with 10.0.13 HD65AA.
First I tried to do the full update like usual with installing Magis 21 into both slots before reboot but then I got stuck on the boot animation.
Tried a lot of things until I found this thread here. Once I got into TWRP I pushed the latest ROM over to the phone and installed it and I could get back into my phone again. But once I tried to install Magisk via TWRP or boot the patched image for 10.0.13 HD65AA from XDA I get stucked in the boot animation again. So I had to once again push the ROM to the phone and install it into the second slot and once again my phone boots again.
So for whatever reason there is an issue with Magisk and both 10.0.13 HD65AA and HD65BA. So at least for me for now no root.
Thank you very much for at least getting into my phone again without losing any data. :good:

Does patched boot.img Magisk work on MIUI V12.5.1.0? (Edit: Yes it does!)

Just curious if anyone has any insight as to whether I can use the Magisk app to patch the newest boot.img (12.5.1.0 global / Android 11 / mi9t pro) and whether it will go smoothly if I install it via fastboot flash boot patchedmagiskhere.img?
I just updated the device using the clean_all mode on MiFlash and everything looks to be working fine;
No TWRP or custom recovery installed
Bootloader in unlocked state
As the update is so new I just wanted to check if anyone had any experience before I go ahead. There's also the old method of flashing magisk as a .zip via TWRP which is now 'depreciated'. As the device says 'Ramdisk NO' it implies Magisk may need to be used in 'recovery mode' (i.e. patched recovery.img and vol+power on every boot) but it worked just fine in MIUI11 so I don't think that's right.
Update: If you've come here looking to find out how to do this then I added instructions in this post.
Can't find answers so I might try fastboot boot patched_magisk.img later today. In theory this'll let me test a patched boot.img instead of going in blind with fastboot flash boot patched_magisk.img so that the boot.img isn't flashed, just booted. If it works I assume I can probably just select Direct Install in Magisk.
droident said:
Can't find answers so I might try fastboot boot patched_magisk.img later today. In theory this'll let me test a patched boot.img instead of going in blind with fastboot flash boot patched_magisk.img so that the boot.img isn't flashed, just booted. If it works I assume I can probably just select Direct Install in Magisk.
Click to expand...
Click to collapse
Hey let me know if you find a solution for this.
I upgarded to this version via TWRP last night. Tried flashing Magisk via TWRP and it kept boot looping into TWRP.
Had to re-flash the rom again in order to boot into the system.
I tried patching the stock recovery image but couldn't get the system to boot into Magisk mode. Tried the Volume Up + Power and let go on splash screen combo but it kept going to stock recovery.
Any help would be appreciated. I'll go crazy having to use the phone without root.
Update: I tried what you mentioned. Manually booting patched boot image. No luck. After showing the MIUI logo for a long time it goes back to recovery. I guess it's basically the same as flashing via TWRP.
shajman said:
Hey let me know if you find a solution for this.
I upgarded to this version via TWRP last night. Tried flashing Magisk via TWRP and it kept boot looping into TWRP.
Had to re-flash the rom again in order to boot into the system.
I tried patching the stock recovery image but couldn't get the system to boot into Magisk mode. Tried the Volume Up + Power and let go on splash screen combo but it kept going to stock recovery.
Any help would be appreciated. I'll go crazy having to use the phone without root.
Click to expand...
Click to collapse
For Xiaomi, always patch BOOT img, not Recovery.
Do not tick Recovery option and flash to Boot partition.
Guides can be found elswhere
Important that you patch the boot img corresponding to your CURRENTLY using stock firmware (if you upgraded, you have to extract and patch its boot.img, not some older or from different Global vs Chinna or else)
zgfg said:
For Xiaomi, always patch BOOT img, not Recovery.
Do not tick Recovery option and flash to Boot partition.
Guides can be found elswhere
Important that you patch the boot img corresponding to your CURRENTLY using stock formware (if you upgraded, you have to extract and patch its boot.img, not some older or from different Global vs Chinna or else)
Click to expand...
Click to collapse
This is what I have always done (patching boot). However it does not seem to be working with v12.5.1.0
I've just tried the Canary build of Magisk as well and no luck. The MIUI splash screen stays on for a while and then it goes to Recovery.
This never happened with any of the previous ROMS (Android 10)
Not sure if I'm doing something wrong.
shajman said:
This is what I have always done (patching boot). However it does not seem to be working with v12.5.1.0
I've just tried the Canary build of Magisk as well and no luck. The MIUI splash screen stays on for a while and then it goes to Recovery.
This never happened with any of the previous ROMS (Android 10)
Not sure if I'm doing something wrong.
Click to expand...
Click to collapse
You may have modules installed and enabled, that do no more work with the new firmware
If you didn't wipe/format Data, modules are still in: /data/adb/modules
(updating firmware does not affect there)
Use TWRP, go to that folder and add an empty file named: disable
(exactly as that), to each subfolder (each subfolder corresponds to one module, you may recignize them by folder names)
Then reboot with the patched boot.img
Later, manage your modules (enable, uninstall, update) from Magisk app (once you successfully boot to Magisk)
zgfg said:
You may have modules installed and enabled, that do no more work with the new firmware
If you didn't wipe/format Data, modules are still in: /data/adb/modules
(updating firmware does not affect there)
Use TWRP, go to that folder and add an empty file named: disable
(exactly as that), to each subfolder (each subfolder corresponds to one module, you may recignize them by folder names)
Then reboot with the patched boot.img
Later, manage your modules (enable, uninstall, update) from Magisk app (once you successfully boot to Magisk)
Click to expand...
Click to collapse
You Sir are an absolute LIFE SAVER!!!!!!!
Thank you!
I also patched magisk just fine . Thanks guys for sharing your experiences; it kinda reassured me it'd probably work - I was thinking booting a patched magisk boot.img might be safer so I did that first and it booted as expected. So I just returned to fastboot and flashed it properly. Installed a few modules (the essentials; ACC, Energized, Busybox), rebooted, we're all good ^_^
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
I think it's already been explained above me but for anyone who hasn't figured it out yet:
Find the recovery zip or fastboot files you updated with (if you don't have them still then go here but use the *exact* region and version - if your device isn't raphael then don't use these), open with 7zip/winrar/whatever and copy the boot.img from them to any folder on your phone. Open Magisk Manager, browse for where you copied it to and patch it; recovery mode box unticked. Then look for Magisk_patched_xxx.img (xxx part being whatever Magisk called it) in your /Downloads folder on your phone. Copy it back to your PC, fire up Tiny ADB & Fastboot.
Do a test-run with fastboot boot Magisk_patched_xxx.img first. If it boots up fine and Magisk shows as working, commit the changes by returning to fastboot with adb reboot fastboot and then the command fastboot flash boot Magisk_patched_xxx.img. Then power it up.
If the temporary boot test-run didn't work, obviously don't execute the flash boot command; power-cycling the phone will get it unstuck.
I should probably note I don't have TWRP (using stock recovery) and I don't know how that factors into this. This was done the day after a clean_all fastboot flash; read previous posts if you've used Magisk previously and updated with your data intact.
I would like to add here to use the boot.img patch method. Flashing magisk as a zip through the recovery will cause a bootloop.
Tested this on my Mi 9T Pro (12.5.1 global) with system encryption enabled.
FPSUsername said:
I would like to add here to use the boot.img patch method. Flashing magisk as a zip through the recovery will cause a bootloop.
Tested this on my Mi 9T Pro (12.5.1 global) with system encryption enabled.
Click to expand...
Click to collapse
I was tempted to do the same because it's the conventional way of installing Magisk and it's how it's always been installed.
That and mucking with something called boot.img sounds like a one-way trip to brick-street. I.e. boot.img makes me think bootloader or in other words, bad news. Although from what I've heard it turns out you can completely screw up the boot.img and you should still have access fastboot and recovery modes. But I didn't run into any problems flashing a new boot.img so I didn't find out .
droident said:
I was tempted to do the same because it's the conventional way of installing Magisk and it's how it's always been installed.
That and mucking with something called boot.img sounds like a one-way trip to brick-street. I.e. boot.img makes me think bootloader or in other words, bad news. Although from what I've heard it turns out you can completely screw up the boot.img and you should still have access fastboot and recovery modes. But I didn't run into any problems flashing a new boot.img so I didn't find out .
Click to expand...
Click to collapse
Men, patching the images is nothing new or exotic.
If you ever read Magisk guide from TJW (the aurhor of Magisk) you would well know that the method has been described there for many years (I personally used the method back since 2018 on other phones)
Besides, it has many practical advantages - if anything goes wrong you just flash the original (unpatched) image
Or, when Magisk updates (unfortunately, it does no more and who knows would it ever again, at least from the established channels like Stable or Canary), if there is a problem with the new Magisk - you just flash your previous version of img that was patched with the working version of Magisk and you are back in business
And there is also nothing impractical here - if you have proper TWRP (you do have for this phone) you don't need to flash the patched img from fastboot but simply from TWRP
You can also use TWRP backup boot.emmc.win instead of extracted boot.img - simply give boot.emmc.win to Magisk for patching (you don't need to rename it) and then flash it
So, guys, did the patched boot image worked for you? for me it did not boot up... :/
HValenti said:
So, guys, did the patched boot image worked for you? for me it did not boot up... :/
Click to expand...
Click to collapse
Of course it does work. But read carefully above. If you just upgraded without Factory reset, and if you had Magisk before, some modules (that remained installed to /data) may cause you the bootloop
And/or, you have to patch exactly the boot.img corresponding to your current firmware, not some from an older A10, etc
In such case, how do you remove the magisk modules after the update? Without root, there is no access to modules.
HValenti said:
In such case, how do you remove the magisk modules after the update? Without root, there is no access to modules.
Click to expand...
Click to collapse
Why don't you read the previous messages in this thread - post #6
Or see:
zgfg said:
Yes, it was asked/answered several times but let it be answered again
Besides adb, there are two other ways of disabling (or even uninstalling) the remained modules
You have to flash your patched boot.img, then
a) Reboott to Android Safe mode, then reboot again to 'normal' mode.
All modules will be disabled but also you will have to re-enable Magisk Hide again
b) Use TWRP (if appropriate for your device), Advanced, File Manager, go to /data/adb/modules and to each folder (foder = module, you can recognize modules by folder names or by reading the textual file module.prop you will find inside) put a file that must be named: disable (exactly as that)
Click to expand...
Click to collapse
Or simoly read the Magisk Wiki, available from Magisk Github (linked from Magisk app):
Module Issues:Magisk and MagiskHide Installation and Troubleshooting guide
www.didgeridoohan.com
zgfg said:
For Xiaomi, always patch BOOT img, not Recovery.
Do not tick Recovery option and flash to Boot partition.
Guides can be found elswhere
Important that you patch the boot img corresponding to your CURRENTLY using stock firmware (if you upgraded, you have to extract and patch its boot.img, not some older or from different Global vs Chinna or else)
Click to expand...
Click to collapse
My Ramdisk says "no" should I still patch boot.img?
not sure how to delete. It does work
Vanmanman said:
My Ramdisk says "no" should I still patch boot.img?
not sure how to delete. It does work
Click to expand...
Click to collapse
It says for everybode on MUII No for Ramdisk but it was discussed snd written everywhere and zillion times that Xiaomi users have to patch boot img
Can I somehow extract boot.img from phone without custom recovery and root?
Rejerf said:
Can I somehow extract boot.img from phone without custom recovery and root?
Click to expand...
Click to collapse
Download the full OTA for your phone, and from it, you can extract the boot.img.
Link for the OTA download and instructions on how to do it is provided here: https://forum.xda-developers.com/t/...-5-1-0-edit-yes-it-does.4299669/post-85271375
Please does someone upgraded succefully from 12.0.5.0 to 12.5.1.0 with root and without wiping data ?
If yes, how did you flashed the 12.5 ROM because TWRP recovery does no support MIUI 12.5 A11 encryption, so I guess flashing it from TWRP is not recomanded.
I am quite afraid to be forced to wipe everything and preserve root is mandatory for me so I did not tried to upgrade for now.
Thank you in advance.

[SOLVED] What is going on?

I use a Redmi Note 7 (lavender) with LineageOS 18.1 with the LineageOS recovery. My device does not have ramdisk.
I decided to install Magisk. I followed the tutorial and flashed the Magisk recovery image to recovery using fastboot. When I boot with the recovery combination (Power + volume up) it does not boot into recovery, but if I long press volume up, it does. But the Magisk app says Magisk is not installed. Flashed again and it still didn't work. So I decided to uninstall it. Since the app did not detect Magisk, I renamed the APK into "uninstall.zip" and sideloaded it usng adb from the LineageOS recovery. That installed Magisk. Today,I decided to boot without Magisk, powering on my phone the usual way (long press Power), but Magisk still works. What is going on?
That's probably just a problem with the Installation Guide.
I just realized that if you flash the apk as a zip it installs Magisk onto boot and it worked, because I do have ramdisk, even ough Magisk tought me I don't.
You've likely got a type of device that doesn't have ramdisk in boot, but still accepts an added initramfs.
It's practically impossible to determine if this is the case, but generally Xiaomi devices are this way, so many Xiaomi users have to install to boot even though they have a "Type III" device (as described here: https://topjohnwu.github.io/Magisk/boot.html#piecing-things-together).

Magisk 25.2 severely breaks LineageOS 18.1 on Samsung Galaxy Tab S5e (SM-T725)

For some odd reason Magisk breaks auto-rotation and sets selinux to permissive on boot after updating to 25.2 (from 25.1).
This is not the first time Magisk messes up Selinux rules. I usuall solved this by making a fresh OS install already with patched boot and by installing the managing app afterwards.
However, this time autorotation stopped working for some reason. And when i try to uninstall Magisk using its app -- OS no longer boots, as if it fails to restore initial boot image.
This selinux problem began since v25.
I use latest official build of Lineage OS 18.1. I have TWRP installed, which i use to install LineageOS.
What am i doing wrong? Has anyone experienced such issues?
I posted the same problem here (did not notice/checked SELinux back then and sound is probably also not working), figured out that all sensors do not work, checked with "Sensor Test" app. I was already considering a separate thread, thus I'll continue here, because this issue definitely deserves a separate thread. Documentation is so scattered and sometimes so confusionly described, that it was hard to make sense of it all...
(Disclaimer: Although I have necessary experience with installing custom ROMs etc., everything stated below is at my own understanding ).
My device: Samsung Galaxy Tab S5e LTE
My goal was: TWRP, LineageOS and Magisk. How hard can it be?
Problems are that (most of the) Samsung devices do not have a "ramdisk" partition where Magisk is normally installed, also the increasingly complexity of encryption en integrity checks makes this more annoying.
First, let me retrace my steps, as far as I can.
When reading the TWRP page, we get a clue where to start: "You are therefore strongly advised to first root your device with Magisk and then pre-root a TWRP image before flashing it to recovery", this is because "Both TWRP and Magisk-rooted Android boot using the recovery kernel, with the device's hardware keys used to choose between TWRP and Android at boot time".
(Magisk "hijacks" part of the recovery partition, since the absence of a ramdisk partition.)
Spoiler: later on you learn this is not completely the case any more, but I would still recommend to hold on to this method, because the TWRP page also states that: "The usual path of installing TWRP prior to rooting is problematic on this device, because the Magisk installer does not support installation to recovery from TWRP. Furthermore, prior rooting of the device with Magisk carries the significant advantage of disabling various device protection mechanisms that you will otherwise need to take care of manually.", and it continues with more scary warnings...
1. Thus followed the Samsung section of the Magisk documentation to have the bootloader unlocked and Magisk installed, but stock firmware is still installed, no problem whatsoever.
Then decipher the already mentioned instruction: "...pre-root a TWRP image before flashing it to recovery". This apparently means that Magisk has to patch the TWRP image, just like as was done with the Samsung firmware.
2. Downloaded the *.tar file of TWRP, extracted the image, patched with Magisk and repacked to the *.tar file with 7-Zip in order to be able to flash it with Odin (see step 4).
*3. I do not recall when I installed the "VBMeta file", although this is instructed in the Lineage OS installation instructions, when following the TWRP instructions it says "...you can now jump to its own section", thus skipping it?? (I did it somewhere in the process...)
Unknown: whether it is still required to patch and flash VBmeta (to disable some verification process)...
4. Flash TWRP recovery, see YouTube video below. This video mentions the use of "multidisabler-samsung", which disables "FBE, proca, Vaultkeeper and auto-reflash of stock recovery on Samsung Pie devices". Current latest version was 3.1, downloaded from this XDA post, I think.
Just as in the YouTube video, I also was stuck at the Samsung logo. After booting into the stock firmware you can check if Magisk still works.
Not sure: "multidisabler-samsung" needed?
5. Install LineageOS (and GApps). The most straightforward step, just install LineageOS, read the instructions. Then install GApps (e.g., BiTGApps).
6. After booting (power and volume + button) and setting up LineageOS, a Magisk icon should be visible in the app drawer, click it and the Magisk app is installed, when opened, Magisk is setting up a few more things and reboots the tablet.
*******************************************************************************************
This is the point were you finally think you made it, but no, here the issues arise.
Issues thus being SELinux permissive status (Xandros Darkstorm), no sound and non-working sensors, thus "auto rotating" feature is not working.
At this point I started to regret my purchase...
In the search of a solution to the problem I stumbled upon the following familiar and solved Magisk issue #4911 (LineageOS 18.1 no sound and no sensors after booting with Magisk), which refers to issue #4394 (Magisk > 21.4 is difficult to install on LineageOS (18.1) with TWRP (Direct Install not enabled unless you use old zip)).
In short: this post mentioned patching the boot image instead of the recovery image.
*******************************************************************************************
I. I extracted "boot.img" from the LineageOS zip file, patched it via Magisk (ramdisk is added to the boot image) and replaced the "boot.img" in the zip file with 7-Zip.
II. Booted into TWRP, flashed an original TWRP image, so recovery is replaced. (Rebooted I guess.)
III. Then wiped previously LineageOS installation and, flashed the LineageOS zip file with patched boot image and GApps and rebooted to system.
IV. After setting up, install Magisk, let is do its thing.
V. I installed "Root Checker Basic" in order to check I gained root checker. It was a PASS! And checked with "Sensor Test" if all sensors worked, they did! And sound also worked .
Yay!
Clearly, all of this can be optimized. Some questions remain, what steps are really necessary and I am also still wondering how to apply a LineageOS update... Anyhow at least it is working.
What resolved
Xandros Darkstorm said:
For some odd reason Magisk breaks auto-rotation and sets selinux to permissive on boot after updating to 25.2 (from 25.1).
This is not the first time Magisk messes up Selinux rules. I usuall solved this by making a fresh OS install already with patched boot and by installing the managing app afterwards.
However, this time autorotation stopped working for some reason. And when i try to uninstall Magisk using its app -- OS no longer boots, as if it fails to restore initial boot image.
This selinux problem began since v25.
I use latest official build of Lineage OS 18.1. I have TWRP installed, which i use to install LineageOS.
What am i doing wrong? Has anyone experienced such issues?
Click to expand...
Click to collapse
What fixed this for me is after re-flashing stock in Odin to get everything working again, just rename the magisk apk to install.zip and flash that in twrp, and open the magisk app once booted, no other steps needed for install, no image patching or anything.
Might be worth seeing if this is the same issue or if there's a more fundamental problem with 25.2
Hi,
I stumbled upon this thread while searching for a way to install Magisk on a S5e.
Following the guide here: https://wiki.lineageos.org/devices/gts4lvwifi/install I already unlocked the bootloader, flashed vbmeta.tar with Odin, flashed lineage-19.1-20221114-recovery-gts4lvwifi.img with Odin and flashed lineage-19.1-20221114-nightly-gts4lvwifi-signed.zip with TWRP-recovery.
Lineage is working fine, but I would also like to use Magisk.
I understood, that the order I follwed is not the recommended order for having both Magisk and Lineage. At least, that is, what you described at the beginning of your post.
But as with your last part you mentioned, that there where issues with sensors, ...
And the solution was to
I. Replace recovery with a patched boot.img of Lineage zip and wipe a prev. Lineage installation
I guess, I might be able to stiull do that though I already have Lineage on the S5e (currently with Lineage/TWRP recovery), right?
I can patch the boot.img from within lineage-19.1-20221114-nightly-gts4lvwifi-signed.zip with Magisk app, right?
Or would I have to patch lineage-19.1-20221114-recovery-gts4lvwifi.img
Is there anything to consider, when zipping the image with the patched boot.img again?
Which TWRP image did you choose to be flashed at step II.?
Barium said:
I. I extracted "boot.img" from the LineageOS zip file, patched it via Magisk (ramdisk is added to the boot image) and replaced the "boot.img" in the zip file with 7-Zip.
II. Booted into TWRP, flashed an original TWRP image, so recovery is replaced. (Rebooted I guess.)
III. Then wiped previously LineageOS installation and, flashed the LineageOS zip file with patched boot image and GApps and rebooted to system.
IV. After setting up, install Magisk, let is do its thing.
V. I installed "Root Checker Basic" in order to check I gained root checker. It was a PASS! And checked with "Sensor Test" if all sensors worked, they did! And sound also worked .
Yay!
Clearly, all of this can be optimized. Some questions remain, what steps are really necessary and I am also still wondering how to apply a LineageOS update... Anyhow at least it is working.
Click to expand...
Click to collapse
Thanks
If this is also a solution, can you please let me know, if there is anyhting to consider, when flashing the stock (got it from SAMMOBILE)? Can the lineage-19.1-20221114-recovery-gts4lvwifi.img still be left on the tab?
After re-flashing the stock, I guess you flashed lineage again, right?
Or did you stay with the stock and just flashed magisk (after renaming the apk to zip)?
Thanks
TheTofu said:
What fixed this for me is after re-flashing stock in Odin to get everything working again, just rename the magisk apk to install.zip and flash that in twrp, and open the magisk app once booted, no other steps needed for install, no image patching or anything.
Click to expand...
Click to collapse
I dared patching the TWRP recover for S5e and flashed it via Odin (AP).
S5e boots up in Lineage, Magisk is working fine.
But when I power off the tablet or restart, Lineage Recovery shows up telling me, that my data would be corrupt.
My only options are to try again or to do a factory reset.
Only way out of this is to re-flash the above mentioned recovery image again.
So how do I get the Magisk patched TWRP recovery permanent?
I wiped system? and re-flashed Lineage via TWRP, got "original" TWRP Recovery for S5e Magisk permanent.
I have to admid, I tried several things and got lucky I did not break something.
I had nearly, what I wanted - TWRP, Lineage and Magisk, but there were issues with the sensors (no auto rotate).
Again I helped myself:
1) flashed the original, unpatched TWRP Recovery for S5e
2) flashed unpatched Lineage for S5e
3) flashed MindTheGapps
4) flashed Magisk-v25.2.apk
No bootloop, original TWRP permanent, Magisks working fine, no issues with sensors.
Tried steps 1, 2 and 4 with the Lineage Recovery and it worked too.

Categories

Resources