How To Guide A13 detailed guide to Root & OTA's & pass SafetyNet / Play Integrity

Search This thread

G5-User7080

Senior Member
May 31, 2018
124
32
My Phone already came with A13 and OEM unlocking became available straight after connecting to wifi.
If it stays grayed out for you or you need to update to A13 / July A12 patch first please refer to other guides such as this one.

Disclaimer:
I don't take responsibility for whatever happens to your device. Expect your device to get wiped.
While everything went without a hitch for me, there is no guarantee it will for you as well.


sources:
Pixel 6 root guide
Pixel 6a root guide
Magisk root guide
Magisk OTA guide

As a sidenote, if you are already rooted and want Magisk to have a backup of the stock boot image, just flash stock boot.img (this will remove root), then boot the Magisk patched boot image and do "direct install" through Magisk. Thats essentially just unrooting and re-rooting.


Prerequisites:​

Update ur phone to the newest available version if possible. At least you probably should be on June 2022 patch, though this Guide is meant for A13.

Get the original Factory Image (not OTA) from google, the version that matches the currently installed one (aka probably the newest if you're fully up to date).
Get the Magisk app apk from the official Github.
Get the adb & fastboot tools as well as necessary google USB drivers (15s installer seems to be outdated yet again).
Get the safetynet-fix-MOD Module from it's Github. (official safetynet-fix got updated and works as well not anymore as of February update.)


Preparing files and device:​

Open the downloaded firmware archive. Inside there will be another zip archive (image-bluejay-[...].zip). Open this and get the boot image (boot.img) from it.

Connect your phone to your pc over USB, and copy both the Magisk apk file and the boot.img file to your phone.

On your phone, open Settings -> About phone, then tap on "Build number" until it says "deveoper options unlocked".
In Settings -> System -> Developer options turn on "OEM unlocking" as well as "USB debugging" and then check the "allow" and "remember" option when it asks you if it should remember your computer.

Now install the Magisk app with the apk, then open it, select "install" and then "select and patch a file" and select the boot.img you moved to your phone earlier.
Magisk saves the patched boot.img in your Downloads folder, move it to your computer.

Now you should have a modified boot.img on your computer, OEM unlocking and adb debugging enabled, as well as your computer authorised for adb on your phone.
You should also not have any outstanding OTA's or reboots after OTA installation.


Unlocking and Rooting:​

Note that unlocking your bootloader will wipe your phone!
Just rooting it won't wipe it if you already have an unlocked bootloader.

Open a terminal on your pc and type adb devices. It should show some number if your adb is working correctly.
Type adb reboot bootloader and wait for it to reboot to bootloader.
Then type fastboot flashing unlock and confirm on your phone that you want to unlock your bootloader.

After you unlocked your bootloader check your phone's screen, specifically where it lists the Bootloader version (second line).
Compare the version number with the one of the bootloader image inside your downloaded firmware zip file. (bootloader-bluejay-bluejay-[...].img)
Also compare the Baseband version with the one of the radio image. (radio-bluejay-[...].img)
If either of those has a newer version in the downloaded factory image, unpack it and flash the new version by executing either command respectively.
Code:
fastboot flash bootloader <drag the new bootloader.img here>
fastboot flash radio <drag new radio.img here>

Now do
Code:
fastboot boot <drag magisk patched boot image here>
and your phone should boot and you should see the first setup screen again.
After going through that, repeat the above steps to enable USB debugging as well as to authorise and remember your computer.
At this point it's also important to turn off "Automatic system updates" in Settings -> Developer options as well. (so that future OTA's don't mess up your phone)

Since your phone got wiped you need to copy the Magisk app apk and install it again.
Now also copy the safetynet-fix-Mod.zip module to your phone.
When you open Magisk and it asks you to complete additional steps after opening it select "cancel" and instead tap on "install" and then -> "direct install".
When Magisk is done tap on "reboot".

After rebooting enable "Zygist" in Magisk's settings and then tap on "Configure DenyList".
Tap the three dot menu and check "Show system apps", then search for "Google Play services" and "Google Play Store", expand them and tap the checkmark, this should select all subcomponents at once for. Do this for both, Play Services and Play Store.
Exit Magisk Settings and tap on the "Modules" tab in Magisk.
Select "Install from storage" and find and select the "safetynet-fix-Mod.zip".
Let it flash and reboot and that's it, you should now pass SafetyNet and Play Integrity.
Play Integrity was a bit iffy for me, after immediately checking it failed but after turning Play Protect in Play Store app settings off and on again and rebooting it worked and never failed again.


OTAs​

  1. Download the newest OTA as well as the factory image with the matching version.
  2. Extract the boot.img from the downloaded factory image, move it to your phone, open Magisk app, click "Install" -> "select and patch a file", then let it patch the boot.img and move the new patched image back to your computer.
  3. In Magisk app, disable all modules.
    Enable adb debugging if you don't have it enabled, then from your computer's terminal, do adb devices to check your device connection, after that do adb reboot sideload
  4. Your phone will reboot to download mode. It should be prompting you to apply the update now.
    Do adb sideload <drag_your_downloaded_OTA.zip_here>
  5. Choose "Reboot system now" on the menu that appears after the update completes.
    Wait for your phone to reboot and unlock it.
  6. Check your android version f.e. under the quick tiles, it should match the update version you installed just now.
    Also confirm that adb debugging is still active.
    If you see an "update completed" or "finishing update" sort of notification, wait for it to complete.
    If you don't see one, just wait a few minutes.
  7. Do adb reboot bootloader and after your phone boots into bootloader you can do fastboot boot <drag_the_patched_boot_image_here> and wait for it to boot.
  8. Go into Magisk app, click "Install" -> "direct install", then don't reboot yet, now enable all your modules again and then reboot.

  1. Download the newest factory image and Pixel Flasher.
  2. Open your Magisk app and disable all modules.
  3. Connect your phone to your computer and start Pixel Flasher.
    Enter the path to your platform tools at the top, below select your phone from the list.
    For "Pixel Phone Factory Image" select your downloaded firmware, then select the one boot image that should appear in the list below.
  4. For "Flash Mode" choose "Keep Data", then click the big "Flash Pixel Phone" button.
  5. When it completes click the "Reboot to Bootloader" button near the top.
    Additionally select the boot image from the list and click "Patch".
    Select the new patched boot image that will appear below.
  6. When your phone rebooted to bootloader click "Live Boot" and it will boot system with root.
  7. Open Magisk app, click "Install" -> "direct install", then don't reboot yet, re-enable all your modules and reboot your phone.

I don't recommend using the Magisk OTA method as it seems there is a bug that might lead to corrupt and bootloop your device.
I list it regardless if you want to try, but I'd recommend to update by sideloading the OTA instead.


check the official Magisk OTA guide for reference.

tldr:
  • don't modify or even rw remount read only partitions such as /system or /vendor
  • disable automaric otas in dev menu
  • when otas are available, open Magisk app, tap on "Uninstall Magisk" -> "restore images", and do NOT reboot.
    Also disable all modules just in case.
  • then open Settings app -> System -> System update
  • wait for the installation to be fully done, both steps 1 and 2, then do NOT press restart now or reboot button
  • go back to Magisk, tap on "install" -> "install to inactive slot
  • after Magisk installed you can press the "reboot" button in Magisk
 
Last edited:

G5-User7080

Senior Member
May 31, 2018
124
32
If you want to remove some preinstalled apps you dont need first check your user id with
Code:
adb shell cmd package list users

Usually it's 0, if not then replace it with your user id, then you can simply use
Code:
adb shell cmd package uninstall --user 0 <package_name>
adb shell cmd package disable-user --user 0 <package_name>
to uninstall / disable the app over adb.

Attached is a powershell script that removes / disables all apps you put in $removeApps or $disableApps respectively.
The current selection is by no means recommended, it is just a collection that won't result in a bootloop, but thats about it. (yes the commented ones included, they are just commented from the last time I used it)
(change file extension to .ps1 if you want to use it, modify it to fit your needs)

You can always reinstall / enable apps by using
Code:
adb shell cmd package enable --user 0 <package_name>
adb shell cmd package install-existing --user 0 <package_name>
 

Attachments

  • adb-remove-apps.txt
    6.7 KB · Views: 9
Last edited:

juv3nal

Senior Member
Hi,
Thank you for your thorough guide.
I'm stuck after this command:
"fastboot flashing unlock"
I get error "waiting for device"
I have installed the USB drivers as per the link you provided, I think, not sure what's happening.
Any suggestion?
Many thanks.

UPDATE: I used a different USB cable and it worked!! 👍
 
Last edited:

MrUrgit

Senior Member
May 20, 2010
201
74
Melbourne
HTC Desire
HTC One (m7)
Hi,
Thank you for your thorough guide.
I'm stuck after this command:
"fastboot flashing unlock"
I get error "waiting for device"
I have installed the USB drivers as per the link you provided, I think, not sure what's happening.
Any suggestion?
Many thanks.
Make sure you have enabled OEM unlocking and USB debugging in Developer Options

Also, you can try the command "fastboot devices" to make sure your device is visible to your PC/Laptop.
 
  • Like
Reactions: juv3nal

G5-User7080

Senior Member
May 31, 2018
124
32
^this

if "fastboot devices" doesnt show the id for your phone then the drivers arent working properly.
iirc there might be an issue with the drivers being properly detected sometimes, only had this once on an older computer.
The original now outdated 15s installer has instructions in the"Note" section on how to fix device detection.

if "fastboot devices" returns the device id then I can only think of OEM unlocking being disabled.

if it still doesnt work, consider switching to the full sdk platform tools, idk if it includes the usb drivers.
 

dexlemaffo

Senior Member
Sep 3, 2014
137
36
Rabat
^this

if "fastboot devices" doesnt show the id for your phone then the drivers arent working properly.
iirc there might be an issue with the drivers being properly detected sometimes, only had this once on an older computer.
The original now outdated 15s installer has instructions in the"Note" section on how to fix device detection.

if "fastboot devices" returns the device id then I can only think of OEM unlocking being disabled.

if it still doesnt work, consider switching to the full sdk platform tools, idk if it includes the usb drivers.
Aswell as using a USB A connected to a USB 2.0 port
 

d_TraXer

Member
Dec 17, 2017
8
1
Freiburg
Google Pixel 6a
This guide worked very well for unlocking my Pixel 6a.

Sadly I cannot root my device, probably because the newest factory image is from February 2023. Does anyone know where to get the newest factory image from?
 

d_TraXer

Member
Dec 17, 2017
8
1
Freiburg
Google Pixel 6a
Okay, I managed to bootloop my device lol

How I fixed it + root:

I used the PixelFlasher to downgrade to the newest factory image (from February) + Data Wipe (sadly).
Then I went through your guide again and it successfully got rooted. 😁👍🏻
 

G5-User7080

Senior Member
May 31, 2018
124
32
Sadly I cannot root my device, probably because the newest factory image is from February 2023. Does anyone know where to get the newest factory image from?
Newest Factory Image is from April though.
I linked it under "Prerequisites".

You can use Pixelflasher just fine for rooting as well, check the OTA with Pixelflasher section, it's essentially just applying OTA and "re-rooting".
If you already figured out how to use Pixelflasher you might as well use that to flash factory

You can also check the Pixel 6 Guide that's linked in "sources", that one is very comprehensive and includes multiple methods, just be aware that versions and downloads are different for the Pixel 6a, the general process is the same though.
 

d_TraXer

Member
Dec 17, 2017
8
1
Freiburg
Google Pixel 6a
Newest Factory Image is from April though.
I linked it under "Prerequisites".

Okay that's weird, I checked the link multiple times but everytime I looked the newest factory image was from February. Just now I noticed a banner on top of the page. It says that the website got automatically translated to german. So I switched back to English and now the newest factory image is from April. 🤷

Anyways thank you for your response. Now I can update to the newest version. 😊👍
 
  • Like
Reactions: G5-User7080

mbellot

Senior Member
Jul 22, 2010
331
112
Thanks for the pointer to the MOD version, Integrity Check was only passing Basic with the original safetynet, the MOD version also passes Device now.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    Newest Factory Image is from April though.
    I linked it under "Prerequisites".

    Okay that's weird, I checked the link multiple times but everytime I looked the newest factory image was from February. Just now I noticed a banner on top of the page. It says that the website got automatically translated to german. So I switched back to English and now the newest factory image is from April. 🤷

    Anyways thank you for your response. Now I can update to the newest version. 😊👍
  • 6
    My Phone already came with A13 and OEM unlocking became available straight after connecting to wifi.
    If it stays grayed out for you or you need to update to A13 / July A12 patch first please refer to other guides such as this one.

    Disclaimer:
    I don't take responsibility for whatever happens to your device. Expect your device to get wiped.
    While everything went without a hitch for me, there is no guarantee it will for you as well.


    sources:
    Pixel 6 root guide
    Pixel 6a root guide
    Magisk root guide
    Magisk OTA guide

    As a sidenote, if you are already rooted and want Magisk to have a backup of the stock boot image, just flash stock boot.img (this will remove root), then boot the Magisk patched boot image and do "direct install" through Magisk. Thats essentially just unrooting and re-rooting.


    Prerequisites:​

    Update ur phone to the newest available version if possible. At least you probably should be on June 2022 patch, though this Guide is meant for A13.

    Get the original Factory Image (not OTA) from google, the version that matches the currently installed one (aka probably the newest if you're fully up to date).
    Get the Magisk app apk from the official Github.
    Get the adb & fastboot tools as well as necessary google USB drivers (15s installer seems to be outdated yet again).
    Get the safetynet-fix-MOD Module from it's Github. (official safetynet-fix got updated and works as well not anymore as of February update.)


    Preparing files and device:​

    Open the downloaded firmware archive. Inside there will be another zip archive (image-bluejay-[...].zip). Open this and get the boot image (boot.img) from it.

    Connect your phone to your pc over USB, and copy both the Magisk apk file and the boot.img file to your phone.

    On your phone, open Settings -> About phone, then tap on "Build number" until it says "deveoper options unlocked".
    In Settings -> System -> Developer options turn on "OEM unlocking" as well as "USB debugging" and then check the "allow" and "remember" option when it asks you if it should remember your computer.

    Now install the Magisk app with the apk, then open it, select "install" and then "select and patch a file" and select the boot.img you moved to your phone earlier.
    Magisk saves the patched boot.img in your Downloads folder, move it to your computer.

    Now you should have a modified boot.img on your computer, OEM unlocking and adb debugging enabled, as well as your computer authorised for adb on your phone.
    You should also not have any outstanding OTA's or reboots after OTA installation.


    Unlocking and Rooting:​

    Note that unlocking your bootloader will wipe your phone!
    Just rooting it won't wipe it if you already have an unlocked bootloader.

    Open a terminal on your pc and type adb devices. It should show some number if your adb is working correctly.
    Type adb reboot bootloader and wait for it to reboot to bootloader.
    Then type fastboot flashing unlock and confirm on your phone that you want to unlock your bootloader.

    After you unlocked your bootloader check your phone's screen, specifically where it lists the Bootloader version (second line).
    Compare the version number with the one of the bootloader image inside your downloaded firmware zip file. (bootloader-bluejay-bluejay-[...].img)
    Also compare the Baseband version with the one of the radio image. (radio-bluejay-[...].img)
    If either of those has a newer version in the downloaded factory image, unpack it and flash the new version by executing either command respectively.
    Code:
    fastboot flash bootloader <drag the new bootloader.img here>
    fastboot flash radio <drag new radio.img here>

    Now do
    Code:
    fastboot boot <drag magisk patched boot image here>
    and your phone should boot and you should see the first setup screen again.
    After going through that, repeat the above steps to enable USB debugging as well as to authorise and remember your computer.
    At this point it's also important to turn off "Automatic system updates" in Settings -> Developer options as well. (so that future OTA's don't mess up your phone)

    Since your phone got wiped you need to copy the Magisk app apk and install it again.
    Now also copy the safetynet-fix-Mod.zip module to your phone.
    When you open Magisk and it asks you to complete additional steps after opening it select "cancel" and instead tap on "install" and then -> "direct install".
    When Magisk is done tap on "reboot".

    After rebooting enable "Zygist" in Magisk's settings and then tap on "Configure DenyList".
    Tap the three dot menu and check "Show system apps", then search for "Google Play services" and "Google Play Store", expand them and tap the checkmark, this should select all subcomponents at once for. Do this for both, Play Services and Play Store.
    Exit Magisk Settings and tap on the "Modules" tab in Magisk.
    Select "Install from storage" and find and select the "safetynet-fix-Mod.zip".
    Let it flash and reboot and that's it, you should now pass SafetyNet and Play Integrity.
    Play Integrity was a bit iffy for me, after immediately checking it failed but after turning Play Protect in Play Store app settings off and on again and rebooting it worked and never failed again.


    OTAs​

    1. Download the newest OTA as well as the factory image with the matching version.
    2. Extract the boot.img from the downloaded factory image, move it to your phone, open Magisk app, click "Install" -> "select and patch a file", then let it patch the boot.img and move the new patched image back to your computer.
    3. In Magisk app, disable all modules.
      Enable adb debugging if you don't have it enabled, then from your computer's terminal, do adb devices to check your device connection, after that do adb reboot sideload
    4. Your phone will reboot to download mode. It should be prompting you to apply the update now.
      Do adb sideload <drag_your_downloaded_OTA.zip_here>
    5. Choose "Reboot system now" on the menu that appears after the update completes.
      Wait for your phone to reboot and unlock it.
    6. Check your android version f.e. under the quick tiles, it should match the update version you installed just now.
      Also confirm that adb debugging is still active.
      If you see an "update completed" or "finishing update" sort of notification, wait for it to complete.
      If you don't see one, just wait a few minutes.
    7. Do adb reboot bootloader and after your phone boots into bootloader you can do fastboot boot <drag_the_patched_boot_image_here> and wait for it to boot.
    8. Go into Magisk app, click "Install" -> "direct install", then don't reboot yet, now enable all your modules again and then reboot.

    1. Download the newest factory image and Pixel Flasher.
    2. Open your Magisk app and disable all modules.
    3. Connect your phone to your computer and start Pixel Flasher.
      Enter the path to your platform tools at the top, below select your phone from the list.
      For "Pixel Phone Factory Image" select your downloaded firmware, then select the one boot image that should appear in the list below.
    4. For "Flash Mode" choose "Keep Data", then click the big "Flash Pixel Phone" button.
    5. When it completes click the "Reboot to Bootloader" button near the top.
      Additionally select the boot image from the list and click "Patch".
      Select the new patched boot image that will appear below.
    6. When your phone rebooted to bootloader click "Live Boot" and it will boot system with root.
    7. Open Magisk app, click "Install" -> "direct install", then don't reboot yet, re-enable all your modules and reboot your phone.

    I don't recommend using the Magisk OTA method as it seems there is a bug that might lead to corrupt and bootloop your device.
    I list it regardless if you want to try, but I'd recommend to update by sideloading the OTA instead.


    check the official Magisk OTA guide for reference.

    tldr:
    • don't modify or even rw remount read only partitions such as /system or /vendor
    • disable automaric otas in dev menu
    • when otas are available, open Magisk app, tap on "Uninstall Magisk" -> "restore images", and do NOT reboot.
      Also disable all modules just in case.
    • then open Settings app -> System -> System update
    • wait for the installation to be fully done, both steps 1 and 2, then do NOT press restart now or reboot button
    • go back to Magisk, tap on "install" -> "install to inactive slot
    • after Magisk installed you can press the "reboot" button in Magisk
    2
    If you want to remove some preinstalled apps you dont need first check your user id with
    Code:
    adb shell cmd package list users

    Usually it's 0, if not then replace it with your user id, then you can simply use
    Code:
    adb shell cmd package uninstall --user 0 <package_name>
    adb shell cmd package disable-user --user 0 <package_name>
    to uninstall / disable the app over adb.

    Attached is a powershell script that removes / disables all apps you put in $removeApps or $disableApps respectively.
    The current selection is by no means recommended, it is just a collection that won't result in a bootloop, but thats about it. (yes the commented ones included, they are just commented from the last time I used it)
    (change file extension to .ps1 if you want to use it, modify it to fit your needs)

    You can always reinstall / enable apps by using
    Code:
    adb shell cmd package enable --user 0 <package_name>
    adb shell cmd package install-existing --user 0 <package_name>
    1
    Hi,
    Thank you for your thorough guide.
    I'm stuck after this command:
    "fastboot flashing unlock"
    I get error "waiting for device"
    I have installed the USB drivers as per the link you provided, I think, not sure what's happening.
    Any suggestion?
    Many thanks.
    Make sure you have enabled OEM unlocking and USB debugging in Developer Options

    Also, you can try the command "fastboot devices" to make sure your device is visible to your PC/Laptop.
    1
    Newest Factory Image is from April though.
    I linked it under "Prerequisites".

    Okay that's weird, I checked the link multiple times but everytime I looked the newest factory image was from February. Just now I noticed a banner on top of the page. It says that the website got automatically translated to german. So I switched back to English and now the newest factory image is from April. 🤷

    Anyways thank you for your response. Now I can update to the newest version. 😊👍