[Guide]How to Root Your Pixel 3a and Install Magisk - Android 9 - 12

Search This thread

sic0048

Senior Member
Jun 25, 2010
1,026
561
Google Pixel 7
Google Pixel 8 Pro
Edit - just an FYI for complete transparency. I have moved from the Pixel 3a XL to the Pixel 6. I no longer own my Pixel 3a XL. While I've been told (thanks @AndDiSa) that the root process for Android 12 is the same as it historically has been, I no longer can test things myself. (The root process for the Pixel 6 is different and more complicated than this phone). If you run into any problems or issues, please post in this thread and someone will hopefully be able to answer them.

I'm assuming you understand how to use ADB on your computer. If you need assistance with installing or using ADB, please refer to this XDA article for more information. However, here are some common issues that people have with ADB if it doesn't work initially for you. 1) Check the Android System Notification that appears in your phone's notifications after you plug in your USB cord. Your phone probably defaults to "No data transfer" and you need to change it to "file transfer" to allow the phone to connect. 2) Make sure you have USB debugging turned on in the Settings/System (advanced)/Developer options. 3) If this is your first time using this phone/computer combination, you will have to accept the connection when it pops up on your phone.

You also need an unlocked bootloader to complete these steps. If you need assistance with unlocking your bootloader, here is decent set of instructions. Those instructions are based on the Pixel 3 phone, but the steps are the same for the 3a devices.

Here are the official Magisk installation instructions. I will walk through them to help everyone understand them. Please note that while TWRP does work with Android 9 (Pie), it does not work currently with Android 10 or 11. If you are still on Pie for some reason you can choose either installation option, but if you have moved to a later Android version, you must use the "Boot Image Patching" installation method.

Custom Recovery Installation Method - (available for Android Version 9/Pie only because TWRP does not work currently with the Android 10/11)
This is the easier installation method IMHO, but it does require using TWRP. If you don't know how to get TWRP for the Pixel 3a, please refer to the official TWRP for Pixel 3a thread
Step 1 - Download and install the Magisk manager app on your phone. (link to the latest stable version can be found here).
Step 2 - Using the Magisk manager app, select "Install Magisk" and select the "Download Zip Only" option. This simply downloads the installation zip to your phone's download folder. It doesn't attempt to install anything.
Step 3 - Boot into TWRP - (because TWRP is not permanent on the stock Pie OS, we must follow these instructions each time we want to boot into TWRP).
Step 3a - Download the latest TWRP image for the 3a to your computer (not your phone) from the official TWRP for 3a thread.​
Step 3b - Connect to your phone via ADB on your computer. You should see the device listed if you type the command "adb devices".​
Step 3c - Boot your phone into the bootloader (type the command "adb reboot bootloader").​
Step 3d - Boot into TWRP using this command, "fastboot boot twrp-3.x.x-x.img" (where "twrp-3.x.x-x.img" = whatever the name of the TWRP download is). Please note you are not using the "flash" command as we are not permanently installing TWRP.​
Step 4 - Once the device boots into TWRP, select "Install" and then find the Magisk.zip download from step 2. Swipe to confirm the installation
Step 5 - After the installation is complete, simply reboot system.
Step 6 - Enjoy your rooted phone and install any Magisk modules that appeal to you
Step 7 - Be sure to turn off the "Automatic System Updates" setting found in Developer settings (Settings /System (advanced) /Developer Options). This will prevent the phone from automatically installing an OTA update and instead allow you to follow the steps listed under the "Taking an OTA Update" section below

The Boot Image Patching Installation method - (the only method currently available under Android 10, 11 or 12, but it also works with Pie).
Use this method if you are on Android 10 or 11 or you are on Android 9/Pie but you don't want to or can't use TWRP.
Step 1 - Obtain a stock boot.img file for the OS version/update that you are currently on. The easiest method is probably to download the applicable full stock image directly from Google. Unzip the files and unzip the second folder and you should find the boot.img file inside.
Step 2 - Copy the stock boot.img file to your phone's storage - probably to /sdcard or to /sdcard/downloads
Step 3 - Download and install the Magisk manager app on your phone. (link to the latest version can be found here). If you are early in the Android 12 cycle, you probably need to use a Canary build of Magisk.
Step 4 - Using the Magisk manager app, press "Install --> Install --> Select and Patch a File" - select the stock boot.img file that you put on your phone in step 2.
Step 5 - Magisk will modify the stock boot.img file and create a patched boot image file. It will save this modified file at "sdcard/Download/magisk_patched.img"
Step 6 - Connect to your phone via ADB on your computer. You should see the device listed if you type the command "adb devices".
Step 7 - Copy the patched boot image from your device to your PC and the adb folder. If you can’t find the file on your phone via MTP or Windows Explorer, you can pull the file by typing the command "adb pull /sdcard/Download/magisk_patched.img" - Please note, I would suggest double checking the "file modified date" prior to moving the file. Be sure to only move the file if it was last modified on the date you are doing this. I've had a strange situation before where the newly modified file didn't immediately show up and the file showed a modified date of the previous month. If you flash an old version, your phone will bootloop.
Step 8 - Boot your phone into the bootloader (type the command "adb reboot bootloader").
Step 9 - Flash the patched boot image to your device using this command, "fastboot flash boot magisk_patched.img"
Step 10 - Reboot (using command "fastboot reboot").
Step 11 - Enjoy your rooted phone and install any Magisk modules that appeal to you
Step 12 - Be sure to turn off the "Automatic System Updates" setting found in Developer settings (Settings /System (advanced) /Developer Options). This will prevent the phone from automatically installing an OTA update and instead allow you to follow the steps listed next.......

Taking an OTA update in the future (if you used this method to install Magisk).
Taking OTA updates is very easy with the Pixel devices because of their A/B partition system. It allows us to uninstall Magisk, take the OTA update, and reinstall Magisk - all from the phone and all without rebooting during the process. Here are the offical Magisk OTA instructions. I will go through the steps to help explain them.

Step 1 - In the Magisk manager app: Click “Uninstall” then “restore images”. DO NOT REBOOT or press the reboot button.
Step 2 - Download and install OTA (in your phone's Settings/System/System Update). DO NOT REBOOT or press the reboot button.
Step 3 - Open the Magisk manager app and click “Install” next to Magisk (usually it says "Magisk is up to date") then “Install to second/inactive slot (After OTA)”
Step 4 - Press the Reboot button in Magisk.

That should be all it takes to install an OTA and keep root.

Please note, we are getting reports that users are getting notifications that an OTA update has been installed even when they have "Automatic Updates" turned off. If this happens to you, don't reboot the phone which is suppose to be the final step in the update process. Instead, follow the above instructions on taking an OTA update, but start in step 3. In other words, you shouldn't have to uninstall Magisk because the update has already been installed. All you need to do is install Magisk to the "second/inactive slot (After OTA)”. After completing that step, you can reboot your phone to complete the update process. Be sure to post your experiences in this thread to let us know if this process works or not.

Just remember that many custom parts (like kernels and Magisk modules) may need to be updated to any new OTA version. Please be sure to check out the forums for each custom kernel or module that you may want to install to ensure it has been updated to the lastest OS version. Don't assume anything or you may find yourself in a bootloop.

If you find yourself in a bootloop after upgrading an already rooted phone
If you find yourself in a bootloop after updating to a new OS version and flashing the magisk_modified boot.img again, it is likely due to an installed Magisk module not being compatible with the new update. To uninstall all Magisk modules to fix the bootloop, follow these steps:

Step 1 - Connect your phone to the computer you use ADB on.
Step 2 - In ADB type the command "adb wait-for-device shell magisk --remove-modules"
Step 3 - Start your phone again or wait for it to go through another bootloop cycle.
Step 4 - as soon as ADB is available (which occurs even during a bootloop) the command will activate, the modules will be removed, and the phone will reboot.

If the normal OTA method isn't working - sideload the OTA update
Taking an OTA update should be as easy as the above instructions. However there is another option available to install an OTA update called sideloading. Sometimes the update doesn't appear on the phone in a timely manner and you may want to manually install the update. Other times the OTA update seems to fail for some reason. In the end, you may decide to sideload the OTA instead of trying get it via the update feature on the phone. Surprisingly, it's actually faster to install the update via sideloading than it will be to take the OTA normally. I'll walk through the sideloading steps.....

Optional Step 1 - Uninstall Magisk (so that it restores the stock boot.img). If you find yourself unable to boot into recovery, you will have to restore the stock boot.img. I've run into this issue on a couple Android 10 images, but most do not require this step.
Step 2 - Download to your computer the correct OTA image from here
Step 3 - Connect to your phone via ADB on your computer. You should see the device listed if you type the command "adb devices".
Step 4 - Boot your phone into recovery (type the command "adb reboot recovery").
Step 5 - The phone will have a green android robot with a red sign over it's open access panel. Press the power button and then the volume up button while still holding down the power button.
Step 6 - Select "Apply update from ADB" using the volume buttons to highlight the choice and the power button to select it to enter the sideload mode.
Step 7 - Using your computer, type "adb sideload ota_file.zip" where ota_file.zip is the name of the OTA file you downloaded in step 2.
Step 8 - Once the update finishes, reboot the phone to complete the update process. (See note below about initial boot times).
Step 9 - To obtain root again, please use one of the two root methods listed above

Please note, while the initial boot is usually pretty quick, it can take longer. I've occasionally seen the process take upwards of 20 minutes and longer. I think part of the reason it can take so long is that sometimes it optimizes the apps during this boot process. The more apps you have, the longer the process may take. When you take an regular OTA update, the phone will change to a screen where is specifically tells you it is optimizing the apps and counts up as the apps are optimized to give you status updates. When you use the side-load method, it all happens with just the regular boot animation running and without any status updates. Because of this, it is easy to assume something has gone wrong with the boot process while in fact the phone is working through the process normally. If it isn't boot looping (showing the initial power screen before moving back to the boot animation), everything is fine and you just need be patient and let the phone complete the process.

My rant about using these "Pre-patched Boot image" files
I started this thread during a period of time where there was a another thread on this forum started by pbanj that showed users how to root their phone by using some pre-patched boot image files. This method is not the generally accepted method and while it works, there are major shortcomings with it (see explanation below). Because it was the only root thread available at the time and he only showed the "pre-patched boot image" method, many people blindly followed his directions only to be confused when it came time to update the software on their phones. I wrote this thread in an effort to show people the official Magisk installation method. Pbanj has since updated his thread and it now includes the preferred method as well. With his edits, the two threads are sharing the same information now, although Pbanj thread still offers people the "pre-patched boot image" method (which I don't recommend people using).

EDIT - Yet another thread pushing a pre-patched root method has been started. It suffers the same issues as listed below.

Shortcomings with using the "pre-patched boot image" method.
As I already mentioned, there is a huge shortcoming with using the "pre-patched boot image" method described in the other root thread. Because he provides a pre-patched boot.img file, you skip some normal installation steps. In the end you have the exact same patched file (which is why his method works), but you cripple the system when it comes to taking any future OTA. That's because the first step in taking an OTA update is having Magisk reflash the stock boot.img effectively uninstalling itself. This step fails if you used his pre-patched boot image method because you skip the step where Magisk creates the backup of the stock boot.img that it needs to uninstall itself.

I already used the "pre-patched boot image" method to gain root. What can I do?
First, let me clarify and say that there is nothing wrong with your phone or root privileges. Your phone will work exactly as expected and root and Magisk will work exactly as expected. That being said, in the near future you will want to update your phone to the latest Android update and this is where the "pre-patched boot image" method is much more cumbersome. The best option is to simply undo his root method and re-root using the method described above. To do this, flash the correct stock boot.img file to your boot partition and then follow the steps above to reinstall Magisk. Jbanj has confirmed this method will work. The other option is just wait until you need to take an update and then sideload the OTA update following the instructions above. This will remove root and you can then follow one of the two methods to obtain root as outlined in this thread.

Notes
- Please be sure you are on the latest adb and drivers which can be found here.
- You do not need to keep the stock boot.img file (from step 2 of the Boot Image Patching method) on your phone after completing these steps. Magisk saves the stock boot.img backup at /root/data in a file with the name "stock_boot_XXXXXXXXXXXX.img.gz"

Thanks to.......
@ZVNexus for getting TWRP working on the 3a and 3a XL phones
@topjohnwu for making Magisk what it is today
 
Last edited:

Bankuu

New member
May 23, 2019
2
0
Made it to step 7/8, went to reboot, and entered bootloop. Not sure exactly what happened, gonna fix this and give it another go.

EDIT: Should I be flashing in fastboot or recovery mode?

EDIT 2: Working! Thanks!
 
Last edited:

jmtjr278

Senior Member
Mar 8, 2012
1,005
553
You know there are more ways to skin a cat, right? This is another method to acquire root. I don't think you need to bash the work that pbanj has done. He provides modified boot.img and also offers help on getting it working. I think acting like your method is the only acceptable way to gain root is extremely pompous and arrogant.

Sent from my Pixel 3a using Tapatalk
 

sic0048

Senior Member
Jun 25, 2010
1,026
561
Google Pixel 7
Google Pixel 8 Pro
You know there are more ways to skin a cat, right? This is another method to acquire root. I don't think you need to bash the work that pbanj has done. He provides modified boot.img and also offers help on getting it working. I think acting like your method is the only acceptable way to gain root is extremely pompous and arrogant.

Sent from my Pixel 3a using Tapatalk

I don't think that this method is the only way to get root, nor is this "my method". It is however the method spelled out by the Magisk developers and it is the only method that uses Magisk strengths when trying to take an OTA update.. I'll simply leave it at that......
 
Last edited:

jmtjr278

Senior Member
Mar 8, 2012
1,005
553
I don't think that this method is the only way to get root, nor is this "my method". It is however the method spelled out by the Magisk developers and it is the only method that uses Magisk strengths when trying to take an OTA update.. I'll simply leave it at that......
Sure. It's the way I do it also. But show some class and don't call out other, helpful members in this fashion and crap all over what they do. I have seen your posts and know your a helpful members also, let's respect each other and be classy.

Sent from my Pixel 3a using Tapatalk
 

alliance1975

Senior Member
Jan 2, 2014
295
116
Alliance College
@sic0048
Thank you. I got to admit it was pretty tense for a while. Thanks to you I made it. Had to do a sideload, had to do some stupid things but I made it. Now, I got through all the steps and I have two items; Having done this transition can I now do the magisk-uninstall-restore images for all future OTAs and is step 9 performing the magisk install process a second time?
 

sic0048

Senior Member
Jun 25, 2010
1,026
561
Google Pixel 7
Google Pixel 8 Pro
Made it to step 7/8, went to reboot, and entered bootloop. Not sure exactly what happened, gonna fix this and give it another go.

EDIT: Should I be flashing in fastboot or recovery mode?

EDIT 2: Working! Thanks!

I've edited the steps and added a few more going into greater detail to try and make it even clearer for users. Let me know if you have any suggestions.
 

sic0048

Senior Member
Jun 25, 2010
1,026
561
Google Pixel 7
Google Pixel 8 Pro
@sic0048
Thank you. I got to admit it was pretty tense for a while. Thanks to you I made it. Had to do a sideload, had to do some stupid things but I made it. Now, I got through all the steps and I have two items; Having done this transition can I now do the magisk-uninstall-restore images for all future OTAs and is step 9 performing the magisk install process a second time?

You should be able to use the normal Magisk OTA update instructions for future updates.

I've updated the thread and I think the "step 9" you listed isn't the same anymore, but I think I understand your question. Actually I think my original instructions were inaccurate as far as that step. I've always gone back into Magisk after flashing the modified boot.img and I thought I hit install to install the Magisk framework (if that is the correct term). But after reading some other guides, I think my memory is incorrect and you don't really have to install anything after the flashing portion of the steps.

Once you reboot after flashing, that should be all you have to do. I'll uninstall Magisk here in a while and walk through the steps myself to ensure this is correct howeve.
 

sic0048

Senior Member
Jun 25, 2010
1,026
561
Google Pixel 7
Google Pixel 8 Pro
@sic0048
Should we keep the stock boot image copied to the phone storage in step 2? Is this where Magisk will look for it to do an image restore?

You do not need to keep the stock boot image that was copied over in step 2. Magisk saves the backup of the boot.img at /root/data. It will have the name "stock_boot_XXXXXXXXXXXXXXXXXXX.img.gz"
 
Last edited:

sic0048

Senior Member
Jun 25, 2010
1,026
561
Google Pixel 7
Google Pixel 8 Pro
Edited - now that jbanj has confirmed we can simply flash the stock boot.img file to the boot partition and start over, the post I originally had here is pointless.

Alliance's question got me to thinking.....

Since Magisk saves the stock boot.img backup at /root/data in a file named "stock_boot_XXXXXXXXXXXX.img.gz" I wonder if we can't simply share a backup file with someone that used jbanj "modified boot image" method and have them copy it to that location. I suspect Magisk will then allow the normal OTA update prceedures to work.

I can share the backup file that I have, but it is for the 3a XL model, Android version 9 (Pie) and the June 5, 2019 security update. That means it will be next month before there will be another OTA update pushed out.

If someone is still on the OEM March update and rooted using the normal directions and is willing to share their backup file, we might be able to try it sooner.

Unfortunately I don't know if Magisk modifies the backup to be some sort of unique file. I doubt it, but I don't know for sure. Of course worse case scenario is that it doesn't work and the person has to flash the OTA manually - which is no different than what they would have to do anyway. So there really isn't much risk in trying this.
 
Last edited:

sic0048

Senior Member
Jun 25, 2010
1,026
561
Google Pixel 7
Google Pixel 8 Pro
Wondering the same thing. I know the OTA is rolling out again today IIRC. But I also read something about root not being available on Q yet, so not sure how that would work out.

Google has changed the file structure in the Q beta 4 release and root is not possible at this time. This is true across all devices (not just the Pixel 3a). I know John Wu (the Magisk developer) is working on a solution and I would expect to see results before Android 10 is released, but only time will tell.

However, at this time there is no root on the Q beta 4. If you need root, you will have to stick to Pie for now.
 
Last edited:

nickmv

Senior Member
Jan 12, 2011
958
251
Memphis
I'm getting weird behavior here that I've been able to replicate.

Bottom line, if you use the Magisk patch method, upon flashing that boot image, your phone will auto-play music every single time it boots up. That's incredibly annoying.

Uninstall and go back to stock boot.img, and it goes away. Flash again, it's right back.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 44
    Edit - just an FYI for complete transparency. I have moved from the Pixel 3a XL to the Pixel 6. I no longer own my Pixel 3a XL. While I've been told (thanks @AndDiSa) that the root process for Android 12 is the same as it historically has been, I no longer can test things myself. (The root process for the Pixel 6 is different and more complicated than this phone). If you run into any problems or issues, please post in this thread and someone will hopefully be able to answer them.

    I'm assuming you understand how to use ADB on your computer. If you need assistance with installing or using ADB, please refer to this XDA article for more information. However, here are some common issues that people have with ADB if it doesn't work initially for you. 1) Check the Android System Notification that appears in your phone's notifications after you plug in your USB cord. Your phone probably defaults to "No data transfer" and you need to change it to "file transfer" to allow the phone to connect. 2) Make sure you have USB debugging turned on in the Settings/System (advanced)/Developer options. 3) If this is your first time using this phone/computer combination, you will have to accept the connection when it pops up on your phone.

    You also need an unlocked bootloader to complete these steps. If you need assistance with unlocking your bootloader, here is decent set of instructions. Those instructions are based on the Pixel 3 phone, but the steps are the same for the 3a devices.

    Here are the official Magisk installation instructions. I will walk through them to help everyone understand them. Please note that while TWRP does work with Android 9 (Pie), it does not work currently with Android 10 or 11. If you are still on Pie for some reason you can choose either installation option, but if you have moved to a later Android version, you must use the "Boot Image Patching" installation method.

    Custom Recovery Installation Method - (available for Android Version 9/Pie only because TWRP does not work currently with the Android 10/11)
    This is the easier installation method IMHO, but it does require using TWRP. If you don't know how to get TWRP for the Pixel 3a, please refer to the official TWRP for Pixel 3a thread
    Step 1 - Download and install the Magisk manager app on your phone. (link to the latest stable version can be found here).
    Step 2 - Using the Magisk manager app, select "Install Magisk" and select the "Download Zip Only" option. This simply downloads the installation zip to your phone's download folder. It doesn't attempt to install anything.
    Step 3 - Boot into TWRP - (because TWRP is not permanent on the stock Pie OS, we must follow these instructions each time we want to boot into TWRP).
    Step 3a - Download the latest TWRP image for the 3a to your computer (not your phone) from the official TWRP for 3a thread.​
    Step 3b - Connect to your phone via ADB on your computer. You should see the device listed if you type the command "adb devices".​
    Step 3c - Boot your phone into the bootloader (type the command "adb reboot bootloader").​
    Step 3d - Boot into TWRP using this command, "fastboot boot twrp-3.x.x-x.img" (where "twrp-3.x.x-x.img" = whatever the name of the TWRP download is). Please note you are not using the "flash" command as we are not permanently installing TWRP.​
    Step 4 - Once the device boots into TWRP, select "Install" and then find the Magisk.zip download from step 2. Swipe to confirm the installation
    Step 5 - After the installation is complete, simply reboot system.
    Step 6 - Enjoy your rooted phone and install any Magisk modules that appeal to you
    Step 7 - Be sure to turn off the "Automatic System Updates" setting found in Developer settings (Settings /System (advanced) /Developer Options). This will prevent the phone from automatically installing an OTA update and instead allow you to follow the steps listed under the "Taking an OTA Update" section below

    The Boot Image Patching Installation method - (the only method currently available under Android 10, 11 or 12, but it also works with Pie).
    Use this method if you are on Android 10 or 11 or you are on Android 9/Pie but you don't want to or can't use TWRP.
    Step 1 - Obtain a stock boot.img file for the OS version/update that you are currently on. The easiest method is probably to download the applicable full stock image directly from Google. Unzip the files and unzip the second folder and you should find the boot.img file inside.
    Step 2 - Copy the stock boot.img file to your phone's storage - probably to /sdcard or to /sdcard/downloads
    Step 3 - Download and install the Magisk manager app on your phone. (link to the latest version can be found here). If you are early in the Android 12 cycle, you probably need to use a Canary build of Magisk.
    Step 4 - Using the Magisk manager app, press "Install --> Install --> Select and Patch a File" - select the stock boot.img file that you put on your phone in step 2.
    Step 5 - Magisk will modify the stock boot.img file and create a patched boot image file. It will save this modified file at "sdcard/Download/magisk_patched.img"
    Step 6 - Connect to your phone via ADB on your computer. You should see the device listed if you type the command "adb devices".
    Step 7 - Copy the patched boot image from your device to your PC and the adb folder. If you can’t find the file on your phone via MTP or Windows Explorer, you can pull the file by typing the command "adb pull /sdcard/Download/magisk_patched.img" - Please note, I would suggest double checking the "file modified date" prior to moving the file. Be sure to only move the file if it was last modified on the date you are doing this. I've had a strange situation before where the newly modified file didn't immediately show up and the file showed a modified date of the previous month. If you flash an old version, your phone will bootloop.
    Step 8 - Boot your phone into the bootloader (type the command "adb reboot bootloader").
    Step 9 - Flash the patched boot image to your device using this command, "fastboot flash boot magisk_patched.img"
    Step 10 - Reboot (using command "fastboot reboot").
    Step 11 - Enjoy your rooted phone and install any Magisk modules that appeal to you
    Step 12 - Be sure to turn off the "Automatic System Updates" setting found in Developer settings (Settings /System (advanced) /Developer Options). This will prevent the phone from automatically installing an OTA update and instead allow you to follow the steps listed next.......

    Taking an OTA update in the future (if you used this method to install Magisk).
    Taking OTA updates is very easy with the Pixel devices because of their A/B partition system. It allows us to uninstall Magisk, take the OTA update, and reinstall Magisk - all from the phone and all without rebooting during the process. Here are the offical Magisk OTA instructions. I will go through the steps to help explain them.

    Step 1 - In the Magisk manager app: Click “Uninstall” then “restore images”. DO NOT REBOOT or press the reboot button.
    Step 2 - Download and install OTA (in your phone's Settings/System/System Update). DO NOT REBOOT or press the reboot button.
    Step 3 - Open the Magisk manager app and click “Install” next to Magisk (usually it says "Magisk is up to date") then “Install to second/inactive slot (After OTA)”
    Step 4 - Press the Reboot button in Magisk.

    That should be all it takes to install an OTA and keep root.

    Please note, we are getting reports that users are getting notifications that an OTA update has been installed even when they have "Automatic Updates" turned off. If this happens to you, don't reboot the phone which is suppose to be the final step in the update process. Instead, follow the above instructions on taking an OTA update, but start in step 3. In other words, you shouldn't have to uninstall Magisk because the update has already been installed. All you need to do is install Magisk to the "second/inactive slot (After OTA)”. After completing that step, you can reboot your phone to complete the update process. Be sure to post your experiences in this thread to let us know if this process works or not.

    Just remember that many custom parts (like kernels and Magisk modules) may need to be updated to any new OTA version. Please be sure to check out the forums for each custom kernel or module that you may want to install to ensure it has been updated to the lastest OS version. Don't assume anything or you may find yourself in a bootloop.

    If you find yourself in a bootloop after upgrading an already rooted phone
    If you find yourself in a bootloop after updating to a new OS version and flashing the magisk_modified boot.img again, it is likely due to an installed Magisk module not being compatible with the new update. To uninstall all Magisk modules to fix the bootloop, follow these steps:

    Step 1 - Connect your phone to the computer you use ADB on.
    Step 2 - In ADB type the command "adb wait-for-device shell magisk --remove-modules"
    Step 3 - Start your phone again or wait for it to go through another bootloop cycle.
    Step 4 - as soon as ADB is available (which occurs even during a bootloop) the command will activate, the modules will be removed, and the phone will reboot.

    If the normal OTA method isn't working - sideload the OTA update
    Taking an OTA update should be as easy as the above instructions. However there is another option available to install an OTA update called sideloading. Sometimes the update doesn't appear on the phone in a timely manner and you may want to manually install the update. Other times the OTA update seems to fail for some reason. In the end, you may decide to sideload the OTA instead of trying get it via the update feature on the phone. Surprisingly, it's actually faster to install the update via sideloading than it will be to take the OTA normally. I'll walk through the sideloading steps.....

    Optional Step 1 - Uninstall Magisk (so that it restores the stock boot.img). If you find yourself unable to boot into recovery, you will have to restore the stock boot.img. I've run into this issue on a couple Android 10 images, but most do not require this step.
    Step 2 - Download to your computer the correct OTA image from here
    Step 3 - Connect to your phone via ADB on your computer. You should see the device listed if you type the command "adb devices".
    Step 4 - Boot your phone into recovery (type the command "adb reboot recovery").
    Step 5 - The phone will have a green android robot with a red sign over it's open access panel. Press the power button and then the volume up button while still holding down the power button.
    Step 6 - Select "Apply update from ADB" using the volume buttons to highlight the choice and the power button to select it to enter the sideload mode.
    Step 7 - Using your computer, type "adb sideload ota_file.zip" where ota_file.zip is the name of the OTA file you downloaded in step 2.
    Step 8 - Once the update finishes, reboot the phone to complete the update process. (See note below about initial boot times).
    Step 9 - To obtain root again, please use one of the two root methods listed above

    Please note, while the initial boot is usually pretty quick, it can take longer. I've occasionally seen the process take upwards of 20 minutes and longer. I think part of the reason it can take so long is that sometimes it optimizes the apps during this boot process. The more apps you have, the longer the process may take. When you take an regular OTA update, the phone will change to a screen where is specifically tells you it is optimizing the apps and counts up as the apps are optimized to give you status updates. When you use the side-load method, it all happens with just the regular boot animation running and without any status updates. Because of this, it is easy to assume something has gone wrong with the boot process while in fact the phone is working through the process normally. If it isn't boot looping (showing the initial power screen before moving back to the boot animation), everything is fine and you just need be patient and let the phone complete the process.

    My rant about using these "Pre-patched Boot image" files
    I started this thread during a period of time where there was a another thread on this forum started by pbanj that showed users how to root their phone by using some pre-patched boot image files. This method is not the generally accepted method and while it works, there are major shortcomings with it (see explanation below). Because it was the only root thread available at the time and he only showed the "pre-patched boot image" method, many people blindly followed his directions only to be confused when it came time to update the software on their phones. I wrote this thread in an effort to show people the official Magisk installation method. Pbanj has since updated his thread and it now includes the preferred method as well. With his edits, the two threads are sharing the same information now, although Pbanj thread still offers people the "pre-patched boot image" method (which I don't recommend people using).

    EDIT - Yet another thread pushing a pre-patched root method has been started. It suffers the same issues as listed below.

    Shortcomings with using the "pre-patched boot image" method.
    As I already mentioned, there is a huge shortcoming with using the "pre-patched boot image" method described in the other root thread. Because he provides a pre-patched boot.img file, you skip some normal installation steps. In the end you have the exact same patched file (which is why his method works), but you cripple the system when it comes to taking any future OTA. That's because the first step in taking an OTA update is having Magisk reflash the stock boot.img effectively uninstalling itself. This step fails if you used his pre-patched boot image method because you skip the step where Magisk creates the backup of the stock boot.img that it needs to uninstall itself.

    I already used the "pre-patched boot image" method to gain root. What can I do?
    First, let me clarify and say that there is nothing wrong with your phone or root privileges. Your phone will work exactly as expected and root and Magisk will work exactly as expected. That being said, in the near future you will want to update your phone to the latest Android update and this is where the "pre-patched boot image" method is much more cumbersome. The best option is to simply undo his root method and re-root using the method described above. To do this, flash the correct stock boot.img file to your boot partition and then follow the steps above to reinstall Magisk. Jbanj has confirmed this method will work. The other option is just wait until you need to take an update and then sideload the OTA update following the instructions above. This will remove root and you can then follow one of the two methods to obtain root as outlined in this thread.

    Notes
    - Please be sure you are on the latest adb and drivers which can be found here.
    - You do not need to keep the stock boot.img file (from step 2 of the Boot Image Patching method) on your phone after completing these steps. Magisk saves the stock boot.img backup at /root/data in a file with the name "stock_boot_XXXXXXXXXXXX.img.gz"

    Thanks to.......
    @ZVNexus for getting TWRP working on the 3a and 3a XL phones
    @topjohnwu for making Magisk what it is today
    4
    @Completely_Clueless you can apply OTA without wiping, you can also apply a new factory image without wiping, so all your data will be kept in that way. When updating to a new version, I always do it in the following way:
    - fastboot flash boot.img <unpatched_boot.img for your current version
    - fastboot reboot (now you are no longer rooted (!))
    - then I do apply the OTA (in parallel Iam downloading the new factory image and do extract the boot.img for that version)
    - after the OTA is applied and the device restarted the new version (you are still unrooted) I am transferring the new boot.img to the device
    - patch the new boot.img with MagiskManager
    - get the patched_boot.img
    - fastboot flash boot patched_boot.img
    - fastboot reboot
    and you are rooted again ..

    These are some (quite easy) steps but I never had problems in updating the phone yet.

    For having a backup solution, I started Android Backup and Restore Tools which gives me the chance to do a backup (and restore) even without having TWRP available and without the need to store data on the device twice (original and backup).
    4
    @sic0048 I've updated my thread
    3
    You know there are more ways to skin a cat, right? This is another method to acquire root. I don't think you need to bash the work that pbanj has done. He provides modified boot.img and also offers help on getting it working. I think acting like your method is the only acceptable way to gain root is extremely pompous and arrogant.

    Sent from my Pixel 3a using Tapatalk
    3
    Made it to step 7/8, went to reboot, and entered bootloop. Not sure exactly what happened, gonna fix this and give it another go.

    EDIT: Should I be flashing in fastboot or recovery mode?

    EDIT 2: Working! Thanks!

    I've edited the steps and added a few more going into greater detail to try and make it even clearer for users. Let me know if you have any suggestions.