[Guide] Magisk Modules Disabler for booting into Magisk core-only Mode

Tulsadiver

Recognized Contributor
Jul 11, 2013
7,761
5,476
253
Tools needed: boot.img extractor. I recommend the one created by osm0sis from this thread:
https://forum.xda-developers.com/sho....php?t=2073775

The first method was developed by osm0sis and removes magisk and all modules.
1. Unpack magisk_patched.img
2. Unzip overlay.dremove1.zip and place overlay.d folder in ramdisk folder.
3. Repack IMG
4. fastboot boot image-new.img created by repacking 8mg

This method is an offshoot of osm0sis version but boots core-only mode. Afterwards, remove the .disable-magisk file from the /cache folder for modules to work. Dot files are hidden files so if your root explorer can't see hidden files, run the "Remove disable_magisk" bat file in ADB.

1. Same as above but use the overlay.dcoreonly1.zip

For both methods you must be rooted for it to work. These are not cure all's for all bootloops.

Remove .disable_magisk bat file
https://www.androidfilehost.com/?fid=4349826312261684994

****************************************

Here is a fastboot bootable image to boot you into Magisk core-only mode in case you bootloop due to flashing a bad module and TWRP is not enough.

Once in fastboot:

fastboot boot image-newpixel3a.img

You will boot with root but modules disabled. After you remove the offending module you will need to go to /cache folder and delete the .disable_magisk file before your modules will work.

fastboot boot image-newpixel3aRemove.img

This one should remove magisk and all modules, then reboot and magisk should reinstall itself (ask to install necessary binaries). This is what osm0sis uses to recover from failed flashes. See this post:
https://forum.xda-developers.com/pi...odules-disabler-booting-magisk-t3976625/page2

Images are in this common folder. Pick the appropriate image for your phone.

6-4-20
https://www.androidfilehost.com/?w=files&flid=313291
 

Attachments

Last edited:

c_tho

Senior Member
Oct 25, 2012
350
170
73
Brisbane
oh my gosh would you believe i desperately needed this on tuesday and, after several hours spent trying unsuccessfully to get magisk manager for recovery working, ended up reflashing and starting again from scratch! crazy timing. anyway thanks for this, will definitely come in handy as i am too stupid to learn from my mistakes, ever.
 
  • Like
Reactions: Tulsadiver

Skittles9823

Recognized Contributor
Jan 9, 2015
1,809
2,041
113
22
Sydney
oh my gosh would you believe i desperately needed this on tuesday and, after several hours spent trying unsuccessfully to get magisk manager for recovery working, ended up reflashing and starting again from scratch! crazy timing. anyway thanks for this, will definitely come in handy as i am too stupid to learn from my mistakes, ever.
Relatable. I've had to hard wipe twice as I'm not used to this a/b stuff without TWRP lol. I've learnt my lesson though and finally granted shell root access, so assuming the phone boots past the bootloader I can use adb to fix up my magisk install.

Sent from my Google Pixel 3a XL using XDA Labs
 

benji

Senior Member
Jan 13, 2009
69
26
18
Thank you! I've been running the stock kernel for the past several days because of a borked Magisk module. I couldn't fix the problem through TWRP since I'm on Android 10. This boot image allowed me to get back root without wiping. So thanks again!

Do you mind explaining how you made the image? I saw on the Magisk website that such a thing was possible but was unable to actually find details on how to create a core only image.
 

Tulsadiver

Recognized Contributor
Jul 11, 2013
7,761
5,476
253
Thank you! I've been running the stock kernel for the past several days because of a borked Magisk module. I couldn't fix the problem through TWRP since I'm on Android 10. This boot image allowed me to get back root without wiping. So thanks again!

Do you mind explaining how you made the image? I saw on the Magisk website that such a thing was possible but was unable to actually find details on how to create a core only image.
You have to build your own copy of magisk from GitHub.

Clone magisk
Go to native/jni/core folder and edit the boot stages.cpp file in notepad++ like this:

Approx line 667

If (access(DISABLEFILE, F_ok) ==0)

Change == to !=

Now build magisk as per instructions on GitHub
One you have built it and there were no errors go to native/out/armeb-v7a folder and get a copy of the magiskini64 file.

