Xiaomi Mi 4, released in 2014, is still a popular device among Android enthusiasts thanks to the powerful hardware (Snapdragon 801, 3 GB of RAM) and active support for custom firmware. However, with the release of new versions of MIUI and Android, official updates for the model have long been discontinued. Firmware reflashing allows not only to update the system to current versions, but also to eliminate the brakes, expand the functionality or even install LineageOS for pure Android.
In this guide, we will analyze all the current ways of flashing β from the official update via Updater to install custom builds via TWRP. Particular attention will be paid to unlocking the bootloader on the Mi 4, taking into account changes in Xiaomi policy from 2023 to 2026, since without this step, installing alternative software is impossible, and you will find solutions to typical errors (for example, Error: 7 in TWRP or βhangβ on the Mi logo).
1. Firmware Preparation: What You Need to Know Before Starting
Reflashing Xiaomi Mi 4 is a process that requires care. Errors at any stage can lead to a device "brick" (inoperability).
- π Why do you need firmware? Update to the new version MIUI, switching to custom build (e.g. Pixel Experience) or eliminating system lags?
- π± What version? MIUI Is it set now? Check in the settings β The phone. β Version. MIUI. For older versions (below) MIUI (10) a firmware intermediate may be required.
- π Is the bootloader unlocked? If not, it will have to be unlocked (see section 3).
- πΎ Is there a backup? Firmware erases all data! Use Mi Cloud or Titanium Backup (requires root).
Important: Xiaomi Mi 4 has two modifications - Mi 4 LTE (cancro) and Mi 4 3G (cancro). Make sure you download the firmware for your model! You can not install software from another modification - this will lead to an error Error: 7 in TWRP.
β οΈ Note: If your Mi 4 was purchased in China, there is a high probability that it has a locked bootloader with a link to the Mi Account. In this case, unlocking through the official Mi Unlock tool may not work β you will need a workaround method (described in section 3).
2. firmware selection: official MIUI vs custom builds
The type of firmware depends on the functionality of the device, performance and even its lifespan. Consider the main options for the Xiaomi Mi 4:
| Type of firmware | Advantages | Deficiencies | Recommended version |
|---|---|---|---|
| Official MIUI (Stable) | Maximum stability, OTG support, optimization for iron | Outdated version of Android (maximum 6.0), lots of bloatware | MIUI 10.2.1.0 (Android 6.0) |
| MIUI for Developers | New features, weekly updates | Bugs, possible lags, unstable work | Xiaomi.EU (unofficial) |
| Castomic (LineageOS) | Up-to-date Android (up to 11), no Bloatware, high performance | It may not work: NFC, IR-blaster, some sensors | LineageOS 16 (Android 9) |
| Pixel Experience | Pure Android with chips from Google Pixel | Less optimization for iron, camera bugs are possible | PixelExperience 10 (Android 10) |
For most users, LineageOS 16 or Pixel Experience 10 are the best choice, offering a balance between Android relevance and stability, IR-blaster for control equipment, it is better to stay on the official MIUI 10.
Where do I download firmware?
- π₯ Officially MIUI: Xiaomi website (select the Global or China region depending on the model).
- π Castomy: section Mi 4 on XDA or Xiaomi.EU.
- βοΈ Tools: TWRP For the Mi 4, Mi Unlock Tool.
π‘
Before downloading the firmware, check its hash amount (MD5) using the HashMyFiles utility. This will save you from downloading corrupted files that can cause installation errors.
3. Unlock the bootloader on Xiaomi Mi 4 (2026 method)
Since 2016, Xiaomi has tightened its bootloader unlock policy. For the Mi 4, the process is complicated by the fact that the model is old, and the official Mi Unlock Tool tool may not recognize the device.
Link your Mi Account to your device (Settings β Mi Account)
Enable debugging via USB (Settings β About Phone β MIUI Version β 7 times tap β Developer β USB Debugging)
Turn it on. OEM-unlocking (Settings) β Additionally. β For developers β Unlocking OEM)
Install ADB/Fastboot drivers on PC (download from Android site)
Download Mi Unlock Tool (version no lower than 5.5.224.30)
-->
Step 1. Linking your Mi Account
Without a Xiaomi account, unlocking is not possible. Go to Settings β Mi Account and log in. Then go to Settings β Additional β Developer and activate:
- π Unblocking status (a notification of account binding should appear).
- π Unlocking OEM (If there is no option, update it. MIUI until the last available version).
Step 2: Launch the Mi Unlock Tool
Connect the Mi 4 to your PC in Fastboot mode (turn off the phone, then press Volume Down + Power).
- Sign in with the same Mi Account as you do on your phone.
- Press Unlock and wait for the check (can take up to 10 minutes).
- If you have a Couldnβt unlock error, try it.
- π Reconnect. USB-cable (use the original cable!).
- π₯οΈ Run Mi Unlock Tool on behalf of the administrator.
- π Wait 72β168 hours (if the account is new, Xiaomi will temporarily block the account).
β οΈ Note: If the Mi Unlock Tool gives an error This device is locked even after all the manipulations, try the bypass method via fastboot oem unlock-go (works on some versions). MIUI). Details - in spoiler below.
Bypass unlock method (for experienced users)
4. Install TWRP Recovery on Xiaomi Mi 4
TWRP (Team Win Recovery Project is a custom recovery required to install unofficial firmware. 4 recommended 3.6.1_9-0, Newer assemblies may not support older iron.
Installation instructions:
- Download the TWRP image for Mi 4 and rename it twrp.img.
- Place the file in the folder with the platform-tools (where fastboot.exe is located).
- Transfer the phone to Fastboot mode (clip Volume Down + Power).
- Open the command line in the folder with platform-tools and execute: fastboot flash recovery twrp.img fastboot boot twrp.img
Once installed successfully, the phone will automatically reboot to TWRP. Important! Don't reboot the device immediately - first perform a data reset (Wipe β Format Data), otherwise there may be firmware errors.
π‘
Installation TWRP To get it back, you can swipe the official image through Fastboot with the fastboot flash recovery command. stock_recovery.img (The file can be extracted from the official firmware).
5. Xiaomi Mi 4 firmware: step-by-step instructions
The way the firmware is installed depends on the type of software being installed, and below are the instructions for all scenarios.
5.1 Install official MIUI via Fastboot
This method is suitable for updating or rolling back to stock firmware.
- π Firmware in.tgz format (download from the official website).
- π₯οΈ Mi Flash Tool (download here).
Steps:
- Unpack the firmware in a folder without Cyrillic symbols.
- Transfer the phone to Fastboot (Loudness down + Power).
- In Mi Flash Tool, click Select, specify the folder with the firmware.
- Select Clean All (full reset) or Clean All and Lock (reset + lock bootloader).
- Press Flash and wait until it is completed (5-10 minutes).
5.2 Installation of custom firmware via TWRP
For LineageOS, Pixel Experience or other custom builds:
- Download the firmware (.zip format) and, if necessary, Open GApps (choose arm β 9.0 β pico for Android 9).
- Reboot to TWRP (Loudness Up + Power).
- Run the Wipe. β Advanced Wipe and mark: ποΈ Dalvik / ART Cache π System π Data π Cache
Install
Open GApps
Wipe β Format Data
Reboot β System
β οΈ Note: If the sensor does not work after the LineageOS or Pixel Experience firmware, download and run through TWRP The problem is related to the incompatibility of drivers in new versions of Android.
Typical errors and their solutions
Even with the exact following of the instructions, there can be problems.
| Mistake. | Reason. | Decision |
|---|---|---|
| Error: 7 in TWRP | Incompatibility of firmware with the device model | Check that you downloaded the firmware for cancro (Mi 4). If the error persists, edit the updater-script in the firmware archive (delete the line with the model verification). |
| Hanging on the Mi logo | Incorrect Wipe or damaged boot.img | Go back to TWRP, run Format Data, then run the firmware, and if it doesn't work, run boot.img separately through fastboot flash boot.img. |
| Couldn't unlock in Mi Unlock | Mi Account is not tied to device or temporarily blocked | Wait 72 hours, check your accountβs link to Settings β Mi Account. If it doesnβt work, use the workaround method (see Section 3). |
| No network after firmware | No modem files or incorrect firmware version | Sweat the official MIUI through Fastboot, then re-install custom firmware. Or download separately modem for your model. |
If your error is not described above, check the logs in TWRP (Advanced β Copy Log) and ask a question on 4PDA or XDA, attaching a screenshot of the error.
7.Optimize the Mi 4 after firmware
After successful firmware, it is recommended to perform several actions to improve performance and stability:
- β‘ Turn off animation: Go to Settings β For developers and install: Animation windows β Off. Transition animations β Duration of the animator β 0.5x
- π Battery calibration: After firmware, reset battery statistics through TWRP (Wipe β Battery Stats. Then fully discharge and charge the phone 2-3 times.
- π‘οΈ Turn off unnecessary services: In LineageOS or Pixel Experience, turn off: π‘ Wi-Fi Scanning and Bluetooth Scanning (Saves Charge). π Auto-Update Apps in Play Market.
- π Cache cleanup: Once a month clean Dalvik Cache through TWRP (Wipe β Advanced Wipe β Dalvik).
For additional acceleration, you can install the FrancoKernel core (available for the Mi 4 on XDA), which optimizes the processor and reduces heat.