• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[Guide] Root Pixel 4a (5G) Android 11 (R)

Search This thread

matt6575

Member
Sep 30, 2014
34
13
I haven't actually attempted it yet. This is my only phone at the moment and use it for work purposes. I do still plan on attempting it though. Maybe this weekend where I'll have a couple days to get back up and going incase something goes wrong.
I'll definitely post back here whenever I do try it.
 
  • Like
Reactions: PhilipTD

Homeboy76

Senior Member
Aug 24, 2012
2,666
1,333
I haven't actually attempted it yet. This is my only phone at the moment and use it for work purposes. I do still plan on attempting it though. Maybe this weekend where I'll have a couple days to get back up and going incase something goes wrong.
I'll definitely post back here whenever I do try it.
Hint
When you do decide to root your phone, do OP, Index, #4 'keep data, then do #7 to root.
 
  • Like
Reactions: PhilipTD

matt6575

Member
Sep 30, 2014
34
13
I will keep that in mind thank you. However I haven't actually unlocked the bootloader yet, just enabled "OEM unlock" in developer settings so far. If I understand right when I do unlock the bootloader it will wipe the device. Is that correct.
 
  • Like
Reactions: PhilipTD

Homeboy76

Senior Member
Aug 24, 2012
2,666
1,333
I will keep that in mind thank you. However I haven't actually unlocked the bootloader yet, just enabled "OEM unlock" in developer settings so far. If I understand right when I do unlock the bootloader it will wipe the device. Is that correct.
My mistake, I thought you had unlocked the bootloader.

Yes, when you unlock the bootloader it will wipe the data.

So, make sure you backup the information you want to keep before you unlock the bootloader i.e. pictures, text messages, etc.

Do OP, Index, # 3 'Unlock bootloader'
Then Do #4 'Keep data , and #7 to root.
 

Messatsu

Senior Member
Aug 10, 2010
289
86
Hi everyone,

Thanks a lot for all the information @Homeboy76 ! I've unlocked the bootloader and managed to root my stock ROM without any issue. I can finally use Titanium back to freeze apps, Greenify some apps, and use AdAway.

Bonus question : is it possible to use Magisk with the stock ROM now? I'm a little bit afraid to try it because TWRP backup isn't possible yet. I'm looking for a way to use some features (double tap to sleep on status bar, add gesture when screen off...) with the stock ROM.
 

Homeboy76

Senior Member
Aug 24, 2012
2,666
1,333
Hi everyone,

Thanks a lot for all the information @Homeboy76 ! I've unlocked the bootloader and managed to root my stock ROM without any issue. I can finally use Titanium back to freeze apps, Greenify some apps, and use AdAway.

Bonus question : is it possible to use Magisk with the stock ROM now? I'm a little bit afraid to try it because TWRP backup isn't possible yet. I'm looking for a way to use some features (double tap to sleep on status bar, add gesture when screen off...) with the stock ROM.
If you rooted your stock ROM you are using Magisk with your stock ROM. AFAIK patching the Magisk.img is the only way to root a Pixel 4a 5g phone.
 
Last edited:

Homeboy76

Senior Member
Aug 24, 2012
2,666
1,333
Just to clarify. These images.work on the Verizon version on the phone? I'll be able to unlock my bootloader with one of these?
Read Index, #3, • Unlock Bootloader.

The Factory/OTA image does not unlock Bootloader. Your phone either has an unlockable bootloader or it doesn't have an unlockable bootloader.

Google, Google Fi, etc., sell Pixel 4a5g with an unlockable bootloader. Wireless Carriers i.e., AT&T, Verizon, etc., usually do not sell phones (Pixel 4a5g) with an unlockable bootloader.
 
Last edited:
Pass SafetyNet with Magisk Alpha:
See OP, New
I am on stable magisk, passed safetynet just by flashing latest safetynet magisk 2.10 from kdrag0n gits

Forgot to mention, the new version since 2.0, it requires Riru magisk to be installed (then restart) first before installing the safetynet
 
Last edited:

Homeboy76

Senior Member
Aug 24, 2012
2,666
1,333
I am on stable magisk, passed safetynet just by flashing latest safetynet magisk 2.10 from kdrag0n gits
@creezalird, thanks for the information. :)

My Motto
If your current USNF configuration is working, why install a newer USNF (v2. 1.1)?
If it ain't broke don't fix it. :)

(y)Kudos to the developer of USNF (@kdrag0n) and all the XDA members that have helped with the development of USNF. They deserve all the accolades they can get for the development of the USNF module.
 
