Install OTA Updates on Rooted Android Devices with Magisk

by | 27 Jun 2020

Trying to install OTA updates on rooted Android and failing? In this guide, we will tell you how you can install OTA updates on rooted Android devices using the Magisk Framework. Installing OTA updates is one of the cons of rooting Android but it is not the case anymore. With this method, you would be able to preserve root and TWRP recovery even after the OTA update is installed on your device.

Why does OTA Update Fail on Rooted Android?

Rooting Android devices gives the user full control. ‘Root’ is sort of like an “administrator” account on Windows operating systems. With root privileges, there is no limit to how you can customize and modify your Android device. But do keep in mind that rooting does come with a few drawbacks and installing OTA updates is one among them. When someone new to the Android rooting scene roots their device, they are not aware of the fact that there are some downsides to rooting Android.

Starting with Android 5.0 Lollipop, Google introduced a few additional checks on the Android system before OTA updates can be installed on an Android device. This new security mechanism, which is part of the block-based OTA method, checks the device partitions such as system, boot, vendor, etc before installing the OTA update to make sure that they are not tampered with. When you root an Android device, you actually modify a few things in some or all of the above-said partitions. And that is why installing OTA update on rooted Android devices fails.

Steps to Install OTA Updates on Rooted Android Devices

Magisk is the most popular and go-to Android rooting solution which comes in the form of an Android flashable zip file. We can simply flash the Magisk flashable zip file via TWRP recovery to root an Android device. It is completely open-source and is also actively developed by the XDA Senior developer topjohnwu. Magisk came into existence in the year 2016 as an alternative way to root Android devices.

One of the best things about rooting your device with Magisk is that you will be able to install OTA updates on rooted Android devices without losing root. Most of the modern Android devices (post-2018) come with the A/B partition scheme which enables seamless OTA updates. Simply put, in the A/B Partition, there are two ‘/system’ partitions. And when you root Android using Magisk, it is only installed to the currently active slot of your Android device. And hence, the other inactive partition stays untouched.

That’s enough of explanation and let us jump right into the guide now:

Step 1: Disable Automatic OTA Updates

Follow the steps below to disable Automatic System Updates in Android:

  1. Go to the Settings.
  2. Look for and select the About phone menu.
  3. Scroll down to the bottom and find the Build number section. Note: Please note that this setting can be buried even further in some Android devices. For example, in Samsung Galaxy devices, you should check here: Settings > About phone > Software information.
  4. Next, continuously tap on the ‘Build number’ section until you see some sort of toast message like ‘You are now a developer’. Developer options’ is now enabled.Install-OTA-Update-Rooted-Android-1
  5. After that, go to Settings > System > Developer options.
  6. Scroll down and turn off the Automatic system updates toggle.

Step 2: Restore Stock Boot Image

Next up, you need to restore stock boot images on your Android device. It is fairly simple – follow the below steps:

  1. Open the Magisk Manager’ app.
  2. Tap on the UNINSTALL button.Install-OTA-Update-Rooted-Android-4
  3. Select the RESTORE IMAGES option.
  4. Wait until you see the “Restoration done!” message on the screen.

DO NOT REBOOT YOUR DEVICE AFTER THIS STEP; DOING SO WILL REMOVE MAGISK FROM YOUR PHONE. Go to the next step.

Step 3: Install the OTA Update 

Now you have stock boot image restored, you are good to install the OTA update on your rooted Android device.

  1. Go to the device Settings > System > System update
  2. Tap on the ‘Download and Install’ button.Install-OTA-Update-Rooted-Android-5

Wait for the installation process to complete.

DO NOT REBOOT YOUR DEVICE AFTER THIS STEP; DOING SO WILL REMOVE MAGISK FROM YOUR PHONE. Go to the next step.

Step 4: Retain TWRP Recovery after OTA Installation [Optional]

This step is completely optional and only needs to be followed if you have rooted your Android device by flashing Magisk zip via TWRP recovery. In such a case, TWRP will be removed after you install the OTA update using the instructions below. In order to preserve TWRP after updating, download and install the ‘TWRP A/B Retention Script‘. Didn’t install via TWRP? No problem; move along to the next step!

For this, you will need to download and install “TWRP A/B Retention Script” (by XDA Recognized Developer osm0sis) from within Magisk Manager. To do so, follow the steps below:

  1. Open the ‘Magisk Manager‘ app.
  2. Tap on the menu on the top-left corner.
  3. Select Downloads’.
  4. Next, search for ‘TWRP A/B Retention Script‘.
  5. Tap on the download icon and select the Install option.

The Magisk Module (which is a small script, in this case) will now be installed on your phone. On to the next step!

Step 5: Preserve Magisk Root after OTA Installation

The last step to install Magisk to the other inactive slot. This is to make sure that you still have root even after you reboot your device after installing the OTA update.

  1. Open Magisk Manager.
  2. Tap on the INSTALL button and then again select the ‘INSTALL‘ option.
  3. Select ‘Install to Inactive Slot (After OTA)‘ when prompted to choose the installation method.
  4. Next, tap on ‘YES‘ to confirm.

Magisk will now be installed on the inactive slot. Once the installation completes, tap on the ‘Reboot‘ button. Magisk Manager will reboot your Android device to the inactive slot where the OTA update was installed.

Phew, that was a lengthy process and it is finally over. Now you should have root with Magisk on your Android device even after installing the OTA update.

Questions? That’s why we have the comments section. Hit me up!

1 thought on “Install OTA Updates on Rooted Android Devices with Magisk”

Leave a Comment