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

[Guide] Flash Magisk on Android 12

Search This thread
I just updated using the OTA, and I'm without root until I get home. I'm going to make sure I back everything up just in case.
Ever since the beta, I've just been boooting the patched kernel instead of flashing it. I can't deal with a data wipe. I thought it is going to be solved once the final a12 was out. This boot 2.0 is like planned obsolescence, because if I have start over, I might as well buy a new phone. It takes forever to set everything up again anyway.
I think you're being a little dramatic. We will figure it out, like we've figured everything else out. It just takes time, and Android 12 final has only been out for a day.

A data wipe isn't that big of a deal if you're backed up to your Google account.
 
  • Like
Reactions: hominine

snovvman

Senior Member
Jun 6, 2008
1,530
511
Not working for me on the final release. Just reboots right back to fastboot after flashing.

Edit: meant for that to be a response to @peikojose



Were you both on A12b with permanent root?
--Are you saying that after the general A12 release, the method in which you used to achieve permanent root no longer works?
--What was the update path?
--OTA via download or sideload, flashing full image?
--Also, what are the devices?
--Lastly, I presume your root method was flashing verity with flags and patched boot?

I'm trying to collect some data so we have a better understanding. Thanks.
 
  • Like
Reactions: V0latyle

snovvman

Senior Member
Jun 6, 2008
1,530
511
Here's to hoping that Pixel 6/Pro are rootable with current methods and there are no surprises:

"The [Tensor] chip also has a Tensor security core, which is a new system that will do processing on sensitive data separate from the main CPU. The chip also has a new Titan M2 onboard to work beside the Tensor security core.

Google said the Titan M2 has been made resilient to advanced attacks including electromagnetic analysis, voltage glitching, and laser fault injection."

Hoping these "features" won't affect our ability to root and pass SafetyNet.
 
  • Like
Reactions: V0latyle
Here's to hoping that Pixel 6/Pro are rootable with current methods and there are no surprises:

"The [Tensor] chip also has a Tensor security core, which is a new system that will do processing on sensitive data separate from the main CPU. The chip also has a new Titan M2 onboard to work beside the Tensor security core.

Google said the Titan M2 has been made resilient to advanced attacks including electromagnetic analysis, voltage glitching, and laser fault injection."

Hoping these "features" won't affect our ability to root and pass SafetyNet.
Well...Google has always been pretty developer friendly, and I can't see them suddenly turning around and making things difficult for us. Remember that they're basically trying to please two groups: They want to provide a solid device for casual users (and the big networks) that is stable, secure, and competitive....but they also want to promote innovation and flexibility, hence the availability of non-network locked devices and the ability to unlock the bootloader.

I don't know what all security enhancements are in Android 12, but given that the final release is very similar to the beta (210812.015 vs 210812.002) I don't think we will run into significant issues. The main purpose of the security core is "private" processing, so the device can quarantine security sensitive processes onto a separate CPU core. It's likely encryption will be involved with this.

The hardware enhancements are intended to resist compromise of an otherwise secure device; I would imagine deliberately compromising security, i.e. unlocking the bootloader, would disable or bypass some of these features.
 
  • Like
Reactions: snovvman

warrencoakley

Senior Member
May 1, 2014
915
164
45
Dublin
Were you both on A12b with permanent root?
--Are you saying that after the general A12 release, the method in which you used to achieve permanent root no longer works?
--What was the update path?
--OTA via download or sideload, flashing full image?
--Also, what are the devices?
--Lastly, I presume your root method was flashing verity with flags and patched boot?

I'm trying to collect some data so we have a better understanding. Thanks.
No,came from 11. At the moment the only way to achieve root is to wipe and reinstall
 
I'm pretty sure Verified Boot 2.0 has been a thing since Android 8 no?
The idea has been around, but I don't think it's ever actually been implemented before. Case in point: we could flash whatever we wanted on the P5 on Android 11, and on previous generations of Pixels, without ever having to worry about it.
 

warrencoakley

