FORUMS
Remove All Ads from XDA

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

6,711 posts
Thanks Meter: 4,899
 
By Tulsadiver, XDA Ad-Free Recognized Contributor on 2nd October 2019, 02:45 PM
Post Reply Email Thread
20th November 2019, 07:36 PM |#11  
Skittles9823's Avatar
Senior Member
Flag Sydney
Thanks Meter: 1,644
 
Donate to Me
More
Quote:
Originally Posted by osm0sis

Hmm.. true, non-working recovery is a definite problem. I'm in that boat right now on my OnePlus 7T, which is how I came across this thread.

Okay, better idea. Instead of mucking around with recompiling magiskinit for the above, just do it via boot script in overlay.d

Tbh, a custom boot.img is the only way to recover in some situations. Like if you can't boot into an adb environment or if you've never granted adb she'll root access.

Sent from my Google Pixel 3a XL using XDA Labs
20th November 2019, 10:54 PM |#12  
osm0sis's Avatar
Recognized Developer / Recognized Contributor
Flag Halifax
Thanks Meter: 30,698
 
Donate to Me
More
Quote:
Originally Posted by Skittles9823

Tbh, a custom boot.img is the only way to recover in some situations. Like if you can't boot into an adb environment or if you've never granted adb she'll root access.

Exactly, so a custom boot.img using overlay.d is the easiest way to accomplish that currently.
20th November 2019, 11:36 PM |#13  
Skittles9823's Avatar
Senior Member
Flag Sydney
Thanks Meter: 1,644
 
Donate to Me
More
Quote:
Originally Posted by osm0sis

Exactly, so a custom boot.img using overlay.d is the easiest way to accomplish that currently.

How would one do that exactly without being able to use adb shell?

Sent from my Google Pixel 3a XL using XDA Labs
21st November 2019, 04:18 AM |#14  
osm0sis's Avatar
Recognized Developer / Recognized Contributor
Flag Halifax
Thanks Meter: 30,698
 
Donate to Me
More
Quote:
Originally Posted by Skittles9823

How would one do that exactly without being able to use adb shell?

overlay.d is built into the boot.img, so you take your latest magisk_patched.img, patch it with the overlay.d scripts to have the desired effect, then repack and flash via fastboot.

Same as the OP likely did, but no need to build Magisk to get a modified magiskinit, since you can do it all via boot script, like I said.
The Following User Says Thank You to osm0sis For This Useful Post: [ View ]
23rd November 2019, 06:02 PM |#15  
osm0sis's Avatar
Recognized Developer / Recognized Contributor
Flag Halifax
Thanks Meter: 30,698
 
Donate to Me
More
If anyone wants to experiment with this idea, here's the basic setup I used for my boot.img to fully reset the /data/adb directory for the soft brick issue (related to a magisk.db failure) I was seeing in the last canary.

Unpack the current magisk_patched.img for your device using my Android Image Kitchen (AIK) project, then create:

ramdisk/overlay.d/init.resetmagisk.rc:
Code:
on post-fs-data
    exec u:r:magisk:s0 root root -- /sbin/init.resetmagisk.sh
