How To Guide Rooting the Google Pixel 6a

Search This thread

ryan92084

Senior Member
Jun 19, 2010
214
40
Here is another way to fix the "stock backup does not exist"
** Load up Command Prompt on Windows**
# put stock boot.img into /sdcard/boot.img

# get sha1
adb shell
su
SHA1=$(cat $(magisk --path)/.magisk/config | grep SHA1 | cut -d '=' -f 2)

# repack boot.img.gz
gzip -9f /sdcard/boot.img

# restore backup
mkdir /data/magisk_backup_${SHA1}
mv /sdcard/boot.img.gz /data/magisk_backup_${SHA1}/boot.img.gz
chmod -R 755 /data/magisk_backup_${SHA1}
chown -R root.root /data/magisk_backup_${SHA1}

source https://forum.xda-developers.com/t/...restore-needs-to-be-put.3845559/post-87259063
 
  • Like
Reactions: zappagirl

ddrum2000

Senior Member
Feb 17, 2009
169
7
Google Nexus 10
LG Nexus 5X
I tried this method of of applying the Oct OTA but it resulted in a boot loop. Any idea what's going on?

To fix it I sideloaded the OTA, rebooted, and reflashed boot to obtain root. This was so easy coming from my old OnePlus but I have issues with every update I've applied. Thanks.
 

m1batt1

Senior Member
Jan 8, 2012
893
501
Springfield, MO
Google Pixel 6a
It has been a long long time since I've been in the flashing game and have never used a phone where the bootloader could actually be relocked after unlocking. All that being said once I've completed the root process can I relock the bootloader and keep root access? I didn't see anything in the main post and missed it if it was covered in the replies. Normally I'd just try it and see what happens but I'm lazy and don't want to have to re install all my apps and that mess only for it to not do what I want it to.
 

ctfrommn

Senior Member
May 25, 2011
7,391
10,753
Minnesota
It has been a long long time since I've been in the flashing game and have never used a phone where the bootloader could actually be relocked after unlocking. All that being said once I've completed the root process can I relock the bootloader and keep root access? I didn't see anything in the main post and missed it if it was covered in the replies. Normally I'd just try it and see what happens but I'm lazy and don't want to have to re install all my apps and that mess only for it to not do what I want it to.
No, locking with root would be very bad and it's such isn't possible.
 
  • Like
Reactions: m1batt1

arik100

Senior Member
Apr 6, 2012
233
15
do i still need to do these reset setups on a december updated device? oem unlocking is greyed out..
 

xracerx123

Member
Apr 13, 2017
24
0
I am thinking of me importing nano into the devices. My main goal is to have a bashrc alias and and make it easy for me to edit files in the system. How can I achieve this?

Is there an equivalent of apt-get command in android? Like what we can do in a jailbreak IOS devices?
 

7kAi

New member
Jan 5, 2023
4
0
Hi, how to fix this issue
1673092651670.png
 

Attachments

  • 1673092637723.png
    1673092637723.png
    28 KB · Views: 16

arik100

Senior Member
Apr 6, 2012
233
15
so i recommend update all updates and then go root it.
the greyed out part changed when i updated it , so i skipped most of this guide.
 

Implosion6394

New member
Jan 10, 2023
2
0
I applied the Dec 22 OTA update last month. I patched the image using magisk and then restarted. It kept failing, but after a few tries it did go through. I suspect it was because I didn't disable a module.

However, it caused me to lose root... So, I'm trying to fix that now. I've downloaded the stock image (TQ1A.221205.012) but when I extract it, I can't see any zip files or img files. There's only a 'payload.bin' that has any weight to it, and that's not got any img file inside either.

7zip.png
 

Implosion6394

New member
Jan 10, 2023
2
0
I applied the Dec 22 OTA update last month. I patched the image using magisk and then restarted. It kept failing, but after a few tries it did go through. I suspect it was because I didn't disable a module.

