How to Patch boot.img with Magisk

Share:

Patching a boot.img with Magisk is the most common way to root an Android device. Here’s a step-by-step guide:


🔧 What You Need

  1. Magisk APK (latest version from GitHub).
  2. Your phone’s boot.img (extracted from your stock ROM or firmware).
  3. A PC with ADB & Fastboot installed (optional but recommended).
  4. USB cable.

📌 Steps to Patch boot.img

1. Prepare the boot image

  • Extract the stock ROM/firmware you downloaded for your device.
  • Locate the boot.img file.

2. Install Magisk

  • Rename Magisk-vXX.X.apkMagisk-vXX.X.apk (don’t unzip).
  • Install it on your phone like a normal APK (enable “Install from Unknown Sources”).

3. Copy boot.img to your phone

  • Move the boot.img file to your device’s internal storage (e.g., Downloads folder).

4. Patch boot.img with Magisk

  1. Open Magisk App.
  2. Tap InstallSelect and Patch a File.
  3. Browse and select your boot.img.
  4. Magisk will generate a patched file named something like: magisk_patched-XXXX.img It will be saved in Download folder by default.

5. Copy patched image back to PC

  • Transfer magisk_patched-XXXX.img from your phone to your PC.

6. Flash patched boot image

  • Reboot your phone into Fastboot/Bootloader mode.
  • Connect to PC and run: fastboot flash boot magisk_patched-XXXX.img
  • Once done, reboot: fastboot reboot

✅ After Reboot

  • Open Magisk App → it should show that Magisk is installed.
  • You now have root access.

⚠️ Important Notes:

  • Always use the stock boot.img from your exact firmware version. Wrong version = bootloop.
  • Some devices with A/B partitions may require flashing to the correct slot.
  • For Samsung devices, the process is slightly different (uses AP.tar instead of boot.img).
Share:

One response to “How to Patch boot.img with Magisk”

  1. OliviaChen Avatar

    This clarifies a lot of my confusion on the topic.

Leave a Reply

Your email address will not be published. Required fields are marked *