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

[Closed] Android 12 Update and Root ***Obsolete***

Status
Not open for further replies.
Search This thread

Regys

Senior Member
Sep 10, 2012
172
8
That's actually not something that anyone has tried to my knowledge. If you intend on upgrading to A12, I have an idea you can test if you're willing? The worst that happens is that you'll have to wipe your phone - which currently seems required anyway. Do you want to give it a try? I'll give you instructions if you do.
Hi,

I will also answer @Homeboy76. My mobile is a pixel 5.
I made myself at the idea of wipe my phone, I made backup of my apps and data.

Yes I want to try, I also think using the method with Android Flash Tool.

As long as I do not make bootloop or brick.
 

V0latyle

Forum Moderator
Staff member
Hi,

I will also answer @Homeboy76. My mobile is a pixel 5.
I made myself at the idea of wipe my phone, I made backup of my apps and data.

Yes I want to try, I also think using the method with Android Flash Tool.

As long as I do not make bootloop or brick.
Okay. If this goes wrong, the worst that will happen is you will have to perform a factory reset.

Download the factory zip for the Android 11 firmware currently on your device. Extract vbmeta, then reflash it with verity and verification disabled. Reboot, and see if the device boots successfully. If it doesn't, and you get a Data Corrupted message, don't worry.

Now, use the Android Flash Tool to install the latest firmware. Make sure "Disable Verity" and "Disable Verification" are checked. If you were able to boot into Android after reflashing vbmeta, do NOT wipe data; if however you got stuck on the Data Corrupted screen, you will have to.

Let me know if you need more detailed instructions.
 

Regys

Senior Member
Sep 10, 2012
172
8
Okay. If this goes wrong, the worst that will happen is you will have to perform a factory reset.

Download the factory zip for the Android 11 firmware currently on your device. Extract vbmeta, then reflash it with verity and verification disabled. Reboot, and see if the device boots successfully. If it doesn't, and you get a Data Corrupted message, don't worry.
How do I understand how to Flasher Vbmeta ? I extracted it on my pc, and after ?

I have to put it on folder platform-tools and use this code ?

fastboot --disable-verity --disable-verification flash --slot=all vbmeta vbmeta.img
Now, use the Android Flash Tool to install the latest firmware. Make sure "Disable Verity" and "Disable Verification" are checked. If you were able to boot into Android after reflashing vbmeta, do NOT wipe data; if however you got stuck on the Data Corrupted screen, you will have to.


Let me know if you need more detailed instructions.
 
Last edited:

V0latyle

Forum Moderator
Staff member
How do I understand how to Flasher Vbmeta ? I extracted it on my pc, and after ?

I have to put it on folder platform-tools and use this code ?

fastboot --disable-verity --disable-verification flash --slot=all vbmeta vbmeta.img
Yes, you can do that, or you can simply do this: Type your command:
Code:
fastboot flash vbmeta --disable-verity --disable-verification
Then drag and drop the vbmeta.img into the command window.
 
Last edited:

BagusPambudi

Member
Nov 9, 2021
14
0
Indonesia
www.im3buzz.com
WARNING: PERMANENT ROOT WHEN UPGRADING FROM ANDROID 11 REQUIRES A DATA WIPE! THERE IS CURRENTLY NO WAY AROUND THIS.


WARNING: MANUALLY INSTALLING FACTORY UPDATES OR IMAGES REQUIRES AN UNLOCKED BOOTLOADER. If your bootloader is locked, DO NOT ATTEMPT THIS.

WARNING: MODIFY YOUR DEVICE AT YOUR OWN RISK. YOU ALONE WILL BE RESPONSIBLE FOR MALFUNCTION, DAMAGE, OR LOSS OF ANY KIND IF SOMETHING GOES WRONG.

Root will be done via Magisk. If you aren't already using it, download and install to your phone.

Warning: For the sake of simplicity, I frequently will use generalizations when referring to files ("[patched boot image]" instead of "magisk_patched-23001_xxxxx.img" for example). It is YOUR RESPONSIBILITY to ensure you are flashing the correct file. The easiest way to do this is type the command in the command line without the file itself, then drag and drop the file you want to flash into the command line window.



For those of you with a locked bootloader:

Simply install the update as usual via OTA, whether automatically through Android Update, or manually via adb sideload.

First, a bit of information on why you need to follow this guide (See this post)

Two new Verified Boot features implemented in Android 12 will interfere with attempts to root. A more detailed explanation is below if you would like.

