• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[Guide] Flash Magisk on Android 12

Search This thread
Follow this video, this worked for me. I'm worried aswell do I need to do this process again for the November patch which I won't. It took me hours to log into apps, setting up routines and tasks and re-connecting smart watches. If the only way is to do the wipe etc again, I will just revert back and lose root as it's not worth the hassle. You can get Netflix, Disney + from other sites.

Yes That work fine I'm on A12 Stable and Root but do configure all same as you (Bluetooth, Amazfit, Account & Reinstall all App's not backup with Google backup & springboard "Yes I'm an old ios iPhone 5 and like many App's on springboard on Pixel it's not good same as Samsung) Many work and can't make it all month not possible if they hadn't feature for update it without loose data no root enough.
Have a good day
 
Last edited by a moderator:
Just had to uncheck 2 things.

This guy explains it in his tutorial.

Hopefully by doing this once means we can update the security patches as normal but it does mean a wipe first to achieve it.

Not to be rude, you don't need to repost the video or the tutorial - first of all, he's following the instructions posted at the beginning of this thread; additionally, many of us already know how to use Android Flash Tool, if not ADB.

This is not new information, nor is it a solution. If you read back through this thread, we discovered exactly why disabling verity and verification was required on the 12 Beta.

What is currently unknown is why data wipe is required on the stable release.
 
  • Like
Reactions: snovvman
Just trying to help. Good luck with your search 👍
We appreciate the help, it's just pretty redundant to post a video which references the original post in this exact thread, and it's not exactly helpful to post something as a solution or fix when it involves doing something we are already aware of - a factory reflash with a wipe.
 
I am still on beta 5 and staying there to be safe.
Reason, I will be moving to the Pixel 6 next week when it arrives. And it will be a whole new ball game.
Well, it stands to reason that the general process would be similar to the Pixel 5 - unlock bootloader, disable dm-verity and vbmeta verification, and run a patched boot image. Of course with the Titan M2, there's no telling.

It's surprising that they haven't released the firmware yet.
 
  • Like
Reactions: vandyman

snovvman

Senior Member
Jun 6, 2008
1,530
511
What is currently unknown is why data wipe is required on the stable release.

The only way to really know for sure is for someone who has upgraded and has working root, to attempt to dirty flash the factory image and see if they run into the same problem.

I will try this in the next couple of days on my P3 XL. Before I do, why would I not sideload the A12GA OTA, flash verity, flash boot and see if that works? Help me understand the reason for factory image. Thanks.

Edit: I re-read your post and see that you already tried the OTA route and was only able to get temp root (w/o verity flash, which is strange). I will try factory and let you know how it goes. I presume as part of the process I should flash verity with flags?
 
Last edited:
  • Like
Reactions: V0latyle

vandyman

Senior Member
Jul 30, 2012
549
219
S.Jersey
Google Pixel 5
Google Pixel 6
Well, it stands to reason that the general process would be similar to the Pixel 5 - unlock bootloader, disable dm-verity and vbmeta verification, and run a patched boot image. Of course with the Titan M2, there's no telling.

It's surprising that they haven't released the firmware yet.
I believe the firmware will be released on October 28th when the P6 is officially released.
 
I will try this in the next couple of days on my P3 XL. Before I do, why would I not sideload the A12GA OTA, flash verity, flash boot and see if that works? Help me understand the reason for factory image. Thanks.

Edit: I re-read your post and see that you already tried the OTA route and was only able to get temp root (w/o verity flash, which is strange). I will try factory and let you know how it goes. I presume as part of the process I should flash verity with flags?
I would say yes - but dm-verity and vbmeta verification have not been implemented on the 3XL to my knowledge. So, all you should have to do is sideload the OTA, then flash a patched boot image.
I believe the firmware will be released on October 28th when the P6 is officially released.
That would make sense. I didn't preorder the P5, but I downloaded the factory firmware before I even got the phone.
 
I've posted status updates in the OP of both of my threads (the guide and the discussion) as to the current status of Android 12 root.

Currently, this is where we are at:

* Flashing /vbmeta or /boot after upgrade results in "data corrupted" error
* Patched image can be live booted (not flashed) for temporary root, as long as /vbmeta and /boot are untouched; if you never reboot your phone this can be a temporary workaround if you don't want to wipe /data
* Permanent root works after factory reset
 

peikojose

Senior Member
May 13, 2012
1,038
178
I've posted status updates in the OP of both of my threads (the guide and the discussion) as to the current status of Android 12 root.

Currently, this is where we are at:

* Flashing /vbmeta or /boot after upgrade results in "data corrupted" error
* Patched image can be live booted (not flashed) for temporary root, as long as /vbmeta and /boot are untouched; if you never reboot your phone this can be a temporary workaround if you don't want to wipe /data
* Permanent root works after factory reset
What would happen in the next month? Factory reset again?
 
  • Like
Reactions: tintn00+xda

HumorBaby

Member
Oct 22, 2021
13
14
Google Pixel 5
I've posted status updates in the OP of both of my threads (the guide and the discussion) as to the current status of Android 12 root.

Currently, this is where we are at:

* Flashing /vbmeta or /boot after upgrade results in "data corrupted" error
* Patched image can be live booted (not flashed) for temporary root, as long as /vbmeta and /boot are untouched; if you never reboot your phone this can be a temporary workaround if you don't want to wipe /data
* Permanent root works after factory reset

I have found that I was able to go from 12b5 to 12 release without wipe and keeping root.

The main difference I am seeing between what I have done and others is that I manually applied the OTA update with adb sideload then I was able to flash vbmeta (with verity disabled) as well as the patched boot img from the factory image, all in one go WITHOUT a reboot.

Pixel 5:
I have successfully (seemingly) gone from a 12b5 to release 12 without a data wipe. Root, safetynet, GPay, are unaffected after 2 reboots so far.

I went in prepared to have to wipe after flashing vbmeta with the disable flags, but I didn't need to. Maybe the trick is to sideload OTA upgrade, then flash vbmeta and patched boot image without rebooting in between??

Anyway, here are the details:

Just like @V0latyle and others , I started from 12b5 (clean wipe flash coming from Android 11), rooted, then set up Riru, LSPosed, etc. for safetynet+GPay.

Back when I did the clean wipe 11 -> 12b5, I had used --disable-verification and --disable-verity in flash-all.sh:
Bash:
...
fastboot --disable-verification --disable-verity -w update image-...
...

Process to upgrade to release:
- Download release factory AND OTA images
- Extract vbmeta.img and boot.img from the factory image
- Patch boot.img using Magisk App on 12b5 phone and pull back to my PC
- sideload OTA without reboot, switch to fastboot mode
- flash vbmeta.img
- flash magisk_patched_boot.img
- reboot, breath sigh of relief after successful boot (and reboot) with root+data intact

pseudo-commands:
Code:
$ adb reboot sideload
$ adb sideload redfin-ota-sp1a.210812.015-2596fc07.zip
## Once OTA upgrade is complete, you should be dropped into recovery menu.
## Pick "Boot to fastboot"
$ fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img
## Disable verity and verification for consistency
$ fastboot flash boot magisk_patched-23001_BLAHB.img
$ fastboot reboot
 
  • Like
Reactions: V0latyle
I have found that I was able to go from 12b5 to 12 release without wipe and keeping root.

The main difference I am seeing between what I have done and others is that I manually applied the OTA update with adb sideload then I was able to flash vbmeta (with verity disabled) as well as the patched boot img from the factory image, all in one go WITHOUT a reboot.
I didn't know you could reboot directly into sideload mode. I thought you had to reboot to recovery and manually enable sideload mode. Good tip, thank you.

I have to wonder if this would work for anyone who's already upgraded?
 
