Magisk General Support / Discussion

DiamondJohn

Recognized Contributor
Aug 31, 2013
4,809
3,959
243
Sydney
Alright so huge update; everything now works! How did I do it?

I switched from using Command Prompt to PowerShell. I don't even know what made me figure out to give that a try, but it worked!

Mystery solved for anyone else that ever has this problem!
Im happy to hear it all now works for you, however, thats the opposite of "mystery solved" as to why it wasnt working before. But it certainly is a path for others who end up in the same dead end as you. (y)
 
  • Like
Reactions: daddylonglegs

daddylonglegs

Senior Member
Oct 23, 2009
486
101
63
Vermont
Im happy to hear it all now works for you, however, thats the opposite of "mystery solved" as to why it wasnt working before. But it certainly is a path for others who end up in the same dead end as you. (y)
Yep! Figured I would post the fix for anyone that ever has the problem.

The only issue now is when Magisk is enabled, my entire phone freezes shortly after booting into Android. I only have 3 modules installed. Universal Safetynet Fix module (v 1.1.1), Systemless Hosts and MagiskHide Props Config.

Any clue why this would be locking my phone up?
 

arkadius41

Senior Member
May 19, 2009
252
13
48
Hi there. Could sb help with proper installation on my device Huawei Mediapad M3, LineageOS-17.1 & twrp-3.3.1-3. Just can't go any further and stop on that below
Screenshot_20210119-131626_Magisk_Manager.png
Screenshot_20210119-131616_Magisk_Manager.png
 

DiamondJohn

Recognized Contributor
Aug 31, 2013
4,809
3,959
243
Sydney
Yep! Figured I would post the fix for anyone that ever has the problem.

The only issue now is when Magisk is enabled, my entire phone freezes shortly after booting into Android. I only have 3 modules installed. Universal Safetynet Fix module (v 1.1.1), Systemless Hosts and MagiskHide Props Config.

Any clue why this would be locking my phone up?
First you question, I dont personally have a clue. Have you tried the magisk boot log?

And just to help others who have your problem, did you have to do the "fastboot flash boot boot_image..." or did the "fastboot flash boot_image.img" work (or whatever it was)?
 

daddylonglegs

Senior Member
Oct 23, 2009
486
101
63
Vermont
OK it seems as though my phone is locking up because Magisk somehow changed my active boot slot?

So when I flashed the patched magisk boot file, I used this command:

Code:
fastboot flash boot magisk_patched_qfngE.img --slot all
I did that because someone here recommended I try that.

After doing that, I noticed my phone now tries boot from slot A. It was previously always slot B.

I tried this command:

Code:
fastboot --set-active=b
which seemed to work, but when my phone reboots, it defaults back to slot A, which is where I get the constant hard lockups in Android.

Does anyone know what's up and what I can do to fix this?
 

Yahoo1

Senior Member
Jul 6, 2014
94
89
38
Yep! Figured I would post the fix for anyone that ever has the problem.

The only issue now is when Magisk is enabled, my entire phone freezes shortly after booting into Android. I only have 3 modules installed. Universal Safetynet Fix module (v 1.1.1), Systemless Hosts and MagiskHide Props Config.

Any clue why this would be locking my phone up?
Maybe wipe everything and start installation from scratch after all your mishaps. Btw the PowerShell use is pretty interesting solution of your previous problem. I mean why Command Prompt was not enough...
 
  • Like
Reactions: daddylonglegs

daddylonglegs

Senior Member
Oct 23, 2009
486
101
63
Vermont
Maybe wipe everything and start installation from scratch after all your mishaps. Btw the PowerShell use is pretty interesting solution of your previous problem. I mean why Command Prompt was not enough...
I appreciate it but there's no way I am wiping my data. Too many important things; even just the way I have the phone set up would be a nightmare to re-do.

I think doing the fastboot flash boot magisk_patched_qfngE.img --slot all command is what screwed my phone up. "--slot all" installs Magisk to both slots and it for whatever reason changed my phone to always boot from slot A.

Is there a way to reverse this? Flash the January 2021 firmware to both slots maybe? How do I do that? Do I have to make each slot active and then run flash-all.bat ?
 

AndDiSa

Senior Member
Dec 2, 2009
3,465
4,524
268
Heidelberg
@daddylonglegs as I already tried to explain to you: the Pixel 3a has two boot slots for seamless updates, i.e.
- before the update it starts e.g. from slot A
- after the update slot B is activated and the phone tries to start from slot B
if for whatever reason the phone cannot boot, slot B will be marked as 'bad' and the phone will automatically start from slot A again.

Flashing to both slots in parallel is not needed / recommended as there is also a ramdisk / system / ... connected to slot B and if those are not compatible to the boot image you have just flashed it will mark automatically the slot as 'invalid' and will fall back to the other one ...
 

daddylonglegs

Senior Member
Oct 23, 2009
486
101
63
Vermont
@daddylonglegs as I already tried to explain to you: the Pixel 3a has two boot slots for seamless updates, i.e.
- before the update it starts e.g. from slot A
- after the update slot B is activated and the phone tries to start from slot B
if for whatever reason the phone cannot boot, slot B will be marked as 'bad' and the phone will automatically start from slot A again.

Flashing to both slots in parallel is not needed / recommended as there is also a ramdisk / system / ... connected to slot B and if those are not compatible to the boot image you have just flashed it will mark automatically the slot as 'invalid' and will fall back to the other one ...
OK thank you.

Maybe I should stop trying to install Magisk from ADB. I believe there is a way to boot to the patched image, and then install Magisk in the app? Is that correct? If so is there a link on how to install that way instead of flashing the patched boot?
 