Senior Member
May 1, 2014
915
164
45
Dublin
Hi ! Yesterday I update A11 to A12 stable with ota adb and flash vmbeta.img and patch boot but doesn't work. I do wipe and flash Fi but loose root and playstore not certified no Netflix etc..
How I do to root it ? With Android flash tool wipe and dm verity etc... ?
But for the next update ? Loose data too ?
Thanks
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.

 
Last edited by a moderator:
  • Like
Reactions: ggkameleon
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.

Hi ! Thanks for response.
Yes if do wipe again same as you.
A noob question. It's possible to format data because my Pixel are crypt this is not the mistake ?
 
Last edited by a moderator:

warrencoakley

Senior Member
May 1, 2014
915
164
45
Dublin
Hi ! Thanks for response.
Yes if do wipe again same as you.
A noob question. It's possible to format data because my Pixel are crypt this is not the mistake ?
You'll just have to back up everything and follow the YouTube video and you'll be good to go. It's a real pain having to set up everything again. I'm hoping that disabling the 2 items mentioned going forward means that you can just sideload the patched Magisk boot img and your done. I'm sure I'll find out in November
 
You'll just have to back up everything and follow the YouTube video and you'll be good to go. It's a real pain having to set up everything again. I'm hoping that disabling the 2 items mentioned going forward means that you can just sideload the patched Magisk boot img and your done. I'm sure I'll find out in November
After I wiped, I was able to root. I don't know why we are having this issue, things were a lot easier on the beta.
 
  • Like
Reactions: warrencoakley
What it seems like at this point is that the same method for root that worked on the 12 Beta also works on the public release - except that a data wipe is required. Not sure why. Flashing vbmeta with the disable flags results in failure to boot and getting stuck in recovery with "Can't load Android system, your data may be corrupt".

Has anyone thus far been able to upgrade from either Android 11 or the 12 beta to the 12 public release, WITHOUT wiping data, AND has been able to root? The closest I've seen seems to be live booting the patched image with stock /boot and /vbmeta; root in this case obviously does not persist with a reboot.
 
  • Like
Reactions: snovvman

snovvman

Senior Member
Jun 6, 2008
1,530
511
What it seems like at this point is that the same method for root that worked on the 12 Beta also works on the public release - except that a data wipe is required. Not sure why. Flashing vbmeta with the disable flags results in failure to boot and getting stuck in recovery with "Can't load Android system, your data may be corrupt".

Has anyone thus far been able to upgrade from either Android 11 or the 12 beta to the 12 public release, WITHOUT wiping data, AND has been able to root? The closest I've seen seems to be live booting the patched image with stock /boot and /vbmeta; root in this case obviously does not persist with a reboot.

Thanks for your continued research. This makes me wonder if we will run into the same issue each month a patch is released. Any theories on what changed between A12b and A12GA?
 
Thanks for your continued research. This makes me wonder if we will run into the same issue each month a patch is released. Any theories on what changed between A12b and A12GA?
I'm honestly not sure. I have a couple theories - one being that they put something in the public release, possibly in the kernel, or maybe the first elements to load from /system, that will fail the boot process and order a reboot to recovery if -any- change is detected with either /boot or /vbmeta - but only if you didn't wipe data.

The reason I believe this is because after I updated using the OTA and before I did anything else, I tried to live boot the patched Magisk image from the beta. It -should- have either bootlooped or booted just fine with everything else being stock. But, it did the same thing as we all have experienced after flashing vbmeta with the disable flags - it attempted boot once, failed, and rebooted into recovery with the "Your data may be corrupt" message. I kept getting the same message after dirty flashing the factory image, with or without the flags, until I wiped /data.

I don't know if this will continue to be an issue going forward. It's damn near impossible to see what the kernel is doing during boot, which makes it also near impossible to pinpoint the problem.

I'm hoping that it's just for the initial root after upgrade, and won't be required for further upgrades.

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.
 
  • Like
Reactions: snovvman

warrencoakley

Senior Member
May 1, 2014
915
164
45
Dublin
Thanks for your continued research. This makes me wonder if we will run into the same issue each month a patch is released. Any theories on what changed between A12b and A12GA?

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.

 
Last edited by a moderator:

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