FORUMS
Remove All Ads from XDA

[Guide] Update and Retain Root

1,782 posts
Thanks Meter: 2,671
 
By eg1122, Senior Member on 15th November 2019, 07:35 PM
Post Reply Email Thread
When phone detects update

1. Disable any desired Magisk modules, ex. Edxposed (I usually disable all modules just to be safe)
2. Reboot
3. In Magisk, select Uninstall, press Restore Images
4. Do NOT Reboot
5. Install OTA Update via Settings -> System -> System Updates
6. When prompted to reboot, Do NOT Reboot
7. In Magisk Manager press Install
8. Select Install to Inactive Slot
9. Reboot
10. Enable the Magisk modules one by one

In case of bootloop after enabling a module there are 2 ways that I know of on how to retain root and fix bootloop.

One requires ADB

While phone is stuck in bootloop, connect phone to PC and run this commands via ADB.

adb wait-for-device shell magisk --remove-modules
adb reboot

This will remove all modules and you should be able to boot.

The second way is via fastboot. More information in this thread.

https://forum.xda-developers.com/pix...agisk-t3990557

Some information that might help some people.

Quote:
Originally Posted by eg1122

I know some users flash patched boot.img that someone else patched, thus bypassing the creation of a backup. I think choosing or not choosing to preserve avb 2.0/dm-verity also affects if phone will take OTA. I always preserve mine and always patch my own boot.img so I haven't ran into any issues. I'll just have to wait and see what happens on my end once I get the update. This reminds me of some issues some people where getting early on when rooting. Some people had to flash the patched boot.img to both a/b slots and some people didn't. Having both slots with a patched boot will also break the restoring of stock boot.img as Magisk only restores the active slot.

The Following 10 Users Say Thank You to eg1122 For This Useful Post: [ View ] Gift eg1122 Ad-Free
15th November 2019, 08:51 PM |#2  
Senior Member
Flag Colton, NY
Thanks Meter: 1,384
 
More
If you do it this way you'll be using the patched boot image from the previous update and not the current one.
15th November 2019, 09:04 PM |#3  
eg1122's Avatar
OP Senior Member
Flag Roma, Tx
Thanks Meter: 2,671
 
Donate to Me
More
Quote:
Originally Posted by airmaxx23

If you do it this way you'll be using the patched boot image from the previous update and not the current one.

No it doesn't. When you select install to inactive slot it patches the newly installed boot.img that has been installed to the inactive slot. Only reason phone promts you to reboot after an update is to switch slots.
15th November 2019, 10:06 PM |#4  
Member
Thanks Meter: 36
 
More
For whatever reason, whenever I would try to do Uninstall - Restore images (in step 3 of the OP), I would get a toast error saying "Stock backup does not exist"
I'm not sure why the expected backup files hadn't been created. I suspect it has to do with the process of manually patching the boot image whilst initially rooting, as suggested in this Git issue.
Anyway, I was ultimately able to work around this, and was eventually able to get Uninstall - Restore images to work.
I wrote about my workaround method here.
The Following 3 Users Say Thank You to pdfruth For This Useful Post: [ View ] Gift pdfruth Ad-Free
15th November 2019, 11:37 PM |#5  
eg1122's Avatar
OP Senior Member
Flag Roma, Tx
Thanks Meter: 2,671
 
Donate to Me
More
Quote:
Originally Posted by pdfruth

For whatever reason, whenever I would try to do Uninstall - Restore images (in step 3 of the OP), I would get a toast error saying "Stock backup does not exist"
I'm not sure why the expected backup files hadn't been created. I suspect it has to do with the process of manually patching the boot image whilst initially rooting, as suggested in this Git issue.
Anyway, I was ultimately able to work around this, and was eventually able to get Uninstall - Restore images to work.
I wrote about my workaround method here.

Yeah, there needs to be a backed up stock boot img for this to work. Being able to restore images the way stated in the issue would solve this as you could just restore a stock boot.img then continue doing the steps.
18th November 2019, 09:04 AM |#6  
Member
Thanks Meter: 3
 
More
So does this work for every update? Just do the steps and it works? Im a complete noob when it comes to this stuff i just follow the write ups and pray!
18th November 2019, 03:35 PM |#7  
eg1122's Avatar
OP Senior Member
Flag Roma, Tx
Thanks Meter: 2,671
 
Donate to Me
More
Quote:
Originally Posted by DemonicMurderer

So does this work for every update? Just do the steps and it works? Im a complete noob when it comes to this stuff i just follow the write ups and pray!

Yes, it has worked for me all the time. These are the exact steps recommended by topjohnwu, I just made them more readibly available to users. Here is a link to his tutorial.

https://topjohnwu.github.io/Magisk/t...a-installation
The Following User Says Thank You to eg1122 For This Useful Post: [ View ] Gift eg1122 Ad-Free
30th November 2019, 11:30 PM |#8  
Senior Member
Thanks Meter: 13
 
More
This work for the Verizon Pixel 4 XL???
1st December 2019, 02:59 AM |#9  
Badger50's Avatar
Recognized Contributor
Flag Kansas City
Thanks Meter: 6,588
 
More
Quote:
Originally Posted by SAMCR02018

This work for the Verizon Pixel 4 XL???

Why would you need to since your not rooted with a locked bootloader? Just take the OTA.
1st December 2019, 03:19 AM |#10  
Senior Member
Thanks Meter: 13
 
More
Quote:
Originally Posted by Badger50

Why would you need to since your not rooted with a locked bootloader? Just take the OTA.

Ok the can the Verizon version get the BL unlocked?
1st December 2019, 03:29 AM |#11  
Badger50's Avatar
Recognized Contributor
Flag Kansas City
Thanks Meter: 6,588
 
More
Quote:
Originally Posted by SAMCR02018

Ok the can the Verizon version get the BL unlocked?

Nope. Unless you got lucky and they sold you a google version by mistake.
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes