Xiaomi smartphone owners who have been granted super-user rights through Magisk often face the dilemma of updating the operating system or keeping the advanced features. OTA-Over-The-Air on modified devices often results in errors or cyclical restarts, due to the integrity of the system partition when booting.
There are several proven methods to solve this problem, allowing you to upgrade to the current version of MIUI or HyperOS. The choice of the particular method depends on whether the unlocked bootloader is used and which custom firmware or patch is used. In this article, we will discuss the algorithms of actions that minimize risks and preserve Root access.
โ ๏ธ Attention: Any manipulation of system files and bootloader carries a potential risk.Be sure to create a full backup of important data before starting the procedure.
Understanding the security architecture of Android on Xiaomi devices is critical to a successful upgrade.The system uses a boot partition verification mechanism that blocks the start when changes are detected, which is why a simple update through the settings menu often โflysโ or does not install on devices with modified boot.img.
Preparation of the device for the update procedure
Before you start any action, you need to make sure that the current system is stable and that all the necessary tools are available. The store must be installed correctly, and the rights of the superuser are active. Ignoring the preparatory stage can lead to data loss or inoperability of the gadget.
You will need to download the current firmware version for your model. It is important to choose the file that corresponds to your current region and firmware type (Global, EEA, China).
- ๐ฑ Charge your smartphone to a minimum 60-70%, Because the process of refrigeration is energy-consuming.
- ๐พ Free up at least 10 GB of free space in internal memory.
- ๐ Make sure that USB-cable is serviceable if you plan to connect to a PC.
It is also recommended to disable automatic updates to Google Play apps during work to avoid background conflicts. Check the Magisk Manager version - it should be up to date, as older versions may not work properly with new Android 13/14 security patches.
โ ๏ธ Warning: Don't try to update if the storage has encryption that you can't get around.In some cases, the update changes the structure of the encryption keys.
Method of saving Root during OTA-update
The most common scenario is to try to install an official update that came in through the air. If you just click the Update button, the system will check the hash amount of the boot partition, detect Magisk modifications and interrupt the installation. To get around this, you need to temporarily restore the original boot image.
The idea is to turn off Magisk before you install the OTA, update it, and then re-patch the new image, and this allows the system to update itself, thinking it's clean, and then you reclaim the superuser rights.
In Magisk, find the Remove or Restore the Original File button. After that, restart. You can now start the OTA installation via the standard Settings โ About Phone menu. If the update requires a reboot, don't panic - the system will update, but the Root will temporarily disappear.
After successfully installing the new version of the software and the first download, you need to open Magisk Manager again. Select the "Install" option and specify "Install in the Inactive slot (after rebooting)" This will apply the patch to the newly updated partition.
- ๐ Launch Magisk and click on the โInstallโ buttonยป.
- ๐ Select the method "Install in an inactive slotยป.
- ๐ฒ Click โStartโ and wait for the process to be completed.
- ๐ Reboot the device to activate the changes.
โ๏ธ Check before OTA
Manual installation of firmware through Recovery
If OTA-It didn't work, or you want to manually upgrade, and you'll need to use Recovery, which is more reliable because you can control every step of the process. You'll need a full firmware archive in.zip.
Place the firmware file in the root of internal memory. Go into recovery mode by holding the key combination (usually Volume Up + Power). From the menu, select the language and press "Install Update Package".
Important: if you have a bootloader unlocked and you have a TWRP or other custom recovery installed, the process may be different. In standard MIUI Recovery, the installation may be blocked by an anti-rollback check, in which case the system will give an error "Can't verify update."
| Type of firmware | Method of installation | Data retention | Risk of Root loss |
|---|---|---|---|
| OTA (Package) | Through settings | Yes. | High (requires manipulation) |
| Recovery (Full) | Through Recovery. | Yes. | Tall (flies completely) |
| Fastboot (Full) | Through PC and MiFlash | No (usually) | Guaranteed fly off |
| Custom (Custom) | Through TWRP | Depends on Wipe. | Requires reinstallation of Magisk |
Once you install the firmware through Recovery, the superuser rights are guaranteed to be removed, as the boot partition will be replaced with stock.You will have to repaint the new boot.img from the downloaded firmware through the Magisk app on your computer or phone.
Update via Fastboot and MiFlash
Using Fastboot mode and MiFlash Tool on a PC is โheavy artillery,โ a technique often used when a phone is โburstโ or needs to change the firmware region. For Root-enabled devices, this is the most dangerous method, as it completely overwrites all partitions.
There are two types of firmware for Fastboot: Clear All and Lock/Save Data. To save data and partition structure with Root, it is important to choose the option without locking the bootloader. However, even when choosing the Save data option, the Root rules will be lost.
fastboot flash boot patched_boot.img
fastboot rebootAbove is a command that you can use after you have firmware through Fastboot to quickly reclaim access. First you flash the stock system, the phone reboots without Root, then you take boot.img from the used firmware, patch it into Magisk and stitch it back through Fastboot.
What to do if MiFlash makes a mistake?
Remember that firmware via Fastboot requires Qualcomm or MediaTek drivers installed, and ADB/Fastboot Without them, the computer will not see the smartphone in bootloader mode.
Recovery of Root Rights after Update
After a successful system update, regardless of the method you choose, you'll probably need to reactivate Magisk. If you upgraded through an OTA with pre-preparedness, just press the installation in the application. If you had a full firmware, the algorithm is more complicated.
You'll need a boot.img file that matches the version of the firmware that's currently installed, which can be extracted from the full firmware archive or pulled with ADB by adb pull /dev/block/bootdevice/by-name/boot boot.img (requires rights, so it's better to take it from the archive).
Open Magisk Manager and click โInstallยป โ ยซSelect and flash the file. Specify the path to the extracted file. boot.img. After the patch is completed, a file with a name like magisk_patched_xxxx.img It's going to be in the Download folder.
- ๐ป Connect your phone to your PC in Fastboot mode.
- โจ๏ธ Enter the command: fastboot flash boot magisk_patched_xxxx.img.
- ๐ Reboot the device with the command fastboot reboot.
โ ๏ธ Attention: Firmware incorrect boot.img (from another version of Android or kernel, will lead to Bootloop (cyclical reboot!
๐ก
Use the MagiskHide Props Config module if your banking apps or Netflix are no longer working after the update, which helps to hide the fact that Root is present and change your devices.
Possible problems and solutions
Modified systems often experience specific errors, including loss of broadband or VoLTE, which is due to the fact that modem and persist partitions can get lost or damaged when flashing.
Another problem is the failure of security applications (Google Pay, banking customers). Even if Magisk is installed, new versions of Google Play Services require a more subtle hidden setting. Use the "Configure DenyList" feature in Magisk settings.
If the phone went into the bootloom after trying to update:
1. Press the volume and power buttons to enter Recovery.
2. Try to make Wipe Cache (not to be confused with Wipe Data if you want to save a photo).
3. If it does not help - you will have to do a complete reset or flash through Fastboot with loss of data.
๐ก
The main rule of Xiaomi updates with Root is never to update blindly.Always have a complete archive of current working firmware on hand for possible rollbacks.
Also worth mentioning is the encryption problem: when you upgrade from Android 12 to Android 13/14, the encryption algorithm can change, and if you use old custom receptacles, they may not be able to work with the new encryption format, making it impossible to access data via TWRP.