How To Guide [GUIDE] Pixel 6 Pro "raven": Unlock Bootloader, Update, Root, Pass SafetyNet

Search This thread

Divine Bicycle

Senior Member
Jan 11, 2022
73
25
Google Pixel 6 Pro
@ECHO OFF
:: Copyright 2012 The Android Open Source Project
::
:: Licensed under the Apache License, Version 2.0 (the "License");
:: you may not use this file except in compliance with the License.
:: You may obtain a copy of the License at
::
:: http://www.apache.org/licenses/LICENSE-2.0
::
:: Unless required by applicable law or agreed to in writing, software
:: distributed under the License is distributed on an "AS IS" BASIS,
:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
:: See the License for the specific language governing permissions and
:: limitations under the License.

PATH=%PATH%;"%SYSTEMROOT%\System32"
fastboot --slot all flash bootloader bootloader-raven-slider-1.2-8739948.img
fastboot reboot-bootloader
ping -n 5 127.0.0.1 >nul
fastboot --slot all flash radio radio-raven-g5123b-102852-220720-b-8851166.img
fastboot reboot-bootloader
ping -n 5 127.0.0.1 >nul
fastboot --slot all update image-raven-tp1a.220624.021.zip

echo Press any key to exit...
pause >nul
exit

I just used this script to upgrade to android 13, and during flashing I got this message. Please reply as soon as you can to help, i tried

fastboot --slot all update image-raven-tp1a.220624.021.zip

and i got the same error.

1660821332517.png
 

V0latyle

Forum Moderator
Staff member

Divine Bicycle

Senior Member
Jan 11, 2022
73
25
Google Pixel 6 Pro

Divine Bicycle

Senior Member
Jan 11, 2022
73
25
Google Pixel 6 Pro
Hmm....How much of your storage have you used up? If you don't have enough free space this could be an issue.

Unfortunately I don't know of a way to fix this other than use the Android Flash Tool to force flash all partitions, which will completely wipe the device
Apparently, aaccording to DevCheck pro, which I found through Kirisakura's twitter haha, /data has 131 gigs free, and /system has 0 bytes free. Is that normal?
 

V0latyle

Forum Moderator
Staff member
The only stupid question is the one you don't ask...well, except for the ones you ask when you already have the answer in front of your face
Is this method still valid to go from 12--13? I usually flash the whole image "-w" after processing the boot.img in Magisk and then fastboot the Magisk patched boot img.
Yes, the process is exactly the same. The only difference I would suggest is due to the anti-rollback in the bootloader, make sure you flash the bootloader to both slots.
 

squidbutt

Senior Member
May 30, 2008
396
14
suffolk
I flashed android 12 stock(coming from protonos)
Rooted(only patched the boot img and flashed it)
Then enabled zygisk and magisk direct installed.
When I was given the option to update to android 13
I downloaded and installed everything DID NOT REBOOT
Then went to magisk and flashed to inactive slot and rebooted

Root retained with bcr and saftynet fix installed.

Hope this helps
 
  • Like
Reactions: CRXed

Dragon Kumera

Senior Member
Mar 14, 2019
353
130
I flashed android 12 stock(coming from protonos)
Rooted(only patched the boot img and flashed it)
Then enabled zygisk and magisk direct installed.
When I was given the option to update to android 13
I downloaded and installed everything DID NOT REBOOT
Then went to magisk and flashed to inactive slot and rebooted

Root retained with bcr and saftynet fix installed.

Hope this helps
how because when I tried it never works or corrupts the boot. I can only succeed when dirty flashing the factory image and or ota.
 

V0latyle

Forum Moderator
Staff member
I flashed android 12 stock(coming from protonos)
Rooted(only patched the boot img and flashed it)
Then enabled zygisk and magisk direct installed.
When I was given the option to update to android 13
I downloaded and installed everything DID NOT REBOOT
Then went to magisk and flashed to inactive slot and rebooted

Root retained with bcr and saftynet fix installed.

Hope this helps
What version of Magisk did you use? This doesn't seem to be working for everyone using the latest Canary or Stable.
 

dilligaf56

Senior Member
Feb 22, 2011
172
47
SoCal, USA
Dumb question - my phone is threatening to perform an OTA update to the August version; it's never threatened to actually do the update before, just nagged me because I have automatic updates turned off in Developer Options. Will it override this setting and actually do the OTA update even though I have that toggled off? I will eventually do it via the factory image method but wanted to wait a week or two and see how it's working for everyone else...!
Thanks!
 

roirraW "edor" ehT

Forum Moderator
Staff member
Dumb question - my phone is threatening to perform an OTA update to the August version; it's never threatened to actually do the update before, just nagged me because I have automatic updates turned off in Developer Options.

If you're rooted, the OTA won't work no matter what. If you're not rooted, I want to know what exactly you mean by:
Will it override this setting and actually do the OTA update even though I have that toggled off?
It's requesting permission from you to download and install the OTA, correct? I don't believe it will automatically do anything without you telling it to do so. I'm familiar with that occasionally an OTA notice somehow slips by the Developer options toggle for Automatic Updates. I've seen others report this from time to time, and it just happened to me earlier this month before Android 13 came out, but after the second round of July updates came out and I never updated to. In my case, I just left the OTA notice hang out in the notifications for the week or two it was there. I had rebooted once or twice in that time for other reasons and besides the notification coming back each time, nothing automatically tried to download and install.

Of course, I'm rooted, so installation would've been unsuccessful, anyway. I have no idea if the Android 13 OTA behaves any differently than all other OTAs regarding waiting for your permission to download and then install. My wife's unrooted Pixel 6 Pro finally got the OTA to Android 13 today, but she doesn't have the Developer option toggle set to disable automatic updates, so I don't know what you should expect for sure.

Good luck!
 
  • Like
Reactions: dilligaf56

V0latyle

Forum Moderator
Staff member
If you're rooted, the OTA won't work no matter what. If you're not rooted, I want to know what exactly you mean by:

It's requesting permission from you to download and install the OTA, correct? I don't believe it will automatically do anything without you telling it to do so. I'm familiar with that occasionally an OTA notice somehow slips by the Developer options toggle for Automatic Updates. I've seen others report this from time to time, and it just happened to me earlier this month before Android 13 came out, but after the second round of July updates came out and I never updated to. In my case, I just left the OTA notice hang out in the notifications for the week or two it was there. I had rebooted once or twice in that time for other reasons and besides the notification coming back each time, nothing automatically tried to download and install.

Of course, I'm rooted, so installation would've been unsuccessful, anyway. I have no idea if the Android 13 OTA behaves any differently than all other OTAs regarding waiting for your permission to download and then install. My wife's unrooted Pixel 6 Pro finally got the OTA to Android 13 today, but she doesn't have the Developer option toggle set to disable automatic updates, so I don't know what you should expect for sure.

Good luck!
I believe the developer options toggle just controls whether the system will automatically apply system updates when the device restarts. It does not control whether the updates are downloaded or installed - just whether the update is completed when the user taps the Restart Now prompt, or when a manual restart is commanded.
 
  • Like
Reactions: roirraW "edor" ehT

dilligaf56

Senior Member
Feb 22, 2011
172
47
SoCal, USA
If you're rooted, the OTA won't work no matter what. If you're not rooted, I want to know what exactly you mean by:

It's requesting permission from you to download and install the OTA, correct? I don't believe it will automatically do anything without you telling it to do so. I'm familiar with that occasionally an OTA notice somehow slips by the Developer options toggle for Automatic Updates. I've seen others report this from time to time, and it just happened to me earlier this month before Android 13 came out, but after the second round of July updates came out and I never updated to. In my case, I just left the OTA notice hang out in the notifications for the week or two it was there. I had rebooted once or twice in that time for other reasons and besides the notification coming back each time, nothing automatically tried to download and install.

Of course, I'm rooted, so installation would've been unsuccessful, anyway. I have no idea if the Android 13 OTA behaves any differently than all other OTAs regarding waiting for your permission to download and then install. My wife's unrooted Pixel 6 Pro finally got the OTA to Android 13 today, but she doesn't have the Developer option toggle set to disable automatic updates, so I don't know what you should expect for sure.

