• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!
  • Fill out your device list and let everyone know which phones you have!    Edit Your Device Inventory

[Guide] Flash Magisk on Android 12

Search This thread

Machuda

Member
Jun 7, 2021
8
0
100% working

Easy update and root and keep your data

You can always update to the latest build and keep your data

Like the first time installation with more 1 step


  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. make sure Wipe Device , Lock Bootloader , Force Flash all Partitions are unchecked .​

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


and finally Patch & flash boot.img

100% not working. After it was done, it said the android system could not be loaded. I had to flash vbmeta to fix it.
 

mistermojorizin

Senior Member
Dec 21, 2011
839
181
Google Pixel 5
I moved vbmeta.img from the zip to disk and flashed this new vbmeta with the disable flags, like in the howto.
Sorry, just to clarify, by "new vbmeta" you mean just the stock on from beta 2? I thought you needed to flash an empty one.

which "how to" you referring to? The OP in this thread doesn't mention vbmeta it's using the flash tool which I can't seem to get to recognize my phone
 

Machuda

Member
Jun 7, 2021
8
0
Sorry, just to clarify, by "new vbmeta" you mean just the stock on from beta 2? I thought you needed to flash an empty one.

which "how to" you referring to? The OP in this thread doesn't mention vbmeta it's using the flash tool which I can't seem to get to recognize my phone

I sometimes have problems with the flash tool. You need to disable the adb server using adb kill-server command. Another thing to check is to make sure USB debugging is turned on.
 

mistermojorizin

Senior Member
Dec 21, 2011
839
181
Google Pixel 5
I'm rooted and I don't want to do a full wipe in order to upgrade to the Android 12 Beta 2. Has anyone tried to use the following method yet?

Preparation:
A. Download the OTA
B. Download the Factory Image and extract vbmeta.img

1. Boot into Recovery
2. Select "Apply update from ADB".
3. From the CMD window --> adb sideload ota.zip
4. After the update go to "Enter fastboot"
5. From the CMD window --> fastboot flash --disable-verity --disable-verification vbmeta vbmeta.img
6. Reboot

I tried this method with 2 modifications.

Step 0 - boot to bootloader switch to slot A (my system is on slot B and slot A is inactive). Recovery flashes the OTA to the inactive slot. So without this step, it was flashing it to Slot A.

Ste 4 - reboot to bootloader

Anyway it didn't work. It wouldn't even try to boot. I was able to flash the stock vbmeta.img without disabling verfication and then at least it was able to boot.
 

Machuda

Member
Jun 7, 2021
8
0
I tried this method with 2 modifications.

Step 0 - boot to bootloader switch to slot A (my system is on slot B and slot A is inactive). Recovery flashes the OTA to the inactive slot. So without this step, it was flashing it to Slot A.

Ste 4 - reboot to bootloader

Anyway it didn't work. It wouldn't even try to boot. I was able to flash the stock vbmeta.img without disabling verfication and then at least it was able to boot.
Yes that's the same problem I'm having. It won't boot with vbmeta modified.
 

kafisc

Senior Member
Aug 30, 2011
63
33
The problem is you just need to disable verity and verificaion once (only possible with a full wipe).

I'm using the Android Flash Tool for Beta 2.1:
https://flash.android.com/preview/beta2.1

I'm using the Android Flash Tool for Beta 3:
https://flash.android.com/preview/beta3

Also download the latest factory image (and extract boot.img):
https://developer.android.com/about/versions/12/download

Within the flash tool uncheck every option (just to be sure).
Only check "Disable Verity" and "Disable Verificaion" and click on flash.
Boot into OS and reboot again.
Patch original boot.img with Magisk.
Reboot to fastboot and flash boot patched_magisk.img.
Done.

You can do this with every update. Always be sure that "Disable Verity" and "Disable Verificaion" are checked when upgrading (and nothing else like Lock Bootloader and so on).

You may need to wipe once. But after the first initial wipe, you don't need to wipe when you upgrade. You just need to be sure "Disable Verity" and "Disable Verificaion" are checked when upgrading.

I'm doing it this way since the first beta an everything is working and I didn't need to wipe again till this day.
 
Last edited:

pax2011

Senior Member
Feb 6, 2016
70
16
Has anyone sucefully rooted beta 3?
Patched boot image with magisk canary if I only boot the image it starts
Then tried to flash patched boot image and get stuck in bootloader
 

jshbrmn

Member
Jun 18, 2021
5
7
Has anyone sucefully rooted beta 3?
Patched boot image with magisk canary if I only boot the image it starts
Then tried to flash patched boot image and get stuck in bootloader
For all the updates from beta 2 - 3 I've followed this process without fail:

- extract boot.img and vbmeta.img from downloaded beta of your relevant device
- add boot.img to phone (if downloaded, and extracted on another device)
- patch boot.img in magisk (i like to rename it to patched_magisk.img)
- move patched_magisk.img to desktop
- download and install latest beta from the OTA provided
- tap the reboot button on the OTA install screen once completed
- once the reboot begins and your screen turns black hit the power and volume down button to get into fastboot
- run
fastboot --disable-verity --disable-verification flash vbmeta path/to/vbmeta.img (you can drag img from location)
- then run
fastboot flash boot path/to/patched_magisk.img (you can drag img from location)

This has worked flawlessly, maintaining root while also keeping all my data.
 
Last edited:

SadaUkyo

New member
Apr 26, 2021
4
0
For all the updates from beta 1 - 3 I've followed this process without fail:

- extract boot.img and vbmeta.img from downloaded beta of your relevant device
- add boot.img to phone (if downloaded, and extracted on another device)
- patch boot.img in magisk (i like to rename it to patched_magisk.img)
- move patched_magisk.img to desktop
- download and install latest beta from the OTA provided
- tap the reboot button on the OTA install screen once completed
- once the reboot begins and your screen turns black hit the power and volume down button to get into fastboot
- run
fastboot --disable-verity --disable-verification flash vbmeta path/to/vbmeta.img (you can drag img from location)
- then run
fastboot flash boot path/to/patched_magisk.img (you can drag img from location)

This has worked flawlessly, maintaining root while also keeping all my data.
Can I do this when I already updated to beta 3?
 

bleez99

Senior Member
May 1, 2011
254
178
Yeah I wouldn't do this unless you've started from the initial process op outlined. I did this moving from beta 2 to 2.1 and then beta 2.1 to beta 3. However beta 2 was my first android 12 install, which I used ops procedure to achieve.

Do this:
You don't need the Android flash tool. I have been manually flashing full images for a long time:
I don't like things done behing my back.

For beta 3:
I flash both sides hence the skip secondary - it saves a few seconds.
When flashing - watch what's scrolling by. The vbmeta.img is modified on the fly.
No need to copy from another build or someone else's hack.
Below is what I use. Successfully.

Modify the last line in the flash-all.bat or.sh
fastboot --skip-reboot --skip-secondary --disable-verity --disable-verification update image-redfin-spb3.210618.013.zip
 

