The Xiaomi Mi 4, released in 2014, is still a popular device among Android enthusiasts thanks to its robust Qualcomm Snapdragon 801-based hardware platform and custom firmware installation. However, over the years, official MIUI support for this model has ceased, and users face security, slow operation and lack of new features.
In this guide, we will look at all the current ways to update software on the Mi 4: from official methods through MIUI Updater to manual installation through Fastboot and TWRP Recovery. Particular attention will be paid to preparing the device, unlocking the bootloader and solving typical errors such as Error: remote: oem unlock is not allowed or hanging on the Mi logo. If you plan to install custom firmware (for example, LineageOS or Pixel Experience), here you will find proven instructions and links to current builds.
Before you start, consider that the wrong firmware can lead to a "brick" (complete failure) of the device. All actions you perform at your own risk. If the Mi 4 is your main smartphone, we recommend you to stock up on a backup device for the duration of the experiments.
1. Firmware Preparation: What to Do Before Starting
Reflashing the Xiaomi Mi 4 requires pre-preparedness to avoid data loss or disruptions in the process. Start by backing up all important files: contacts, photos, messages and apps.
- π± MIUI Backup (built-in function in Settings) β Additionally. β Backup)
- βοΈ Cloud services: Google Drive, Mi Cloud or Yandex Disk
- π» Manual copying on PC through MTP (Connect the phone as USB-accumulator)
Then check the battery power, it should be at least 60%. If the battery runs out during firmware, the device can turn into a brick.
- π Original. USB-cable (better than the one that came with the kit)
- π₯οΈ Windows computer 10/11 or Linux (for Fastboot and Linux) ADB)
- π₯ Downloaded drivers Qualcomm and Xiaomi USB Drivers (links in the section "Downloading software")
β οΈ Note: If your Mi 4 has not been previously downloaded, check the bootloader status with the command fastboot oem device-info. If the answer has the line Device unlocked: false, you will need to unlock (section 3).
For convenience, collect all the necessary tools in one folder on your computer:
Downloaded firmware (official or customized)|Drivers for Xiaomi and Qualcomm|Utilities. ADB/Fastboot (platform-tools)|Backup of data|USB-cable-->
2. Download firmware: where to get official and custom software
The choice of firmware depends on your goals. Official MIUI builds will provide stability, but may be outdated. Custom firmware (like LineageOS 16 or HavocOS) will give you an up-to-date version of Android, but may contain bugs. Below are proven sources for Mi 4 (codename cancro):
| Type of firmware | Source | Last version | Notes |
|---|---|---|---|
| Official MIUI (Stable) | MIUI Downloads | MIUI 9.6 (Android 6.0) | The latest official version for the Mi 4 |
| Official MIUI (Developers) | Xiaomi.EU | MIUI 12.5 (Android 10) | Unofficial port with support for Google services |
| Castomic (LineageOS) | XDA Developers | LineageOS 14.1 (Android 7.1.2) | Stable build with security updates |
| The Pixel Experience (Pixel Experience) | Pixel Experience | PixelExperience 10 (Android 10) | Requires an unlocked bootloader and TWRP |
When downloading, pay attention to:
- π The code name of the device is for Mi 4 This is a cancro. cancro_lte (LTE-version) is not suitable for the standard model!
- π¦ File type:.zip for installation via Recovery.tgz or.img for Fastboot
- π File integrity β check the hash amount (MD5) After downloading using the HashMyFiles utility.
β οΈ Note: Firmware from sites like needrom.com or 4pda.to You can download only from official sources or trusted forums (XDA, MIUI Forum).
After downloading, unpack the archive into a folder with platform-tools (where adb.exe and fastboot.exe lie). mi4_firmware.zip (or.tgz).
Official. MIUI|Xiaomi.EU (informal) MIUI)|LineageOS or other custom|I don't know, I need help choosing.-->
3. Unlocking the bootloader: a mandatory step for custom firmware
The bootloader on the Xiaomi Mi 4 is locked by default.This means you can't install custom Recovery or firmware without unlocking it.The official way from Xiaomi requires you to link your Mi Account to the device and wait. SMS-Unlock code (can take up to 720 hours!) Alternative methods speed up the process, but require caution.
For official unlocking:
- Link the device to your Mi Account in Settings β Xiaomi Account.
- Enable Developer Options (7 times click on the MIUI version in Settings β About Phone).
- Activate OEM Unlock and USB Debugging in Settings β Additional β For Developers.
- Install Mi Unlock Tool on your PC and log in under the same account.
- Connect your phone in Fastboot mode (click Volume Down + Power) and follow the program instructions.
If the official method is not suitable, you can use workarounds:
Alternative Unlocking Method (for experienced users)
After successful unlocking, check the status of the team:
fastboot oem device-infoThe answer should be Device unlocked: true.
π‘
Unlocking the bootloader erases all data on the device, including internal memory. Don't miss the backup step!
4. Install firmware via Fastboot (recommended method)
Fastboot is suitable for official firmware in.tgz or.img format, and is considered the most reliable method, since it flashes through all parts of the device, including boot, system and recovery.
- Unpack the downloaded firmware in the folder with the platform-tools (files should appear) flash_all.bat, images\...).
- Turn off your phone and press Volume Down + Power to log into Fastboot (Mi Bunny logo with FASTBOOT labeled).
- Connect the device to your PC and check for detection by command: fastboot devices must display a serial number.
- Start the firmware: For Windows: double-click on flash_all.bat. For Linux/macOS: execute./flash_all.sh.
Wait until it is completed (about 5-10 minutes).
If the process is interrupted with the remote: partition table doesn't exist, do:
fastboot oem edl
fastboot flash partition gpt_bin.img
fastboot flash bootloader bootloader.img
fastboot reboot-bootloaderThen repeat the firmware.
β οΈ Warning: If the Mi 4 has been stuck on the Mi logo for longer than 15 minutes after firmware, force it to reboot in Recovery (clip Volume Up). + Power) and run Wipe Data. This often solves the first run problem.
5. Installation via TWRP Recovery (for custom firmware)
If you have chosen custom firmware (for example, LineageOS), you will need to TWRP Recovery. This method is more flexible, but it requires an unlocked bootloader. TWRP:
- Download the latest version of TWRP for Mi 4 (cancro) from the official website.
- Rename the file to twrp.img and place it in a folder with platform-tools.
- Download your phone to Fastboot and execute: fastboot flash recovery twrp.img
- Download the TWRP command immediately: fastboot boot twrp.img (This is a temporary boot to avoid overwriting Recovery with regular firmware.)
Now install the firmware:
- In TWRP, select Wipe β Advanced Wipe and select Dalvik / ART Cache System Data Cache
Swipe for confirmation.
Install
.zip
Gapps
Magisk
Reboot System
The first launch of custom firmware can take up to 15 minutes. If the device is getting stuck on the boot animation, wait at least 20 minutes before the forced reboot.
π‘
If your mobile network is not working after installing custom firmware, check the APN settings in Settings β Mobile Network β Access Points (APN). Often manual operator settings help.
6. Solving typical firmware errors
Even with the exact instructions, errors can occur, and the following are the most common problems and solutions for the Xiaomi Mi 4:
| Mistake. | Reason. | Decision |
|---|---|---|
| Error: remote: oem unlock is not allowed | No Mi Account is tied or OEM Unlock option is enabled | Check your account binding in Settings β Xiaomi Account and enable OEM Unblocking |
| This package is for "cancro" devices; this is a "cancro_lte" | Firmware for the wrong model (LTE vs 3G) | Download the firmware with the correct code name (cancro or cancro_lte) |
| Hanging on the Mi logo after firmware | Partition conflict or incomplete installation | Download to Recovery and run Wipe Data, then re-flash |
| E: Footers are wrong in TWRP | A damaged firmware file | Check it out. MD5-file sum and download again |
| There is no mobile network after the firmware | Incompatible modems or APN settings | Install the correct modems (firmware-update) or enter APN manually |
If the device does not turn on after a failed firmware ("brick"), try:
- Load to Fastboot (clip Volume Down + Power for 10-15 seconds).
- If you don't respond, put it in mode. EDL: Turn off the phone. Press the volume up. + Loud down and plug in. USB-Hold the buttons for 10-15 seconds until the Qualcomm port arrives. HS-USB QDLoader 9008 in Device Manager.
EDL
Mi Flash Tool
.tgz
Clean All
β οΈ Attention: Regime EDL β If the Mi Flash Tool is a Sahara or Firehose error, the eMMC chip may be damaged and iron-level repairs will be required.
7.Optimization after firmware: what to do first
After successful firmware installation, follow a few steps to ensure stable operation of the Mi 4:
- π Reset the cache: In Recovery, select Wipe β Wipe Cache, which will eliminate possible lags.
- π Set up security: Enable Find My Device (if firmware supports). Set a pin or pattern lock.
- π± Update Apps: Go to Google Play and click Update All.
- π Calibrate the battery: Fully discharge and charge the phone 2-3 times in a row to correctly display the charge level.
For custom firmware, it is recommended:
- Install Magisk for root rights (if necessary).
- Set SELinux to Permissive mode (if there are problems with modules): setenforce 0 (temporary) or edit /system/build.prop.
- Disable unnecessary services via ADB to save charge: adb shell pm disable-user --user 0 com.miui.analytics
After you have firmware on the custom core (e.g., FrancoKernel), check the temperature of the processor with AIDA64. If the temperature in the idle is above 50Β°C, return to the drain core.