ramdisk/overlay.d/sbin/init.resetmagisk.sh:
Code:
#!/system/bin/sh
rm -rf /data/adb/* && reboot
So, pretty simple stuff, and I'm sure it could be applied to some sort of Core Only workaround until @topjohnwu decides what he wants to do with all those Core Only boot.img Pull Requests.
The Following 2 Users Say Thank You to osm0sis For This Useful Post: [ View ]
24th November 2019, 11:38 PM |#16  
Tulsadiver's Avatar
OP Recognized Contributor
Thanks Meter: 4,899
 
Donate to Me
More
Quote:
Originally Posted by osm0sis

overlay.d is built into the boot.img, so you take your latest magisk_patched.img, patch it with the overlay.d scripts to have the desired effect, then repack and flash via fastboot.

Same as the OP likely did, but no need to build Magisk to get a modified magiskinit, since you can do it all via boot script, like I said.

Cool. What I did was modify the magisk native/jini/core/bootstages.cpp

Edit: yes sir, your method works great to remove magisk and all modules. The method I had gives you the option to just remove the offending module, though sometimes you have to remove everything anyway. Thank you for your awsome input. If it is okay with you, I'd like to offer both methods in my posts on the pixel forums.
The Following User Says Thank You to Tulsadiver For This Useful Post: [ View ] Gift Tulsadiver Ad-Free
25th November 2019, 01:39 AM |#17  
osm0sis's Avatar
Recognized Developer / Recognized Contributor
Flag Halifax
Thanks Meter: 30,698
 
Donate to Me
More
Quote:
Originally Posted by Tulsadiver

Cool. What I did was modify the magisk native/jini/core/bootstages.cpp

Edit: yes sir, your method works great to remove magisk and all modules. The method I had gives you the option to just remove the offending module, though sometimes you have to remove everything anyway. Thank you for your awsome input. If it is okay with you, I'd like to offer both methods in my posts on the pixel forums.

Sure! You could modify my method to remove all modules by running `magisk --remove-modules` instead of my `rm -rf` command (or just changing the `rm -rf` target), or even try to force Core Only mode by changing the setting directly in magisk.db then rebooting. It's a root shell so pretty much sky's the limit.
4th December 2019, 07:43 PM |#18  
paplo's Avatar
Junior Member
Flag Løsning
Thanks Meter: 1
 
More
Quote:
Originally Posted by osm0sis

Sure! You could modify my method to remove all modules by running `magisk --remove-modules` instead of my `rm -rf` command (or just changing the `rm -rf` target), or even try to force Core Only mode by changing the setting directly in magisk.db then rebooting. It's a root shell so pretty much sky's the limit.

I have tried multiple methods from this thread but with no success.. Could you maybe help me by altering this boot.img to disable/remove all Magisk modules? Or maybe make it boot core only? It's for my OP 7T. Thanks!
https://mega.nz/#F!rxYDyQia!ziPLPvRsu3kxNBGt694OEQ
4th December 2019, 11:37 PM |#19  
osm0sis's Avatar
Recognized Developer / Recognized Contributor
Flag Halifax
Thanks Meter: 30,698
 
Donate to Me
More
Quote:
Originally Posted by paplo

I have tried multiple methods from this thread but with no success.. Could you maybe help me by altering this boot.img to disable/remove all Magisk modules? Or maybe make it boot core only? It's for my OP 7T. Thanks!
https://mega.nz/#F!rxYDyQia!ziPLPvRsu3kxNBGt694OEQ

If `adb shell magisk --remove-modules` didn't fix the issue for you then you might be in the same boat I was and need to nuke all of Magisk's files in /data/adb.

Getting off topic for a Pixel thread, but here's the OnePlus 7T (hotdogb) image I made following my own instructions.

It's with an older Canary of Magisk so once you get it booting you should update to the latest Canary immediately.
Attached Files
File Type: zip magisk_reset.img.zip - [Click for QR Code] (12.88 MB, 36 views)
4th December 2019, 11:51 PM |#20  
paplo's Avatar
Junior Member
Flag Løsning
Thanks Meter: 1
 
More
Quote:
Originally Posted by osm0sis

If `adb shell magisk --remove-modules` didn't fix the issue for you then you might be in the same boat I was and need to nuke all of Magisk's files in /data/adb.

Getting off topic for a Pixel thread, but here's the OnePlus 7T (hotdogb) image I made following my own instructions.

It's with an older Canary of Magisk so once you get it booting you should update to the latest Canary immediately.

Yeah off topic I know.. Just spotted you had been in the same pickle with the same phone as me. I worked like a charm! Thanks!
The Following User Says Thank You to paplo For This Useful Post: [ View ] Gift paplo Ad-Free
5th December 2019, 03:45 PM |#21  
ramsyst's Avatar
Member
Thanks Meter: 4
 
More
Quote:
Originally Posted by osm0sis

If `adb shell magisk --remove-modules` didn't fix the issue for you then you might be in the same boat I was and need to nuke all of Magisk's files in /data/adb.

Getting off topic for a Pixel thread, but here's the OnePlus 7T (hotdogb) image I made following my own instructions.

It's with an older Canary of Magisk so once you get it booting you should update to the latest Canary immediately.

Hi osm0sis, I'm having the same issue with Xiaomi Mi 9t. Could you also modify the boot image the Mi 9t. Or, is there an universal image I can use ?
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes