[GUIDE] Pixel 5 "redfin": Unlock Bootloader, Update, Root, Pass SafetyNet

Search This thread

eriks0n

Member
Oct 15, 2015
11
2
Also will updating with Factory Images without a data wipe clear out my 2FA entries in the Google Authenticator?
 

Regys

Senior Member
Sep 10, 2012
195
10
Hi,

I would like to understand the part "Initial Root / Create Master Root Image"

Is it compulsory ? because last time I had to use the phone.

I'm updating with Android Flash Tool.

Thx !
 

eriks0n

Member
Oct 15, 2015
11
2
Before I try the "Update and Root Automatic OTA" approach, is there anything to watch out for?

The instructions say to uninstall magisk before downloading the OTA.

I haven't asked the Android device to update but I am seeing the prompt to restart to install the OTA. Does this mean it's too late for me to take this approach as the OTA has already downloaded and I have yet to uninstall magisk?

When I updated the last two times I did a factory update, I want to try to avoid that as I don't want to reset up all my two-factor authentications in Google Authenticator.


I ending up just updating with factory images.

My SafetyNet check continued to pass and root is working flawlessly with this method.

This process works well, just need to create a new "master boot.img" file with the updated factory files before following the instructions, this part is implied in the instructions.

But doing this I didn't lose my Google Authenticator entries.
 
  • Like
Reactions: elong7681

V0latyle

Forum Moderator
Staff member
Before I try the "Update and Root Automatic OTA" approach, is there anything to watch out for?

The instructions say to uninstall magisk before downloading the OTA.
Don't uninstall, just restore images - but this shouldn't be necessary because of the below:
I haven't asked the Android device to update but I am seeing the prompt to restart to install the OTA. Does this mean it's too late for me to take this approach as the OTA has already downloaded and I have yet to uninstall magisk?
No. It apparently already passed block verification. Just open Magisk, disable any modules you have installed, then tap Install > Install to Inactive Slot. Magisk will patch the boot image in the other slot then force a reboot to that slot.
When I updated the last two times I did a factory update, I want to try to avoid that as I don't want to reset up all my two-factor authentications in Google Authenticator.
Just follow the instructions and you'll be fine. Make sure you disable modules just to be safe. If for whatever reason you get a boot loop, flashing the factory boot image should get you running while you figure out the problem.
 
  • Like
Reactions: eriks0n
Anyone else having issue with google pay?
I just rooted with latest factory image and the wallet tile is disabled...
All I have done after root is add modules
- MagiskHide Props Config 6.1.2-v137
- Universal SafetyNet Fix 2.2.1
I pass safetynet attestation in YASNAC

And add followings in Magisk DenyList (all sub-component for each) :
- Google Play Protect Service
- Google Play Store
Google Play Service as well, but it doesnt stay after reboot (I saw on page 9 that it's normal behaviour)

Am I missing something or is it related to latest firmware update?

Edit : maybe some more details can be interesting:
- Magisk canary
- in Settings / Google / Settings for Google Apps / Google Pay : my bank card is set and seem to be operational (bank validated it and the NFC logo isnt greyed or crossed)
 
Last edited:

V0latyle

Forum Moderator
Staff member
Hi,

I would like to understand the part "Initial Root / Create Master Root Image"

Is it compulsory ? because last time I had to use the phone.

I'm updating with Android Flash Tool.

Thx !
Initial Root essentially describes the process to root your device, coming from unrooted factory firmware. A patched boot image is required for root. An unpatched boot image does not have root.

Anyone else having issue with google pay?
I just rooted with latest factory image and the wallet tile is disabled...
All I have done after root is add modules
- MagiskHide Props Config 6.1.2-v137
- Universal SafetyNet Fix 2.2.1
I pass safetynet attestation in YASNAC

And add followings in Magisk DenyList (all sub-component for each) :
- Google Play Protect Service
- Google Play Store
Google Play Service as well, but it doesnt stay after reboot (I saw on page 9 that it's normal behaviour)

Am I missing something or is it related to latest firmware update?

Edit : maybe some more details can be interesting:
- Magisk canary
- in Settings / Google / Settings for Google Apps / Google Pay : my bank card is set and seem to be operational (bank validated it and the NFC logo isnt greyed or crossed)
Make sure you've enabled DenyList on GPay as well. There do seem to be some occasional quirks upon initial root, but generally GPay continues to work as long as everything is set up correctly. I'm able to add/remove cards and use NFC without a problem.
 
Can you share what's on your DenyList? I don't see any GPay while searching for it in Magisk...

Here's mine (and yes, I have a nice butt thanks to the 30 days challenge app)
And the wallet tile
 

Attachments

  • Screenshot_20220406-150925.png
    Screenshot_20220406-150925.png
    183.8 KB · Views: 23
  • Screenshot_20220406-153531.png
    Screenshot_20220406-153531.png
    126.1 KB · Views: 20
Last edited:
It's called "Google Pay"
I don't have any "Google Pay" app in the deny list entries, but I found the sneaky bastard so now my denied apps are
- Google Play Store
- my banks apps
- this com.....wallet app

Doing a clear cache and data of Google Play service and reboot solved the problem

Thanks for your answers and digging!
 

Attachments

  • Screenshot_20220406-212840.png
    Screenshot_20220406-212840.png
    196.5 KB · Views: 12

V0latyle

Forum Moderator
Staff member
Can you share what's on your DenyList? I don't see any GPay while searching for it in Magisk...

Here's mine (and yes, I have a nice butt thanks to the 30 days challenge app)
And the wallet tile
Screenshot_20220406-101848.png


Google Pay has been superseded by GPay. The only important items on the list are Play Store and GPay, and honestly if you already have GPay installed, you don't even need to block Play Store. I simply did because of Play Protect.
I've blocked the other apps for various reasons - all payment and DRM apps (Venmo is also on the list), social media (observed odd behaviour from Facebook with unblocked root), and for some reason the smart home stuff doesn't work properly with root either

Screenshot_20220406-151800.png
 
Last edited:
  • Like
Reactions: AnyNameYouWish
I haven't installed the Gpay app since it's natively included in my P5, so I don't have anything similar to yours nor "Google Pay" as suggested by eriks0n.
Only the "systemui.plugin" wallet... I guess it's related to some local specifications...

Anyway, thanks again for prompt answers - and for the OP tutorial :)
 
  • Like
Reactions: V0latyle

Regys

Senior Member
Sep 10, 2012
195
10
Initial Root essentially describes the process to root your device, coming from unrooted factory firmware. A patched boot image is required for root. An unpatched boot image does not have root.
Hi,

In what order to do it ? As I said, last time I was afraid to lose everything :)

Sorry, but it's a bit confusing for me.

Thx !
 

V0latyle

Forum Moderator
Staff member
Hi,

In what order to do it ? As I said, last time I was afraid to lose everything :)

Sorry, but it's a bit confusing for me.

Thx !
If you have not unlocked your bootloader, you will be forced to wipe data when you do so. There is no way around this. Fortunately, most of your data on your device backs up to the cloud, so you won't lose everything. Keep in mind that Photos does not back up every time your system takes a snapshot, so make sure you perform a manual backup in the Photos app.

To root your device, follow the instructions under Initial Root.
 

Regys

Senior Member
Sep 10, 2012
195
10
If you have not unlocked your bootloader, you will be forced to wipe data when you do so. There is no way around this. Fortunately, most of your data on your device backs up to the cloud, so you won't lose everything. Keep in mind that Photos does not back up every time your system takes a snapshot, so make sure you perform a manual backup in the Photos app.

To root your device, follow the instructions under Initial Root.
My phone is already rooted and unlocked , I have the January version.
 

V0latyle

Forum Moderator
Staff member
My phone is already rooted and unlocked , I have the January version.
Okay, so you're asking how to best update without wiping data?

Any of the methods described in the OP will allow you to do this. I personally recommend dirty flashing the factory image, but you'll need to update bootloader and radio.
 
  • Like
Reactions: elong7681

Regys

Senior Member
Sep 10, 2012
195
10
Okay, so you're asking how to best update without wiping data?

Any of the methods described in the OP will allow you to do this. I personally recommend dirty flashing the factory image, but you'll need to update bootloader and radio.
Yes no wiping,

just know when exactly should I install my modified boot.img

After the flash or the flash/reboot?
 

V0latyle

Forum Moderator
Staff member
Yes no wiping,

just know when exactly should I install my modified boot.img

After the flash or the flash/reboot?
After the flash, before you reboot.

This is the command I use to flash my Pixel 5:
fastboot update --skip-reboot --slot=all <update image file path>

The update package reboots the device into fastboot; when the update completes, the device is still in fastboot due to the --skip-reboot option. Then, I flash the patched boot image: fastboot flash boot --slot=all <patched boot image file path>
 

noxqzs

Member
Jan 22, 2007
39
4
I followed instructions for rooting my Pixel but absentmindedly forgot to disable automatic updates. Phone was rebooted after the update. On page 11 of this thread, I noticed a user (a4abbas) with a similar situation. Could you confirm that the steps to regain root are:

(I am on stock ROM with just magisk and no modules. )

download factory image for current update I am on.
extract boot.img
patch with magisk in phone
fastboot the updated file
reboot

I apologize if this question has been asked over and over.

thanks for your contributions to the forum.
 

V0latyle

Forum Moderator
Staff member
I followed instructions for rooting my Pixel but absentmindedly forgot to disable automatic updates. Phone was rebooted after the update. On page 11 of this thread, I noticed a user (a4abbas) with a similar situation. Could you confirm that the steps to regain root are:

(I am on stock ROM with just magisk and no modules. )

download factory image for current update I am on.
extract boot.img
patch with magisk in phone
fastboot the updated file
reboot

I apologize if this question has been asked over and over.

thanks for your contributions to the forum.
You're on the right track.
 
  • Like
Reactions: noxqzs

Top Liked Posts

  • There are no posts matching your filters.
  • 4
    I updated to June the way I always have:
    • Patched new boot image in Magisk
    • Reboot to bootloader
    • Flash bootloader and radio
    • Reboot to bootloader
    • Dirty flash factory image (--skip-reboot --slot=all)
    • Flash patched boot image to both slots
    • Reboot; update complete.
    2
    I did what it says exactly, but I always ended up with an old version. But I was able to solve it with your "Update and Root OTA Sideload" method. After flashing the old master-root.img, I did the described steps and now I have the newest firmware with root. Thanks :)
    Don't flash an old boot image after updating. You can temporarily boot it to give Magisk root so that it can patch the new image.
    1
    No, still on the Android 12 beta which I had to install to get out of a mess that you helped me with back in January (see post #128).
    Oh, okay. You should be able to update to the latest release using the method of your choice. I would personally recommend dirty flashing the factory image.
    1
    It says SP2A.220305.012 Is there any way to boot from the other slot?
    I wouldn't try without updating again.

    Follow these instructions exactly:
    1. Follow the prompts to download and install the update, or force update via Settings > System > System Update. Do not reboot.
    2. When prompted to reboot, go into Magisk, then tap Install > Install to Inactive Slot. Magisk will prompt you to reboot; follow the prompts.
    3. Device should reboot into updated slot with root. If you get a failure message during OTA, go into Magisk, tap Uninstall, then Restore Images, before trying to update again.
    1
    I did what it says exactly, but I always ended up with an old version. But I was able to solve it with your "Update and Root OTA Sideload" method. After flashing booting the old master-root.img, I did the described steps and now I have the newest firmware with root. Thanks :)
  • 15
    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 flash bootloader <bootloader image name>
    fastboot reboot bootloader
    ping -n 5 127.0.0.1 > nul
    fastboot flash 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!
    6
    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.
    4
    For those who are wondering, this is how I updated my Pixel 5 (and my wife's 5a):
    1. Download and extract the factory image
    2. Extract boot.img from the factory update image
    3. Copied boot.img to device, patched in Magisk, copied patched boot image back to update folder
    4. Reboot device to bootloader
    5. Apply update:
      Code:
      fastboot update device-image-buildnumber.zip
    6. Let device boot and finish update; reboot to bootloader
    7. Boot patched image:
      Code:
      fastboot boot magisk_patched-23016_xxxxx.img
    8. Open Magisk, tap Install, Direct Install, then reboot.
    9. Done.
    You can potentially save a couple steps by using --skip-reboot when applying the update, then simply rebooting to bootloader and flashing the patched boot image.

    Note: I manually patched the boot image because I didn't have a 23016 boot image handy.
    4
    For those who are wondering, this is how I updated my Pixel 5 (and my wife's 5a):
    1. Download and extract the factory image
    2. Extract boot.img from the factory update image
    3. Copied boot.img to device, patched in Magisk, copied patched boot image back to update folder
    4. Reboot device to bootloader
    5. Apply update:
      Code:
      fastboot update device-image-buildnumber.zip
    6. Let device boot and finish update; reboot to bootloader
    7. Boot patched image:
      Code:
      fastboot boot magisk_patched-23016_xxxxx.img
    8. Open Magisk, tap Install, Direct Install, then reboot.
    9. Done.
    You can potentially save a couple steps by using --skip-reboot when applying the update, then simply rebooting to bootloader and flashing the patched boot image.

    Note: I manually patched the boot image because I didn't have a 23016 boot image handy.
    Confirmed working

    Just applied January update like how I have always been doing on Android 11. This wouldn't be possible without Magisk version 23016
    4
    @TKruzze @V0latyle If you're using USNF it doesn't matter if you add the necessary gms components to the Deny listh. The module will always remove them since keeping them on the list will actually keep USNF from doing it's thing.

    For simple SafetyNet pass Universal SafetyNet Fix is all you need (and possibly MagiskHide Props Config if you need to spoof a device fingerprint).