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

Search This thread

V0latyle

Forum Moderator
Staff member
ok only by the system, hard reset is not possible

1/ Factory Reset is deep format than Hard Reset ?
2/ Factory Reset redefines the bootloader?
I still don't quite understand what you're asking. What do you mean by a "hard reset"?

As I stated, factory reset wipes all user data and system settings. Only the critical system partitions are untouched.

There is no way to "reset" the bootloader - you can reflash it, but this is rarely necessary.

What exactly are you trying to do?
 

Regys

Senior Member
Sep 10, 2012
239
18
I still don't quite understand what you're asking. What do you mean by a "hard reset"?

As I stated, factory reset wipes all user data and system settings. Only the critical system partitions are untouched.

There is no way to "reset" the bootloader - you can reflash it, but this is rarely necessary.

What exactly are you trying to do?
I just want to reset all my phone, And make an clean installation with the last update.

I go through recovery mode and do the factory reset. I want to keep my bootloader unlocked
 

V0latyle

Forum Moderator
Staff member
I just want to reset all my phone, And make an installation with the last update.

I go through recovery mode and do the factory reset. I want to keep my bootloader unlocked
Okay. Factory reset doesn't affect the bootloader at all so it won't relock your phone.

If you want, you can reflash your devices AND wipe it at the same time. Follow the instructions under "Update and Root Factory Image", but make sure you add a -w to the command when flashing the update, so it would look like this:
fastboot update -w <update image>

You can still use the other arguments at the same time, so if you wanted to flash to both slots but prevent a reboot so you can flash a patched boot image, use:
fastboot update -w --skip-reboot --slot all <update image>

There is one more option that's potentially more thorough....

You can use the Android Flash Tool and check the "Wipe device" and "Force flash all partitions" boxes. Make sure that you uncheck the "Lock bootloader" box if you want to leave it unlocked. This will reflash every partition on your device.
 
  • Like
Reactions: Regys

Regys

Senior Member
Sep 10, 2012
239
18
Okay. Factory reset doesn't affect the bootloader at all so it won't relock your phone.

If you want, you can reflash your devices AND wipe it at the same time. Follow the instructions under "Update and Root Factory Image", but make sure you add a -w to the command when flashing the update, so it would look like this:
fastboot update -w <update image>

You can still use the other arguments at the same time, so if you wanted to flash to both slots but prevent a reboot so you can flash a patched boot image, use:
fastboot update -w --skip-reboot --slot all <update image>

There is one more option that's potentially more thorough....

You can use the Android Flash Tool and check the "Wipe device" and "Force flash all partitions" boxes. Make sure that you uncheck the "Lock bootloader" box if you want to leave it unlocked. This will reflash every partition on your device.
I'm going to do it in several times, I can't with these commands.

Factory Reset
Flash last version and Root
 

Regys

Senior Member
Sep 10, 2012
239
18
Okay, the commands I gave you will work. You can wipe data at the same time you're flashing the latest version.
Ok, Where exactly should the zip be extracted ? In platform-tools ?

otherwise the order will be that ?

Code:
fastboot update -w <redfin-tp1a.221005.002>
 
Last edited:

V0latyle

Forum Moderator
Staff member
Ok, Where exactly should the zip be extracted ? In platform-tools ?
I generally extract the factory zip to its own folder, just to keep things separate. I don't put any of the files or images in the platform-tools folder, because I can drag and drop the files into the command window.
otherwise the order will be that ?

Code:
fastboot update -w <redfin-tp1a.221005.002>
No - you'd be flashing the zip that is inside that package: image-redfin-tp1a.221005.002.zip

See this post
 
Last edited:

Regys

Senior Member
Sep 10, 2012
239
18
I generally extract the factory zip to its own folder, just to keep things separate. I don't put any of the files or images in the platform-tools folder, because I can drag and drop the files into the command window.

No - you'd be flashing the zip that is inside that package: image-redfin-tp1a.221005.002.zip
I understand, doing it this way is better indeed. I don't know Pixel Flasher

what do you call "both slots" ?
 

V0latyle

Forum Moderator
Staff member
I understand, doing it this way is better indeed. I don't know Pixel Flasher
Pixel Flasher thread

It's a program that automates the ADB and fastboot commands. You don't have to extract anything or handle any files, the program does it for you. It's still a good idea to familiarize yourself with how ADB works as well as how to flash the phone manually, so that you understand what's going on.
 

Regys

Senior Member
Sep 10, 2012
239
18
Pixel Flasher thread

It's a program that automates the ADB and fastboot commands. You don't have to extract anything or handle any files, the program does it for you. It's still a good idea to familiarize yourself with how ADB works as well as how to flash the phone manually, so that you understand what's going on.
Yes, I see later

last thing, what do you call "both slots" ?
 

V0latyle

Forum Moderator
Staff member
Yes, I see later

last thing, what do you call "both slots" ?
Pixel devices are A/B partition layout - meaning that the critical partitions (/bootloader, /radio, /boot, /system, /vbmeta, etc) all have two slots - /boot_a and /boot_b. Normally, when you flash the factory image, it just flashes to whatever is currently the active slot (you can see this at the bottom of the bootloader screen). Sideloading the OTA on the other hand always installs to the other slot.

The A/B layout is used for seamless system updates - while the system is running on one slot, it can download and install an update package to the other slot, then schedule a reboot to that slot, so that the only "interruption" in the user experience is the reboot.

