OTA Update for Rooted/Bootloader Unlocked

Wdenton

Member
Sep 15, 2012
29
3
0
Hey all, just wanted to try and combine the bits and pieces of the "how to update OTA for rooted/BL unlocked" phones into one place as a quick run down for myself (and others who might have the same question) for the OTA:

  1. Grab OTA update manually
  2. Uninstall Edge Sense Mod from Magisk
  3. Plug in phone into PC
  4. adb reboot recovery
  5. adb fastboot flash "stock boot.img"
  6. adb sideload "OTA file name"
  7. Reboot to bootloader using the volume and power button
  8. adb fastboot flash "patched image to inactive slot (no idea how yet, sorry! Will add command)"
  9. Reboot phone
  10. Go back into Magisk and install manager for root
  11. Re-install Edge Sense Mod within Magisk
  12. *Optional*Re-apply Magisk Hide

Please let me know if there's any steps I'm missing or how it could be made easier for others to understand and if there's credit(s) missing (10+ hr shift and running on strong tea only 11 hr shift arguing with doctors to actually provide care instead of leeching insurance, and insurance to pay the damn medical claims instead of baton passing them to patients).

Disclaimer:
I'm no developer, just a common user that wants to make it a bit more convenient for other Pixel 3a owners to OTA update while rooted/BL unlocked. If it didn't work, or you encountered error(s), let me know and I can link them in so others can learn.

Disclaimer 2:
The above step(s) is assuming you've used pbanj's method for getting Magisk. Apparently I should add this as there's the "conventional" and "unconventional" method for Magisk. Had no idea since there was no guide available informing people otherwise at the time of making this step-by-step guide.

Credits:
pbanj for Pixel 3a root and Magisk images saving a MASSIVE some time, and its thread for the above steps.

googlephoneFKLenAsh for details of what I was missing in my initial steps.

sic0048 for making the root confusion apparent, and making a modified boot image method (the pbanj Magisk) here and his guide for rooting here.
 
Last edited:

googlephoneFKLenAsh

Senior Member
Jul 31, 2017
108
27
28
Hey all, just wanted to try and combine the bits and pieces of the "how to update OTA for rooted/BL unlocked" phones into one place as a quick run down for myself (and others who might have the same question) for the OTA:

  1. Grab OTA update manually
  2. Uninstall Edge Sense Mod from Magisk
  3. Plug in phone into PC
  4. adb reboot recovery
  5. adb sideload "OTA file name"
  6. Reboot to bootloader using the volume and power button
  7. fastboot flash "patched image"
  8. Reboot phone
  9. Go back into Magisk and install manager for root
  10. Re-install Edge Sense Mod within Magisk
  11. *Optional*Re-apply Magisk Hide

Please let me know if there's any steps I'm missing or how it could be made easier for others to understand and if there's credit(s) missing (10+ hr shift and running on strong tea only).

Disclaimer:
I'm no developer, just a common user that wants to make it a bit more convenient for other Pixel 3a owners to OTA update while rooted/BL unlocked.

Credits:
pbanj for Pixel 3a root and Magisk images saving a MASSIVE amount of time, and its thread for the above steps.
Before step 5, you need to fastboot flash stock boot.img before doing "adb sideload ota file".
 

alliance1975

Senior Member
Jan 2, 2014
280
109
43
Alliance College
I think step 7 should specify flashing patched image to inactive slot, (a or b), so as to be on the new active slot after a reboot, (step 8).

---------- Post added at 08:33 AM ---------- Previous post was at 08:28 AM ----------

Before step 5, you need to fastboot flash stock boot.img before doing "adb sideload ota file".
I followed the op procedure and it worked without flashing the stock boot image. To what slot would you flash the stock image, active slot or inactive slot? Can it be flashed to old slot after step 8 reboot? Would there be any benefit?
 

sic0048

Senior Member
Jun 25, 2010
910
465
83
I'm not sure why people insist that using the "modified" boot images make the update process faster or easier..... I assure you it does not.

Here is the update process if you install Magisk the normal way......
- Magisk: Click “Uninstall” → “restore images” → NO REBOOT
- Download and install OTA → NO REBOOT
- Clear all apps from recents (probably not even needed, but better to be safe than sorry).
- Magisk: Click “Install” → “Install to second/inactive slot (After OTA)”
- Reboot

That's all......... and it's all done from the phone. No computer or ADB is required for updates.

Tell me how that is harder than your method or how your method saves "a MASSIVE amount of time"?????

Look, I'll be the first to admit that using the modified boot images does make the initial root process easier and faster - by a few steps and about 2 minutes of time. But you will pay for it when it comes time to update your phone.
 
Last edited:

alliance1975

Senior Member
Jan 2, 2014
280
109
43
Alliance College
I'm not sure why people insist that using the "modified" boot images make the update process faster or easier..... I assure you it does not.

Here is the update process if you install Magisk the normal way......
- Magisk: Click “Uninstall” → “restore images” → NO REBOOT
- Download and install OTA → NO REBOOT
- Clear all apps from recents (probably not even needed, but better to be safe than sorry).
- Magisk: Click “Install” → “Install to second/inactive slot (After OTA)”
- Reboot

That's all......... and it's all done from the phone. No computer or ADB is required for updates.

Tell me how that is harder than your method or how your method saves "a MASSIVE amount of time"?????

Look, I'll be the first to admit that using the modified boot images does make the initial root process easier and faster - by a few steps and about 2 minutes of time. But you will pay for it when it comes time to update your phone.
Forgive me sic0048. You helped me in another post but I feared doing the initial step, magisk-uninstall-restore images. My reading of these forums indicates there is no stock image to restore since it was overwritten by the patched image during the initial root process. It is the transition from using patched images to doing a normal Magisk install that I lack knowledge of.
 

duh1

Senior Member
Feb 19, 2015
167
64
48
Forgive me sic0048. You helped me in another post but I feared doing the initial step, magisk-uninstall-restore images. My reading of these forums indicates there is no stock image to restore since it was overwritten by the patched image during the initial root process. It is the transition from using patched images to doing a normal Magisk install that I lack knowledge of.
Great point, difference between downloading a patched boot image vs patching yourself is not clear as to how it affects the OTA update...
 
Last edited:

sic0048

Senior Member
Jun 25, 2010
910
465
83
Forgive me sic0048. You helped me in another post but I feared doing the initial step, magisk-uninstall-restore images. My reading of these forums indicates there is no stock image to restore since it was overwritten by the patched image during the initial root process. It is the transition from using patched images to doing a normal Magisk install that I lack knowledge of.
I totally understand the confusion......

If you use normal Magisk installation method where you let Magisk modify the stock boot.img file, then the OTA update method that I described above should work. Because you let Magisk modify the stock boot image, it will be able to use the stock image in the first step - Magisk: Click “Uninstall” → “restore images” → NO REBOOT

If you used the "modified boot image" method, you were able to skip the step where you let Magisk modify the stock boot image. This saves time initially, but it comes back to bit you during an OTA update because Magisk is unable to use the stock image to uninstall itself. You are correct that the normal Magisk "How to Take an OTA Update" instructions will fail if you used the modified boot image to gain root initially.

I guess I didn't realize that you had used the "modified boot image" method. Here is my recommendation to all those that have used the modified boot image method - start over.........

- use the Magisk manager app to Uninstall Magisk using the "Complete Uninstall" method.
- Pull the stock boot.img from the applicable factory image (whatever OS version/update you are currently on). Downloads are available here https://developers.google.com/android/images
- Using your computer, flash the stock boot.img file by using the command "fastboot flash boot boot.img"
- Reinstall Magisk using the "normal" method....
- Put the stock boot.img file on your phone's root SD card location
- Use the Magisk manager app to modify the stock boot.img
- move the magisk_modified boot image to your computer
- flash the magisk_modified boot image to the boot partition using the command "fastboot flash boot <patched_boot.img file name>"
- reboot

Then follow the instructions I gave for the normal OTA update process listed a couple posts above.

---------- Post added at 02:25 PM ---------- Previous post was at 02:14 PM ----------

Unless I'm misunderstanding the process, seems like Magisk is missing a checkbox to backup the unpatched boot image prior to creating a patched image, for future OTA updates...
Magisk isn't missing this option, it's just that the method suggested by pbanj in this thread bypasses the normal method. It's not an issue with Magisk, it's an issue with the root method being suggested.

What I really need to do is create another "How to Root" thread and list the normal and recommended method. The confusion comes from people coming to this site and reading pbanj's thread and thinking that is the correct way to root. It is not the correct way to root.
 
Last edited:
  • Like
Reactions: Wdenton

duh1

Senior Member
Feb 19, 2015
167
64
48
I think step 7 should specify flashing patched image to inactive slot, (a or b), so as to be on the new active slot after a reboot, (step 8).

