Installing custom firmware on Xiaomi devices via Fastboot mode is a process that requires careful and understanding of each step. Unlike standard updates via MIUI Updater, this method allows you to install alternative versions of Android (for example, LineageOS, Pixel Experience or ArrowOS), gain root access or restore a brick after unsuccessful experiments, but it comes with risks ranging from loss of warranty to complete failure of the device if you disrupt the sequence of actions.
In this article, weβll take a look at the entire process, from preparing and unlocking the bootloader to direct firmware and post-installation settings. Weβll focus on the critical points that 90% of users miss: checking the firmwareβs compatibility with the codename of the device (codenames like raphael for the Redmi K20 Pro) and using the MiFlash tool correctly to avoid anti-rollback errors. If youβre a beginner, we recommend reading the sections on risk and backup first, and they will save you from errors.
1.Preparation: What to do before the firmware
Before you start installing unofficial software, you need to follow a few critical steps, and ignoring them can lead to data loss, device locking, or even physical damage to the hardware (for example, when interrupting the firmware process).
First, back up all your data completely. Use Mi PC Suite (the official software from Xiaomi) or third-party utilities like TWRP (if you already have one installed). Note that backups through Google Account won't save SMS, call logs, or some application settings. For security, copy important files to an external drive or cloud.
- π± Check the model and code name of the device: go to Settings β The phone. β Version. MIUI And then you tap Kernel Version a few times, and you can find a Device line in the menu that appears (like cepheus for Xiaomi Mi 9), which you need to use to select the right firmware.
- π Charge the battery to at least 70%. Fastboot firmware can take up to 30 minutes, and discharging in the process will cause a failure.
- π₯οΈ Prepare your PC: install the latest versions of Xiaomi drivers (you can download it on the official website), ADB/Fastboot tools and archives (e.g, 7-Zip firmware-unpacking).
- π Download the firmware only from verified sources: XDA Developers, SourceForge (open source projects) or thematic telegram channels. Avoid files with.exe extensions - they may contain malware.
β οΈ Note: If your device was purchased in China (suffix version) CN In the model, the firmware of the global version (Global) can lead to problems with the modem (no network). EFS.
2 Unlocking the bootloader: official and informal ways
The bootloader on Xiaomi devices is locked by default, and unlocking it is a must before installing any unofficial firmware. The official method requires linking the Mi Account to the device and waiting for confirmation (usually 7-14 days). Unofficial methods (for example, through vulnerabilities in EDL) can work faster, but can risk blocking IMEI.
For official unlocking:
- Activate Developer Mode: Go to Settings β About Phone and tap the MIUI version 7 times.
- Include OEM Unlock and USB Debugging in the Developer Menu.
- Link your Mi Account to your device in Settings β Xiaomi Account.
- Download the Mi Unlock Tool utility from the official website and follow the instructions of the program.
If you donβt like the waiting period (720 hours), you can try to get around it. EDL-mode, but it requires a special cable (Deep Flash Cable) or soldering contacts on the board. This method is not recommended for beginners, as improper actions can lead to failure of the device.
| Unlocking method | Waiting time | Risks. | Tools required |
|---|---|---|---|
| Official (Mi Unlock) | 7-14 days | Minimum (the guarantee is lost) | PC, Mi Unlock Tool, Mi Account |
| EDL (through vulnerability) | 5-10 minutes | High (risk of blocking IMEI) | Deep Flash Cable, Mi Flash Pro |
| TWRP (if already installed) | 1-2 minutes | Medium (possible errors in firmware) | Established TWRP, file disable_miui_anti_rollback.zip |
β οΈ Warning: Once the bootloader is unlocked, all data on the device will be erased! This includes photos, contacts and installed apps. Don't rely on backups made through Mi Cloud - it's often impossible to restore them after custom software firmware is installed.
3. Selection and verification of firmware: how not to go wrong with the version
Firmware selection is the most common reason Xiaomi devices get βbrickedβ; even if the model name matches, firmware may not be compatible because of:
- π Different code names (e.g. Redmi Note 8 has Ginkgo and Willow variants).
- π‘ Regional modifications (firmware for Global is not suitable for China without patches).
- π Anti-Rollback protection (installation of the old version of the software on the new device will block it).
To avoid problems:
- Check your deviceβs code name (see Section 1) and check it against supported models on the firmware page.
- Learn a topic with XDA Developers or 4PDA β there are usually known bugs and ways to get around them.
- If you install MIUI-based firmware (e.g. xiaomi.eu), make sure that the version is no older than the current official version.
Example: Poco F3 (codename alioth) will be suitable for Pixel Experience firmware marked alioth-13.0-20231010. Installing a version for aliothin (Indian modification) can lead to a broken modem.
What is Anti-Rollback and why is it dangerous?
4. Fastboot Firmware Process: Step-by-step instruction
When all the preparations are complete, you can start firmware. We will use the MiFlash utility (for official firmware) or fastboot commands (for custom ones).
Battery charge >70% | Xiaomi drivers installed on PC| Firmware unpacked in folder without Cyrillic | Fastboot (black screen with rabbit) | Antiviruses disabled (they can block MiFlash)
-->
Step 1: Transfer the device to Fastboot mode
Turn off your smartphone. Press the Volume down button. + Power for 10-15 seconds until you see a screen with a rabbit in a hat, connect the device to the PC through the USB-cable (preferably original).
Step 2. Check the connection
Open the command line (Win + R β cmd) and type:
fastboot devicesIf the device is determined (the serial number will appear), you can continue. If not, check the drivers or try another one. USB-port.
Step 3: Firmware via MiFlash (for official firmware)
- Unpack the downloaded firmware (.tgz or.zip format) into a folder without spaces and Cyrillic.
- Open MiFlash, press Select and point the way to the firmware folder.
- At the bottom, select Clean All (Full Cleaning) or Clean All and Lock (Cleaning + Lock bootloader).
- Press Refresh β your device should appear in the list.
- Click Flash and wait until it is completed (usually 5-15 minutes).
Step 4: Firmware custom software through fastboot commands
For informal firmware (like LineageOS), you usually need to manually flash each partition. Example commands for the Redmi Note 10 Pro (sweet):
fastboot flash boot boot.img
fastboot flash dtbo dtbo.img
fastboot flash recovery recovery.img
fastboot flash system system.img
fastboot flash vendor vendor.img
fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img
fastboot rebootβ οΈ Warning: If the device has been stuck on the logo for more than 10 minutes after the fastboot reboot command, donβt try to turn it off with the power button! plug it in and wait another 20 to 30 minutes β sometimes the first download takes a long time due to app optimization.
π‘
If MiFlash gives you a "Couldn't find partition" error, try manually specifying the path to the file. flash_all.bat Open the command line in this folder and execute the command. flash_all.bat.
5. Typical errors and their solutions
Even with the correct following of the instructions, there can be problems, and the following are the most common mistakes and ways to fix them.
| Mistake. | Reason. | Decision |
|---|---|---|
| This package is for"xxx" devices; this is a"yyy" | The firmware is not suitable for your model. | Check the code name of the device and download the correct version. |
| Anti-rollback check fail | Reverse to the old version of MIUI | Swipe through a newer official firmware, then try again |
| Device is locked | The bootloader is not unlocked | Return to Section 2 and unlock the |
| The device does not turn on after firmware | No critical sections are stitched (e.g. vbmeta) | Repeat the flag firmware --disable-verity |
If the device boots after firmware, but there are problems (for example, the camera or mobile network is not working), most likely, the firmware is incompatible with your region.
- π Check the error log via adb logcat (required to be enabled) USB Debugging).
- π Install a patch for the modem (look for the 4PDA device-model).
- π₯ Try a different firmware build (for example, go from Global to EEA).
π‘
If the device doesn't turn on or respond to buttons after the firmware is done, don't panic. In 90% of cases, it can be restored via EDL mode, but it will require a special cable or soldering of test points on the board.
6. Post-installation setting: what to do after firmware
Once the firmware is successful, the device requires additional customization. Here's what you need to do first:
- Check the basic functions: calls, mobile internet, Wi-Fi, Bluetooth, camera and sensors (gyroscope, compass). If something doesn't work, go back to section 5.
- Update your firmware to the latest version: Many custom software (for example, LineageOS) support OTA-Update through the built-in Settings menu β System system β Update.
- Install GApps (if required): Most custom firmware does not include Google services. Download the appropriate Open GApps package (choose arm64 for modern devices) and run it through TWRP.
- Set up root access (optional): If you need superuser rights, install Magisk via TWRP or boot.img patch.
To improve productivity and battery life:
- π Turn off unnecessary background processes in Settings β Annexes.
- π΅ Set up Battery Saver mode to save charge.
- π‘οΈ Install an alternative launcher (like Nova Launcher) to speed up the interface.
If you have installed MIUI-based firmware (e.g. xiaomi.eu), pay attention to additional settings:
- π Include Second Space to separate work and personal space.
- π Set up App Lock to protect confidential applications.
- π¨ Activate Super Wallpapers for dynamic wallpapers (not available on all devices).
7 Risks and how to minimize them
Installing unofficial software always involves risks, but they can be reduced by following several rules:
1. Loss of guarantee
Unlocking the bootloader automatically voids the Xiaomi warranty, and if you need maintenance, you can return the device to its original state:
- π Sweep through the official firmware through MiFlash in clean all and lock mode.
- π± Perform reset to factory settings in Settings β Additionally. β Recovery and discharge.
However, some service centers may detect traces of unlocking even after these actions.
2. IMEI or modem lock
This problem is more common when you run firmware through EDL or use incompatible firmware, to avoid it:
- π‘ Always check firmware compatibility with your model and region.
- π§ If the modem has stopped working, run the modem sections separately and EFS firmware.
3. Data loss
As mentioned earlier, the firmware erases all data to minimize the loss:
- βοΈ Use cloud services to back up photos and contacts (Google Photos, Mi Cloud).
- πΎ Create a local copy through TWRP (if fitted, or ADB Backup.
β οΈ Note: Some banking applications (e.g. Sberbank Online or Tinkoff) may block work on devices with unlocked bootloader or root access. If these services are critical to you, consider using a second phone for experiments.