Last edited:

Scottay5150

Senior Member
Jan 3, 2011
761
47
Silly question.

I just received my warranty device. How do I know if the BL is unlocked for rooting? I am able to check off the OEM unlocking in developer options?

I do not want to brick my phone by rooting my phone that is BL locked.
 

Homeboy76

Senior Member
Aug 24, 2012
2,666
1,333
Silly question.

I just received my warranty device. How do I know if the BL is unlocked for rooting? I am able to check off the OEM unlocking in developer options?

I do not want to brick my phone by rooting my phone that is BL locked.
OP, Index, #3, Unlock Bootloader, #9 Notes:

After unlocking your bootloader, you'll see a warning: The bootloader is unlocked and...
 

mn1968

Senior Member
Nov 7, 2011
561
154
Question about Step 7 - Root/Reroot with Magisk and Pass SafetyNet

Just received my used 4a 5g. Updated to September firmware. Rooted per the instructions and I pass SafetyNet. I have Magisk v23 installed, along with Universal SafetyNet Fix v 2.1.1, Riru, & Riru - LSPosed. I did not install XPrivacy Lua. Anyway, everything works as intended. But I'm wondering what is the purpose of Riru LSPosed and XPrivacyLua? It seems I could probably uninstall LSPosed.

Hmmm, re-reading the instructions further, perhaps LSPosed and XPrivacyLua allow for Google Play Services to work and trick device certification. I have not completely set the phone up with my Google account, hence I cannot log into google Play to check certification. I guess I'll find out later next week after I switch to the phone full time.

Thanks
 