Good luck!
I am rooted, so hopefully you're right!

I usually do the manual updates with my laptop, but after a recent airline trip on which I was forced to leave my laptop in checked baggage, the Linux partition boots but the Windows one doesn't. I have a backup of the Windows NTFS and recovery partitions, but it's a couple of months old, so looking for other fixes first; once I get everything fixed, will do the update via the factory image method.

Thanks!
 

Top Liked Posts

  • 1
    So just to ask, is there a way to root my A12 pixel without losing all my data etc?
    Rooting itself doesn't cause any data loss. However, you do have to have your bootloader unlocked. If you don't currently have it unlocked, then unlocking it will cause you to wipe and there is no way around that.
  • 5
    Thanks all,
    OEM is already unlocked.
    with out --slot all command , i have the same issue:

    C:\Users\Admin\Desktop\platform-tools_r33.0.3-windows\platform-tools>fastboot flash boot magisk_patched-25200_LDJee.img
    Warning: skip copying boot_b image avb footer (boot_b partition size: 67108864, boot_b image size: 100663296).
    Sending 'boot_b' (98304 KB) OKAY [ 2.306s]
    Writing 'boot_b' (bootloader) unable to update boot image: use unmerged...
    FAILED (remote: 'failed to flash partition (boot_b)')
    fastboot: error: Command failed
    C:\Users\Admin\Desktop\platform-tools_r33.0.3-windows\platform-tools>

    Jumped from a android 12 original rom rooted to android 13.

    i have also sideloaded android 13 after applying the android 13 upgrade.
    Are you using the correct boot image to patch? The size seems to be off. The boot image should be around 64 MB. Looks like you may be using a boot image from a different device.
    5
    The need for Displax's USNF mod depends are what you are trying to do. For example, many people need that mod to use the new Google Wallet. For other things, kdragon's USNF may be sufficient.
    4
    Thanks for your reply.

    Upgraded to 33.0.3 but i have the same issue.
    I use the image from the last android 13 official rom : 13.0.0 (TP1A.220624.021, Aug 2022)
    Right, but for which device (raven, oriole, bluejay, etc) and what is the exact name of the image you are patching (boot.img, vbmeta.img, etc).
    Where did you download it from? The ONLY acceptable source for Magisk APKs is the official GitHub, linked in the OP.

    When you're asked specific questions, you should give specific answers. If you don't give us the information we ask for, we can't be of much help.
    size: 67108864, boot_a image size: 100663296).
    Sending 'boot_a' (98304 KB)
    The image size is wrong, I think you're using the wrong image as @Lughnasadh pointed out. The size looks similar to the boot image of the 765G devices (4a 5g, 5, 5a) at 98,304KB (100,663,296 bytes). The correct boot image size for the Raven is 65,536KB (67,108,864 bytes)

    Make sure you are using THIS factory package, and ONLY use the boot image from it.

    The boot image you have been using is NOT from a Tensor series factory package. I don't know where you got it from, but you either took some shortcuts or ignored the instructions completely.
    4
    It took me a while to get comfortable with it myself and to figure it out, but this is what I've been doing with every update since July for my P6P (including upgrading to 13):

    1. Uninstall Magisk with restore (can leave modules)
    2. Hook phone to PC & switch to file transfer
    3. Open cmd prompt
    4. adb reboot fastboot
    5. Navigate to and select recovery
    6. Select apply update from adb > click power button to select
    7. adb sideload ota raven-ota-<whatever>.zip
    8. Reboot phone, allow setup to finish
    9. Extract full zip
    10. Extract boot.img from the other zip within the folder
    11. Copy boot.img to the phone
    12. Reinstall Magisk
    13. Patch boot.img
    14. Disconnect/reconnect phone from/to computer and select File Transfer again
    15. Copy patched boot img back to computer
    16. adb reboot fastboot
    17. fastboot flash boot --slot=all magisk_patched-<whatever>.img
    18. Reboot phone
    Hello! In general, your method looks fine to me just on a quick inspection - however, the main problem with Android 13 is when the bootloader (not boot) isn't installed to both slots. Until the Android 13 Stable bootloader is flashed to both slots, there is a chance that you could wind up with a fully bricked phone that can only be repaired by sending it in to Google.

    The very first thing anyone (who is concerned) should do when manually updating on any Pixel 6 is:
    Code:
    adb reboot bootloader
    fastboot --slot all flash bootloader bootloader.img

    After that, all update processes can be done absolutely just like any other month - no matter what method you use.
    4
    Yeah, he does know about this. Probably just slipped his mind.
    Also been crazy busy so while I have 5 min here and there to post replies, haven't had time to edit the OP. Typing this on my phone with my cat staring at me and the shower running, less than 40 min til I have to leave for work

    Edited while my breakfast cooks
  • 91
    ⚠️⚠️⚠️ WARNING! IF YOU ARE UPDATING TO ANDROID 13 FOR THE FIRST TIME, READ THIS FIRST!⚠️⚠️⚠️

    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, as well as support for the Android 13 beta.
    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 <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.

    Please note that the SafetyNet API has been deprecated for the Play Integrity API. Because Play Integrity relies on Hardware Key Attestation for the MEETS_STRONG_INTEGRITY evaluationType, it is not possible, nor will it ever be, to pass Play Integrity on a modified system with an unlocked bootloader. More information here.

    However, @Displax has modified the original Universal SafetyNet Fix by kdrag0n; his mod forces the "old" SafetyNet attestation, as if your device were running a version of Android older than 8.0.

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

    Please note that this is a temporary solution; any apps that remove legacy support for SafetyNet will not benefit from this; the only reason this hasn't already happened is because doing so would prevent anyone using legacy Android versions older than 8.0 from using said apps.

    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_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!
    9
    Magisk Stable is now at version 24.1, so I will no longer be providing any Magisk updates.

    You can use any version of Magisk now - Stable, Beta, or Canary. as long as it is 23016 or newer.

    Once again, if you want to switch versions of Maagisk, it is HIGHLY RECOMMENDED that you "Complete Uninstall" within Magisk before installing the new version. Multiple instances of Magisk can break root.

    If you simply want to update Magisk, the best way to do so is from within the app.


    Once the February update is out, I will perform some testing with installing to inactive slot, and if it works, I will update this guide.

    Given the low activity on this thread, I will probably close it if everything goes well with the next update.

    Thank you all for your testing and contributions.
    8
    My update process is to remove vbmeta.img (in addition to removing the -w flag in the flash-all script) from the factory zip before I flash it in fastboot. Seems to have worked so far, ymmv.
    7
    Magisk Canary updated to 23019
    Changes:
    - [Zygisk] Skip loading modules into the Magisk app to prevent conflicts
    - [MagiskBoot] Change `zopfli` to a more reasonable config so it doesn't take forever
    - [General] Several `BusyBox` changes

    Preferred method of update is from within Magisk app.


    If installing for the first time, here is the APK Download
    7
    I just used this method, (same one described on Magisk website here https://topjohnwu.github.io/Magisk/ota.html) and it worked perfectly, both root and safetynet.
    Can someone explain to me why you see all kind of guide to update which are far more complicated than that ?
    Part of it is due to device differences - non A/B devices can't use seamless updates, so re-rooting is only possible by either patching the boot image directly, or by flashing Magisk in a custom recovery.

    Part of it is also due to user preferences. Some people, like me, prefer to update using the factory images, instead of OTA.

    And part of it is probably a bit of misinformation mixed in with anecdotes, where people who don't fully understand how the process works, but they declare that something has to be done a certain way because of what worked for them.

    I try to stick to the first two. I've spent a lot of time learning about how Android works, so I make a point of providing instructions that align with how everything is supposed to be done, while accommodating alternatives for those who want them.

    Are you 100% sure?

    Cause topjohnwu said that OTA patching from within Magisk was broken for Pixel devices.

    See here

    Notice the date of that post, 16 months ago. Magisk Canary 23017 re-incorporated the ability to install to inactive slots.

    I have been following the commits closely, so when 23017 was released, I announced it in my guides. Had you read back a couple pages, your question has been answered.

    If you don't believe me, check the commits here.