[GUIDE] Unlock/Root/Safetynet for Pixel 4a

Search This thread

a1291762

Senior Member
Nov 20, 2012
639
278
yasmar.net
fastboot flash boot magisk_patched-23000_AVQT0.img
target reported max download size of 268435456 bytes
sending 'boot' (65536 KB)...
OKAY [ 1.500s]
writing 'boot'...
FAILED (remote: Failed to write to partition Not Found)
That's not a current fastboot because it doesn't know how to turn 'boot' into 'boot_a' or 'boot_b' based on the current slot.

If you can't upgrade to the current fastboot, you can try one of these options.

1. Find your current slot and boot that:
fastboot getvar current-slot # will be 'a' or 'b'
fastboot flash boot_a magisk_patched.img # or boot_b

2. Boot the patched image and get Magisk Manager to do the permanent installation.
fastboot boot magisk_patched.img
# use Magisk Manager to install (direct)
 

a1291762

Senior Member
Nov 20, 2012
639
278
yasmar.net
When I connect my usb to phone there is no notification to select transfer files option or adb option. That notification is gone. Any help?
I have no idea...

Is USB debugging still enabled in Settings -> System -> Advanced -> Developer?

Can adb see the phone?

Do you have Settings -> Connected Devices -> USB? Mine is set to "USB controlled by this device" and "Use USB for No data transfer".

I get 2 notifications when I connect USB. one for ADB and one for regular USB.

Maybe you need to disconnect and re-connect the cable?
 

thedemon786

Senior Member
Jul 15, 2012
409
105
Delhi
Google Pixel 4a
I have no idea...

Is USB debugging still enabled in Settings -> System -> Advanced -> Developer?

Can adb see the phone?

Do you have Settings -> Connected Devices -> USB? Mine is set to "USB controlled by this device" and "Use USB for No data transfer".

I get 2 notifications when I connect USB. one for ADB and one for regular USB.

Maybe you need to disconnect and re-connect the cable?
yeah i too used to get those 2 notificatins. now theres none. my device is detected though. and i see my devicewhen i use adb devices command. just no notification and hence i cant use transfer files option. i tried everything reconnecting, rrdtarting mobile , laptop etc.
 

a1291762

Senior Member
Nov 20, 2012
639
278
yasmar.net
still no notification but i found a setting in developer option to connect file transfer when i connect my phone to usb. so at least file transfer also working and usb too. just no notification.
It is possible to hide notifications...
Maybe you accidentally did this for the USB notifications? I have no idea what "app" they are attached to though... System Events or SystemUI probably...
 

a1291762

Senior Member
Nov 20, 2012
639
278
yasmar.net
reached home yet? lol
Had a ... Bad few days. Long story.
Anyway, it's Android System and I can't even disable these notifications, though I can customize them...
Screenshot_20210613-104556.png
Screenshot_20210613-104512.png
Screenshot_20210613-104526.png
 

thedemon786