Unpack a copy of your magisk_patched.img.
In the ramdisk folder replace the init file with the .magiskini64 file (rename to init)
Repack your magisk_patched.img
The results are a patched IMG that will boot core only mode.
 
  • Like
Reactions: b0li

Bramton1

Senior Member
Apr 13, 2011
211
39
48
Columbia, MD
I definitely need to make sure I have this handy. A few questions, if you don't mind.

1. I would assume one should make a new version everytime they update to the latest security patch, correct? For example, I should not use a patched boot.ing from the December patch if I'm on the January, patch, correct?

2. Do your instructions assume that someone already put a .disable_magisk file in /cache, or does the boot.img itself do that job?
 

Tulsadiver

Recognized Contributor
Jul 11, 2013
7,761
5,476
253
I definitely need to make sure I have this handy. A few questions, if you don't mind.

1. I would assume one should make a new version everytime they update to the latest security patch, correct? For example, I should not use a patched boot.ing from the December patch if I'm on the January, patch, correct?

2. Do your instructions assume that someone already put a .disable_magisk file in /cache, or does the boot.img itself do that job?
To update boot would be best but you are just booting the image, not flashing. The old method required building a modded version of Magisk. The new method you just unpack the magisk_patched.img and drop in the overlay folder.

The boot image installs the .disable_magisk file for you.
 
Last edited:

Velcorn

Senior Member
Jul 9, 2015
156
44
58
Hamburg
Thank god for this one. I almost did a fullwipe because I couldn't get Magisk to work after flashing the March factory image in order to update. Turns out I forgot to remove your center clock/battery icon gone module. I didn't expect it to be the culprit, but it seems it was. Regardless, I'm back to working root after days of trying to find a fix :p
 

zgfg

Senior Member
Oct 10, 2016
4,364
1,865
233
Is it possible to fastboot boot (not flash) the modified boot image for disabling modules and then install Magisk via Magisk Manager?
You should be able to boot with the modified image, but you don't "install" Magisk then - Magisk is already installed, just you booted with all the modules disabled

Just open Magisk Manager, go to Modules and mark to remove the module(s) causing bootloop.
Pay also attention to remove
.disable-magisk file from /cache
as described in OP post #1

Then reboot with your proper Magisk patched image (no more Core Only) and if you have removed the module in the previous step, this time you should be booted to Magisk with no bootloop and with your other modules re-enabled again
 
Last edited:

cucumbersmell

Senior Member
Nov 14, 2009
352
144
73
Portland, OR
You should be able to boot with the modified image, but you don't "install" Magisk then - Magisk is already installed, just you booted with all the modules disabled

Just open Magisk Manager, go to Modules and mark to remove the module(s) causing bootloop.
Pay also attention to remove
.disable-magisk file from /cache
as described in OP post #1

Then reboot with your proper Magisk patched image (no more Core Only) and if you have removed the module in the previous step, this time you should be booted to Magisk with no bootloop and with your other modules re-enabled again
I used Tulsadiver's core-only boot.img for the OP7T to root the phone by fastboot booting it and then using Magisk Manager to install to the active and inactive slots. Was hoping the boot.img for the 3a would work similarly. Was nice and simple and saved the time of having to download and patch the boot.img.
 

Tulsadiver

Recognized Contributor
Jul 11, 2013
7,761
5,476
253
I used Tulsadiver's core-only boot.img for the OP7T to root the phone by fastboot booting it and then using Magisk Manager to install to the active and inactive slots. Was hoping the boot.img for the 3a would work similarly. Was nice and simple and saved the time of having to download and patch the boot.img.
It is based off of a magisk_patched.img so you might be able to use it like that. You would need to remove the .disable_magisk file from the cache folder though. This is a little different than the one I helped out with on the 7T forum.
 
  • Like
Reactions: cucumbersmell

zgfg

Senior Member
Oct 10, 2016
4,364
1,865
233
I used Tulsadiver's core-only boot.img for the OP7T to root the phone by fastboot booting it and then using Magisk Manager to install to the active and inactive slots. Was hoping the boot.img for the 3a would work similarly. Was nice and simple and saved the time of having to download and patch the boot.img.
Edit: Sorry, seems I just missed the thread ?
 
Last edited: