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

Search This thread

Regys

Senior Member
Sep 10, 2012
269
20
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>
it restarted after the update. but I patch the boot.img.
 
Last edited:

MpandAUS

Senior Member
Feb 17, 2015
116
51
Google Pixel 5a
Great useful thread, ty! Just one question... Is it not possible to backup your data while your on stock and haven't unlocked the bootloader yet? How to backup your data when you havent unlocked the bootloader or rooted it? Surely there has be another way of do a complete backup besides the google crappy backup feature.
 

V0latyle

Forum Moderator
Staff member
Great useful thread, ty! Just one question... Is it not possible to backup your data while your on stock and haven't unlocked the bootloader yet? How to backup your data when you havent unlocked the bootloader or rooted it? Surely there has be another way of do a complete backup besides the google crappy backup feature.
Not really. Android has incorporated data segregation for apps for a long time, so it's impossible for any one app to read data from another app, with the exception of "shared" data in storage. The only way around this is root, which is not possible without an unlocked bootloader.
 

omartins

Senior Member
Jan 31, 2011
253
81
Great useful thread, ty! Just one question... Is it not possible to backup your data while your on stock and haven't unlocked the bootloader yet? How to backup your data when you havent unlocked the bootloader or rooted it? Surely there has be another way of do a complete backup besides the google crappy backup feature.
Personally, I use Swift Backup (root mode), but, according to the developer change log, it was recently included a modality without root, keeping a considerable share of the backup capabilities... give it a look.
 

V0latyle

Forum Moderator
Staff member
Personally, I use Swift Backup (root mode), but, according to the developer change log, it was recently included a modality without root, keeping a considerable share of the backup capabilities... give it a look.
Again, it's not possible for an app to backup other apps' data without root. This is a security feature that's been a part of Android for quite some time to prevent malicious apps from accessing sensitive information.
 

laughoutloud

New member
Jul 22, 2014
2
1
after holding off for months, I was forced to update from 11 to 12 (April patch) and attempted to use the factory img update method to do it while maintaining root. the update went smoothly and I do have root, but safetynet fails across the board. magisk is up to date and I have USNF. any ideas appreciated!
 

Attachments

  • Screenshot_20220419-172637.png
    Screenshot_20220419-172637.png
    136.2 KB · Views: 41
  • Screenshot_20220419-172644.png
    Screenshot_20220419-172644.png
    244.1 KB · Views: 40
  • Screenshot_20220419-172625.png
    Screenshot_20220419-172625.png
    144.2 KB · Views: 39

V0latyle

Forum Moderator
Staff member
after holding off for months, I was forced to update from 11 to 12 (April patch) and attempted to use the factory img update method to do it while maintaining root. the update went smoothly and I do have root, but safetynet fails across the board. magisk is up to date and I have USNF. any ideas appreciated!
I recommend using Canary 24306 until Stable 24.4 is released.

I also recommend against using Riru unless you are using modules that explicitly require it. You're using the wrong version of USNF.

On my Pixel 5, I'm passing SafetyNet with this configuration:
  • Stock ROM, stock kernel Magisk patched
  • Magisk Canary 24306, Zygisk and DenyList enabled
  • DenyList configured for Google Play Store (does not affect SafetyNet but will fail Play Protect)
  • Module: MagiskHide Props Config 6.1.2
  • Module: Universal SafetyNet Fix 2.2.1
SafetyNet confirmed passing with YASNAC
 

laughoutloud

New member
Jul 22, 2014
2
1
looks like the out of date USNF was the culprit. thanks!
magisk manager doesn't display the canary channel as an option for me, only stable and beta (and custom). should i just plug the canary channel link into custom? if so, where could i find that link?
 
  • Like
Reactions: V0latyle

AnyNameYouWish

Senior Member
Last edited:
  • Like
Reactions: laughoutloud

V0latyle

Forum Moderator
Staff member
looks like the out of date USNF was the culprit. thanks!
magisk manager doesn't display the canary channel as an option for me, only stable and beta (and custom). should i just plug the canary channel link into custom? if so, where could i find that link?
You'd have to uninstall Magisk, then download the canary version from the button on the Magisk page:
1650629882924.png
 

cubandanger05

Senior Member
Dec 22, 2009
545
184
Google Pixel 5
Google Pixel 6a
Updated to May's release. I'm still using Magisk 23001 - don't judge me. Followed these steps, never fails:

