[GUIDE] Pixel 4a (5G) "bramble": Unlock Bootloader, Update, Root, Pass SafetyNet

Search This thread
Sep 20, 2022
21
0
y
I would recommend you try to keep your posts professional and concise on XDA. That was pretty hard to read.

Rooting Android 13 works exactly the same way as Android 12.
I can arrange that.. but hey!!,
😱
😱

'Error boot repair ' now.. after I may of rebooted bootloader AFter flashing (couldnt figure out bootloader menu language i guess.. kinda vague if u ask me...) then i proceeded to reflash it again.... No more o.s. I guess...?

Theres gotta be more to this life thing... i tell you what...

rn_image_picker_lib_temp_1ea415cd-4545-4a74-a1ff-971b2e4daa80.jpg
 
Last edited:
Sep 20, 2022
21
0
"Error boot prepare". That's a new one. Sounds like there is something wrong with your boot image. Try reflashing the factory (unpatched) boot image and see if that works.

What exactly did you do before this happened? If I read your previous post correctly, it appears you unlocked the bootloader and tried to install Magisk?
Okay so i got the phone unlocked used... Updated the firmware to the latest Droid 13 I believe...
unlocked bootloader and flashed the latest android 13 rom... then I patched magisk onto the copied windows file... ( i had to drag and drop it in a native windows folder before moving it onto the pixel internal storage...thanstead of drag and dropping it from winrar for some reason...?)

Went into bootloader, flashed with quotes around the file path....

and I may of pressed reboot bootloader thanstead of Start in the bootloader menu post-flashing..

I flashed it again via Cmd line just incase ... <.< >.>

now stuck

Tried Google flash tool to put Android 12L on it but it gave error after a couple restarts... now its stuck on bootloader reainding NO VALID SLOT TO BOOT
 
Last edited:

V0latyle

Forum Moderator
Staff member
Okay so i got the phone unlocked used... Updated the firmware to the latest Droid 13 I believe...
unlocked bootloader and flashed the latest android 13 rom... then I patched magisk onto the copied windows file... ( i had to drag and drop it in a native windows folder before moving it onto the pixel internal storage...thanstead of drag and dropping it from winrar for some reason...?)

Went into bootloader, flashed with quotes around the file path....

and I may of pressed reboot bootloader thanstead of Start in the bootloader menu post-flashing..

I flashed it again via Cmd line just incase ... <.< >.>

now stuck

Tried Google flash tool to put Android 12L on it but it gave error after a couple restarts... now its stuck on bootloader reainding NO VALID SLOT TO BOOT
Android Flash Tool didn't work? That's odd. What options did you have checked when you tried that?

Let's focus on getting back to a running device before we start over with root. Leave your device in bootloader mode, connect via USB, and flash the latest factory image with the Android Flash Tool. Check the "Force flash all partitions" and "Wipe device" boxes. Don't check anything else. If you get any errors, try to get a photo or screenshot or something.
 
Sep 20, 2022
21
0
Android Flash Tool didn't work? That's odd. What options did you have checked when you tried that?

Let's focus on getting back to a running device before we start over with root. Leave your device in bootloader mode, connect via USB, and flash the latest factory image with the Android Flash Tool. Check the "Force flash all partitions" and "Wipe device" boxes. Don't check anything else. If you get any errors, try to get a photo or screenshot or something.
Thanks you, went ahead and tried the droid 13 beta release and it resstored the phone with no bootloader :< back to square 1.... good thing i didnt try the automated rom install script I seen on youtube... oooweee
 

V0latyle

Forum Moderator
Staff member
Thanks you, went ahead and tried the droid 13 beta release and it resstored the phone with no bootloader :< back to square 1.... good thing i didnt try the automated rom install script I seen on youtube... oooweee
Okay. Now that you're up and running, install the latest Magisk on your device. Make sure you're downloading it from the project GitHub repo; links are in the first post of this thread.