Looking at the details on Android Verified Boot, the only other element I can find is rollback protection - but from what I can see, that's disabled on an unlocked bootloader. There's a corrupted data screen for EIO mode, but we already get the UNLOCKED screen during boot.

Here's the odd thing:

The corrupted data message we have been seeing seems to appear in recovery - which resides in the /boot partition along with the kernel.

In the details on how dm-verity works, it says that the protection lives in the kernel.

So maybe we need to use the --disable-verity flag when flashing /boot as well? I'm just guessing here, but perhaps there's some sort of check where dm-verity looks for verification to be enabled on /vbmeta, and if it doesn't find it, goes into recovery mode with the "corrupted data" message.

The problem with this theory is that it happens with older boot images too, such as the beta, where we did NOT see this issue.

I did find this thread which details how Magisk can be used to disable dm-verity.

Ultimately, someone is going to have to be the guinea pig and test some ideas while we try to sort this out. Volunteers?
 
However for those who didn't disable the 2 V's previously I don't see any other way around it than to wipe
At this point we are just guessing, and will have to see what happens when we get there.

Don't forget that we cannot mix and match vbmeta and boot - at least with this first release of 12 Stable, both vbmeta and boot have to be from the same build. So, if whatever is causing this problem is not changed with the next update, it's very likely that flashing vbmeta again without a data wipe will result in a corruption error.

Again, we are just guessing, but it seems fairly logical.
 

warrencoakley

Senior Member
May 1, 2014
915
164
45
Dublin
If your in need of root as in now then a wipe is the only way. It's a pain and time consuming however it's always good once in a while to start a fresh and get rid of any bugs or issues you may have built up in the past.
 
If your in need of root as in now then a wipe is the only way. It's a pain and time consuming however it's always good once in a while to start a fresh and get rid of any bugs or issues you may have built up in the past.
No...we can still temp boot the patched image without flashing it. Reboot obviously loses root but it's a good temporary solution.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 3
    Universal SafetyNet Fix 2.2.0 is out on public release for those of you who want to use the new Zygisk.
    2
    It's not easy, you basically have to look at the canary channel commits, and they're all named "app-debug"

    Magisk 23001
    Monitor this and you should be able to keep privy of releases (aside from the app notifying you of such).

    2
    Good evening.
    Yes I would do it like that next time.

    It's just that I wanted to explain the situation well and especially to know if it was necessary to flash the "vbmeta.img & verity & verification" to return to the original Boot.img and same for Re-Root and flash the "modified Boot.img".
    But you answered my question and thank you. it's not necessary ! only for an update.
    Have a good day thanks again
    Restoring the boot image does not require that you do anything with vbmeta. In fact I would recommend that you don't.
    2
    thanks for the response.

    The phone is 100% stock, running 12.0 (current firmware), only thing I’ve done so far is unlock the boot loader and create the patched boot file.

    I’ll reflash the current firmware using the web-ui and force flash all partitions, and report back.
    Make sure you check "Disable Verity" and "Disable Verification" too.
    1
    Pixel 5
    A12

    I solved the issue by patching boot.img with latest app, then flashing magisk_patched-boot.img in fastboot.
    (y)
  • 19
    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.
    6
    @Anonshe posted ths method in the Pixel 6 Pro thread. Does this work for the Pixel 4a 5(G), Pixel 5 or the Pixel 5a?
    Just updated my Pixel 5 to the November Sec Patch without any data loss. Since I'd disabled vbmeta before, steps were simple:
    - Used Payload Dumper to extract the boot and vbmeta images. Patched the former.
    - Rebooted to Recovery
    - Sideloaded the OTA package
    - Reboot to bootloader from the recovery menu
    Code:
    fastboot --disable-verification --disable-verity flash vbmeta vbmeta.img
    Code:
    fastboot boot magisk_patched.img

    After it booted up, opened Magisk Manager, installed via Direct Install. All works fine.
    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
    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.
    4
    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