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

Search This thread

G5-User7080

Senior Member
May 31, 2018
119
29
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 so you can get OTAs, 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​

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
119
29
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.4 KB · Views: 3
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
197
73
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
119
29
^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
124
33
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
 

Top Liked Posts

  • There are no posts matching your filters.
  • 4
    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 so you can get OTAs, 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​

    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.