Dm-verity (device-mapper-verity) is a method by which an image on block devices (the underlying storage layer of the file system) can be checked to determine if it matches an expected configuration, using a cryptographic hash tree. If the hash doesn't match, dm-verity prevents the stored code from loading.

Vbmeta verification is the other half of this - it provides a cryptographically signed reference hash which is used to verify the integrity of /boot, /system, and /vendor partitions. The vbmeta image is only used to verify /boot, while vbmeta-system is used to verify /system.

This was implemented to prevent persistent rootkits by means of a hardware level security check, to prevent "potentially harmful applications" such as Magisk from evading detection, as such applications residing within the kernel will have higher privileges than the detection applications.

What this means is that with these two enabled, a modified boot image will cause a verification error when flashed to the device, preventing boot. Interestingly, this check is not performed against "live" boot images loaded via ADB, so with dm-verity and vbmeta verification enabled, a modified image can be booted as long as the image in /boot is intact.

The good news is, disabling these features is as easy as using a command switch.
The bad news, however, is that /data must be clean the first time this is done.


If you update via automatic OTA: THIS WILL REQUIRE A WIPE EVERY TIME!
1. Download the factory image (Yes, this is required) to your computer. Connect your device via USB.
2. Extract the contents of the factory image, then extract both boot.img and vbmeta.img from the image-[device].zip (where [device] is the codename for your device, such as Redfin for Pixel 5
2. Reboot to bootloader: With device connected via USB, Developer Options enabled and USB Debugging enabled, reboot to bootloader using ADB:
Code:
adb reboot bootloader
3. Continue to Reflash vbmeta below

To manually install the OTA:
1. Download the OTA for your device, as well as the factory image (Yes, you need both) to your computer.
2. Install the OTA
3. Extract the contents of the factory image, then extract both boot.img and vbmeta.img from the image-[device].zip (where [device] is the codename for your device, such as Redfin for Pixel 5
4. Let the update complete, and IMMEDIATELY reboot to bootloader.
5. Continue to Reflash vbmeta below

Reflash VBmeta
1. Reflash vbmeta with dm-verity and boot verification disabled:
Code:
fastboot --disable-verity --disable-verification flash --slot=all vbmeta vbmeta.img
2. If this is the first time you are rooting Android 12, you will end up in Recovery with this message: "Can't load Android system. Your data may be corrupt." You will have to perform the factory reset to continue. Once complete, let the device boot Android.
3. If you have previously wiped and are updating, let the device boot Android.
Continue to Patch Boot Image below.

1. Open this link in Google Chrome (DO NOT USE MICROSOFT EDGE OR MOZILLA FIREFOX) Here is the link for beta
2. Connect your device via USB (make sure USB Debugging is enabled)
3. Enable ADB access in the browser
4. Select your device
5. Select the Android 12 build
6. IMPORTANT: Click the pencil icon next to the selected build
7. Ensure Wipe Device, Disable Verification, and Disable Verity are checked. DATA WIPE IS REQUIRED when updating from an older version of Android. Don't lock your bootloader if you want root. Force flash all partitions should not be necessary (but use this if you've run into problems and are starting over). Skip Secondary and Force Debuggable should be unchecked, unless you want to use ADB for root access on the stock kernel for some reason.
8. Click Install Build.
9. Wait until the update finishes, including a reboot to Android.
10. Continue to Patch Boot Image below.

1. Download the factory image to your computer and connect your device via USB, with USB debugging enabled.
2. Extract the contents of the factory ZIP
3. Reboot to bootloader:
Code:
adb reboot bootloader
4. If necessary, update the bootloader: WARNING: IF DONE INCORRECTLY THIS WILL BRICK YOUR DEVICE!
Code:
fastboot flash bootloader [bootloader image]
Reboot back to bootloader.
5. If necessary, update the radio:
Code:
fastboot flash radio [radio image]
Reboot to bootloader.
6. Install the update:
Code:
fastboot --disable-verity --disable-verification -w update [factory image zip]
DATA WIPE IS REQUIRED when updating from an older version of Android.
7. Let the update complete, including a reboot to Android
8. Continue to Patch Boot Image below

1. Extract boot.img from the factory image ZIP if you haven't done so already
2. Install Magisk on your phone
3. Move the boot image to your phone via USB, and patch it using "Select and Patch a File" in Magisk
4. Move the patched boot image back to your PC
5. Reboot to bootloader
6. Flash the patched boot image:
Code:
fastboot flash boot [patched boot image]
7. Reboot to system.

For subsequent updates to Android 12:
DO NOT USE AUTOMATIC UPDATE! DO NOT LET THE DEVICE BOOT BEFORE YOU DISABLE VERITY AND VERIFICATION!

Follow the same directions as above, except you don't have to wipe.

Key reminders:
* The OTA does not have a way to set the disable flags for vbmeta, so if you update via OTA, you will have to reflash vbmeta with the disable flags every time you update.
* The most critical thing to remember is that once you have disabled verified boot and gained permanent root, YOU MUST NOT let the device boot into Android if /vbmeta is flashed without disabling verity and verification.
* If you forget to do this and let the device boot into Android, you will end up in Rescue Party: Recovery Mode screen with the message "Can't load Android system. Your data may be corrupt." YOU WILL HAVE TO WIPE TO GET ROOT BACK.



If you run into problems, or just want to share your results, please feel free to post your method and results in this thread.
Does anyone know why the Google Chrome app on Android 11 often gets bugs?
 

Regys

Senior Member
Sep 10, 2012
172
8
It's not necessary to quote the original OP when asking a question.

Additionally, your question should be related to the topic of the thread. Please post off topic questions in a separate thread.
I could do that, normally it's ok ?

Capture.PNG


So I can go to the installation by Android Flash Tool, on the other hand I think it offers me the beta SPB5.210812.002 (7671067)

In your opinion I disable "Wipe Device" ? after that does not pose a problem to make the wipe.
 
Last edited:

V0latyle

Forum Moderator
Staff member
I could do that, normally it's ok ?

View attachment 5456389
Okay, now see if your phone will boot. If it does, continue to the next step.

So I can go to the installation by Android Flash Tool, on the other hand I think it offers me the beta SPB5.210812.002 (7671067)

In your opinion I disable "Wipe Device" ? after that does not pose a problem to make the wipe.
You can select what build you want to install. The only boxes that should be checked are "Disable Verity" and "Disable Verification".
 

Regys

Senior Member
Sep 10, 2012
172
8
Okay, now see if your phone will boot. If it does, continue to the next step.


You can select what build you want to install. The only boxes that should be checked are "Disable Verity" and "Disable Verification".
Hi,

Everything went well, I was able to install Android 12 and root it ;).

