Jump to content

OTA Update fails after using Magisk Root


Recommended Posts

A few days ago, I flashed a patched boot image to boot_a.

I used the image from here and patched it with the Magisk app.

It worked wonderfully, I had root and the phone would pass safety net checks.

After flashing the patched boot image, I backed up boot_b.
Today I got the OTA notification and switched to slot b using fastboot --set-active=b and then rebooted and tried installing the OTA, I got the following error message:

Install fail
Reason: 20

image.thumb.png.659dc7079818441b06a49268408afab8.png

Magisk is not active on slot b, so why can't I install the update?

image.thumb.png.1724cfe20e0d2803158cbfad89ac4880.png

  • Like 1
Link to post
Share on other sites

Magisk does not modify any system files, but adaway modifies a hosts file, so the integrity checks fail.

At least that's how I understand it.

I'll be restoring the factory rom and then installing the OTA updates to slot a.

Link to post
Share on other sites
1 hour ago, elvissteinjr said:

From what I've read, for AdAway to work nicely you just need to enable "systemless hosts" in Magisk Manager and not change the target hosts file.

Yeah, I definitely need to do that next time.

edit: I messed up and had to do a factory reset.

Edited by d
  • Like 1
Link to post
Share on other sites
On 12/11/2019 at 4:05 AM, Craig said:

I just gave adaway a try with the systemless hosts magisk module installed, hopefully I can still get OTAs.  Will let you know shortly..

I tried it today without luck. Followed the instructions here: https://github.com/topjohnwu/Magisk/blob/master/docs/tutorials.md

(really just uninstall in Magisk, then try to install the OTA.)

Same error as above. 😞

Link to post
Share on other sites
3 minutes ago, zurvan2 said:

I tried it today without luck. Followed the instructions here: https://github.com/topjohnwu/Magisk/blob/master/docs/tutorials.md

(really just uninstall in Magisk, then try to install the OTA.)

Same error as above. 😞

Are you saying that even after uninstalling Magisk completely, you couldn't get the OTA to install?  Did you reboot the phone after uninstalling Magisk?

Link to post
Share on other sites
39 minutes ago, david said:

Are you saying that even after uninstalling Magisk completely, you couldn't get the OTA to install?  Did you reboot the phone after uninstalling Magisk?

No, because the instructions say *not* to reboot the phone. If you're going to flash using fastboot, you may as well just flash the new version rather than doing an OTA, I guess. (although flashable versions of updates are always hard to find)

  • Like 1
Link to post
Share on other sites
40 minutes ago, zurvan2 said:

No, because the instructions say *not* to reboot the phone. If you're going to flash using fastboot, you may as well just flash the new version rather than doing an OTA, I guess. (although flashable versions of updates are always hard to find)

I wasn't suggesting flashing using fastboot.  I just meant rebooting so that Magisk is completely gone from memory and the phone is in its normal pre-Magisk state.  

Regarding flashing with fastboot, I may have missed it, but I don't think they have made the firmware available as a flashable form, except the original firmware that the earliest phones shipped with.

  • Like 1
Link to post
Share on other sites

The only thing you need to flash is the modified boot.img, and boot.img has probably not changed in the updates since the zip we were provided.  If/when an update changes that, I guess we'll need another root solution or another flashall from fxtec, or maybe it won't matter anyway and we can keep using the old boot.img regardless.

Edited by Craig
  • Like 1
Link to post
Share on other sites
On 12/12/2019 at 4:00 PM, david said:

I wasn't suggesting flashing using fastboot.  I just meant rebooting so that Magisk is completely gone from memory and the phone is in its normal pre-Magisk state.  

This *did* work in a later test with no other changes.

Link to post
Share on other sites
  1. Fully restore to stock. erase user data. (basically, should be the same as starting with a fresh phone)
  2. flash magisk (I used the image provided on the thread about magisk) fastboot flash boot magisk_patched.img
  3. boot to android
  4. install magisk manager
  5. verify root works
  6. reboot to bootloader, flash default boot.img: fastboot flash boot boot.img
  7. reboot to android
  8. apply OTA update

So root alone isn't enough to prevent the OTA, or is at least reversible.
When I extend step 5 to "restore everything" then the OTA doesn't work in step 8. There must be something I'm using that's modifying something that I'm not aware of. I'll keep trying to narrow this down, but it's probably just something modifying /system, which obviously could prevent the OTA from working.

  • Thanks 2
Link to post
Share on other sites

Thanks for those steps.  I am also wondering if A/B partitioning is coming into play at all here and creating variability in your testing, depending on the state of each partition and which partition you are on when you try the OTA.

Link to post
Share on other sites

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.

 

  • Thanks 1
Link to post
Share on other sites
12 minutes ago, 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.

 

Thanks for the information.  And you re-flashed the system partition like this?

fastboot flash system_a system.img
fastboot flash system_b system.img

 

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