• 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

Skeetch79

Senior Member
Oct 29, 2010
315
203
West Milford, NJ
I had the same problem with Magisk 23010 - Navy Federal app wouldn't even start. Universal SafeteyNet Fix is not updated for 23010 yet, CTS profile still fails, so Safetynet won't pass. I ended up downgrading to 23001, and it's working fine.

Which version of Magisk are you using?

I would try this:
  1. Remove Magisk - restore images first, then Complete Uninstall. Let the phone reboot.
  2. Re install Magisk (I used 23001). Re patch boot image.
  3. Reboot to bootloader, flash the patched boot images to both slots:
    fastboot flash --slot=all boot magisk-boot.img
    ***OR***
    Boot the patched image:
    fastboot boot magisk-boot.img
  4. Launch Magisk again and check for root. If you booted the image instead of flashing it, you can now perform Direct Install in Magisk.
I prefer to use the second method, because it allows me to test a patched image while still having a good image in /boot; if everything works, I can then just directly install Magisk to /boot without flashing.

The same process works for 23010 if you want to use the newest version of Magisk, although it's more difficult to get Safetynet to pass.

Both verity and verification must be disabled; if you did that, then yes you should be able to flash the patched image.
I am using version 23000 - the link you provided is for a zip file. Can this be renamed to apk and installed as an app? (or do you have a link to v23001 as an apk?)

Thank you for the method suggestions - I am leaning towards the second method. Do I need to uninstall Magisk, restore the images and then reinstall Magisk if I go with Method 2 or can I simply boot using the patched boot image?
 
  • Like
Reactions: V0latyle

V0latyle

Forum Moderator
Staff member
I am using version 23000 - the link you provided is for a zip file. Can this be renamed to apk and installed as an app? (or do you have a link to v23001 as an apk?)
Yes, just rename it as an apk and install it.

I'd much rather be able to get it straight from John Wu's Github, but it appears he has either removed or made private all of the older Canary builds.
Thank you for the method suggestions - I am leaning towards the second method. Do I need to uninstall Magisk, restore the images and then reinstall Magisk if I go with Method 2 or can I simply boot using the patched boot image?
I'm not sure I understand your question. I ran into a similar issue as you with a banking app that was crashing, I assume due to CTS fail, so I decided to downgrade to an older Canary version of Magisk, which I discovered is more complicated than one would think.

When you restore images in the Magsik app, it removes root from the boot images, so after reboot you lose root. The second half is removing everything Magisk related (Complete uninstall) because simply uninstalling the app via the Android app manager doesn't clean everything up, and you'll run into issues with being unable to use root.

So, what I'm saying is, remove Magisk completely, which will restore the stock boot image. Magisk will reboot the phone, at which point both Magisk and root will be gone. Then, install the older version, use it to patch the boot image manually (Select and Patch a File), copy the boot image back to your computer and either flash it or boot it. Either way, you should boot into rooted Android, and if you chose to boot instead of flash, you can then use Magisk to directly patch /boot.

Then, use Magisk Hide + Riru + Universal SafetyNet Fix, and you should be able to get a SafetyNet pass.

Hope this helps.
 

Skeetch79

Senior Member
Oct 29, 2010
315
203
West Milford, NJ
Yes, just rename it as an apk and install it.

I'd much rather be able to get it straight from John Wu's Github, but it appears he has either removed or made private all of the older Canary builds.

I'm not sure I understand your question. I ran into a similar issue as you with a banking app that was crashing, I assume due to CTS fail, so I decided to downgrade to an older Canary version of Magisk, which I discovered is more complicated than one would think.

When you restore images in the Magsik app, it removes root from the boot images, so after reboot you lose root. The second half is removing everything Magisk related (Complete uninstall) because simply uninstalling the app via the Android app manager doesn't clean everything up, and you'll run into issues with being unable to use root.

So, what I'm saying is, remove Magisk completely, which will restore the stock boot image. Magisk will reboot the phone, at which point both Magisk and root will be gone. Then, install the older version, use it to patch the boot image manually (Select and Patch a File), copy the boot image back to your computer and either flash it or boot it. Either way, you should boot into rooted Android, and if you chose to boot instead of flash, you can then use Magisk to directly patch /boot.

Then, use Magisk Hide + Riru + Universal SafetyNet Fix, and you should be able to get a SafetyNet pass.

Hope this helps.
Apologies if my question wasn't clear.

Hopefully to clarify:
- Can I install Magisk 23001, patch the stock boot image, reboot into Android using the patched boot image and then install Magisk and gain permanent root
-or-
- do I have to completely uninstall Magisk, restore the stock Pixel 5 images, install Magisk 23001, patch the stock boot image, boot with the patched boot file and then install Magisk for root?

Difference between the two: do not restore stock images or restore stock images.

How do I completely uninstall Magisk? Is this via computer? I am running a PC with Windows 10.
 

V0latyle

