Home > Magisk Manager

How to Fix Bootloop after Flashing magisk_patched.img

In this guide, we will show you the steps to fix the bootloop issue after flashing the magisk_patched.img file. Rooting is considered an absolute necessity when it comes to gaining administrative privileges or getting access to the system partition. In this regard, there are two different methods that you could take, both of which involve the use of the Magisk App (as is now known as, beginning with version 22).

The first method is a pretty straightforward one, you only need to flash the Magisk ZIP via TWRP and your device stands rooted. However, not every device has a working TWRP. Likewise, some users prefer to keep a safe distance from flashing this custom recovery due to the complexity involved (especially after the A/B vs A partition change). All these reasons combined, users generally flock over to the second method.

This involves extracting the boot.img from the stock firmware, patch it via Magisk and flash it via Fastboot Commands. While it involves quite a few steps but is a tried and tested method. With that said, it isn’t free from its fair share of issues as well. One among them is when the user ends up in a bootloop after flashing the magisk_patched.img file. If you are also getting bugged with this issue, then this guide is here to help you out. Follow along.



The Reason for Bootloop after flashing Magisk Patched Boot.img File

fix bootloop after flashing magisk_patched.img

So why does this issue arises in the first place? Well, it happens when the boot partition on your device gets corrupted. And one of the major reasons for the same is when you have patched and flashed the incorrect build of boot.img. Always remember that you need to use the stock boot.img file that corresponds to the current build number of your device.

In other words, you should download the same firmware version that is currently installed onto your device. If you don’t do so but rather try out the rooting using an older or newer build of the stock firmware, then the issue is imminently bound to happen. So with this, you would have got a perfect idea regarding the reason for this issue. Let’s now check out the steps to fix the bootloop after flashing the magisk_patched.img file.

How to Fix Bootloop after Flashing magisk_patched.img

The below instructions are listed under separate sections for ease of understanding. Make sure to follow in the exact same sequence as mentioned below. Droidwin and its members wouldn’t be held responsible in case of a thermonuclear war, your alarm doesn’t wake you up, or if anything happens to your device and data by performing the below steps.

Download Stock Firmware

To begin with, download the stock firmware for your device. Make sure to download the same version that is currently installed on your device. You may verify the same by going to the About Phone section of your device.

Extract Stock Firmware

Once downloaded, extract it to any convenient location on your PC. While some OEMs pack their firmware in ZIP/RAR/TGZ format and you could easily extract it via WinRAR. On the other hand, OnePlus have it inside payload.bin, LG in KDZ/DZ, and Oppo and Realme have it in OZIP. So you may refer to the below guides if you own any of these devices.

Install Android SDK

install adb platform tools windows

Next up, install the Android SDK Platform Tools on your PC. This is the official ADB and Fastboot binary provided by Google and is the only recommended one. So download it and then extract it to any convenient location on your PC. Doing so will give you the platform-tools folder.



Boot Bootloop Device to Fastboot Mode

You will now have to boot your device to Fastboot Mode. Since the device is in a bootloop. you wouldn’t be able to use the adb reboot bootloader. So you would have to use the hardware key combinations for the same.

While there are no universal combinations as such, most devices follow the pattern of powering off the device and then pressing and holding the Volume Down Keys (if that doesn’t work out, then you may try with the Volume Up key as well). Once done, let’s now move over to the final step of this guide to fix the bootloop after flashing magisk_patched.img.

Flash Stock Boot.img to Fix magisk_patched.img Bootloop

  1. Transfer the stock boot.img file to the platform-tools folder on your PC.
  2. Now connect your device to the PC via USB cable.
  3. Head over to the platform-tools folder, type in CMD in the address bar, and hit Enter. This will launch the Command Prompt.
    command-prompt-adb
  4. Now if your device is A-only single slot (i.e. if you have flashed the magisk_patched boot.img to only one slot), then type in the below command to flash the stock boot.img file:
    fastboot flash boot boot.img
  5. On the other hand, if your device is dual partition A/B (i.e. if you have flashed the magisk_patched boot.img to both the slots), then you will have to flash the stock boot.img to both the slots, via the following two commands:
    fastboot flash boot_a boot.img
    fastboot flash boot_b boot.img
  6. Once that is flashed, you may now reboot the device to the OS via the following command:
    fastboot reboot
  7. This should boot the device to the OS. However, if that doesn’t happen and your device is still stuck in a bootloop, then you would have to flash the entire stock firmware via Fastboot. For that, please refer to our guide to Flash Stock Firmware via Fastboot Commands.

So this was all from this guide on how to fix the bootloop issue after flashing the magisk_patched.img file. If you have any queries concerning the aforementioned steps, do let us know in the comments. We will get back to you with a solution at the earliest.

Share:
  • So i flashed the magisk_patched boot.img file to partition B but when i exited the bootloader from adb, it sent my phone into a bootloop. I then shifted to partition A and the phone works fine. When i flashed it through Partition A. it gave me error? If i flash the magisk_patched file to both partion A and B, will it still cause me a bootloop?

  • Phan trahn

    “You will now have to boot your device to Fastboot Mode. Since the device is in a bootloop. you wouldn’t be able to use the adb reboot bootloader. So you would have to use the hardware key combinations for the same.”
    My phone is in boot loop after flashing magisk_patched.img which was created from magisk verison 23. I tried volume down + power, volume up + power, volume up + volume down + power and could not get into fastboot nor recovery at all. As such, I could not flash stock boot.img to fix the boot loop. How do I get into fastboot when all button combinations fail to work? My phone is oukitel WP 15. Please help. Thanks.

  • TheDon13

    Hi Sadique

    A huge thank you for all your advice on android phone rooting. Your articles are so very helpful, clear & concise and have allowed me to retrieve many a phone over the past few years. Thanks for all you do