- How to Install OTA Updates on Rooted Android Devices using Magisk [Without Losing Root]
- What is an OTA Update?
- Why You Can’t Install OTA Updates on Rooted Android Devices Automatically?
- Magisk Root, A/B Partitions, and OTA Updates
- How to Install OTA Updates on Rooted Android Devices?
- Step 1: Disable Automatic System Updates in Settings
- Step 2: Restore Stock Boot Image When an OTA is Available
- Step 3: Install the OTA Update on your Rooted Android Device
- Step 4 [Optional]: Retain TWRP Recovery after OTA Installation
- Step 5: Preserve Magisk Root after OTA Installation
- How to Install OTA Updates Manually using Recovery and ADB sideload
- Method 1: Install OTA update from recovery “Apply ZIP”
- Method 2: Install OTA update via ADB Sideload
How to Install OTA Updates on Rooted Android Devices using Magisk [Without Losing Root]
An OTA update has arrived, but you cannot install it because your Android device is rooted? Well, that’s a known downside of rooting Android. In this guide, you will learn how to install OTA updates on rooted Android devices using Magisk. By using the method provided in this guide, you will also be able to retain root and TWRP after installing the OTA update. Before we get any further, let us take a quick look at what OTA updates are and how they work.
What is an OTA Update?
An OTA Update a.k.a an Over-the-Air Update is a wireless method of receiving and installing updates to an Android device’s software.
It is remotely pushed by the device manufacturer (Also known as the ‘OEM’) and is the easiest and most effective way to update an Android device’s software to the latest available version. Once an OTA update arrives, it is either automatically installed or prompts the user to manually download and install it.
So, how does one install an OTA update on a rooted Android device? You will know more about it in the next section. Read ahead.
Why You Can’t Install OTA Updates on Rooted Android Devices Automatically?
Rooting an Android device is great, it gives the user tremendous control over the device’s software and allows making any sort of modifications to it. However, it comes with its own drawbacks. The biggest one is losing the ability to take automatic OTA (over-the-air) updates. And users (Generally who are new to the scene) often tend to overlook this factor when they root their Android device.
In Android 5.0 and above, Google introduced the concept of block-based OTAs. This new mechanism does certain pre-OTA block checks to verify the integrity of the device’s software. In layman terms, once the installation begins, the device partitions (like system, boot, vendor, dtbo, etc) are checked for modifications like Root, TWRP, etc. And if detected, the OTA update will fail to install.
Magisk Root, A/B Partitions, and OTA Updates
But thanks to Magisk, you can easily install OTA updates on rooted Android devices without losing root. For those who don’t know, Magisk is a Universal Systemless Interface that allows you to make modifications to your Android device’s software systemless-ly, that is, without altering the /system partition.
Not just that, it has also developed to be the most prominent modern-day rooting solution for Android using MagiskSU. Want to know more about how it came into existence? Then there’s no better way but to hear out the story directly from its creator – topjohnwu.
The developer devised two different methods to install Magisk and root Android devices:
- The first method follows the traditional process of installing a custom recovery (TWRP, OrangeFox, etc) and then using it to flash the Magisk installer zip (root package). But since you will install a custom recovery during this method, it makes it even harder to take OTA updates. So, to regain the ability to take automatic OTA updates or install them manually, you would require to first uninstall/remove root and other modifications applied to the software. And further, restore the stock Android recovery on your device.
- The second method was introduced when Google first released the Google Pixel devices in 2016. These devices came with dual A/B partition system to support seamless updates and removed the recovery partition from the devices completely. So, the first method failed rigorously. This new method involves patching the stock boot image using Magisk and then flashing the patched boot image via Fastboot.
The best part about rooting your Android device with Magisk is that it gives you the ability to install OTA updates easily. So, follow the instructions below on how to do it.
Note: If you’re upgrading from Android 10 to Android 11, make sure that you update to Magisk 21.0 or the latest Magisk Canary release. v20.4 and lower do not support Android 11.
How to Install OTA Updates on Rooted Android Devices?
Now, since most new OEM Android devices come with the A/B partition scheme, OTA updates are seamlessly installed to the inactive slot. When you root using Magisk, it is only installed to the currently active slot of your Android device. And thus, the inactive slot/partitions stay untouched.
When an OTA arrives, you can simply restore the stock boot image from within Magisk Manager, then install the OTA update to the inactive slot. And finally, right before you reboot your phone, you can install Magisk to the inactive slot to preserve root after the update.
Still, sounds a bit confusing? Don’t worry, the instructions below will take you through the complete process in detail. For your convenience, we have split the instructions into 5 different steps so that you can understand exactly what you’re doing.
Step 1: Disable Automatic System Updates in Settings
In Android 8.0 Oreo (and above), Google introduced a new automatic updates policy that downloads and installs OTA updates as soon as they are available.
Although this is great for an average Android user, but not for those who have rooted their devices. In order to update your rooted Android phone, you must first prevent the system from automatically installing updates without your acknowledgment.
Simply follow the steps below to disable Automatic System Updates in Android:
- Go to the Settings menu on your Android device.
- Navigate through the settings and select the About phone menu.
- Scroll down to the bottom and find the Build number section.
- Note: In the case of some OEM devices, the Build Number section could be nested further in the Settings menu. For example, in Samsung Galaxy devices, you will need to go to Settings → About phone → Software information.
- Now, continuously tap on the ‘Build number’ section for five (5) times to enable ‘Developer options‘ on your device.
- Once enabled, go to Settings → System → Developer options.
- Scroll down and turn off the Automatic system updates toggle.
Step 2: Restore Stock Boot Image When an OTA is Available
Now your Android device is rooted and an OTA update notification has arrived. When an OTA update is available, you will need to restore the stock boot image (and dtbo, if applicable) and uninstall Magisk from the current slot.
To do so, go to the app drawer and launch the ‘Magisk Manager‘ app. Then tap on the UNINSTALL button and select the RESTORE IMAGES option. You should now see the “Restoration done!” message on the screen.
Do not! Absolutely do not reboot your phone now, or else Magisk will be uninstalled completely.
Step 3: Install the OTA Update on your Rooted Android Device
Now, with the stock boot image restored, you can freely install the OTA update on your rooted Android device. Simply go to the device Settings → System → System update, and press the ‘Download and Install‘ button.
Once the installation finishes, you shall be prompted to reboot your phone. DO NOT REBOOT YOUR DEVICE YET! Simply move ahead to the next step.
Step 4 [Optional]: Retain TWRP Recovery after OTA Installation
This is an optional step and only to followed if you installed Magisk using TWRP recovery (Method 1). It will allow you to retain TWRP recovery after installing the OTA update.
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:
- Go to the app drawer and launch the Magisk Manager app.
- Tap on the menu icon (3-horizontal lines) on the top-left of the app’s window.
- Select ‘Downloads‘.
- Now search the modules repository for “TWRP A/B Retention Script“.
- Next, tap on the download icon and select the Install option.
The script should now be installed on your phone. There’s nothing more you’d need to do for this now. The script will do its job and preserve TWRP after the OTA installation finishes.
Step 5: Preserve Magisk Root after OTA Installation
The final step to install Magisk to the inactive slot. This will preserve root after the OTA installation is finished and the device is rebooted into the updated OS.
- Open Magisk Manager.
- Tap on the ‘INSTALL‘ button and select the ‘INSTALL‘ option.
- Select ‘Install to Inactive Slot (After OTA)‘ when prompted to choose the installation method.
- Finally, tap on ‘YES‘ to confirm when the warning message appears on the screen.
- Magisk will now be installed on the inactive slot.
- Once the process finishes, tap on the ‘Reboot‘ button.
Magisk Manager will now force-switch your Android device to the inactive slot where the OTA update was installed. This will help prevent any post-OTA verifications that the system might have carried.
That’s it! You have just successfully installed an OTA update on your Android device rooted with Magisk. So when the next time an OTA update arrives, you can follow the same instructions to upgrade your device, and that too without losing root.
If you have any questions regarding the instructions/procedure listed here, feel free to let us know. We shall try to help you to the best of our knowledge. Make sure that you mention your device’s name (model number if applicable) and the software build number installed. This will allow us to help you quickly and more efficiently.
Источник
How to Install OTA Updates Manually using Recovery and ADB sideload
If there’s one thing that Android devices have had right for a very long time, then it’s the system of Over-The-Air a.k.a OTA updates. This ensures that a user can get updates for his/her device directly on the phone without needing to connect phone to a PC. This feature was adopted by Apple for its iPhone later than Android.
However, the thing with OTA updates is that not everyone gets them right off. To let it go smooth on download servers, manufacturers roll out OTA updates only gradually to select regions and users and complete it over the course of up to one month. But of course, people like us don’t wait that long.
OTA updates can also be installed manually. Although manufacturers won’t give you this as a direct option, but users who receive the OTA updates often publicly share the .zip file of the update. That file is your ticket to install a OTA update manually.
So if you’ve the .zip file of the OTA update you wish to install, follow the instructions below to install it manually.
Method 1: Install OTA update from recovery “Apply ZIP”
Note: Custom recoveries like TWRP, CWM, PhilZ touch, etc. might not work. You’ll most probably need a stock recovery to install OTA updates manually.
- Download and transfer the OTA update’s .zip file to your Android device’s internal storage (don’t put it inside any folder).
- Boot your device into recovery mode.
└ Once in recovery mode, use Volume buttons to navigate up and down between options and Power button to select an option. - Select the “Apply update” or “Apply update from phone storage” option.
- Select the OTA .zip file you transferred in Step 1 above. and install it.
- Once installation is finished, select reboot from recovery main menu.
Method 2: Install OTA update via ADB Sideload
Note: Again, you’ll probably need a stock recovery.
- Setup ADB and Fastboot on your PC.
- Download the OTA update .zip file on your PC and rename it to ota.zip.
- Enable USB debugging:
- Go to your phone’s settings » About phone » and tap “Build number” Seven times. This will enable Developer options on your phone.
- Now go to Settings » Developer options » and tick the USB debugging check box.
- Connect your phone to PC.
- Now open the folder where you downloaded the OTA update .zip file and then open a command window inside the folder. To do that, do a “Shift + Right click” on any empty white space inside the folder and select “Open command window here” from the context menu.
- Now issue the following command into the command window to reboot your device into recovery mode:
└ Check your phone’s screen, if it asks for “Allow USB debugging”, accept it by selecting OK/Yes.
└ This will begin the OTA installation.
That’s all. Hope this guide serves you well. If you feel like adding something to this page, do let us know in the comments section below.
Источник