1. Download the new full factory image
2. Extract the file. Then extract boot.img from the image zip file within.
3. Copy boot.img to your pixel 5
4. Patch it with magisk
5. Move back the patched file, rename it to boot.img
6. Update the original zip file titled image-redfin-r*.zip with the new boot.img file (override the older one)
7. Edit flash-all file by replacing -w with --disable-verification --disable-verity
so it won't wipe your device clean
8. Reboot phone to bootloader and flash with flash-all
 

V0latyle

Forum Moderator
Staff member
Updated to May's release. I'm still using Magisk 23001 - don't judge me. Followed these steps, never fails:

1. Download the new full factory image
2. Extract the file. Then extract boot.img from the image zip file within.
3. Copy boot.img to your pixel 5
4. Patch it with magisk
5. Move back the patched file, rename it to boot.img
6. Update the original zip file titled image-redfin-r*.zip with the new boot.img file (override the older one)
7. Edit flash-all file by replacing -w with --disable-verification --disable-verity
so it won't wipe your device clean
8. Reboot phone to bootloader and flash with flash-all
Here's how I updated my Pixel 5 and wife's 5a:

Downloaded and extracted May factory image.
Rebooted device to bootloader.
Bootloader and baseband versions have not changed; skipped.
Applied factory image:
Code:
fastboot update --skip-reboot --slot all <image-device-buildnumber.zip>
When update completed, rebooted to bootloader
Booted April patched image (24305) from previous update: (I cheated here and reused the Pixel 5 boot image on my wife's 5a; bramble, redfin, and barbet hardware are identical, so the kernels are too)
Code:
fastboot boot <April patched image>
Device booted into Android with root. Opened Magisk, tap Install, tap Direct Install, reboot.
Running 24.3 Stable on wife's 5a, Canary 24306 on my 5.
 
Last edited:

DeathUp

New member
Mar 7, 2015
1
0
I've had a rooted Pixel 5 for a while, suddenly whilst using it, it rebooted and now it's stuck constantly refreshing at the bootloader is unlocked screen. I'm confused what could of caused this. I was still on android 11 at the time. Is there anything I can do to recover my data or stop it?
 

andybones

Retired Forum Moderator / Inactive RD
May 18, 2010
15,092
15,480
Google Pixel 5
I've had a rooted Pixel 5 for a while, suddenly whilst using it, it rebooted and now it's stuck constantly refreshing at the bootloader is unlocked screen. I'm confused what could of caused this. I was still on android 11 at the time. Is there anything I can do to recover my data or stop it?
If you are stuck and can't boot to ROM, and don't have the phone backed up.
One think you should be able to save is your Internal storage by installing TWRP and pulling the contents to a PC.
 

V0latyle

Forum Moderator
Staff member
I've had a rooted Pixel 5 for a while, suddenly whilst using it, it rebooted and now it's stuck constantly refreshing at the bootloader is unlocked screen. I'm confused what could of caused this. I was still on android 11 at the time. Is there anything I can do to recover my data or stop it?
Making sure I understand this correctly, it doesn't even start to boot the kernel (Google logo), it's just bootlooping at the orange bootloader screen?

Try booting the stock boot image for your build; if you can't remember what your build number is just use the latest A11 image.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 17
    Official updates for this device ended February 2024.

    If you are looking for my guide on a different Pixel, find it here:
    For best results, use the latest stable Magisk release.
    Discussion thread for migration to 24.0+.
    Note: Magisk prior to Canary 23016 does not incorporate the necessary fixes for Android 12+.


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

    PixelFlasher by @badabing2003 is an excellent tool that streamlines the update process - it even patches the boot image for you.
    The application essentially automates the ADB interface to make updating and rooting much easier. However, it is STRONGLY recommended that you still learn the "basics" of using ADB.

    For instructions, downloads, and support, please refer to the PixelFlasher thread.

    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.

    SafetyNet has been deprecated for the new Play Integrity API. More information here.

    In a nutshell, Play Integrity uses the same mechanisms as SafetyNet for the BASIC and DEVICE verdicts, but uses the Trusted Execution Environment to validate those verdicts. TEE does not function on an unlocked bootloader, so legacy SafetyNet solutions will fail.

    Before asking any questions, please read this post.
    For help passing Play Integrity verdicts, see this thread.

    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_20230323-072859-3-png.5870161
    • "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 @badabing2003 , @pndwal , @Displax , @Az Biker , @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).