Forum Moderator
Staff member
Apologies if my question wasn't clear.

Hopefully to clarify:
- Can I install Magisk 23001, patch the stock boot image, reboot into Android using the patched boot image and then install Magisk and gain permanent root
-or-
- do I have to completely uninstall Magisk, restore the stock Pixel 5 images, install Magisk 23001, patch the stock boot image, boot with the patched boot file and then install Magisk for root?

Difference between the two: do not restore stock images or restore stock images.

How do I completely uninstall Magisk? Is this via computer? I am running a PC with Windows 10.
Here's the link for the actual APK from Github.

When you uninstall Magisk from within the app, it restores the boot images for you; you don't have to do that manually.

You need to be familiar with Android Platform Tools (adb and fastboot), as well as where to get the factory image for your device, how to extract files, and how to copy them to/from your phone.
Here's some more detailed instructions:

  1. Launch Magisk. Tap Uninstall, then Restore Images. Once it finishes, go back to Uninstall, then Complete Uninstall. Let it reboot your phone.
  2. You will boot into unrooted Android without Magisk. Install 23001.
  3. If you haven't already, download the Android 12 factory zip. Extract boot.img and copy it to your phone.
  4. Launch Magisk, then tap Install, then Select and Patch a File. Patch the boot.img you just copied to your phone. Copy the magsik_patched-23001_xxxxx.img back to your computer.
  5. Reboot to bootloader (I use ADB to do this:)
    [code[adb reboot bootloader[/code]
  6. Flash the patched boot image:
    Code:
    fastboot flash --slot=all boot magisk_patched-23001_xxxxx.img
    ***OR***
    Boot the patched image: (I like to do it this way)
    Code:
    fastboot boot magisk_patched-23001_xxxxx.img
  7. If you flashed the patched image, you're done.
  8. If you booted the patched image, launch Magisk, then tap Install, then Direct Install.
 

Skeetch79

Senior Member
Oct 29, 2010
315
203
West Milford, NJ
Here's the link for the actual APK from Github.

When you uninstall Magisk from within the app, it restores the boot images for you; you don't have to do that manually.

You need to be familiar with Android Platform Tools (adb and fastboot), as well as where to get the factory image for your device, how to extract files, and how to copy them to/from your phone.
Here's some more detailed instructions:

  1. Launch Magisk. Tap Uninstall, then Restore Images. Once it finishes, go back to Uninstall, then Complete Uninstall. Let it reboot your phone.
  2. You will boot into unrooted Android without Magisk. Install 23001.
  3. If you haven't already, download the Android 12 factory zip. Extract boot.img and copy it to your phone.
  4. Launch Magisk, then tap Install, then Select and Patch a File. Patch the boot.img you just copied to your phone. Copy the magsik_patched-23001_xxxxx.img back to your computer.
  5. Reboot to bootloader (I use ADB to do this:)
    [code[adb reboot bootloader[/code]
  6. Flash the patched boot image:
    Code:
    fastboot flash --slot=all boot magisk_patched-23001_xxxxx.img
    ***OR***
    Boot the patched image: (I like to do it this way)
    Code:
    fastboot boot magisk_patched-23001_xxxxx.img
  7. If you flashed the patched image, you're done.
  8. If you booted the patched image, launch Magisk, then tap Install, then Direct Install.
Thank you sir! You are a god send!

I reflashed the stock images, patched the boot file with the magisk 23001, rebooted into fastboot and flashed to both slots! rocking root now!!!

Thank you again !
 
  • Like
Reactions: V0latyle

V0latyle

Forum Moderator
Staff member
An excellent point that was brought up from a Pixel 6 user:

Data wipe is required for permanent root after upgrading to Android 12. That much we know.

But what about a device that had an original clean install of Android 12?

Who here wiped when upgrading to Android 12, and did not reflash vbmeta until AFTER you set up your device?
Basically, we need to determine if it matters when you flash vbmeta. Here's what needs to be tested:
- Factory flash Android 12 with a wipe; do NOT disable verity and verification
- Set up and use your device
- After everything is set up (download all your apps) attempt to reflash vbmeta with verity and verification disabled, as well as a patched boot image.

If this is successful, this means we shouldn't have to wipe every time we take a monthly update.
 
Last edited:

V0latyle

Forum Moderator
Staff member
@V0latyle so this whole time i could've been booting the patch and install thru magisk after I boot up ?
Yes. It's all up to a matter of preference - you can either boot the rooted image then direct patch through Magisk, or you can just flash it since you have to start from bootloader anyway.
 

rbouza1

Senior Member
May 16, 2013
679
159
midland
Google Pixel 6
Yes. It's all up to a matter of preference - you can either boot the rooted image then direct patch through Magisk, or you can just flash it since you have to start from bootloader anyway.
Seems less risky when booting with the img and opposed to flashing it. I only need root to move my clock to the right lol. AdAway works via VPN, Vance YouTube is ad free.
 

thomas.raines

Recognized Developer
Jun 23, 2011
2,154
3,899
Hutto
The proper way to upgrade while retaining data is to use the OTA.
I know this may see like a dumb quesiton coming from a dev that's been around for a while, but by OTA, do you mean settings>system update>check for updates (mine phone always says up to date). I dl the updates straight from the factory images site where I have 2 options: Flash or Link. Is the "Flash" option an OTA? I've never tried that one in fear it will wipe data...
 

V0latyle

Forum Moderator
Staff member
I know this may see like a dumb quesiton coming from a dev that's been around for a while, but by OTA, do you mean settings>system update>check for updates (mine phone always says up to date). I dl the updates straight from the factory images site where I have 2 options: Flash or Link. Is the "Flash" option an OTA? I've never tried that one in fear it will wipe data...
The Flash link takes you to the Android Flash Tool. It's pretty damn cool if you've never used it before. It essentially performs the factory flash via ADB through your browser...but you can select options like relocking your bootloader, wiping data, disabling verity/verification, force flash all partitions, etc. Basically a web GUI alternative for using ADB command line.

By OTA, I mean either the automatic update, or ADB sideload. I believe you -can- dirty flash the Android 12 update over Android 11, but this is not advisable.

The issue we are currently having is being able to retain data *and* root after the update. So far, it seems that in order to root on Android 12, you have to start with a clean install, even if you took the OTA update. Factory reset (data wipe) counts as a clean install.

One user, @HumorBaby ,was able to upgrade from 12 Beta to the stable release without wiping data by sideloading the OTA, but skipping reboot before flashing vbmeta. However, it should be noted that he started with a clean install with the 12 Beta.
 

jnss98b

Senior Member
The Flash link takes you to the Android Flash Tool. It's pretty damn cool if you've never used it before. It essentially performs the factory flash via ADB through your browser...but you can select options like relocking your bootloader, wiping data, disabling verity/verification, force flash all partitions, etc. Basically a web GUI alternative for using ADB command line.

By OTA, I mean either the automatic update, or ADB sideload. I believe you -can- dirty flash the Android 12 update over Android 11, but this is not advisable.

The issue we are currently having is being able to retain data *and* root after the update. So far, it seems that in order to root on Android 12, you have to start with a clean install, even if you took the OTA update. Factory reset (data wipe) counts as a clean install.

One user, @HumorBaby ,was able to upgrade from 12 Beta to the stable release without wiping data by sideloading the OTA, but skipping reboot before flashing vbmeta. However, it should be noted that he started with a clean install with the 12 Beta.
Oh wait so I'm rooted on Android 11 right now and I can just accept the on device OTA without losing data but only lose root? I'm planning to just root through booting the patched image so I can just update to Android 12 straight through the settings app?
 

V0latyle

Forum Moderator
Staff member

thomas.raines

Recognized Developer
Jun 23, 2011
2,154
3,899
Hutto
The Flash link takes you to the Android Flash Tool. It's pretty damn cool if you've never used it before. It essentially performs the factory flash via ADB through your browser...but you can select options like relocking your bootloader, wiping data, disabling verity/verification, force flash all partitions, etc. Basically a web GUI alternative for using ADB command line.

By OTA, I mean either the automatic update, or ADB sideload. I believe you -can- dirty flash the Android 12 update over Android 11, but this is not advisable.

The issue we are currently having is being able to retain data *and* root after the update. So far, it seems that in order to root on Android 12, you have to start with a clean install, even if you took the OTA update. Factory reset (data wipe) counts as a clean install.

One user, @HumorBaby ,was able to upgrade from 12 Beta to the stable release without wiping data by sideloading the OTA, but skipping reboot before flashing vbmeta. However, it should be noted that he started with a clean install with the 12 Beta.
Thank you. Unfortunately for me, I have never any the OTA updates and have had to manually update my phone. I'm going to try the Android Flash Tool to update to 12.
 

V0latyle

Forum Moderator
Staff member

V0latyle

Forum Moderator
Staff member
I would like to recognize @ipdev for finding this:
To add to V0latyle's post.

Pixel 4a [sunfish] has no issue updating and installing Magisk on Android 12.

The issue starts with Pixel 4a (5G) [bramble].
This is also the first Pixel using Boot Header v3.
Boot image header, version 3 - source.android - Link
Vendor boot header - source.android - Link

The 3, 3a, and 4 series along with 4a are using header v2.

4a (5G), 5 and 5a are using header v3.

Just downloaded and checked.
6 and 6 Pro are using header v4.

I am not sure if that is the problem but, it is quite a distinguishing line between Pixels that have this issue with Magisk and those that do not on Android 12. 🙃

After a little more testing on my 5 [redfin], I will open an issue on GitHub.
Magisk - GitHub - Issues - Link

Cheers all. :cowboy:
We still don't know if this has something to do with our issue, but there's a huge chance it does.
 
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.