[Guide] Flash Magisk on Android 12

Search This thread

myhuky3

Member
Nov 30, 2018
10
7
Trying to root the Pixel 5 running Android 12 by flashing a magisk-patched boot image results in the phone only booting to fastboot mode ("failed to load/verify boot images")
Some users have reported that booting (instead of flashing) the patched boot image works and makes root temporarily available but i didn't have any success with that.
The phone booted up but root didn't work.

I won't explain how to unlock the bootloader or set up adb here.

!Warning! This will wipe your phone so take a backup!

Also i do not take any responsibility if you break your device.
And if anything goes wrong just factory reset your device using the Android Flash Tool or by following this tutorial.

Here's what i did to get Magisk v22.0 working on the first developer preview of Android 12:


Install A12 with disabled AVB & dm-verity:
  1. Make sure USB-Debugging is enabled in developer-options and you have authorized the pc you're using on your phone.

  2. Boot your phone into fastboot mode.
    You can do this by turning it off and then starting it by holding Power + Volume Down
    until fastboot mode appears or just adb reboot bootloader

  3. Go here and click on the link for the Android Flash Tool.
    (I didn't copy the link directly so i don't have to update it everytime google releases a new update)

  4. It should ask you to allow the website to access ADB Keys. Click Ok.
    If the website somehow doesn't work, try using Google Chrome.

  5. Select your Pixel 5. If it's not showing up click add device.

  6. Click on the edit symbol (pen) in the box where the selected build is shown.

  7. Make sure Wipe Device, Disable Verity and Disable Verification are checked.

  8. Install and boot the phone when it's finished.

Patch & flash boot.img
  1. Download and install the Magisk Canary App from GitHub.

  2. Download the factory image from here and extract boot.img from it.
    (Inside the downloaded zip-file is another zip file containing the boot image)

  3. Copy the extracted boot.img to your phone and open the magisk app.

  4. Click on Install -> Select and Patch a File and let it do its magic.

  5. Copy the magisk-patched boot image that should be found in your phones download folder back to your PC.

  6. Reboot into fastboot mode as i explained earlier and flash the patched boot image.
    (fastboot flash boot magisk_patched.img)
    Then reboot the device.

Now root should be working. If it bootloops and says your phone has to be factory reset, do it.
If for some reason you still get an AVB-Error and end up stuck in fastboot mode just flash the stock image and try to patch it again.

This is my first post on here and i didn't have much time but i'm glad if it helped at least one person.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 4
    Trying to root the Pixel 5 running Android 12 by flashing a magisk-patched boot image results in the phone only booting to fastboot mode ("failed to load/verify boot images")
    Some users have reported that booting (instead of flashing) the patched boot image works and makes root temporarily available but i didn't have any success with that.
    The phone booted up but root didn't work.

    I won't explain how to unlock the bootloader or set up adb here.

    !Warning! This will wipe your phone so take a backup!

    Also i do not take any responsibility if you break your device.
    And if anything goes wrong just factory reset your device using the Android Flash Tool or by following this tutorial.

    Here's what i did to get Magisk v22.0 working on the first developer preview of Android 12:


    Install A12 with disabled AVB & dm-verity:
    1. Make sure USB-Debugging is enabled in developer-options and you have authorized the pc you're using on your phone.

    2. Boot your phone into fastboot mode.
      You can do this by turning it off and then starting it by holding Power + Volume Down
      until fastboot mode appears or just adb reboot bootloader

    3. Go here and click on the link for the Android Flash Tool.
      (I didn't copy the link directly so i don't have to update it everytime google releases a new update)

    4. It should ask you to allow the website to access ADB Keys. Click Ok.
      If the website somehow doesn't work, try using Google Chrome.

    5. Select your Pixel 5. If it's not showing up click add device.

    6. Click on the edit symbol (pen) in the box where the selected build is shown.

    7. Make sure Wipe Device, Disable Verity and Disable Verification are checked.

    8. Install and boot the phone when it's finished.

    Patch & flash boot.img
    1. Download and install the Magisk Canary App from GitHub.

    2. Download the factory image from here and extract boot.img from it.
      (Inside the downloaded zip-file is another zip file containing the boot image)

    3. Copy the extracted boot.img to your phone and open the magisk app.

    4. Click on Install -> Select and Patch a File and let it do its magic.

    5. Copy the magisk-patched boot image that should be found in your phones download folder back to your PC.

    6. Reboot into fastboot mode as i explained earlier and flash the patched boot image.
      (fastboot flash boot magisk_patched.img)
      Then reboot the device.

    Now root should be working. If it bootloops and says your phone has to be factory reset, do it.
    If for some reason you still get an AVB-Error and end up stuck in fastboot mode just flash the stock image and try to patch it again.

    This is my first post on here and i didn't have much time but i'm glad if it helped at least one person.
    2
    Hey, thanks for this. FYI @LazerL0rd (zest kernel) detailed here (click on the spoiler) how to do this with just the command line and factory images and without the need for the AFT.

    edit: formatting
    1
    Thanks for create this post.Works perfect,😊
    1
    Thanks for create this post.Works perfect,😊
    😊
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone