Hi, I installed an incompatible Magisk module in the past, which cause bootloop of my phone. Co I dirty flashed my ROM (Pixel Experience) to get my phone work again. My current situation is that I cannot flash Magisk because an incompatible module is still on my phone. How to disable this module without root and TWRP? TWRP is not yet available for my phone
Phone: Xiaomi Mi 9 (cepheus)
ROM: Pixel Experience (PixelExperience_cepheus-12.0-20220123-1916-OFFICIAL.zip)
Magisk 23 or 24
Recovery: PixelExperience Recovery
Enter in TWRP.
Advanced > File Manager.
Go to "/data/adb" and delete the folders of the specific magisk module.
Reboot.
I cannot use TWRP on my phone, it is not available yet for Android 12.
Download latest twrp, try first fastboot boot image to test it, then flash with fastboot and delete broken module from /data/adb
OK, I tried boot latest twrp. The touchscreen was not working, so I plugged in a USB mouse. But now I cannot mount data partition in TWRP
I found the solution!
Flash Magisk
Reboot
adb wait-for-device shell magisk --remove-modules while booting
martin131 said:
I found the solution!
Flash Magisk
Reboot
adb wait-for-device shell magisk --remove-modules while booting
Click to expand...
Click to collapse
Hi Martin, could you elaborate on how you did this?
I made the mistake of installing non-zygisk module amd now my phone won't boot. I can boot to TWRP but there's nothing in /data/adb.
Thanks in advanced!
Nevermind, I figured out the process but still get stuck in boot up screen after installing magisk 24.1.
I ended up reinstalling the ROM again.
martin131 said:
I found the solution!
Flash Magisk
Reboot
adb wait-for-device shell magisk --remove-modules while booting
Click to expand...
Click to collapse
What do you mean by "while booting"? I tried here and got "adb is out of data. killing"
Try to enter safe mode on your device. Magisk will disable all modules if detected the safe mode enable. Reboot and remove the problem modules, and reboot again.
I have an Xperia 10 III (XQ-BT52) only rooted with Magisk (no RTWP) in which I tried to install the Magisk module wfd_pie_magisk_20_4.zip which ended up in a bootloop. Having the unit connected whilst booting I bombarded the command line with
adb shell
and lo and behold it did connect for a few (8-10) seconds giving me a prompt, before rebooting again.
Realising these few seconds could be enough to delete the module, i went for:
adb shell
XQ-BT52:/ $
su
XQ-BT52:/ #
rm -rf /data/adb/modules/WFD_PIE
and the unit rebooted. It did loop again twice, but the second time it all came up nicely.
Conclusion, if you get into a boot loop you might be able to recover if being quick enough to erase the module. First you need to identify what the directory name of the module is by simply do:
ls /data/adb/modules
hosts
WFD_PIE
Once knowing the name of the directory (WFD_PIE in my case) get the prompt whilst booting, quickly write (or simply prepare the rm command by putting it into the terminals cut/paste buffer).
su
rm -rf /data/adb/modules/[directory name]
hit enter, and hope for the best. The system will hopefully get up and running again after a few boots (one more boot than expected).
martin131 said:
I found the solution!
Flash Magisk
Reboot
adb wait-for-device shell magisk --remove-modules while booting
Click to expand...
Click to collapse
Thank you, it worked!
martin131 said:
I found the solution!
Flash Magisk
Reboot
adb wait-for-device shell magisk --remove-modules while booting
Click to expand...
Click to collapse
Thank you. This is a lifesaver!
martin131 said:
I found the solution!
Flash Magisk
Reboot
adb wait-for-device shell magisk --remove-modules while booting
Click to expand...
Click to collapse
Thank you for this, you saved my phone.
If anyone else has this issue, go to recovery first and then boot to normal core mode without Magisk enabled, then restart your phone again with however you enable Magisk and then enter the code at the splash screen on CMD.
You also can just flash the stock boot img (or init_boot.img for Pixel 7 and maybe some other devices) and then wipe magisk app data then flash the patched img again
martin131 said:
I found the solution!
Flash Magisk
Reboot
adb wait-for-device shell magisk --remove-modules while booting
Click to expand...
Click to collapse
Thank you for saving my phone
For future reference, if you have a incompatible module, boot into safe mode, then boot back normally, and it will be disabled. No need to uninstall magisk.
martin131 said:
I found the solution!
Flash Magisk
Reboot
adb wait-for-device shell magisk --remove-modules while booting
Click to expand...
Click to collapse
This worked!!! Saved me from having to flash off my data!!! Thanks, Martin.
Related
An unusual question;
I have a need to do 'adb shell setprop persist... '
I can do that after flashing TWRP and booting it. Works fine.
I assumed (wrongly) that 'fastboot boot patched_boot.img' would allow me to run the same adb command. I realize that the patched boot images are made to then further install Magisk Manager, systemless root, etc.
My question is there any way to get the patched_boot.img to allow a simple adb setprop command, like twrp does? (without going the full root route).
Thanks very much for taking the time to respond to my obviously not very knowledgeable question about Magisk.
AsItLies said:
An unusual question;
I have a need to do 'adb shell setprop persist... '
I can do that after flashing TWRP and booting it. Works fine.
I assumed (wrongly) that 'fastboot boot patched_boot.img' would allow me to run the same adb command. I realize that the patched boot images are made to then further install Magisk Manager, systemless root, etc.
My question is there any way to get the patched_boot.img to allow a simple adb setprop command, like twrp does? (without going the full root route).
Thanks very much for taking the time to respond to my obviously not very knowledgeable question about Magisk.
Click to expand...
Click to collapse
If you have Magisk working, use a module to do that setprop for you. I believe "MagiskHide Props Config" in the Magisk repo could do that trick.
AsItLies said:
An unusual question;
I have a need to do 'adb shell setprop persist... '
I can do that after flashing TWRP and booting it. Works fine.
I assumed (wrongly) that 'fastboot boot patched_boot.img' would allow me to run the same adb command. I realize that the patched boot images are made to then further install Magisk Manager, systemless root, etc.
My question is there any way to get the patched_boot.img to allow a simple adb setprop command, like twrp does? (without going the full root route).
Thanks very much for taking the time to respond to my obviously not very knowledgeable question about Magisk.
Click to expand...
Click to collapse
You want to patch a boot image, so that it sets the property on boot that you wanted it to, right ??
If that's the case, you can directly use MagiskBoot to unpack the boot image and then ramdisk, then you can create an init.*.rc script to do your custom tasks and import that in init.rc where you need that to be applied.
JayminSuthar said:
You want to patch a boot image, so that it sets the property on boot that you wanted it to, right ??
If that's the case, you can directly use MagiskBoot to unpack the boot image and then ramdisk, then you can create an init.*.rc script to do your custom tasks and import that in init.rc where you need that to be applied.
Click to expand...
Click to collapse
Looking more carefully at doing this right now. Yes, it certainly sounds like it would do what's needed. Will post back with results. Thnx for the pointing out this possibility.
I was on magisk rooted pixel 3 Android 10, no twrp. After flashing a magisk module, it boot, but couldn't get into desktop, kind of bootloop. So i fastboot stock boot img and boots, but lost root previleage.
I want to remove the said magisk module, with no root and no twrp.
Any suggestions???
Thanks.
evanxyj said:
I was on magisk rooted pixel 3 Android 10, no twrp. After flashing a magisk module, it boot, but couldn't get into desktop, kind of bootloop. So i fastboot stock boot img and boots, but lost root previleage.
I want to remove the said magisk module, with no root and no twrp.
Any suggestions???
Thanks.
Click to expand...
Click to collapse
While the phone is in the bootloop connect the phone to your PC and open cmd, cd to the folder where you have adb drivers and type:
adb wait-for-device shell magisk --remove-modules
This will remove all the modules and you should exit the bootloop
visa91 said:
While the phone is in the bootloop connect the phone to your PC and open cmd, cd to the folder where you have adb drivers and type:
adb wait-for-device shell magisk --remove-modules
This will remove all the modules and you should exit the bootloop
Click to expand...
Click to collapse
Thanks. Actually my phone booted into system, it said "phone is starting"and kept that forever, but it never went into desktop. Wonder whether or not your script will work...
evanxyj said:
Thanks. Actually my phone booted into system, it said "phone is starting"and kept that forever, but it never went into desktop. Wonder whether or not your script will work...
Click to expand...
Click to collapse
It is not necessary to enter the desktop. I have a Huawei and my phone was in a bootloop showing Huawei logo. I put this script in the cmd while the phone was in huawei logo and I was able to exit the bootloop by losing all magisk modules.
visa91 said:
It is not necessary to enter the desktop. I have a Huawei and my phone was in a bootloop showing Huawei logo. I put this script in the cmd while the phone was in huawei logo and I was able to exit the bootloop by losing all magisk modules.
Click to expand...
Click to collapse
I'll try next time I ****ed up my system again. Thsnks.
visa91 said:
It is not necessary to enter the desktop. I have a Huawei and my phone was in a bootloop showing Huawei logo. I put this script in the cmd while the phone was in huawei logo and I was able to exit the bootloop by losing all magisk modules.
Click to expand...
Click to collapse
Delete. Misguide
evanxyj said:
U can try this one
https://forum.xda-developers.com/pixel-3/themes/magisk-modules-disabler-booting-magisk-t3967433
Click to expand...
Click to collapse
No. Boot images are device specific, and that's a Pixel 3 boot image that won't work on @visa91's Huawei.
Didgeridoohan said:
No. Boot images are device specific, and that's a Pixel 3 boot image that won't work on @visa91's Huawei.
Click to expand...
Click to collapse
My mistake.
I have a OnePlus 7T, which I rooted by booting to magisk_patched_boot.img (since there is no TWRP for OnePlus 7T yet).
I installed some module which caused bootloop. I recovered from bootloop by dirty flashing stock rom (just the boot.img).
Bootloop resolved. Root gone.
Now if I boot into magisk_patched_boot.img, it gets stuck on bootloop again. So I am assuming the magisk module files are still present.
How do I get rid of those modules?
Try here:
https://didgeridoohan.com/magisk/Ma...agisk_functionality_bootloop_loss_of_root_etc
Didgeridoohan said:
Try here:
https://didgeridoohan.com/magisk/Ma...agisk_functionality_bootloop_loss_of_root_etc
Click to expand...
Click to collapse
Worked like a charm, thank you so much!!
If anyone else is suffering through the same issue, while in bootloop, enter the following command in command prompt (in adb directory)
Code:
adb wait-for-device shell magisk --remove-modules
mihir24 said:
Worked like a charm, thank you so much!!
If anyone else is suffering through the same issue, while in bootloop, enter the following command in command prompt (in adb directory)
Code:
adb wait-for-device shell magisk --remove-modules
Click to expand...
Click to collapse
I have the same problem. I dirty flashed the stock rom and now i reflashed the patched rom in order to enter the command.
nothing happens for me. i just copy and pasted that command. is that wrong?
thanks
so yea i need to uninstall modules so i can root and not format wipe the phone. i have tried the whole adb wait-for-device shell magisk --remove-modules when its sitting on the g with the line under it. it reboots but then just goes back to the g with a line under it. i have read up on other ways to do it one involving twrp but unfortunately twrp isn't out for 3xl. any help would be appreciated thanks in advance.
DrUnkeN_TiGeR said:
so yea i need to uninstall modules so i can root and not format wipe the phone. i have tried the whole adb wait-for-device shell magisk --remove-modules when its sitting on the g with the line under it. it reboots but then just goes back to the g with a line under it. i have read up on other ways to do it one involving twrp but unfortunately twrp isn't out for 3xl. any help would be appreciated thanks in advance.
Click to expand...
Click to collapse
were u able to find any solution? I'm in the same boat as u
mihir24 said:
Worked like a charm, thank you so much!!
If anyone else is suffering through the same issue, while in bootloop, enter the following command in command prompt (in adb directory)
Code:
adb wait-for-device shell magisk --remove-modules
Click to expand...
Click to collapse
thank you :good::good::good::good:
Hi, I would like to run adb on my Galaxy S10+ but if I plug any usb cable on my phone, it starts. How to disable this behavior please?
I tried the same for my Pixel 3a. I can't get adb to recognize it. Fastboot does and if I boot to stock bootloader it at least boots and recognizes it but of course it doesn't snow magisk installed..
mihir24 said:
Worked like a charm, thank you so much!!
If anyone else is suffering through the same issue, while in bootloop, enter the following command in command prompt (in adb directory)
Code:
adb wait-for-device shell magisk --remove-modules
Click to expand...
Click to collapse
Holy crap, thanks for the clarification!! I found the original instructions but could not get it to work, this got it working!
You have to be in the bootloop and then enter the command above!
This worked on my Huawei P20 Pro.
Doesn't work for me, adb Devices doesn't show anything. I can boot to rescue mode or into adb sideload and it finds it. Really want to get this working
GrandMstrBud said:
Doesn't work for me, adb Devices doesn't show anything. I can boot to rescue mode or into adb sideload and it finds it. Really want to get this working
Click to expand...
Click to collapse
You can try this. It is for the Pixel 3a only.
fastboot boot image-new.img
image-new.img
https://www.androidfilehost.com/?fid=8889791610682920432
You should boot up with root but modules disabled. Remove your modules with root explorer located here (data/adb/modules) then remove the .disable_magisk file that is in the cache/ folder. It is a hidden file (starts with a dot) so your root file explorer will need to be set to show hidden files.
This all should be done while in bootloop after flashing your magisk_patched.img
Just boot to fastboot and boot the image.
https://forum.xda-developers.com/pixel-3a/how-to/magisk-modules-disabler-booting-magisk-t3976621
Tulsadiver said:
You can try this. It is for the Pixel 3a only.
fastboot boot image-new.img
image-new.img
https://www.androidfilehost.com/?fid=8889791610682920432
You should boot up with root but modules disabled. Remove your modules with root explorer located here (data/adb/modules) then remove the .disable_magisk file that is in the cache/ folder. It is a hidden file (starts with a dot) so your root file explorer will need to be set to show hidden files.
This all should be done while in bootloop after flashing your magisk_patched.img
Just boot to fastboot and boot the image.
https://forum.xda-developers.com/pixel-3a/how-to/magisk-modules-disabler-booting-magisk-t3976621
Click to expand...
Click to collapse
Hey there, I'm using a Pixel 4a and I've run into the exact same issue unfortunately. While in the boot loop I ran the adb command but it just keeps on waiting to detect my device. There seems to be no modified magisk_patched.img defaulting to Magisk core-only mode on XDA for the Pixel 4a (only for older devices), and I've also tried your other tutorial using the AIK to build a custom one for myself, which did not work unfortunately. What should I do to restore root while preventing the problematic module from loading? Thank you!!!:crying:
mihir24 said:
Worked like a charm, thank you so much!!
If anyone else is suffering through the same issue, while in bootloop, enter the following command in command prompt (in adb directory)
Code:
adb wait-for-device shell magisk --remove-modules
Click to expand...
Click to collapse
just replying to say this helped me!!
With magisk, after flashing the patched boot.img (generated from magisk) via fastboot and receiving a bootloop, i ran this code, which then restarted my phone and got me to my homescreen
using oneplus7 and android 11, thanks, now i have root with magisk (rip twrp?)
tThank you so much this saved my device from getting flashing the ROM again
For future readers, you should boot into safe mode (Google to find the key press combination for safe mode) and then reboot again. This will disable all magisk modules so you can go into the manager and remove the module/s causing the bootloop
CerealKiiller said:
For future readers, you should boot into safe mode (Google to find the key press combination for safe mode) and then reboot again. This will disable all magisk modules so you can go into the manager and remove the module/s causing the bootloop
Click to expand...
Click to collapse
Thank You So So Much. I already thought i'd have completely re set up every module and setting.
Hello Guys
Got issues with my 2 mi phones after the Stable Global MIUI 11
I assume that you can try to use this theory to resolve your boot loop with Magisk as well.
Requirement:
Unlocked the bootloader
Step 1. You need TWRP recovery.
And the phone can go to fastboot mode and use CMD
Code:
fastboot flash recovery twrp(whatever your twrp name).img
Some stock boot recovery the recovery img when you try to boot the phone
So in CMD
Code:
fastboot boot twrp(whatever your twrp name).img
Step 2 Install Magisk by putting it thro TWRP
Install Zip, after installation don't restart your phone yet (it will boot loop)
Use the File Manager in TWRP
Go to /data/adb/magisk/chromeos find "futility" file and chmod 644
Go to /data/adb/magisk find "BusyBox" file and chmod 664
Click to expand...
Click to collapse
Then you can restart the phone to system
Step 3 Edit google service database
Download SQL editor. Navigate to /data/data/com.google.android.gms/databases and open dg.db
Change any value contains "attest" the column C to from "10(most the case)" to "0"
Click to expand...
Click to collapse
If you see too many of them, you can clear cache and data for Play store, google service and google pay.
Step 4 Change permission to DB
Many ways of doing it, I still use the file manager in TWRP
Go to /data/data/com.google.android.gms/databases find "dg.db" file and chmod 440
Click to expand...
Click to collapse
Restart
Step 5 in Magisk Hide google Service and Google Pay
Then enjoy open your Google pay and add your card.
Hope this can help you.
Best
Zhu
Why to complicate that much, there is much easier way
Sent from my Redmi Note 8 Pro using Tapatalk
I would just like to point out that this isn't a solution per se, more of a dirty workaround. By using chmod 644 on those files you're crippling Magisk and a whole bunch of stuff will break...
This sounds like a better workaround, since it won't break Magisk functionality (untested by me, since I don't have any MIUI devices, so I can't confirm if it actually works):
https://forum.xda-developers.com/showpost.php?p=80995509&postcount=4
goulaobangzi said:
Hello Guys
Got issues with my 2 mi phones after the Stable Global MIUI 11
I assume that you can try to use this theory to resolve your boot loop with Magisk as well.
Requirement:
Unlocked the bootloader
Step 1. You need TWRP recovery.
And the phone can go to fastboot mode and use CMD
Code:
fastboot flash recovery twrp(whatever your twrp name).img
Some stock boot recovery the recovery img when you try to boot the phone
So in CMD
Code:
fastboot boot twrp(whatever your twrp name).img
Click to expand...
Click to collapse
After this, when you boot to TWRP, you can do factory reset, but you loose data...
Hello, on my pixel 3XL android 11 i have install edxposed sandhook and magisk riru.
Since then, I have a bootloop. Cannot delete because no TWRP. I have flashed the non-root image and can boot without root. If I remake a boot image via magisk and flash, I have the bootloop again.
How to uninstall old modules please?
I tried the following command during the bootloop :
adb wait-for-device shell magisk --remove-modules
Click to expand...
Click to collapse
the phone goes back to the fastboot and cannot restart as if it removes the boot.img
I just figured out how to do it.
I flashed the original boot.img and restart
I downloaded the recovery image and flash with magisk
https://androidfilehost.com/?w=files&flid=313291
Click to expand...
Click to collapse
fastboot flash boot image-newpixel3xl.img
adb wait-for-device shell magisk --remove-modules
fastboot flash boot magisk_patched.img
all done