Top Liked Posts

  • There are no posts matching your filters.
  • 20
    [Guide] Root Pixel 4a (5G) Android 11 (R) Unlock/Lock Bootloader + Systemless ROOT
    Android Security Bulletin—October 2021
    Pixel Update Bulletin—October 2021


    Introduction
    This Guide is for Pixel 4a 5(G) owners that want to Root their phone, and enjoy the benefits of rooting it without installing a Custom ROM. However, for those that just can't live without a Custom ROM, take a look at 'Custom ROMs for Pixel 4a 5(G)'.


    New
    1. Magisk Alpha (vvb2060)

    2. Android 12 Developer Preview - Beta 5


    Update(s)
    1. Factory/OTA Images - 10/04
    2. Magisk Stable - Magisk-23.0 05/12
    3. Magisk Beta - Magisk-23.0 05/12
    4. Magisk Canary - Magisk-23xxx
    5. TWRP - Waiting for T.R.W.P. for Android 11 (R)
    6. SafetyNet - SafetyNetFix v1.2.0
    7. SDK Platform-tools - r31.0.3 08/18
    8. Custom Kernels
      • Proton Kernel v1.4 05/17
      • CleanSlate R v1.7.5 02/11
    9. OS
    10. Custom ROMs
      • ProtonAOSP v11.6.0 08/25
      • UNOFFICIAL LineaeOS v18.1-microG 02/07
      • [ROM][OFFICIAL][bramble] LineageOS 18.1 - Nightly


    Disclaimer
    1. I assume no responsibility for the malfunctioning/bricking of your phone.
    2. The order of listed items i.e., Custom Kernels, Custom ROMS, etc. Does not indicate my preference for them. It is your responsibility to do the research before selecting an item.


    Prerequisites
    1. A Pixel 4a 5(G) phone with an unlocked bootloader.
    2. The latest Android 11 (R) Factory or OTA Image: "bramble" for Pixel 4a 5(G)


      Factory Image

      OTA Image
    3. A Computer with the latest SDK Platform-Tools: r31.0.3 installed.
      • Important: Update Platform Tools, regularly, for optimal performance.


    Other Guides
    [Guide] Pixel 5 Android 11 (R)


    Credits/Thanks/Recognitions
    1. @topjohnwu - Magisk Beta/Canary/Stable
    2. Those I may have, inadvertently, forgotten.


    Index
    (NOTE: Numbers 1-11 are not steps, they are individual sets of instructions).
    1. Open a Command Prompt/Boot Fastboot Mode/Boot Recovery

      • Open a Command Prompt on Computer
        1. Open File Explorer, click the platform-tools folder ==> click the folder icon (left side of address bar) to highlight it type cmd and press enter.
        2. Open a Powershell Command Prompt on Computer: Open File Explorer, click the platform-tools folder ==> click the folder icon (left side of address bar) to highlight it type powershell and press enter.
        3. Notes:
          • Enable USB Debugging, on your phone: Settings ==> System ==> Advanced ==> Developer options ==> Scroll down to USB debugging and enable it.
          • When using the Powershell Command Prompt Commands must be preceeded with ./: i.e, ./fastboot devices
          • If you do not want to open a Command Prompt every time you want to use the fastboot command, add the path to the Platform-tools folder to Windows environment variables.
      • Boot fastboot mode (bootloader):
        • Power off phone, press and hold the power and volume down buttons until you see Start.
      • Boot Recovery
        • Power off phone, press and hold the power and volume down buttons until you see Start. Use volume up/down button until you see Recovery mode. Press power button.
    2. Test fastboot

      • Enable Developer Options - Tap Settings > About phone > Build number 7 times or until you should see 'you are a Developer'.
      • Enable USB Debugging - Tap Settings > System > Advanced > Developer options >
        Enable USB Debugging.
      • Open a Command Prompt on your computer in the Platform-tools folder.
      • Boot fastboot mode on your phone (#1)
      • Connect the phone to the Computer.
      • At the prompt type: fastboot devices to verify communication with phone. It should return your phone's serial number.
    3. Unlock Bootloader/Return Phone to Stock/Lock Bootloader

      • Unlock Bootloader

        1. This will erase all user data from the device!
        2. Backup your data
        3. Activate Developer Options: Tap Settings > About Phone > Tap Build Number 7 times or until you see you are a Developer. Tap back > System > Advanced > Developer Options. Enable OEM Unlock and, USB Debugging.
        4. Boot fastboot mode
        5. Connect the phone to the Computer with USB cord.
        6. Open a Command Prompt on your computer and type fastboot flashing unlock and press enter.
        7. You should see a request for confirmation on your phone, use the volume keys to scroll and the power key to select.
        8. Allow the process to complete and then type fastboot reboot at the Command Prompt and press enter.
        9. When your phone reboots disconnect your usb cable.
          Notes: After unlocking your bootloader, you'll see a warning: The bootloader is unlocked and... You will see this warning until, you relock the bootloader.
          Do not relock your bootloader until you have returned the device to Stock.
      • Return Phone to Stock

        1. Backup your data/Internal storage
        2. Settings > System > Advanced > Reset Options > Erase all data (factory reset)
        3. Log in
        4. Set up phone
      • Lock Bootloader

        1. Return the phone to Stock before locking the bootloader, failure to do so could brick your phone
        2. This will erase all user data from the device!
        3. Boot fastboot mode
        4. Open a Command Prompt and type this at the Prompt: fastboot flashing lock
        5. You should see a request for confirmation on your phone, use the volume keys to scroll and the power key to select.
        6. Allow the process to complete, then type this at the Command Prompt: fastboot reboot
        7. Enable Developer Options: Settings > About phone > Tap Build number 7 times or until you see 'you are a developer'.
        8. Tap Back > Developer options and toggle OEM Unlock off.
    4. Install/Update Factory Image keep or wipe data

      • Important Note(s):
        1. When doing a major upgrade i.e., Android 10 (Q) to Android 11 (R): I recommend doing a clean install. What is a clean install?
          • Doing a Factory reset prior to installing, major, update.
          • Using flash-all.bat file without removing the -w.
        2. Always verify you have the latest version of SDK Platform-Tools installed on your computer before installing the Factory Image: Pixel 4a 5(G) - bramble.
        3. If your phone was rooted, and you want to 'Keep Data'. Do this first open Magisk ==> unhide Magisk App (if you hid it) ==> Disable/Remove all modules ==> then Uninstall Magisk - Restore images prior flashing the Factory image. Why? The changes in the New factory image may cause Magisk modules to fail. This will cause boot loops. Additionally, before Enabling/Installing the modules you Disabled/Removed check with the Dev of the module to ensure it was updated to work with the latest factory image.
        4. If you get an error: while flashing, try one of these options:
          • Change the USB port to a non charging USB port.
          • Change the USB cord.
          • Change Computers.
        5. Backup your data
        6. Download the latest Factory Image: Pixel 4a 5(G) - bramble to your Computer.
        7. Extract the factory Image to a folder.
      • Flash Factory Image Keep Data

        • Open the folder you extracted the Factory Image to and Edit the flash-all.bat file with a file editor i.e., Notepad. Remove the -w from this command: fastboot -w update image-bramble-aa9a.999999.999.zip
          Note: If you do not remove the -w your data and internal storage will be wiped.
        • After, you have edited the flash-all.bat file. Copy/Move these files to the Platform-tools folder:
          1. bootloader-bramble-....img
          2. flash-all.bat
          3. image-bramble-....zip
          4. radio-bramble-....img
        • Open a Command Prompt on your computer in the Platform-tools folder and type: flash-all at the Command Prompt and press enter.
        • System will reboot when flashing is complete.
        • Do #7 to root/reroot.
      • Flash Factory Image Wipe Data

        • This will wipe your phones Internal Storage.
        • Open the folder you extracted the Factory Image to and Copy/Move these files to the Platform-tools folder:
          1. bootloader-bramble-....img
          2. flash-all.bat
          3. image-bramble-....zip
          4. radio-bramble-....img
        • Open a Command Prompt on your computer in the Platform-tools folder and type: flash-all at the Command Prompt and press enter.
        • The phone will reboot when flashing is complete.
        • Do #7 to root/reroot.
    5. ADB Sideload

    6. Extract/Flash boot.img

      • Extract boot.img

        1. Download the latest Factory image to your phone.
        2. Extract the Factory Image file (bramble-r2d1a.999999.999-factory-99a9a99a.zip) to a folder.
        3. Open the folder and, extract the Image file (image-bramble-aa9a.999999.999.zip) into the folder.
      • Flash boot.img

        1. Flashing the boot.img removes root.
        2. Open the folder you extracted the 'image...zip' file to and copy the boot.img file to your computer's platform-tools folder or to the folder that has fastboot.exe in it.
        3. Boot fastboot mode
        4. Connect the phone to the Computer
        5. Open a Command Prompt and type the following command at the prompt:
          fastboot flash boot --slot all boot.img
        6. Reboot
    7. Root/Reroot with Magisk and Pass SafetyNet.

      • Important Note(s):
        1. When doing a major upgrade i.e., Android 10 (Q) to Android 11 (R): I recommend doing a clean install. What is a clean install?
          • Doing a Factory reset prior to installing, major, update.
          • Using flash-all.bat file without removing the -w.
        2. If your phone was rooted Do this first unhide Magisk App (if you hid it) then Uninstall Magisk - Restore Images. Why? The changes in the Factory image may cause Magisk modules to fail. This will cause boot loops.
      • Download files:

        1. Magisk App - Download to your phone
        2. Custom kernels - Download to your phone - install with Kernel Manager
        3. Kernel Manager - Download to your phone
      • Patching the boot.img

        1. Do #6 - Extract boot.img
        2. Install Magisk (Beta, Canary or Stable) App
        3. Open Magisk App
        4. Depending on the version of Magisk App installed: Set the Update Channel to Beta, Canary or Stable.
        5. Tap Install (next to Magisk)
        6. Tap, Select and Patch a File
        7. Select the boot.img file you extracted from the latest factory image.
        8. Tap the ✓ (Check Mark)
        9. Tap Let's Go
        10. When you see done, the boot.img has been patched (magisk_patched_xxxxxx.img), and stored in the download folder.
        11. Reboot
        12. Copy the patched boot.img file to your computer's Platform-tools folder or the folder that has fastboot.exe in it.
        13. Boot fastboot mode
        14. Connect the phone to the Computer with USB cord.
        15. Open a Command Prompt in the folder you copied the patched boot.img to.
        16. Type fastboot flash boot "name of patched boot".img without the quote marks at the Prompt and press enter.
        17. Type fastboot reboot at the Prompt and press enter.
        18. Important Notes: If your phone boot loops try one of the following options:
          • Flash the 'stock' boot.img to both slots: fastboot flash boot boot.img --slot all
          • Boot Safe Mode - Press Power Off button ==> Press Power Off until you see boot Safe Mode ==> Press Ok.
      • Pass SafetyNet

        1. Download the latest SafetyNetFix: from MAGISK MODULE ❯ Universal SafetyNet Fix 1.1.0
        2. Install SafetyNetFix
          • Open Magisk
          • Tap Modules icon
          • Tap Install from storage
          • Navigate to the SafetyNetFix file you downloaded
          • Tap the SafetyNetFix file
          • Tap the check mark (✓ at the bottom) to start the installation.
          • After it installs tap the Save icon to save the log
          • Tap Reboot.
        3. Enable Magisk Hide
          • Open Magisk Canary App
          • Tap the Setup icon.
          • Scroll down to Magisk - MagiskHide and enable it.
          • Tap Back arrow => tap Superuser icon => tap MagiskHide and enable (✓): Google Play Services and Google Play Store.
          • Close Magisk Manager.
        4. Install Magisk Modules Riru, Riru - LSPosed and install XPrivacy Lua
          • Open Magisk
          • Tap Modules icon
          • Install Magisk module Riru-...zip
          • After it installs tap the Save icon to save the log
          • Reboot
          • Open Magisk
          • Tap Modules icon
          • Install Magisk module Riru_-_LSPosed-....zip
          • After it installs tap the Save icon to save the log
          • Reboot
          • Downloaded and install XPrivacy Lua module from: here
          • Reboot
          • Open LSPosed
          • Tap Modules
          • Enable XPrivacyLua module
          • Tap 3dots Menu (top-right)
          • Tap Hide
          • Uncheck System apps
          • Tap Google Play Services
          • Tap Setup icon (top-right)
          • Scroll down
          • Tap Google Play Services
          • Scroll down and enable/check (✓)
            • Determine Activity
            • Read identifiers
            • Use analytics
            • Use tracking
          • Reboot
          • Open Magisk
          • Test SafetyNet
        5. Clear Google Play Services Data
          • Open Settings
          • Tap Apps & notifications
          • Tap see all...
          • Tap three dot menu
          • Tap Show system
          • Scroll down to Google Play Services
          • Tap it
          • Tap Storage & cache
          • Tap Clear storage
          • Exit Settings
          • reboot
        6. Check Device Certification
          • Open Google Play Store app
          • Tap Menu - Circle top right
          • Tap Settings
          • Tap About
          • check Device certification.
    8. Set Magisk App Update Channel/Update Magisk

      • Set Magisk App Update Channel

        • Open Magisk App > Tap Settings icon > Update Channel > Select Stable, Beta, Canary or Custom.
      • Update Magisk

        1. When Magisk App notifies you of an update:
        2. Tap install.
        3. Select, Direct Install (Recommended)
        4. When it finishes installing
        5. Tap, Save Log
        6. Log location: /storage/emulated/0/Download
        7. Tap, Reboot
        8. Done!
    9. Custom ROMs

    10. Apps/Mods/Scripts/Tethering/Themes
    11. T.W.R.P. Backup/Restore

      • Waiting for Android 11 (R) T.W.R.P.
    3
    hi @Homeboy76 ,
    maybe i'm wrong, but in your
    Prerequisites

    1. A Pixel 4a 5(G) phone with an unlocked bootloader.
    2. The latest Android 11 (R) Factory or OTA Image: "bramble" for Pixel 4a 5(G)
    3. Factory Image
    also at:
    4. Install/Update Factory Image keep or wipe data
    Just checked
    It is pointing to the Pixel 4a 5(G) bramble factory image.

    Download the latest Factory Image: Pixel 5 - bramble to your Computer. --> pixel 5 (only text)? Fixed!
    3
    Thanks for the write-up. Just got one of these as I dropped my old phone, and I was due anyways. So question regarding Safetynet. I went ahead and went with the latest Feb factory image, patched the boot and rooted with Magisk, then tried the safety net and attestation fails. Anybody have the feb patch and passing safetynet? if so what was the sequence you used? thanks
    - Root with Magisk patched img
    - Open Magisk Manager install SafetyNet module
    - Reboot
    - Open Magisk Manager Enable Magisk hide
    - Hide Google Play store, Google pay, etc
    - Clear cache and storage for the above apps
    - Reboot
    2
    Provided you are not on Verizon:
    Try reinstalling the stock boot.img from the update, flash the OTA, or perform another clean install. After first boot and performing any necessary setup (if clean install), power off phone, remove sim card, reboot. Creat a new patched boot.img, install it and reboot. Turn phone off, reinstall sim card, reboot as normal. Should fix the issue. Make sure you are using the latest magisk (I prefer stable of canary personally but it's your call).
    If you are on verizon, do not install the April update in this thread, as it is stated "All carriers EXCEPT Verizon."

    However, there is an OTA update on the official frimware website that does work on Verizon. I just flashed it myself. Maybe Homeboy76 could update thread?
    :( Do not repeat do not follow these instructions. The information is only partially correct. :(

    I just checked the Factory image and the OTA image pages the only change was the All carriers EXCEPT Verizon has been removed from the images description.

    The OP has been updated to reflect the change.

    These images work on Verizon Pixel 4a 5g phones.
    2
    Try using LSPosed, it may have the modules you need. Take a look at #7 Pass SafetyNet #3
    LSPosed + GravityBox did the trick! Thanks a lot.