How To Guide [GUIDE] Pixel 5a "barbet": Unlock Bootloader, Update, Root, Pass SafetyNet

Search This thread

V0latyle

Forum Moderator
Staff member
Yeah. Thanks. I was about to delete the post since I already figured it out.
Thank you anyway!
No problem. I have since edited my post so make sure you read it again, but the basic information remains the same. The only thing a factory reset does is wipe /data. It does not restore partitions, so if you have flashed a patched boot image, it will remain patched after a factory reset.
 

SideSkroll

Member
Jun 1, 2014
48
5
Lima
The Magisk patch is permanent until removed or overwritten. The Magisk app on the other hand lives in /data and will not survive a factory reset.

So, to accomplish what you're asking, you would simply perform a factory reset; once you installed the Magisk app again, you'd have root.

If you want to update, use the factory update method but add the -w argument to wipe data:
Code:
fastboot update --skip-reboot -w <image-barbet-buildnumber.zip>
Once the update completes, you'd flash the patched boot image, then reboot. You'd boot into a clean system with the latest update, and once you installed the Magisk app again, you'd have root.
Wait, so if I want to update the phone. Do I need to do all of that? everytime? every security patch etc? Or are we talking about Android versions? Cause I was thinking about using this method:

Spoiler: Update and Root Automatic OTA


  1. Before you download the OTA, open Magisk, tap Uninstall, then Restore Images.
  2. Take the OTA update when prompted. To check for updates manually, go to Settings > System > System Update > Check for Update
  3. Allow the update to download and install. DO NOT REBOOT WHEN PROMPTED. Open Magisk, tap Install at the top, then Install to inactive slot. Magisk will then reboot your device.
  4. You should now be updated with root.
 

V0latyle

Forum Moderator
Staff member
Wait, so if I want to update the phone. Do I need to do all of that? everytime? every security patch etc? Or are we talking about Android versions? Cause I was thinking about using this method:

Spoiler: Update and Root Automatic OTA


  1. Before you download the OTA, open Magisk, tap Uninstall, then Restore Images.
  2. Take the OTA update when prompted. To check for updates manually, go to Settings > System > System Update > Check for Update
  3. Allow the update to download and install. DO NOT REBOOT WHEN PROMPTED. Open Magisk, tap Install at the top, then Install to inactive slot. Magisk will then reboot your device.
  4. You should now be updated with root.
Yes, you can do this. You said you wanted to wipe your device, however, so it's always best to use a factory image if you want to return to absolute stock. You can still flash a patched boot image, like I said.
 

emonkhan826

Senior Member
Nov 28, 2015
158
32
25
Dhaka
www.facebook.com
Screenshot_20220309-120219.png
i update latest version after that i flash magisk patches boot images but my device getting bootloop. I want to install magisk i want root. Anyone help me how to install magisk?. 😢
 

V0latyle

Forum Moderator
Staff member
View attachment 5556285i update latest version after that i flash magisk patches boot images but my device getting bootloop. I want to install magisk i want root. Anyone help me how to install magisk?. 😢
What version of Magisk are you using? I had no trouble updating my wife's 5a with the factory image, and rooted with Magisk Canary 24102.
 

V0latyle

Forum Moderator
Staff member
I patches boot images using Magisk v24.2 latest version. Can you give me your patches boot images? How can i root march update? Plzz help me. 🥲
Are you using the correct image? While I could provide my patched image, I'd prefer people learn to do it themselves. That's the whole point of this guide - to educate. Go back to the OP and read the instructions for Initial Root, and tell me what you're having trouble with.

Also, where did you download Magisk from? If you didn't download it from the official GitHub, get rid of it; any "Magisk Manager" site that is not the official GitHub repo is NOT a genuine or trustworthy source.

Hint: I have the repo linked in the OP under Downloads.
 

emonkhan826

Senior Member
Nov 28, 2015
158
32
25
Dhaka
www.facebook.com
Are you using the correct image? While I could provide my patched image, I'd prefer people learn to do it themselves. That's the whole point of this guide - to educate. Go back to the OP and read the instructions for Initial Root, and tell me what you're having trouble with.

Also, where did you download Magisk from? If you didn't download it from the official GitHub, get rid of it; any "Magisk Manager" site that is not the official GitHub repo is NOT a genuine or trustworthy source.

Hint: I have the repo linked in the OP under Downloads.
Yes i am using current images and i read all installation. I downloaded magisk from official GitHub repo. Plzz help me how to install magisk 😢 bro give me your magisk canary download link i try to patche boot images and try to flash patches boot images. I install update using adb sideload and i patch boot images and flash it but device not bootup automatic restart.
 
Last edited:

V0latyle

Forum Moderator
Staff member
Yes i am using current images and i read all installation. I downloaded magisk from official GitHub repo. Plzz help me how to install magisk 😢 bro give me your magisk canary download link i try to patche boot images and try to flash patches boot images. I install update using adb sideload and i patch boot images and flash it but device not bootup automatic restart.
Magisk Canary should make no difference, but here is Canary 24201

If you're sideloading the OTA, you can't flash the patched image right after updating - you have to let the phone boot and finish the update. Follow the instructions under "Update and Root Sideload OTA". Note that it won't automatically reboot after the sideload completes; you'll need to select Reboot now on the device screen when the update finishes. Then, let the device boot into Android (you won't have root) and sit for a few minutes before you reboot to bootloader and attempt to flash the patched boot image.
 

emonkhan826

Senior Member
Nov 28, 2015
158
32
25
Dhaka
www.facebook.com
Magisk Canary should make no difference, but here is Canary 24201

If you're sideloading the OTA, you can't flash the patched image right after updating - you have to let the phone boot and finish the update. Follow the instructions under "Update and Root Sideload OTA". Note that it won't automatically reboot after the sideload completes; you'll need to select Reboot now on the device screen when the update finishes. Then, let the device boot into Android (you won't have root) and sit for a few minutes before you reboot to bootloader and attempt to flash the patched boot image.
Which command i use to flash patched boot image?
fastboot flash boot.img
Or
fastboot boot.img?
 

emonkhan826

Senior Member
Nov 28, 2015
158
32
25
Dhaka
www.facebook.com
Magisk Canary should make no difference, but here is Canary 24201

If you're sideloading the OTA, you can't flash the patched image right after updating - you have to let the phone boot and finish the update. Follow the instructions under "Update and Root Sideload OTA". Note that it won't automatically reboot after the sideload completes; you'll need to select Reboot now on the device screen when the update finishes. Then, let the device boot into Android (you won't have root) and sit for a few minutes before you reboot to bootloader and attempt to flash the patched boot image.
I flash patched boot image but still same problem. See the picture it's says boot.img missing cmdline or os version 😓
 

Attachments

  • PXL_20220309_175945066.MP.jpg
    PXL_20220309_175945066.MP.jpg
    7.3 MB · Views: 21

V0latyle

Forum Moderator
Staff member
After flash patched boot image my device star to boot after that automatic reboot and bootup but magisk root not installed. What can i do now?
Check your Android version and make sure you're updated. If you are, you should be able to reboot to bootloader and flash the Magisk patched boot image.

If however you are not updated, you need to re-update using one of the methods at the beginning of this thread.
 

emonkhan826

Senior Member
Nov 28, 2015
158
32
25
Dhaka
www.facebook.com
Check your Android version and make sure you're updated. If you are, you should be able to reboot to bootloader and flash the Magisk patched boot image.

If however you are not updated, you need to re-update using one of the methods at the beginning of this thread.
Check my ss i am updated. If it's possible to get march build magisk patched boot image download link and boot image flashing cmdline?
 

Attachments

  • Screenshot_20220310-004952.png
    Screenshot_20220310-004952.png
    141.1 KB · Views: 14
  • Screenshot_20220310-004939.png
    Screenshot_20220310-004939.png
    84.9 KB · Views: 15

V0latyle

Forum Moderator
Staff member
Check my ss i am updated. If it's possible to get march build magisk patched boot image download link and boot image flashing cmdline?
Once again, ignore the cmdline error. It means nothing in this case and is not a problem. I get that error too when flashing my phone.

You are patching boot.img, and not bootloader.img, right?

If an image you have patched doesn't work, my image most likely won't work for you either.
 

V0latyle

Forum Moderator
Staff member
For what it's worth, I was able to update my wife's 5a (and my 5) using the factory image method in the OP. The only difference is on my 5, I rebooted to bootloader before flashing the patched boot image; on my wife's 5a, I didn't reboot and flashed the patched boot image in fastbootd after the update. Result was the same.

Also, I flashed to both slots, but this shouldn't be necessary nor will it affect your success.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    So I tried the OTA for the June Update and it worked. Somehow I still ended up missing a step somewhere because even though I had updated to the latest Canary (25001) I was unable to see the option to install to the inactive slot. So I just an already patched kernel to boot and then ran Magisk install. And was up and running again.
    1
    So I went back and figured out the problem. I rebooted after restoring image and before taking the OTA, which explains why I didn't have the option to install in the inactive slot.
  • 20
    If you are looking for my guide on a different Pixel, find it here:
    Update 6-20-22: Magisk 25.1 is recommended as this includes fixes for OTA updates.
    Discussion thread for migration to 24.0+.

    DO NOT use any version of Magisk lower than Canary 23016 as it does not yet incorporate the necessary fixes for Android 12 and your device.


    WARNING: YOU AND YOU ALONE ARE RESPONSIBLE FOR ANYTHING THAT HAPPENS TO YOUR DEVICE. THIS GUIDE IS WRITTEN WITH THE EXPRESS ASSUMPTION THAT YOU ARE FAMILIAR WITH ADB, MAGISK, ANDROID, AND ROOT. IT IS YOUR RESPONSIBILITY TO ENSURE YOU KNOW WHAT YOU ARE DOING.

    Prerequisites:


    Android Source - Setting up a device for development


    1. Follow these instructions to enable Developer Options and USB Debugging.
    2. Enable OEM Unlocking. If this option is grayed out, unlocking the bootloader is not possible.
    3. Connect your device to your PC, and open a command window in your Platform Tools folder.
    4. Ensure ADB sees your device:
      Code:
      adb devices
      If you don't see a device, make sure USB Debugging is enabled, reconnect the USB cable, or try a different USB cable.
      If you see "unauthorized", you need to authorize the connection on your device.
      If you see the device without "unauthorized", you're good to go.
    5. Reboot to bootloader:
      Code:
      adb reboot bootloader
    6. Unlock bootloader: THIS WILL WIPE YOUR DEVICE!
      Code:
      fastboot flashing unlock
      Select Continue on the device screen.

    1. Install Magisk on your device.
    2. Download the factory zip for your build.
    3. Inside the factory zip is the update zip: "device-image-buildnumber.zip". Open this, and extract boot.img
    4. Copy boot.img to your device.
    5. Patch boot.img with Magisk: "Install" > "Select and Patch a File"
    6. Copy the patched image back to your PC. It will be named "magisk_patched-23xxx_xxxxx.img". Rename this to "master root.img" and retain it for future updates.
    7. Reboot your device to bootloader.
    8. Flash the patched image:
      Code:
      fastboot flash boot <drag and drop master root.img here>
    9. Reboot to Android. Open Magisk to confirm root - under Magisk at the top, you should see "Installed: <Magisk build number>

    1. Before you download the OTA, open Magisk, tap Uninstall, then Restore Images. If you have any Magisk modules that modify system, uninstall them now.
    2. Take the OTA update when prompted. To check for updates manually, go to Settings > System > System Update > Check for Update
    3. Allow the update to download and install. DO NOT REBOOT WHEN PROMPTED. Open Magisk, tap Install at the top, then Install to inactive slot. Magisk will then reboot your device.
    4. You should now be updated with root.

    1. Download the OTA.
    2. Reboot to recovery and sideload the OTA:
      Code:
      adb reboot sideload
      Once in recovery:
      Code:
      adb sideload ota.zip
    3. When the OTA completes, you will be in recovery mode. Select "Reboot to system now".
    4. Allow system to boot and wait for the update to complete. You must let the system do this before proceeding.
    5. Reboot to bootloader.
    6. Boot the master root image (See note 1):
      Code:
      fastboot boot <drag and drop master root.img here>
      Note: If you prefer, you can download the factory zip and manually patch the new boot image, then flash it after the update. Do not flash an older boot image after updating.
    7. Your device should boot with root. Open Magisk, tap Install, and select Direct Install.
    8. Reboot your device. You should now be updated with root.
    Note: You can use Payload Dumper to extract the contents of the OTA if you want to manually patch the new boot image. However, I will not cover that in this guide.

    Please note that the factory update process expects an updated bootloader and radio. If these are not up to date, the update will fail.
    1. Download the factory zip and extract the contents.
    2. Reboot to bootloader.
    3. Compare bootloader versions between phone screen and bootloader.img build number
      Code:
      fastboot flash bootloader <drag and drop new bootloader.img here>
      If bootloader is updated, reboot to bootloader.
    4. Compare baseband versions between phone screen and radio.img build number
      Code:
      fastboot flash radio <drag and drop radio.img here>
      If radio is updated, reboot to bootloader.
    5. Apply update:
      Code:
      fastboot update --skip-reboot image-codename-buildnumber.zip
      When the update completes, the device will be in fastbootd. Reboot to bootloader.
    6. Boot the master root image (See note 1):
      Code:
      fastboot boot <drag and drop master root.img here>
      Note: If you prefer, you can manually patch the new boot image, then flash it after the update. Do not flash an older boot image after updating.
    7. Your device should boot with root. Open Magisk, tap Install, and select Direct Install.
    8. Reboot your device. You should now be updated with root.
    Note: If you prefer, you can update using the flash-all script included in the factory zip. You will have to copy the script, bootloader image, radio image, and update zip into the Platform Tools folder; you will then have to edit the script to remove the -w option so it doesn't wipe your device.
    The scripted commands should look like this:
    Code:
    fastboot update bootloader <bootloader image name>
    fastboot reboot bootloader
    ping -n 5 127.0.0.1 > nul
    fastboot update radio <radio image name>
    fastboot reboot bootloader
    ping -n 5 127.0.0.1 > nul
    fastboot update  --skip-reboot --slot=all <image-device-buildnumber.zip>
    Once this completes, you can reboot to bootloader and either boot your master patched image, or if you patched the new image, flash it at this time.

    1. Follow the instructions on the Android Flash Tool to update your device. Make sure Lock Bootloader and Wipe Device are UNCHECKED.
    2. When the update completes, the device will be in fastbootd. Reboot to bootloader.
    3. Boot the master root image (See note 1):
      Code:
      fastboot boot <drag and drop master root.img here>
      Note: If you prefer, you can download the factory zip and manually patch the new boot image, then flash it after the update. Do not flash an older boot image after updating.
    4. Your device should boot with root. Open Magisk, tap Install, and select Direct Install.
    5. Reboot your device. You should now be updated with root.

    This is my configuration that is passing Safety Net. I will not provide instructions on how to accomplish this. Attempt at your own risk.

    Zygisk + DenyList enabled
    All subcomponents of these apps hidden under DenyList:
    • Google Play Store
    • GPay
    • Any banking/financial apps
    • Any DRM media apps
    Modules:
    To check SafetyNet status:
    I do not provide support for Magisk or modules. If you need help with Magisk, here is the Magisk General Support thread. For support specifically with Magisk v24+, see this thread.

    Points of note:
    • The boot image is NOT the bootloader image. Do not confuse the two - YOU are expected to know the difference. Flashing the wrong image to bootloader could brick your device.
    • While the Magisk app is used for patching the boot image, the app and the patch are separate. This is what you should see in Magisk for functioning root:
      screenshot_20211218-194517-png.5486339
    • "Installed" shows the version of patch in the boot image. If this says N/A, you do not have root access - the boot image is not patched, or you have a problem with Magisk.
    • "App" simply shows the version of the app itself.
    • If you do not have a patched master boot image, you will need to download the factory zip if you haven't already, extract the system update inside it, then patch boot.img.
    • If you prefer updating with the factory image, you can also extract and manually patch the boot image if desired.
    • Some Magisk modules, especially those that modify read only partitions like /system, may cause a boot loop after updating. As a general rule, disable these modules before updating. You are responsible for knowing what you have installed, and what modules to disable.


    Credits:
    Thanks to @ipdev , @kdrag0n , @Didgeridoohan , and last but not least, @topjohnwu for all their hard work!
    3
    Absolutely fantastic! Thanks for this thread and guide!

    As an aside, how is it I didn't know you can drag and drop to the command window? (This tip gets the hero of the day award in my book!)
    Makes things a whole lot easier, don't it?

    I try to stick with the KISS method. Keep It Simple, Stupid!

    Or...Keep it stupidly simple, whatever. :D
    2
    "Install to inactive slot" is no longer supported in Magisk.

    This is extremely old information from September 2020. Install to inactive slot has been re-implemented as of Magisk Canary 23017 {January 20, 2022).

    Please, check your information to ensure it's up to date before you post.
    2
    I'm currently using Magisk Canary build?
    May I Install Magisk Beta and also Magisk Stable build to the latest November 2021 build?
    I honestly don't know. I've used Magisk 22.1, 23.0, Canary 23001 through 23011, all have worked for me.

    The caveat is that Magisk 23010+ is Zygisk, which means that some legacy modules won't work anymore until they're updated - Universal SafetyNet Fix for example.
    Coming from the Pixel 3XL, which bricked out of the blue. I did every update on that phone, but never got to do 12 before the magical brick. I want to update this phone (5a, which I just realized is different than the 5?), but this seems to be missing quite a few steps. Shouldn't there be 4 different files added to your SDK folder and flashed, or has it completely changed, and I need to do more digging? Thanks.
    You don't have to add any files to your SDK folder, you can always drag and drop them into the command line window. We are only working with two files here: vbmeta.img and boot.img.
    Is there any way to do this after already updating? Or do I have to wait for the next update (I prefer flashing factory images).
    You can do this as many times as you want. The critical point to remember is that if you allow Android to boot after not disabling verity/verification, you will have to wipe the next time you disable it.
    I flashed the Nov factory image but forgot to disable the verified boot. Is there any way I can disable it so i can flash the magisk patched boot?
    Yes...but you're going to have to wipe data. Extract vbmeta.img, and reflash it:
    Code:
    fastboot flash vbmeta --disable-verity --disable-verification <drag and drop vbmeta.img here>
    Then, reboot your device. You will end up in Rescue Party, with the option to "Try again" or "Factory data reset". Choose the factory reset.

    The best way to make sure you don't have to wipe your data is to always use --disable-verity --disable-verification when updating via the factory image.
    2
    Followed directions for recommended Android Flash Tool and everything worked flawlessly. If you've already rooted your phone once then you have somewhat of an idea of what you're doing. Just read everything twice and follow the directions. Thank you OP for such a clear path to update and root!