By cons I do not pass SafetyNet "CTS Profile Match"
 

Regys

Senior Member
Sep 10, 2012
172
8
So you didn't have to wipe data?

I am able to get SafetyNet to pass on my P5 with Magisk 23001 and Universal Safetynet Fix 2.1.1
No, I did a wipe to be clean.

For SafetyNet it's resolved I did not have to install the 2.1.1. I use Magisk stable.

For the next update it will have to do the same again ? Disable Verity, Verification and Use One Methods of the Guide ?
 

ipdev

Recognized Contributor
Feb 14, 2016
1,652
1
2,258
Google Nexus 10
Nexus 7 (2013)
It does not make a difference if verity and verification are disabled on Android 11.
Once you flash Android 12, you will need to wipe data. 🤬
I hope someone will proves me wrong on this and find a way of updating. :D

<SNIP>
The wipe only needs to be done if the device has booted into system while verity and verification were enabled.
Even updating from Android 11 (with verity and verification disabled) to Android 12 (with verity and verification disabled) still requires a data wipe.
The initial boot fails and you are rebooted into Recovery Party. :censored:
As long as you keep verity and verification disabled after you initially wiped userdata on Android 12, you do not need to wipe again. ;)
<SNIP>

Cheers all. :cowboy:
 

Regys

Senior Member
Sep 10, 2012
172
8
So you had to wipe to boot after

fastboot flash vbmeta --disable-verity --disable-verification

on 11 so the experiment failed or "didn't have to" but wiped anyway "to be clean" so the experiment … failed successfully?

¯\_(ツ)_/¯
No, I first disabled Verity and verification under Android 11.

Then I updated with Android Flash Tool
 

puterboy

Member
Jun 24, 2012
47
21
So, after reading the full thread and the last page of posts, it is unclear to me whether there is now a way to upgrade to Android 12 with root and without having to wipe.
If it is indeed possible (and confirmed) on a Pixel 5/5a, could someone write up the adjusted full set of steps required (and perhaps even start a new thread to keep it clear). I don't want to do something wrong that would require me to deal with a wiped phone (again).
If it's not confirmed or if it doesn't work universally, I will can wait (patiently) on Android 11 until a confirmed solution emerges.

Thanks.
 
Last edited:

V0latyle

Forum Moderator
Staff member
No, I first disabled Verity and verification under Android 11.