However, it caused me to lose root... So, I'm trying to fix that now. I've downloaded the stock image (TQ1A.221205.012) but when I extract it, I can't see any zip files or img files. There's only a 'payload.bin' that has any weight to it, and that's not got any img file inside either.

View attachment 5806705
never mind, just realised I was downloading the OTA file rather than factory
 

Top Liked Posts

  • There are no posts matching your filters.
  • 12
    Rooting the Pixel 6a is just about as easy as any other factory unlocked pixel, but because so many people have had issues with unlocking their bootloaders, I figured I'd post my exact personal steps I took when a Pixel 6a came into my tech shop to be rooted, and I discovered the current bug with Rooting

    What You'll Need:
    - June 2022 Firmware OTA Update Installed at least: Do this on device. Do Not download the OTA update from google's firmware website.
    - ADB/Fastboot/Google Drivers for Windows: I use this to install- ADB 15sec Installer
    - Magisk Manager APK: Github - Magisk Github Releases
    - Firmware Matching Currently Installed: Google FW page - Google Official Firmware Downloads - you need this for the boot.img file
    - A Windows Computer
    - A USB-C cable to connect to your phone to the computer

    OEM Unlock Bug
    With early units sold by Google, they're shipping with a bug where OEM Unlock stays grayed out. Here's the only way I got around this issue
    1.) Log out of any Google Account on the device
    2.) Connect to Wifi, check for updates without your sim card in the device. There is a bug where it will potentially download the update for your carrier sim
    3.) At minimum, you should get the June 2022 security patch update. Run the update and remember which update it is for when you download the firmware to get boot.img
    4.) When the update is finished, Factory Reset your device either from settings or Android recovery
    5.) Go through Android setup without sim card in, and don't connect to wifi, finish setup without logging into a google account or anything
    6.) When setup is done, connect to wifi and put your sim back in.
    7.) Pay attention in your notifications for "Preparing your Device" notification.
    8.) When that notification pops up, enable Developer options (tap build number a bunch of times)
    9.) OEM Unlock should be possible to enable now. Also enable USB Debugging

    Pre-Root Setup
    1.) Install Magisk Manager from Github
    2.) Use 7zip (or any other ZIP opening program) to extract the boot.img from your firmware download from google
    -- the boot.img is inside another zip file that's in the download from google. very easy to get
    3.) Put the Boot.img on your phones internal storage
    4.) Open Magisk Manager, and select your Boot.img from internal storage. Patch the boot.img to make it a rooted boot.img
    5.) With your phone connected to the computer, move the magisk_patched.img from sdcard/downloads to your computer
    6.) If USB debugging is properly enabled, now you can open CMD and reboot to bootloader with
    Code:
    adb reboot bootloader

    Unlocking the bootloader
    1.) With the device connected, OEM Unlock enabled, and booted to bootloader, you can unlock the bootloader with the following command
    Code:
    fastboot flashing unlock
    -- If nothing changes on your phone screen, use Device Manager to make sure the device is recognized via google drivers: vid here on that - Quick Fastboot Drivers Install Tutorial
    2.) On your phone, use the volume keys to select Unlock Bootloader, then hit the power button, device should reboot back to bootloader
    3.) flash the boot partition with the magisk patched boot.img
    Code:
    fastboot flash boot magisk_patched.img
    4.) Now you can reboot back into your device and you should be rooted!
    Code:
    fastboot reboot

    Congrats! Now you're bootloader unlocked and rooted! GrapheneOS is already available if you want a degoogled rom, haven't seen another rom pop up yet
    all done from there

    updating your device when rooted
    I do not have a pixel 6a specifically for this right now to confirm this will work, but on every other device with OTA's, this has been my process.
    1.) Download your OTA using the system update part of Settings
    2.) When it pops up and is ready to restart to finish installing the update, DO NOT CLICK RESTART IN SETTINGS/SYSTEM UPDATE
    3.) Go to Magisk Manager, and select Install next to Magisk
    4.) Select "Install to Inactive Slot (After OTA)
    5.) When its done patching the boot partition, hit restart in Magisk
    Your OTA Update is now rooted
    5
    Im starting work on my custom kernel now so hopefully MVK for Bluejay will be ready in the coming days/weeks.
    4
    To save time and effort here is the magisk patched boot.img for June 2022 patch level, Carrier Unlocked 6a from the Google Store. Make SURE you are on build SD2A.220601.003 before flashing! ;)
    3
    Guys!! English!!! Please!!! :)
    You won't like this answer, but if you don't know what you're doing, you shouldn't be doing this.
    I'm done for tonight :)

    Somehow I got to the point where the security update got installed!!! I followed the ota with magisk guide and did not restart after it, went into the magisk, installed onto the secondary partition (or whatever it's called), rebooted.. and the phone completely froze.. I thought "that's it, this pixel has had a nice long 1wk long life :D".
    Held the power button for over 30 seconds, booted up, went to magisk, patched the boot.img file, flashed it, and nothing - still no security update installed.

    I want to offload the process of updating the phone to my wife, but I kinda like permanent root for acc control, etc
    I think you misunderstand me.

    When you flash the boot image with fastboot flash boot <boot image>, you're actually writing that binary to the /boot partition. If you do this with a patched image, Magisk does not have a backup.
    When you boot the boot image, with fastboot boot <boot image>, you're sending the binary to the device to load instead of what's written to /boot. If you boot a patched image, then perform Direct Install in Magisk, Magisk then creates a backup of the original image in /boot so as to be able to restore it later.

    Just reflash the stock June bootimage, take the new update and reflash the patched boot. The kernel didnt change between these 2 releases so the patched boot works on either.
    I would not recommend doing this. While the kernel may be the same, the boot image contains other components that are updated with almost every release, such as the Android security engine. It's OK to temporarily boot an older image, but I recommend always flashing the boot image that corresponds to the update.

    how reflash stock boot image if i dont have a backup? I need to flash it in bootloader mode?
    Download the factory update package (not the OTA) and extract boot.img from within it, then flash in bootloader: fastboot flash boot <boot image>
    Let me explain worse 😂: I download the boot.img directly from google, but then if I flash it in bootloader mode, I don't lose all the magisk modules on reboot? Don't risk the bootloop?
    Magisk operates via a kernel patch to grant root access. If you flash an unpatched boot image, you lose root, meaning Magisk is unable to load any modules. The only time this would cause a boot loop is if you updated via OTA, then flashed an older boot image; the system would see the mismatch and assume the update failed.
    2
    To save time and effort here is the magisk patched boot.img for June 2022 patch level, Carrier Unlocked 6a from the Google Store. Make SURE you are on build SD2A.220601.003 before flashing! ;)
    As this thread ages, not everyone will have the June 2022 update. That's why I suggested/put the steps in to do it themselves with matching firmware to what their device is on.

    To get the `OEM Unlock` option in Developer Options to work, it's simpler to just manually flash 12.1.0 (SD2A.220601.004, Jun 2022, Verizon, Verizon MVNOs) and then wipe.

    Even though it's label as Verizon, it should work for all carriers.
    This DID NOT work for me. That's why I wrote this up the way I did.

    Hello, if we have already unlocked the bootloader, we just have to do this: start cmd then fastboot flash boot magisk_patched.img then restart the phone?
    If you're bootloader is already unlocked, you just have to flash the patched magisk boot img, correct. I wrote this up for those having issue with not having the ability even if it is an unlocked from google device

    these instructions sound like "the usual process", but for the 6a isn’t there something to patch regarding vbmeta as well?

    (never had a phone that "needed" this, but in my understanding it "should" be necessary with the 6a? won’t have time to try out myself before the weekend, just asking ..)

    Correct, these are basically the usual steps. There's nothing regarding vbmeta flashing in this case of just rooting stock firmware. You only need to do that with ROMs (GSI's mainly)