[Guide] Flash Magisk on Android 12

Search This thread

jshbrmn

Member
Jun 18, 2021
5
8
There are other methods that will likely be developed and supported, but this one will remain an option for the finished version of 12.
 

tauio111

Senior Member
Feb 27, 2011
615
424
Google Pixel 5
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
Ach right, so you can pass the arguments to a fastboot update command and not just flashing vbmeta. Hoped so, but did not find a single hint on Google about it actually working. Haven't tried it yet though.
 

bleez99

Senior Member
May 1, 2011
313
263
Nvidia Shield
Google Pixel 6 Pro
Do you think this will be necessary once the finished version of Android 12 is out?
Probably. How hard is it to modify flash-all.sh?
I apply the monthly updates myself, I always modify the shell script.

Keep --disable-verity --disable-verification in the fastboot command line. You don't need the others I'm showing, it's just how I approach updates. I flash the current slot, no reboot, change the slot, flash again. That way I flip flop slots each month. Just my OCD showing. The --skip-secondary option is my preference when flashing both a and b slots. I'll reboot myself when finished.
I wouldn't recommend the --skip-secondary when only flashing the current slot.

fastboot --skip-reboot --skip-secondary --disable-verity --disable-verification update image-redfin-spb3.210618.013.zip
 

bleez99

Senior Member
May 1, 2011
313
263
Nvidia Shield
Google Pixel 6 Pro
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.
 

Attachments

  • Screenshot_20210717-192000.png
    Screenshot_20210717-192000.png
    80.1 KB · Views: 35
  • safetynet-fix-SPB3-v1.2.0.zip
    1.4 MB · Views: 48
Last edited:

bleez99

Senior Member
May 1, 2011
313
263
Nvidia Shield
Google Pixel 6 Pro
Ach right, so you can pass the arguments to a fastboot update command and not just flashing vbmeta. Hoped so, but did not find a single hint on Google about it actually working. Haven't tried it yet though.
I did - you'll be good to go. And I have safetynet.
Google Pay is set up, no rejected cards, but I haven't made a purchase yet. Confidence is high.
 

Jiggs82

Senior Member
Dec 22, 2010
5,960
2,858
The Bronx, NY
Google Pixel 6 Pro

pndwal

Senior Member
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
 
  • Like
Reactions: Jiggs82

yoyo linuxien

Member
Feb 7, 2008
42
13
Seems no-one here tried @vvb2060 Magisk Alpha yet. 😉

Nb. Target SDK (API) bumped to 31
https://xdaforums.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
Tried it on a Pixel 4a 5G. I am on Android 12 beta 3, never disabled verity because I don't want to wipe it.

I still get the same error at boot : failed to load/verify ...
 

bgboii

Senior Member
Jan 7, 2013
659
64
www.youtube.com
Google Pixel 7 Pro
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
could I do this with ota?
 

bleez99

Senior Member
May 1, 2011
313
263
Nvidia Shield
Google Pixel 6 Pro
Ah okay. Will this wipe my data? I'm trying to avoid wiping data
You may have to. Going with a flash from 11 to 12 may pose problems with stability if you don't wipe. There is an example command line a few posts up that show how to disable verity and the command line I displayed excludes the -w for wiping. You may get lucky and have a good running phone. You may run into issues. If you do you'll have to wipe. I fully recommend backing up your sdcard data before doing anything. Simply taking the ota or sideloading it will be fine until you apply magisk. Then you'll pull your hair out. If you do a full flash, modifying the last line in the flash.bat or sh as shown will give you success. Read up on fastboot and the command line options. As I stated in an earlier post I flash both a and b slots, then manually restart. That's what my example command line facilitates. Read up on switching the active slot as well. My command line isn't for everyone, it's how I flash. It's an example. If you do use my example, you must flash twice, once on the current slot, then on other.
 
  • Like
Reactions: bgboii

jshbrmn

Member
Jun 18, 2021
5
8
Full flash of the latest system image or the OTA only ?

I followed the process I posted on page 4 to move from 3 to 3.1 without issue....just to be clear:

- 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.

This is only confirmed working from version to version (and subversion). I'd imagine it would work even while skipping a version, but it is untested.
 

Eiad Ajam

Senior Member
Jul 24, 2012
405
116
Homs
I followed the process I posted on page 4 to move from 3 to 3.1 without issue....just to be clear:



This is only confirmed working from version to version (and subversion). I'd imagine it would work even while skipping a version, but it is untested.
My phone won't boot
it keeps going to fastboot
 

Eiad Ajam

Senior Member
Jul 24, 2012
405
116
Homs
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
This is working perfectly with me
thank you
 
  • Like
Reactions: dvx2550

Top Liked Posts

  • There are no posts matching your filters.
  • 22
    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