Example: You're currently on slot A, running the September update. When the October update comes available, the system can download and install it to slot B. Following a reboot, the system boots slot B, so you're now on the October update on slot B, and slot A becomes inactive. Then, when the November update drops, the system can download and install it to slot A.

It's generally not necessary to flash the factory update to both slots.
 

Regys

Senior Member
Sep 10, 2012
239
18
Pixel devices are A/B partition layout - meaning that the critical partitions (/bootloader, /radio, /boot, /system, /vbmeta, etc) all have two slots - /boot_a and /boot_b. Normally, when you flash the factory image, it just flashes to whatever is currently the active slot (you can see this at the bottom of the bootloader screen). Sideloading the OTA on the other hand always installs to the other slot.

The A/B layout is used for seamless system updates - while the system is running on one slot, it can download and install an update package to the other slot, then schedule a reboot to that slot, so that the only "interruption" in the user experience is the reboot.

Example: You're currently on slot A, running the September update. When the October update comes available, the system can download and install it to slot B. Following a reboot, the system boots slot B, so you're now on the October update on slot B, and slot A becomes inactive. Then, when the November update drops, the system can download and install it to slot A.

It's generally not necessary to flash the factory update to both slots.
Ok, thank you for all these explanations and for your time to answer them.

I do by the cmd as you indicated. I just want to do a factory reset and remove all traces of app etc. that have been on my phone for 2 years. and do a clean install
 
  • Like
Reactions: V0latyle

V0latyle

Forum Moderator
Staff member
Okay. Then just follow the steps under "Update and Root Factory Image", and add -w to the command when you flash the update.

Alternatively....this will require more work and more steps....you could use the Android Flash Tool to force flash all partitions, then reboot the device to bootloader and flash the patched boot image.

But, factory reset (data wipe) should be sufficient.
 

Regys

Senior Member
Sep 10, 2012
239
18
Nice ok,

I use Android Flash Tool to make update, is a good tools.

Just check "Wipe Device" and "Force Flash All Partition"
 
  • Like
Reactions: V0latyle

Durchmesser

Member
Oct 14, 2015
35
2
Since last update of Lineagos my Pixel5 misses root. So I rebootet to recovery and detected twrp is not anymore on my phone.
I downloaded twrp and flashed it.
aftert that twrp ssems not boot and oly show the twrp logo.
Since i changed to bootloader i now stick on fastbootd and nothing wort. neither fastboot recovery nor fastboot vendor_boot.
I get permission error. and reboot every time ends in fastboot.
 

V0latyle

Forum Moderator
Staff member
Since last update of Lineagos my Pixel5 misses root. So I rebootet to recovery and detected twrp is not anymore on my phone.
This thread is for the stock firmware. If you need help with LineageOS, you need to post in the LineageOS thread for your device.
I downloaded twrp and flashed it.
TWRP cannot be flashed on our devices...
aftert that twrp ssems not boot and oly show the twrp logo.
This is why. When you flash TWRP to /boot, you overwrite the boot image, so now the only thing in /boot is TWRP. The Pixel devices do not have a discrete recovery partition, so to install TWRP, you must live boot the TWRP image, then perform Install within TWRP to patch the existing boot image.

However....

TWRP and Magisk both depend on patching the boot image, and in my experience, do not work together. I personally see little need for using TWRP on our devices because of the ability to flash individual partitions directly from fastboot.
Since i changed to bootloader i now stick on fastbootd and nothing wort. neither fastboot recovery nor fastboot vendor_boot.
I get permission error. and reboot every time ends in fastboot.
This is why it's important to learn about how everything works before you start changing things. I have no idea what all you've done to your device so I can't very well tell you how to fix it.

If you want to start over, try using the Android Flash Tool to re-install the OEM firmware to your device. Since you had a custom ROM installed, make sure you check the Force flash all partitions and Wipe device boxes.
 
  • Like
Reactions: badabing2003

Top Liked Posts

  • 1
    Yes, it seems to work with https://github.com/Displax/safetynet-fix/releases
    and by adding Revolut app to deny list in magisk.
  • 1
    If I install OTA, can I downgrade to Android 11 later if I don't like it or it is not possible anymore?
    AFAIK there is nothing preventing rollback on the Pixel 5. However I doubt your issue with Play Store certification has anything to do with Android version.
    An update- I installed this mod https://github.com/Displax/safetynet-fix/releases
    instead of the "official" 2.4 and now both safety checks pass all the time in YASNAC, and both device & basic check pass in the other app all the time.

    ..but g play still shows that the device is not certified, and still can not see Revolut in play store when I search for it.

    Anyone managed to get Revolut in play store on rooted Pixel 5 ? Could it be that Revolut requires the 3rd type of check to pass, the one that is hardware-backed?
    Wipe data for Play Store and restart.

    For further support regarding Play Integrity please ask your questions in this thread. Be sure to specify what other mods you're using, if any
    1
    Yes, it seems to work with https://github.com/Displax/safetynet-fix/releases
    and by adding Revolut app to deny list in magisk.
  • 16
    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.

    However, @Displax has modified the original Universal SafetyNet Fix by kdrag0n; his mod is able to force basic attestation instead of hardware, meaning that the device will pass BASIC and DEVICE integrity.

    Mod available here. Do not use MagiskHide Props Config with this mod.

    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:
    • Universal SafetyNet Fix 2.3.1 Mod - XDA post
    To check SafetyNet status:
    To check Play Integrity 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_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).