Then, follow the instructions under "Update and root factory image", except you don't need to update - you only need to patch and flash the boot image.
 
Sep 20, 2022
21
0
unknown.png

so.. i did all of this.. and root checker says im still not rooted?

Screenshot_20220923-173234.png

attempting the OTA root method now i guess.. since it's next in the sequential order of your posts...:rolleyes:
 
Last edited:

V0latyle

Forum Moderator
Staff member
unknown.png

so.. i did all of this.. and root checker says im still not rooted?

Screenshot_20220923-173234.png

attempting the OTA root method now i guess.. since it's next in the sequential order of your posts...:rolleyes:
I'm pretty sure I said to use the factory image method. You don't need Root Checker, Magisk will tell you if you have root.

Please, go back and read the OP. Thoroughly.
 

Droid9684

Senior Member
May 9, 2011
505
39
I cant install root and twrp between using platform tools on Mac and Windows. I already patched the factory boot image with magisk. Transfered file to platform tools folder and have phone in fastboot mode.
 

V0latyle

Forum Moderator
Staff member
I cant install root and twrp between using platform tools on Mac and Windows. I already patched the factory boot image with magisk. Transfered file to platform tools folder and have phone in fastboot mode.
Since we can directly flash partitions on the Pixel, and because we can patch the boot image with Magisk, there's no need to use TWRP.

All you should have to do now is flash the patched boot image to /boot by following the instructions in the OP.

If you have a problem while following the instructions, I will be glad to assist. If on the other hand you aren't following the instructions and run into problems, you are on your own.
 
  • Like
Reactions: Homeboy76

Droid9684

Senior Member
May 9, 2011
505
39
Since we can directly flash partitions on the Pixel, and because we can patch the boot image with Magisk, there's no need to use TWRP.

All you should have to do now is flash the patched boot image to /boot by following the instructions in the OP.

If you have a problem while following the instructions, I will be glad to assist. If on the other hand you aren't following the instructions and run into problems, you are on your own.
I was able to root it by using command fastboot flash boot changing the command and name to master root img from magisk name.

I was able to install a debloater magisk module app this is only way im able to remove system apps.

Is there an alternative recovery I can use for this phone?
I want to be able to backup and restore my device as needed. As my main phone S20+ its rooted with twrp on A12.

Also i'm finding it lags while streaming. Is this because of the ram useage?
 

V0latyle

Forum Moderator
Staff member
I was able to root it by using command fastboot flash boot changing the command and name to master root img from magisk name.

I was able to install a debloater magisk module app this is only way im able to remove system apps.

Is there an alternative recovery I can use for this phone?
I want to be able to backup and restore my device as needed. As my main phone S20+ its rooted with twrp on A12.
Pixel devices do not have a bespoke recovery partition; recovery lives in the boot image. Personally I've never found any use for TWRP on a Pixel. There is no official recovery for the Bramble, although there is at least one unofficial TWRP project. In my experience, TWRP and Magisk do not work together, since both patch the boot image, so while you can live boot the TWRP image, attempting to install TWRP results in a bootloop.
Also i'm finding it lags while streaming. Is this because of the ram useage?
Could be, I don't know.
 
  • Like
Reactions: Homeboy76

Droid9684

Senior Member
May 9, 2011
505
39
Pixel devices do not have a bespoke recovery partition; recovery lives in the boot image. Personally I've never found any use for TWRP on a Pixel. There is no official recovery for the Bramble, although there is at least one unofficial TWRP project. In my experience, TWRP and Magisk do not work together, since both patch the boot image, so while you can live boot the TWRP image, attempting to install TWRP results in a bootloop.

Could be, I don't know.
So my next question woud be do I return this device and get Pixel 5? Theres twrp support for it and it seems better supported according to xda forums. Or do I go with like another Samsung device as I have a S20+ as my main?

And I've had a bit of lag while trying to live stream on Pixel 4a 5G! Not sure why tho!
 
Last edited:

V0latyle

Forum Moderator
Staff member
So my next question woud be do I return this device and get Pixel 5? Theres twrp support for it and it seems better supported according to xda forums. Or do I go with like another Samsung device as I have a S20+ as my main?

And I've had a bit of lag while trying to live stream on Pixel 4a 5G! Not sure why tho!
The 4a 5G, 5, and 5a all use the same SoC and the same kernel. So, if you're able to find working TWRP on one of the other devices, it should work on yours. But again, like I said, unless you're planning on installing a custom ROM or flashing a custom kernel, TWRP really isn't necessary; every time there's an update, you'd have to re-patch the boot image anyway, because the update would get rid of TWRP.

I use a Pixel 5, and as far as I know, TWRP doesn't work properly with Android 13, nor does it work with Magisk v25+.
 
Sep 20, 2022
21
0
I'm pretty sure I said to use the factory image method. You don't need Root Checker, Magisk will tell you if you have root.

Please, go back and read the OP. Thoroughly.
Okay, so does this mean I Literally have to redo a factory google flash or is there some way I can flash the stock 12L zip I DLed.. dont wanna blow thru 4 gb of data...
 
Last edited:

V0latyle

Forum Moderator
Staff member
Okay, so does this mean I Literally have to redo a factory google flash or is there some way I can flash the stock 12L zip I DLed.. dont wanna blow thru 4 gb of data...
There's really only one way to root your device, and that's by patching the boot image in Magisk. The boot image is found in the factory zip.

Alternatively, and I don't know how successful this would be, you could try booting (not flashing!) TWRP, then install Magisk in TWRP.

I'm not sure what situation you're in or how you got there, but it sounds to me like you didn't follow any particular instructions and somehow came up with your own method. Am I accurate in that assessment?
 
Last edited:
Sep 20, 2022
21
0
There's really only one way to root your device, and that's by patching the boot image in Magisk. The boot image is found in the factory zip.

Alternatively, and I don't know how successful this would be, you could try booting (not flashing!) TWRP, then install Magisk in TWRP.

I'm not sure what situation you're in or how you got there, but it sounds to me like you didn't follow any particular instructions and somehow came up with your own method. Am I accurate in that assessment?
you are correct, I chose to follow the OP post in sequential order and then wandered onto the next post about Updating to OTA:
unknown.png
about:blank


When I must of already acquired root... I blame the Nicotine Gum which I seem to enjoy despite never using cigarettes...
 

V0latyle

Forum Moderator
Staff member
you are correct, I chose to follow the OP post in sequential order and then wandered onto the next post about Updating to OTA:
unknown.png
about:blank


When I must of already acquired root... I blame the Nicotine Gum which I seem to enjoy despite never using cigarettes...
This still doesn't provide me much context. I need more information in order to help you.

What were the circumstances before you started having problems? How did you initially root? At what point did you have trouble? What have you tried thus far?

There's not much I can do about your data cap; if you still have the factory image downloaded on your computer, at least that's a start.

Also, I wasn't aware we had a Discord server. I'm on there now.
 
Last edited:
Sep 20, 2022
21
0
Following the UPDATE AND ROOT FACTORY IMAGE SECTION....


unknown.png


Entered the usual paltform tools command.... and now im getting this error?
Thought the problem was because my sunfish 12L .zip had a space in the name and it was somehow causing some stack error in the code... NOPE...

unknown.png

ANY IDEAS???
 

V0latyle

Forum Moderator
Staff member
Following the UPDATE AND ROOT FACTORY IMAGE SECTION....


unknown.png


Entered the usual paltform tools command.... and now im getting this error?
Thought the problem was because my sunfish 12L .zip had a space in the name and it was somehow causing some stack error in the code... NOPE...

unknown.png

