How to root Android 12 by using Magisk patched boot.img (Without TWRP)

The newest iteration of Android OS has officially been released and with that comes a plethora of new and exciting features. Moreover, the developers and techies will also feel the urge to take one step further and customize their devices to reap even more benefits. In that regard, gaining administrative privilege and accessing system partition will be the priority. This can easily be achieved by rooting your smartphone using Magisk.

However, as the Android 12 is still relatively new, there are some concerns as to how to root the smartphones. If you need any help in rooting Android 12 by using Magisk, this article will be perfect for you. Here, you’ll get to know the step-by-step instructions on how to root your device via Magisk patched boot.img.

How to root devices running Android 12 via Magisk patched boot.img (without TWRP)

Step 1: Install the Android SDK Platform Tools

First, install the Android SDK Platform on your PC. This will allow you to have the needed platform tools folder, which will be used in this guide.

Step 2: Enable USB debugging and OEM unlocking

After that, you should enable USB debugging and OEM unlocking on your phone. The former makes your device recognizable to the PC in ADB mode while the latter is needed for carrying out the bootloader unlocking process.

Do that by going to Settings -> About Phone -> Tap on Build Number 7 Times -> Head over the Settings -> System -> Advanced -> Developer Options -> Finally Enable USB debugging and OEM unlocking.

Root Android 12 by using Magisk patched boot.img (Without TWRP)

Step 3: Unlock the bootloader

Next, you should unlock the device’s bootloader. Remember, this will wipe off all the data from your smartphone while also nullifying the warranty.

Step 4: Download stock firmware

Now, you’ll need to download the stock firmware for your smartphone. Ensure that you’re downloading the correct version that needs to be installed. Then, extract the firmware to a convenient location on your PC.  You will need to use two files for rooting your device. The first one will be the “stock boot.img” for rooting and “vbmeta” file for disabling the DM Verity (this will only apply for Pixel devices, from Pixel 4A 5G all the way to Pixel 6 Series).

Step 5: Extract Boot.img from firmware

You’ll have to get hold of the stock boot.img file from the firmware you’ve just downloaded. For Pixel smartphones, you can just extract the firmware and get the file. For other OEMs, it’ll be different and you’ll have to refer to device-specific guides for extracting the stock boot.img file for the device.

Step 6: Patch the stock boot.img via Magisk

  • Install the Magisk app on your device.
  • Ensure that the boot.img is transferred to your device.
  • Now, tap on the Install button located next to Magisk.
  • In the Method section, choose Select and Patch a file.
  • After that, browse to the extracted boot.img file before selecting it.
  • Tap on the Let’s Go option located at the top right corner.
  • Magisk will load the boot.img file and then patch it accordingly. Once that is done, you will get the Download Complete message.
  • The patched file will get saved in Internal Storage -> Downloads. The name of the file would be “magisk_patched.img”.
  • If there are any additional characters at the end of the file name, delete them such that the complete name remains “magisk_patched.img”.
  • Transfer the file to the platform-tools folder on your desktop.

Step 7: Boot to Fastboot mode

  • Connect your phone to the PC via USB cable. Ensure that USB debugging is enabled.
  • Head over to the platform-tools folder and type in CMD in the address bar before hitting enter.
  • In the CMD window, type in the following command for booting your device to Fastboot mode –
    • adb reboot bootloader

Step 8: Disable AVB and DM Verity

This step isn’t required for Android 12 Stable versions. If you have a stable version, skip over to the next step. For Pixel users starting from Pixel 4A 5G to Pixel 6 Series, you will have to flash this vbmeta file.

  • Go to the extracted firmware folder and you’ll find a “vbmeta.img” file. Transfer the file to the platform-tools folder on your PC.
  • Type in this command in the CMD window that you’ve opened –
    • fastboot flash –disable-verity –disable-verification vbmeta vbmeta.img

Step 9: Flash Patched boot.img via Fastboot

Continue if you’re not using Pixel 4A 5G, 5, 5A, and 6 Series. There instructions will not work for Pixel devices.

  • Firstly, ensure that you have transferred the Patched boot.img file to the platform-tools folder. Rename the file to “magisk_patched_boot.img”.
  • Type this command in the CMD window that you’ve opened in the platform-tools folder –
    • fastboot flash boot magisk_patched_boot.img
  • The file will be flashed to the current active slot.
  • Finally, you will now reboot the device to the OS using the following command –
    • fastboot reboot
  • Done!!!!
Aviral Sharma
Aviral Sharma
Aviral Sharma is a talented and passionate writer who has been using words to express his thoughts ever since he learnt how to hold a pen. He is passionate about outer space, history, sports and most importantly technology. Aviral is a regular writer for rootmygalaxy.net and has been getting better by the day. He currently own Samsung Galaxy S24 Ultra, iPhone 13 and a HP Pavilion laptop

Leave a Comment