AndDiSa

Senior Member
Dec 2, 2009
3,465
4,524
268
Heidelberg
@daddylonglegs no, you need to upload the original boot.img (which is exactly matching the OS you are running) to a running phone where Magisk-Manager is installed. Then you need to patch that image, get it back to your PC and flash it into the currently active slot (e.g. flashing without any --slot parameter). After that you can boot your phone and it's rooted with Magisk.
 
  • Like
Reactions: daddylonglegs

daddylonglegs

Senior Member
Oct 23, 2009
486
101
63
Vermont
@daddylonglegs no, you need to upload the original boot.img (which is exactly matching the OS you are running) to a running phone where Magisk-Manager is installed. Then you need to patch that image, get it back to your PC and flash it into the currently active slot (e.g. flashing without any --slot parameter). After that you can boot your phone and it's rooted with Magisk.
That's what I am doing. My phone hard locks whenever it boots and Magisk is installed. Flashing the original boot.img file, my phone works fine. Flashing the Magisk one makes my phone freeze up about a minute into being inside Android 11.
 

AndDiSa

Senior Member
Dec 2, 2009
3,465
4,524
268
Heidelberg
Most likely it's related to Systemless hosts. I had this freezing from time to time, too, but since about two weeks it's working fine (even with systemless hosts enabled). Try to run without systemless hosts (at least for some time) and see whether this fixes your issues.
 
  • Like
Reactions: daddylonglegs

Homeboy76

Senior Member
Aug 24, 2012
2,443
1,176
188
OK thank you.

Maybe I should stop trying to install Magisk from ADB. I believe there is a way to boot to the patched image, and then install Magisk in the app? Is that correct? If so is there a link on how to install that way instead of flashing the patched boot?
Using a windows computer, try:
- unhide magisk
- uninstall Magisk --> Restore Images
- opening File Explorer
- click the platform-tools folder
- click the folder (left side of address bar) to highlight the address
- type cmd and press enter.
- at the prompt type:
- fastboot flash boot magisk_patched_xxxx.img
 
Last edited:
  • Like
Reactions: daddylonglegs

zgfg

Senior Member
Oct 10, 2016
4,843
2,147
233
Will my Adblocker still work OK?

Also how do I uninstall the module? The adb wait-for-device shell magisk --remove-modules command does nothing for me in PowerShell. I press enter and nothing happens.
If your system is read-only (e g. A11), AdAway will not work without Systemless hosts

To disable, open Magisk Manager, modules tab, find Systemless hosts, disable its button and reboot

You can also disable by some root explorer like MiXplorer or from TWRP by putting an empty file named disable (exactly as that) to the folder:
/data/adb/modules/hosts
(always reboot)

Disabling through Magisk Manager does the same, putting that disable file.
Enabling just removes the disable file
 
  • Like
Reactions: daddylonglegs

zgfg

Senior Member
Oct 10, 2016
4,843
2,147
233
Update: phone locks up with only Universal Safetynet Fix module (v 1.1.1) installed. FML.
If you have TWRP, you can disable as was described for Systemless hosts.
This time you put disable file to the folder:
/data/adb/modules/safetynet-fix (not sure about the exact folder name but you will see)

Or disable all modules by booting to Safe Android mode, then to normal mode (you will also have to re-enable Magisk hide)

Or remove all modules by adb command - everything is described in Magisk Wiki on Github, pls read and learn 👍
 

daddylonglegs

Senior Member
Oct 23, 2009
486
101
63
Vermont
So try no modules first. And did you make sure to patch boot.img from correct factory zip file? Is it the same version you have on your phone now? I know it probably is, I am just running out of ideas here...
First I want to say thank you so much to you and all the other strangers that have been trying to help me. You have no idea how much I appreciate it. I try to pay it forward in my everyday life. :)

I definitely am using the proper boot file from the latest firmware. I checked and redownloaded a half dozen times just to make sure.

With no modules, my phone works fine. I just installed Systemless Hosts and Riru, and rebooted and no lockups. This says to me the issue is Universal Safetynet Fix module (v 1.1.1) .

This is very unfortunate because passing SafetyNet is really important to me. I can live without it for a bit and maybe the next version of Universal Safetynet Fix will not lock up my phone. But what if it does? Is there any way to just remove a single module instead of removing them all with that ADB command?

If you have TWRP, you can disable as was described Systemless hosts.
This time you put disable file to the folder:
/data/adb/modules/safetynet-fix (not sure about the exact folder name but you will see)

Or disable all modules by booting to Safe mode, then to normal mode (you will also have to re-enable Magisk hide)

Or remove all modules by adb command - everything is described in Magisk Wiki on Github
Unless I am missing something I thought TWRP hasn't worked in forever? Since like, Android 9 or something?
 
  • Like
Reactions: Yahoo1

zgfg

Senior Member
Oct 10, 2016
4,843
2,147
233
Id there any way to just remove a single module instead of removing them all with that ADB command?

Unless I am missing something I thought TWRP hasn't worked in forever? Since like, Android 9 or something?
The adb command:
adb wait-for-device shell magisk --remove-modules

uninstalls all modules - but you can easily reinstall what you need

Or use Android Safe mode, then normal boot, then remove or enable modules from your Magisk Manager (you must also enable Magisk hide)

For TWRP it depends if it was ported to your device

Latest official TWRP 3.5 supports A11 but again, must be ported to your device - check on your device forum and on https://dl.twrp.me

For SafetyNet Fix google, search on XDA or scroll back for few days in this thread to find its XDA thread.
Ask there why your phone bootloops with or if there is some special test version you could try for your phone
 
Last edited: