Jump to content
d

OTA Update fails after using Magisk Root

Recommended Posts

This stuff makes me wonder if there's not a way to have the system partition read-only except the files which are layered by Magisk, even for applications using root access.
Though I guess it's not terrible as it is right now as long as userdata stays untouched when restoring.

Share this post


Link to post
Share on other sites
On 12/14/2019 at 9:26 PM, zurvan2 said:

Something I did managed to modify the system partition despite my being careful not to. This resulted in the OTA not being able to be applied, even after returning the boot partition to stock.

I *was* able to apply the OTA in this state by applying the *just* the system image in addition. This let me apply the OTA.

I was then able to re-root using this patched magisk and had root before/after applying the OTA update.

Be forewarned that there are *multiple* OTA updates, and they will be applied in order, so make sure you check for new updates before re-rooting.

 

Would you be so kind as to explain a bit more (with commands) your process? You seem to describe the very same problems I am facing, and found a solution.

Share this post


Link to post
Share on other sites

Each partition has an image that can be applied to reset that partition to what it "should" be. Most of the partitions then cannot be modified and have OTA updates work... any modifications would make the OTA fail checks that ensure that the update is safe to apply. This is actually valuable, because the updates are not complete images, they are like a recipe to take the existing data on the partition and write new bits in specific locations. If the existing partition doesn't match the expected image, that could write complete garbage over whatever is actually there.

There are a couple partitions that can be changed, notably the userdata partition, where all your stuff is normally written. If you look at the "return to stock" thread, you'll find a script that has 18 unique images, most of which get applied to 2 partitions each so android can perform online updates. One of these images is "system.img" and the partitions it goes on are system_a and system_b.

So, steps:

0. Make sure you have a good backup of your stuff. (Google actually does a surprisingly good job at this nowadays, at least for stuff from the play store)

1. Find the system.img that goes with your current system version. I have no idea where you can find this for recent updates. When I did this, I returned to the original stock image, before any OTAs, but that only worked because that was what the rest of my system was at. You must have the right version of this image for your phone to have the OTA work, and using the wrong image could prevent the phone from booting.

2. get your phone into bootloader mode and connected to your computer. You can either do this by turning the phone off, and then turning it on while holding volume up, *or* connect it while running normally and run "adb reboot bootloader". You can verify that the device is connected properly by running "fastboot devices". Your device should be listed.

3. run "fastboot flash system_a system.img" and "fastboot flash system_b system.img"  You only actually need one of these, but I have no idea how to figure out which one is currently in use.

Standard disclaimers apply... if everything breaks, you can always return to stock, but only by wiping userdata, as far as I know.

  • Thanks 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

Terms