Top Liked Posts

  • There are no posts matching your filters.
  • 5
    For those of you who don't have safetynet working, here.
    All credit goes to @kdrag0n, I just modified the shell scripts for B3

    Pull request done if you don't want my zip.
    3
    Has anyone sucefully rooted beta 3?
    Patched boot image with magisk canary if I only boot the image it starts
    Then tried to flash patched boot image and get stuck in bootloader
    For all the updates from beta 2 - 3 I've followed this process without fail:

    - extract boot.img and vbmeta.img from downloaded beta of your relevant device
    - add boot.img to phone (if downloaded, and extracted on another device)
    - patch boot.img in magisk (i like to rename it to patched_magisk.img)
    - move patched_magisk.img to desktop
    - download and install latest beta from the OTA provided
    - tap the reboot button on the OTA install screen once completed
    - once the reboot begins and your screen turns black hit the power and volume down button to get into fastboot
    - run
    fastboot --disable-verity --disable-verification flash vbmeta path/to/vbmeta.img (you can drag img from location)
    - then run
    fastboot flash boot path/to/patched_magisk.img (you can drag img from location)

    This has worked flawlessly, maintaining root while also keeping all my data.
    3
    Yeah I wouldn't do this unless you've started from the initial process op outlined. I did this moving from beta 2 to 2.1 and then beta 2.1 to beta 3. However beta 2 was my first android 12 install, which I used ops procedure to achieve.

    Do this:
    You don't need the Android flash tool. I have been manually flashing full images for a long time:
    I don't like things done behing my back.

    For beta 3:
    I flash both sides hence the skip secondary - it saves a few seconds.
    When flashing - watch what's scrolling by. The vbmeta.img is modified on the fly.
    No need to copy from another build or someone else's hack.
    Below is what I use. Successfully.

    Modify the last line in the flash-all.bat or.sh
    fastboot --skip-reboot --skip-secondary --disable-verity --disable-verification update image-redfin-spb3.210618.013.zip
    1
    Seems no-one here tried @vvb2060 Magisk Alpha yet. 😉

    Nb. Target SDK (API) bumped to 31
    https://forum.xda-developers.com/t/magisk-general-support-discussion.3432382/post-85350767

    Latest changes commits (link above for others):
    • App adapted to Android 12
    • Android 12+ super user hides the screen overlay when the window pops up
    🤠 PW
    1
    Can this be installed over the official magisk app (canary) ?
    Need to replace App to see Alpha channel (it's not John's).

    I had no issues just installing app with Canary App installed; you can try. Others needed to uninstall it first (due to different signing keys?).

    Nb. Data / modules / settings are not lost or affected simply by uninstalling App as they remain in /data/adb unless Uninstall (full) is run from App or recovery. 👍 PW
  • 10
    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.
    5
    For those of you who don't have safetynet working, here.
    All credit goes to @kdrag0n, I just modified the shell scripts for B3

    Pull request done if you don't want my zip.
    4
    Hey just wondering how you achieved root with beta 2? I've tried a few things and haven't seem to be able to get it working (bootloop).

    Is there a definitive process out there?
    4
    The problem is you just need to disable verity and verificaion once (only possible with a full wipe).

    I'm using the Android Flash Tool for Beta 2.1:
    https://flash.android.com/preview/beta2.1

    I'm using the Android Flash Tool for Beta 3:
    https://flash.android.com/preview/beta3

    Also download the latest factory image (and extract boot.img):
    https://developer.android.com/about/versions/12/download

    Within the flash tool uncheck every option (just to be sure).
    Only check "Disable Verity" and "Disable Verificaion" and click on flash.
    Boot into OS and reboot again.
    Patch original boot.img with Magisk.
    Reboot to fastboot and flash boot patched_magisk.img.
    Done.

    You can do this with every update. Always be sure that "Disable Verity" and "Disable Verificaion" are checked when upgrading (and nothing else like Lock Bootloader and so on).

    You may need to wipe once. But after the first initial wipe, you don't need to wipe when you upgrade. You just need to be sure "Disable Verity" and "Disable Verificaion" are checked when upgrading.

    I'm doing it this way since the first beta an everything is working and I didn't need to wipe again till this day.
    3
    Has anyone sucefully rooted beta 3?
    Patched boot image with magisk canary if I only boot the image it starts
    Then tried to flash patched boot image and get stuck in bootloader
    For all the updates from beta 2 - 3 I've followed this process without fail:

    - extract boot.img and vbmeta.img from downloaded beta of your relevant device
    - add boot.img to phone (if downloaded, and extracted on another device)
    - patch boot.img in magisk (i like to rename it to patched_magisk.img)
    - move patched_magisk.img to desktop
    - download and install latest beta from the OTA provided
    - tap the reboot button on the OTA install screen once completed
    - once the reboot begins and your screen turns black hit the power and volume down button to get into fastboot
    - run
    fastboot --disable-verity --disable-verification flash vbmeta path/to/vbmeta.img (you can drag img from location)
    - then run
    fastboot flash boot path/to/patched_magisk.img (you can drag img from location)

    This has worked flawlessly, maintaining root while also keeping all my data.