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

Search This thread
Re-patch and re-flash the boot image.
Hi ! I do it but always after restart it loose root (photo)
If I remove all mods and remove root and after root it again ?
But how do to remove root ? Just flash Boot.img ?
And I think post on Magisk Thread thanks
 

Attachments

  • Magisk loose root.png
    Magisk loose root.png
    172.3 KB · Views: 9

V0latyle

Forum Moderator
Staff member
Hi ! I do it but always after restart it loose root (photo)
If I remove all mods and remove root and after root it again ?
But how do to remove root ? Just flash Boot.img ?
And I think post on Magisk Thread thanks
Something may have been screwed up between Magisk and the boot image patch.

The best way to remove root is to use Complete Uninstall within the Magisk app; this only works if you have functioning root.

Try this:
  1. Temporarily boot the patched image:
    Code:
    fastboot boot <drag and drop patched boot image>
  2. When the device boots, open Magisk and check to see if you have root.
  3. If you do have root, select "Uninstall" within Magisk, then "Complete Uninstall".
  4. Allow Magisk to reboot your device.
  5. Ensure no other copies of Magisk are on the device - such as if you hid the Magisk app as something else.
  6. Re-install Magisk 23016.
  7. Reboot to bootloader and flash the patched boot image:
    Code:
    fastboot flash boot <drag and drop patched image>
  8. Boot device.

    If this doesn't work, I'm afraid you may have to wipe data.
 
  • Like
Reactions: ggkameleon
Something may have been screwed up between Magisk and the boot image patch.

The best way to remove root is to use Complete Uninstall within the Magisk app; this only works if you have functioning root.

Try this:
  1. Temporarily boot the patched image:
    Code:
    fastboot boot <drag and drop patched boot image>
  2. When the device boots, open Magisk and check to see if you have root.
  3. If you do have root, select "Uninstall" within Magisk, then "Complete Uninstall".
  4. Allow Magisk to reboot your device.
  5. Ensure no other copies of Magisk are on the device - such as if you hid the Magisk app as something else.
  6. Re-install Magisk 23016.
  7. Reboot to bootloader and flash the patched boot image:
    Code:
    fastboot flash boot <drag and drop patched image>
  8. Boot device.

    If this doesn't work, I'm afraid you may have to wipe data.
Hi ! Ok thank you very much. I do it this week-end.
And post before on thread of Magisk
have a good day
 
  • Like
Reactions: V0latyle
Something may have been screwed up between Magisk and the boot image patch.

The best way to remove root is to use Complete Uninstall within the Magisk app; this only works if you have functioning root.

Try this:
  1. Temporarily boot the patched image:
    Code:
    fastboot boot <drag and drop patched boot image>
  2. When the device boots, open Magisk and check to see if you have root.
  3. If you do have root, select "Uninstall" within Magisk, then "Complete Uninstall".
  4. Allow Magisk to reboot your device.
  5. Ensure no other copies of Magisk are on the device - such as if you hid the Magisk app as something else.
  6. Re-install Magisk 23016.
  7. Reboot to bootloader and flash the patched boot image:
    Code:
    fastboot flash boot <drag and drop patched image>
  8. Boot device.

    If this doesn't work, I'm afraid you may have to wipe data.
Hi ! Do you know what is it ?
I think it's magisk modified with hide.
I can use it if I remove root it's safe ? Thanks
Magisk alpha
ahttpss://t.me/magiskalpha/400?single
 

V0latyle

Forum Moderator
Staff member
  • Like
Reactions: ggkameleon
Yes that sounds right. Make sure all instances of Magisk are removed from the device.
Hello, I am coming back to you to inform you that I have finally succeeded.
But it will not have been easy I tried to remove the Root as you had indicated to me but did not work.

Then I tried the same with Magisk Alpha ! same not work
Then flash the Vbmeta and disable verity & flash the Boot img modified but the Pixel got stuck in fastboot.

Finally I deleted the Root and then reinstalled the Ota via adb sideload & reboot.

I finally reinstalled the official Magisk Canary and modified the boot img. Then I started all over again ! Sideload Ota, Flash Boot modified and once reboot I opened Magisk and flash direct installation of Magisk and there perfect it worked and all my modules were installed ?
I think Magisk leaves traces in the system.
 

V0latyle

Forum Moderator
Staff member
Hello, I am coming back to you to inform you that I have finally succeeded.
But it will not have been easy I tried to remove the Root as you had indicated to me but did not work.

Then I tried the same with Magisk Alpha ! same not work
Then flash the Vbmeta and disable verity & flash the Boot img modified but the Pixel got stuck in fastboot.

Finally I deleted the Root and then reinstalled the Ota via adb sideload & reboot.

I finally reinstalled the official Magisk Canary and modified the boot img. Then I started all over again ! Sideload Ota, Flash Boot modified and once reboot I opened Magisk and flash direct installation of Magisk and there perfect it worked and all my modules were installed ?
I think Magisk leaves traces in the system.
Yes - the only way to properly remove Magisk is to use "Complete Uninstall" inside the Magisk app. Unfortunately this is only possible if you have root. Otherwise, if you try to install another version of Magisk, it will make a mess of things.

Glad you were able to get it fixed though.
 
  • Like
Reactions: ggkameleon

V0latyle

Forum Moderator
Staff member

Messatsu

Senior Member
Aug 10, 2010
294
87
Yes - the only way to properly remove Magisk is to use "Complete Uninstall" inside the Magisk app. Unfortunately this is only possible if you have root. Otherwise, if you try to install another version of Magisk, it will make a mess of things.

Glad you were able to get it fixed though.
Hello. I have the exact same problem, when I reboot my device I lost root. After reading your message, I uninstalled Magisk (with Magisk option), installed it back (Canary version 23016), flashed the patched boot image.

I got root back, so I tried to reboot my device, and I lost root again. :[

EDIT : Fixed it...somehow I was flashing the boot img into the booloader, I had to go to Fastboot mode (https://www.hardreset.info/devices/google/google-pixel-4a-5g/fastboot-mode/ ) to flash it correctly!
 
Last edited:

V0latyle

Forum Moderator
Staff member
Hello. I have the exact same problem, when I reboot my device I lost root. After reading your message, I uninstalled Magisk (with Magisk option), installed it back (Canary version 23016), flashed the patched boot image.

I got root back, so I tried to reboot my device, and I lost root again. :[

EDIT : Fixed it...somehow I was flashing the boot img into the booloader, I had to go to Fastboot mode (https://www.hardreset.info/devices/google/google-pixel-4a-5g/fastboot-mode/ ) to flash it correctly!
It shouldn't matter. Perhaps you needed to flash it to both slots.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    Well, I'll know soon enough. I'm planning to replace the port tomorrow. Just hope I don't crack the glass or mess up the digitizer taking it apart.
  • 9
    If you are looking for my guide on a different Pixel, find it here:
    Update 4-28-22: While Magisk 24.0 has been updated for use with Android 12, many users are still having problems with patching the out of band OTA, so Canary 24306 is recommended.
    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 update bootloader <bootloader image name>
    fastboot reboot bootloader
    ping -n 5 127.0.0.1 > nul
    fastboot update 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.

    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.

    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:
    To check SafetyNet 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
    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
    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

    ┌(・。・)┘♪
    1
    DO NOT take the automatic OTA if you are rooted.

    Well, that explains why I haven't been able to update boot with my patched file.

    First I've heard of it and not sure I'm ready to wipe everything and start over.

    Sucks to be an early adopter.

    Thanks for the post.
    1
    Well, I'll know soon enough. I'm planning to replace the port tomorrow. Just hope I don't crack the glass or mess up the digitizer taking it apart.