---------- Post added at 08:33 AM ----------
I followed the op procedure and it worked without flashing the stock boot image. To what slot would you flash the stock image, active slot or inactive slot? Can it be flashed to old slot after step 8 reboot? Would there be any benefit?
Normally you would flash the stock boot image to the active slot to unroot the phone prior to installing the OTA.

Confused as to why flashing stock boot is no longer necessary. If this works as stated, it would appear the OTA is no longer patching the phone's boot and system partitions as had been done in the past. So perhaps the OTA now installs full boot and system images?
 
Last edited:

sic0048

Senior Member
Jun 25, 2010
910
465
83
Normally you would flash the stock boot image to the active slot to unroot the phone prior to installing the OTA.

Confused as to why flashing stock boot is no longer necessary. If this works as stated, it would appear the OTA is no longer patching the phone's boot and system partitions as had been done in the past. So perhaps the OTA now installs full boot and system images.

If that is indeed the case we should be able to just install the OTA normally through the system update button without having to uninstall Magisk and get rid of root first. Then as the Magisk tutorial states cancel the reboot go into the Magisk manager and reroot. Has anyone tried this on a rooted phone?
I had read, but have not confirmed myself, that the OTA images did include the boot and system img. However I just checked and the factory image for the June update on Bonito is 1.6gb while the "full OTA" image is only 1.1gb. So the two images are not identical. It's not like you saving a bunch of time by not uninstalling Magisk first and I don't think I would skip this simple step with the hope it would work. I'll continue to follow the recommended procedure that the Magisk developer has come up with and I would recommend to others that they do the same.
 

duh1

Senior Member
Feb 19, 2015
167
64
48
I had read, but have not confirmed myself, that the OTA images did include the boot and system img. However I just checked and the factory image for the June update on Bonito is 1.6gb while the "full OTA" image is only 1.1gb. So the two images are not identical. It's not like you saving a bunch of time by not uninstalling Magisk first and I don't think I would skip this simple step with the hope it would work. I'll continue to follow the recommended procedure that the Magisk developer has come up with and I would recommend to others that they do the same.
It's smaller as the OTA only contains the partitions that have changed such as system and boot. The other partitions are probably cloned over from the active slot to the inactive slot.

As I mentioned previously, the Magisk tutorial does not account for not having a backup of the stock boot image when you download the patched boot, so to remove boot prior to installing the OTA, you must manually flash the stock boot.
 
Last edited:

googlephoneFKLenAsh

Senior Member
Jul 31, 2017
108
27
28
Before step 5, you need to fastboot flash stock boot.img before doing "adb sideload ota file".
I think step 7 should specify flashing patched image to inactive slot, (a or b), so as to be on the new active slot after a reboot, (step 8).

---------- Post added at 08:33 AM ---------- Previous post was at 08:28 AM ----------



I followed the op procedure and it worked without flashing the stock boot image. To what slot would you flash the stock image, active slot or inactive slot? Can it be flashed to old slot after step 8 reboot? Would there be any benefit?
Before step 5, flash stock boot.img to slot a (or just use getvar to get the current active slot. It should be slot a before first ota). If you don't flash stock boot img, you will get error message "E: Failed to verify package compatibility".
I think you didn't get this message because you actually restored stock boot.img when you uninstalled magisk. For those who rooted their phone by flashing patched boot.img, magisk doesn't know the location of stock boot.img.
Then in step 7, flash patched boot.img to slot b (after ota, the active changes to slot b. If there is new ota in the future, just use getvar to find out the active slot)
 
  • Like
Reactions: Wdenton

Wdenton

Member
Sep 15, 2012
29
3
0
I'm not sure why people insist that using the "modified" boot images make the update process faster or easier..... I assure you it does not.

Here is the update process if you install Magisk the normal way......
- Magisk: Click “Uninstall” → “restore images” → NO REBOOT
- Download and install OTA → NO REBOOT
- Clear all apps from recents (probably not even needed, but better to be safe than sorry).
- Magisk: Click “Install” → “Install to second/inactive slot (After OTA)”
- Reboot

That's all......... and it's all done from the phone. No computer or ADB is required for updates.

Tell me how that is harder than your method or how your method saves "a MASSIVE amount of time"?????

Look, I'll be the first to admit that using the modified boot images does make the initial root process easier and faster - by a few steps and about 2 minutes of time. But you will pay for it when it comes time to update your phone.
I totally understand the confusion......

If you use normal Magisk installation method where you let Magisk modify the stock boot.img file, then the OTA update method that I described above should work. Because you let Magisk modify the stock boot image, it will be able to use the stock image in the first step - Magisk: Click “Uninstall” → “restore images” → NO REBOOT

If you used the "modified boot image" method, you were able to skip the step where you let Magisk modify the stock boot image. This saves time initially, but it comes back to bit you during an OTA update because Magisk is unable to use the stock image to uninstall itself. You are correct that the normal Magisk "How to Take an OTA Update" instructions will fail if you used the modified boot image to gain root initially.

I guess I didn't realize that you had used the "modified boot image" method. Here is my recommendation to all those that have used the modified boot image method - start over.........

- use the Magisk manager app to Uninstall Magisk using the "Complete Uninstall" method.
- Pull the stock boot.img from the applicable factory image (whatever OS version/update you are currently on). Downloads are available here https://developers.google.com/android/images
- Using your computer, flash the stock boot.img file by using the command "fastboot flash boot boot.img"
- Reinstall Magisk using the "normal" method....
- Put the stock boot.img file on your phone's root SD card location
- Use the Magisk manager app to modify the stock boot.img
- move the magisk_modified boot image to your computer
- flash the magisk_modified boot image to the boot partition using the command "fastboot flash boot <patched_boot.img file name>"
- reboot

Then follow the instructions I gave for the normal OTA update process listed a couple posts above.

---------- Post added at 02:25 PM ---------- Previous post was at 02:14 PM ----------



Magisk isn't missing this option, it's just that the method suggested by pbanj in this thread bypasses the normal method. It's not an issue with Magisk, it's an issue with the root method being suggested.

What I really need to do is create another "How to Root" thread and list the normal and recommended method. The confusion comes from people coming to this site and reading pbanj's thread and thinking that is the correct way to root. It is not the correct way to root.
Before step 5, flash stock boot.img to slot a (or just use getvar to get the current active slot. It should be slot a before first ota). If you don't flash stock boot img, you will get error message "E: Failed to verify package compatibility".
I think you didn't get this message because you actually restored stock boot.img when you uninstalled magisk. For those who rooted their phone by flashing patched boot.img, magisk doesn't know the location of stock boot.img.
Then in step 7, flash patched boot.img to slot b (after ota, the active changes to slot b. If there is new ota in the future, just use getvar to find out the active slot)
Before step 5, you need to fastboot flash stock boot.img before doing "adb sideload ota file".
Thanks to all, was not expecting this much reply in this short amount of time, at all.

I made this step by step guide because no dedicated thread really was readily accessible in one place. Hopefully this inspires others to make guides.
 
Last edited:

duh1

Senior Member
Feb 19, 2015
167
64
48
Before step 5, flash stock boot.img to slot a (or just use getvar to get the current active slot. It should be slot a before first ota). If you don't flash stock boot img, you will get error message "E: Failed to verify package compatibility".
I think you didn't get this message because you actually restored stock boot.img when you uninstalled magisk. For those who rooted their phone by flashing patched boot.img, magisk doesn't know the location of stock boot.img.
How else could the phone have been rooted besides flashing a patched boot image on a device without a custom recovery, such that Magisk on his device knows where to find the stock boot image?
 

googlephoneFKLenAsh

Senior Member
Jul 31, 2017
108
27
28
How else could the phone have been rooted besides flashing a patched boot image on a device without a custom recovery, such that Magisk on his device knows where to find the stock boot image?
Learn how to read a few posts in this thread.

Root method 1: install magisk, patch the stock boot image, then flash the patched boot image to gain root. Magisk knows where the stock boot image is. In this case, just follow the instructions to take ota: uninstall magisk to restore stock boot image and take ota, then reroot.

Root method 2: flash patched boot image provided by someone in the forum, then install magisk to get root. In this case Magisk doesn't have a backuped stock boot image. So the regular instructions of uninstalling Magisk to restore stock boot image doesn't work and you need to manually flash stock boot image to take ota.
 

duh1

Senior Member
Feb 19, 2015
167
64
48
Learn how to read a few posts in this thread.

Root method 1: install magisk, patch the stock boot image, then flash the patched boot image to gain root. Magisk knows where the stock boot image is. In this case, just follow the instructions to take ota: uninstall magisk to restore stock boot image and take ota, then reroot.

Root method 2: flash patched boot image provided by someone in the forum, then install magisk to get root. In this case Magisk doesn't have a backuped stock boot image. So the regular instructions of uninstalling Magisk to restore stock boot image doesn't work and you need to manually flash stock boot image to take ota.
Difference is downloading the patched image vs patching it yourself. Wasn't clear how that created the issue. Well written, thx for pointing it out.

So if anyone patches the new version boot image before uninstalling Magisk, they'll get an error. Likewise, patching the current boot image in the manager will allow the uninstall to work correctly...
 
Last edited:

pbanj

Senior Member
Dec 22, 2011
953
445
63
Learn how to read a few posts in this thread.

Root method 1: install magisk, patch the stock boot image, then flash the patched boot image to gain root. Magisk knows where the stock boot image is. In this case, just follow the instructions to take ota: uninstall magisk to restore stock boot image and take ota, then reroot.

Root method 2: flash patched boot image provided by someone in the forum, then install magisk to get root. In this case Magisk doesn't have a backuped stock boot image. So the regular instructions of uninstalling Magisk to restore stock boot image doesn't work and you need to manually flash stock boot image to take ota.
you dont need to restore stock to update. the restore is only needed if you want the phone to handle the update. if you sideload the ota in adb it updates fine then you can just flash the new patched boot image. also fun little fact, even if you use the pre-patched images you can still use magisk's internal update method. you just have to do one simple thing....... grab the stock boot.img for your current update, and tell magisk to patch it, it will create the stock backup and then you can just use the magisk update method. i've been meaning to add that to my thread but i've been busy and having some health problems so i haven't been on here in a few days.
 
  • Like
Reactions: 12paq

ritchea

Senior Member
Sep 6, 2011
830
172
43
okeechobee
you dont need to restore stock to update. the restore is only needed if you want the phone to handle the update. if you sideload the ota in adb it updates fine then you can just flash the new patched boot image. also fun little fact, even if you use the pre-patched images you can still use magisk's internal update method. you just have to do one simple thing....... grab the stock boot.img for your current update, and tell magisk to patch it, it will create the stock backup and then you can just use the magisk update method. i've been meaning to add that to my thread but i've been busy and having some health problems so i haven't been on here in a few days.
Sorry for the health issues. Take care and get well soon.
Thank you for this post. I was getting confused about the ADB sideload of OTA (which, iirc, didn't work on unlocked BL on my last phone), which you said does work on the 3a. My last phone was the N5X and despite Magisk being available, I stayed with SuperSu (which worked for me as well as suhide and FlashFire). The dual slot is new to me; I think my MOTO Z3 Play has that (I'm not unlocking that one atm) so it really doesn't matter.

If I fastboot flashed the patched boot.img to slot_b, then the next time I flash any boot.img, I will have to direct it to slot_a [fastboot flash boot_a boot.img]? I guess I'll learn as I go along. Next, I'll take current stock boot.img and tell magisk to patch it.
 

pbanj

Senior Member
Dec 22, 2011
953
445
63
Sorry for the health issues. Take care and get well soon.
Thank you for this post. I was getting confused about the ADB sideload of OTA (which, iirc, didn't work on unlocked BL on my last phone), which you said does work on the 3a. My last phone was the N5X and despite Magisk being available, I stayed with SuperSu (which worked for me as well as suhide and FlashFire). The dual slot is new to me; I think my MOTO Z3 Play has that (I'm not unlocking that one atm) so it really doesn't matter.

If I fastboot flashed the patched boot.img to slot_b, then the next time I flash any boot.img, I will have to direct it to slot_a [fastboot flash boot_a boot.img]? I guess I'll learn as I go along. Next, I'll take current stock boot.img and tell magisk to patch it.
ya pretty much. every time the phone updates the active slot changes. I'm currently updating my root thread so everything is clearer and in one place.
 
  • Like
Reactions: Wdenton

duh1

Senior Member
Feb 19, 2015
167
64
48
you dont need to restore stock to update. the restore is only needed if you want the phone to handle the update. if you sideload the ota in adb it updates fine then you can just flash the new patched boot image. also fun little fact, even if you use the pre-patched images you can still use magisk's internal update method. you just have to do one simple thing....... grab the stock boot.img for your current update, and tell magisk to patch it, it will create the stock backup and then you can just use the magisk update method. i've been meaning to add that to my thread but i've been busy and having some health problems so i haven't been on here in a few days.
Just to be sure, sideloading bypasses the OTA package compatibility verification that would give an error during normal update if it detects wrong boot version?
 

pbanj

Senior Member
Dec 22, 2011
953
445
63
Just to be sure, sideloading bypasses the OTA package compatibility verification that would give an error during normal update if it detects wrong boot version?
correct. i had no issue with it, and i friend is the one who told me about it as that's how she installs her updates even though she could use the magisk method