Then I updated with Android Flash Tool
Well, the whole idea was to see if it was possible to upgrade to Android 12 and root without wiping data.
So, after reading the full thread and the last page of posts, it is unclear to me whether there is now a way to upgrade to Android 12 with root and without having to wipe.
If it is indeed possible (and confirmed) on a Pixel 5/5a, could someone write up the adjusted full set of steps required (and perhaps even start a new thread to keep it clear). I don't want to do something wrong that would require me to deal with a wiped phone (again).
If it's not confirmed or if it doesn't work universally, I will can wait (patiently) on Android 11 until a confirmed solution emerges.

Thanks.
As of right now, no. Follow the directions in the OP; there is unfortunately no way that we know of to preserve your data.

Just make sure your photos are backed up, and everything else to Google One, and you'll be fine.
 
  • Like
Reactions: ipdev and elong7681

Regys

Senior Member
Sep 10, 2012
172
8
Well, the whole idea was to see if it was possible to upgrade to Android 12 and root without wiping data.

As of right now, no. Follow the directions in the OP; there is unfortunately no way that we know of to preserve your data.

Just make sure your photos are backed up, and everything else to Google One, and you'll be fine.
I did not understand like that sorry, but I think it's not a problem if you save his phone and apps.

What I have done.

1 / I made a backup of my mobile via Google
2 / I made a backup of my apps via Swift Backup
3 / I restored all that as fast as doing backup

I have not had anything to do in the system settings, only what differs from Android 11
 
Status
Not open for further replies.

Top Liked Posts

  • There are no posts matching your filters.
  • 18
    Update 12-16: I am closing this thread as it is no longer relevant. Please refer to this guide.
    7
    Magisk Canary was updated to 23016 last night. This includes a fix for the vbmeta header issue, meaning that disabling verity/verification should no longer be required, and we should be able to root as we did before. This needs testing, make sure you back up your data and photos before you try this!

    Q: "If verity/verification are disabled, do I need to enable them now?"
    A: No. The only thing you have to do is update to Magisk 23016.
    Q: "Will enabling verity/verification wipe my data?"
    A: No.

    I will be updating the OP to reflect this.
    6
    Who is calling you stupid?!?! It's an American expression: for example, your costume is ruined by rain, so, you say: it's the weather stupid.

    Anyway, I am trying to help, so, there is no reason to seek insults where there isn't one.
    It's just the way you worded it is all. I am born in America, and actually thought the same thing when I read it.
    It's confusing to me though..

    I would say, not "it's the weather, stupid"
    but rather
    "it's the stupid weather"

    so reading "It's the bootloader stupid"
    I feel should be,
    "it the stupid bootloader"

    but thank you for clearing up that you aren't passing insults.
    And it's hard to tell through text whose being argumentative, and whose being helpful.
    Glad you're the latter.
    5
    Or he/you could add this to it when flashing factory image via ADB only. Why? Because it works on the pixel 4a 5(G) and may work on the Pixel 5. It would not confuse anyone, just provide another less complicated option for upgrading/updating those phones. Seems pretty black and white to me.
    Agreed.

    The confusion arises from this:
    PS :
    Pixel 4a 5(G) phone owners need to know for the initial upgrade (Android 11 to Android 12), they do not need the fastboot flash --disable-verity --disable-verification --slot-all vbmeta vbmeta.img step in this case
    This implies that verity and verification need not be disabled when upgrading from Android 11...which if you want permanent root, is not true. This can be omitted if one flashes the factory image, as they can incorporate the flags into the command:
    Code:
    fastboot update -w --disable-verity --disable-verification image-device-buildnumber.zip
    However, if the update is performed via the OTA, then vbmeta must be specifically disabled.

    If you understand what he is saying, why not add the Pixel 4a 5(G) note to the Reminders?
    This is true across ALL affected devices - Pixels on the SD765G and Tensor. It is not specific to one device.

    Still, I will update the notes for the sake of clarity.
    4
    Who is calling you stupid?!?! It's an American expression: for example, your costume is ruined by rain, so, you say: it's the weather stupid.

    Anyway, I am trying to help, so, there is no reason to seek insults where there isn't one.
    I didn't seek one, I guess I misunderstood. I have never heard of that expression before, at least not in that context. I'm American too, and I've generally heard it like this:

    "Hey, what's making that howling noise?"
    "It's the wind, stupid!"

    I digress.

    I'll have to pick this up later; it's late, my wife is demanding....attention, and I want to enjoy the weekend.