ANY IDEAS???
Yes, you aren't following the instructions. You're trying to boot the entire factory zip, when you should be booting the patched boot image. Notice at the top where it says "extract the contents".

This is what you should be doing:
  1. Extract the factory zip:
    1665063183956.png
  2. Open the folder the contents are extracted to:
    1665065851080.png

    And the one inside it:
    1665065890911.png

  3. The contents should look like this:
    1665065928527.png

    image-device-buildnumber.zip is the system update package. This contains the images for system partitions including /boot. Extract this:
    1665067430852.png

    bootloader-device-version.img
    is the bootloader image. This should ONLY be flashed to /bootloader
    radio-device-version.img is the radio image. This should ONLY be flashed to /radio.
    Ignore the flash-all files. These are scripts to perform a whole flash of the device; unless you edit the script, data will be wiped.
  4. Open the system update folder. This is what you should see:
    1665067503661.png

    boot.img is the only file you need. This is the file you need to copy to your phone, patch in Magisk, then copy the resulting magisk_patched-xxxxx_xxxxx.img back to your computer. This patched image is what you'll want to flash to /boot.

This guide is NOT intended for beginners. It is up to you to understand and follow the instructions contained herein.
This is why I posted a warning in the OP:
1665067751067.png

I'm not trying to be rude here, but there comes a point where, if you don't understand what you should be doing, you shouldn't attempt it. As you are evidently not familiar with which files you should be using, or ADB commands in general, I suggest that you take the time to familiarize yourself with those topics before you go any further.
 

Attachments

  • 1665062376210.png
    1665062376210.png
    27.2 KB · Views: 5
  • 1665063177017.png
    1665063177017.png
    14.1 KB · Views: 0
  • 1665065846049.png
    1665065846049.png
    6.4 KB · Views: 0
  • 1665067470781.png
    1665067470781.png
    31.3 KB · Views: 0
  • 1665067494141.png
    1665067494141.png
    31.5 KB · Views: 0
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 11
    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.
    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 --slot=all <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.

    SafetyNet has been deprecated for the new Play Integrity API. More information here.

    In a nutshell, Play Integrity uses the same mechanisms as SafetyNet for the BASIC and DEVICE verdicts, but uses the Trusted Execution Environment to validate those verdicts. TEE does not function on an unlocked bootloader, so legacy SafetyNet solutions will fail.

    However, @Displax has modified the original Universal SafetyNet Fix by kdrag0n; his mod is able to bypass TEE, meaning that the device will pass BASIC and DEVICE integrity.

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

    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!
    2
    Yea, they said change the port, but wanted $100 to do it. It's not an easy job, so that's not unreasonable, but the phone is probably worth only $200ish , so that seemed like a lot. I've tore down plenty of phones so it was a lot more economical to do it myself.
    2
    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.
    2
    Anyone having issues taking the android 13 update? I have tried twice, uninstalling magisk and modules, taking the update, applying magisk to inactive slot, and both time it has tried to boot the the new slot, fialed, then fallen back to the (now unrooted) android 12 slot.

    About to give up and just download the full update, patch it, and update from ADB.
    Patching inactive slot has been hit and miss. Try using Pixel Flasher.
    2
    Magisk Canary was updated to 23016 last night. This includes a fix for the vbmeta header issue, meaning that disabling verity/verification should no longer be required, and we should be able to root as we did before.
    So I did upgrading from latest 11 to latest 12 some minutes ago. Booted, patched boot.img with magisk 23016 and flashed the patched image to get back root. Worked like a charm just like any update before. So no more wipe needed.

    So, it's time for the good old pal Stinky Wizzleteats and his song about being happy. That's right, it's the happy, happy, joy, joy song:
    Happy, happy, joy, joy
    Happy, happy, joy, joy
    Happy, happy, joy, joy
    Happy, happy, joy, joy
    Happy, happy, joy, joy
    Happy, happy, joy, joy

    ┌(・。・)┘♪