Senior Member
Jul 15, 2012
409
105
Delhi
Google Pixel 4a

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    that might be a case ... and i too dont have any idea lol
    Doh! I'm an idiot. I can find out when I get home and plug my phone in 🤦‍♂️
  • 22
    With the pixel 4a finally arriving for some (like me), figured I'd make a quick guide

    Note that unlocking your bootloader breaks safetynet. There's a workaround in this guide but no guarantee that it won't get patched out in the future.

    Also note that this only works with the unlocked carrier model. Cell providers typically lock you out from this unlock process.

    Unlocking Bootloader (this is for the unlocked mode, can't speak for other models)
    • Go to system settings -> About phone -> tap on 'Build number' several times until Developer Options is enabled
    • Back out into settings and go to System -> Advanced -> Developer Options -> Enabled 'OEM Unlocking'
    • Unplug your phone if it's plugged into anything and power it off
    • Boot into fastboot by holding Power + Vol Down
    • Plug into pc -> open terminal/shell/whatever
    • Type 'fastboot flashing unlock' -> Follow prompt on device to unlock bootloader (Note that this will FACTORY RESET device)
    • The bootloader is now unlocked!

    Rooting
    • Grab the boot img for your rom. If it's stock, get it from the official zip
    • Copy the boot.img to your device
    • Install Magisk manager (grab it from the release zip on github - it's in the common folder)
    • Open Magisk Manager -> select 'Beta'
    • Back on the main page of Magisk Manager, Select 'Install' -> 'Select and Patch File' -> select your boot.img file -> it'll output the patched boot img to your Downloads folder
    • Copy the magisk_patched.img to your pc
    • Reboot your device back into fastboot (see Unlock section above)
    • Open a terminal in the directory your patched boot img file is and type 'fastboot flash boot magisk_patched.img'
    • You're now rooted!
    • Disable "Automatic System Updates" in Developer Options so you aren't surprised with an OTA on boot and end up unrooted (see the OTA section below on proper way of updating)

    Passing SafetyNet
    As was discovered some time ago, google is switching to a hardware attestation method for safetynet. Fortunately, at the time of writing, there is a workaround thanks to @Didgeridoohan. As of January 2021, this fix no longer works. A new module by @kdrag0n now fixes the hardware attestation issue:
    • Enable MagiskHide in magisk manager
    • Download/Install his Safetynet-fix module from this xda thread
    • Reboot and verify you should hopefully pass safetynet!

    Taking an OTA While Rooted

    Note: Installing to Inactive slot has been disabled temporarily meaning that if you take an ota, you'll need to do the patch boot img method like you did initially. See here for more details.

    Note that you can download the rom from google's site here and extra the boot img from there for patching.
    TopJohnWu has a great guide on how to do this here along with some nice screen shots that complement this quick guide. I'll summarize the applicable stuff here:
    • When an OTA is available, ignore it at first
    • Open Magisk Manager and go to Uninstall -> Restore Images
    • Now go back to Settings -> System -> Advanced -> System Update and install the OTA but DO NOT REBOOT
    • Once the install is done (but before rebooting), go back into Magisk Manager -> Install -> Install to Inactive Slot
    • Once the install is done, choose the reboot option IN MAGISK MANAGER. It works some voodoo magic to switch to updated slot and skip post-ota verifications
    Having issues?

    Try magisk canary instead


    Note that this isn't a support thread but just a guide. You're welcome to post your tips/experiences/questions here but don't expect me to answer or reply to them.

    I'll try to keep this updated with other useful guides such as TWRP when/if it is released for this device :good:
    3
    Everytime I install magisk module and reboot I boot back up without root. Amy help?

    When you fastboot flash, make sure you flash the slot you're booting from. If you're feeling lazy, flash the patched boot.img into both slots
    Code:
    fastboot flash boot --slot all boot.img
    3
    Actually I'm on October update, with unlock bootloader and root with Magisk Canary, how can I update to November update? If someone can explain clearly, I'm little afraid with out TWRP...

    Hello,

    You could do easily.
    - First check the channel update in magisk. Change to beta (beta works well know for patching boot.img)
    - Update the manager, update magisk by direct install, update modules if needed --> reboot
    (it's better to limit risk of a bootloop)
    - After reboot, open magisk manager and uninstall magisk --> Restore images.
    - Know you could going to settings --> system --> advanced --> update (you will see the november update)
    - Update --- (wait wait wait) and reboot (it's actually impossible to keep root by reflashing from magisk before reboot), after this you have lost root when reboot

    - Download the last sunfish for pixel 4a from --> https://developers.google.com/android/images#sunfish
    (don't accept any other sources about boot.img) check that the version is the same as the one you just updated.
    - Extract boot.img from zip inside the zip archive -> transfert on phone (delete any old boot.img or patched on the phone, to avoid a mistake)
    - In magisk manager --> install magisk --> select and patch a file, choose the boot.img.
    - transfert the new makisk_patched.img on computer in adb folder for example(look the size, it must be the same as the original file)
    - power off phone
    - Boot into fastboot by holding Power + Vol Down
    - plug phone and open adb
    Code:
    d:\platform-tools>fastboot flash boot magisk_patched.img
    Sending 'boot_b' (65536 KB)                        OKAY [  1.629s]
    Writing 'boot_b'                                   OKAY [  0.294s]
    Finished. Total time: 2.265s
    
    d:\platform-tools>fastboot reboot
    Rebooting                                          OKAY [  0.044s]
    Finished. Total time: 0.052s

    That's all, your are re-rooted after update.
    2
    How do you correctly update magisk on Pixel4a since patching boot.img and stuff. What are the steps ?
    2
    i was trying to create a patched boot.img but the file always ends up being about half the size of the original file and when i flash it i cant boot any longer.

    Is there a specific version/combination of softwares that i need to produce a valid patched boot image? im currently using magisk manager 8.0.3 and 11.0.0 (RQ1A.201205.008, Dec 2020)

    EDIT: got it sorted out, as many stated before i needed to use the Canary Magisk apk to make it work. it was not so obvious where to get and the provided links are not working. In case anyone is looking for the link its on the github page in the readme
    1608385790142.png
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone