How to flash Xiaomi Redmi 4X through Recovery: detailed instructions with nuances

Xiaomi Redmi 4X (codenamed santoni) is still a popular budget smartphone, but its official support is long over. Firmware through recovery is the only way to upgrade the device to current versions of MIUI or install custom firmware like LineageOS. However, the process has many pitfalls, from locking the bootloader to installation errors. In this guide, we will analyze the unique firmware algorithm for Redmi 4X through TWRP and stock recovery, which takes into account all the nuances of the 2017 model.

It's important to understand that firmware through recovery is different from an update through Fastboot or MI Flash Tool. Here you work directly with the phone's memory partitions, which gives you more control but also requires caution. For example, an incorrectly selected version of TWRP for santoni can lead to a device "brick" and installing incompatible firmware to a boot cycle. We'll go into detail at each step, including preparing drivers, choosing the right version of recovery and solving typical errors like Error 7 or Failed to mount /data.

1. Firmware Preparation: What to Do Before Starting

Before you start firmware, make sure that all the prerequisites are met. Xiaomi Redmi 4X has a locked bootloader, and unlocking it is a must. Without this, installing custom recovery or firmware is impossible.

Also check:

  • πŸ”‹ Battery charge of at least 60% (when discharged during firmware, the device can turn into a brick").
  • πŸ’» Availability of Windows-PC with installed drivers ADB/Fastboot (You can download from the official Xiaomi website or through the Mi Unlock Tool).
  • πŸ“₯ Downloaded files: Firmware in.zip format (for TWRP or stock recovery). TWRP for santoni (version) 3.6.2_9-0 Mi Unlock Tool to unlock the bootloader.
  • πŸ”Œ Original. USB-cable (cheap cables can cause data transmission errors).

Pay special attention to the choice of firmware. For Redmi 4X suitable:

  • πŸ“¦ Officially MIUI Xiaomi (select the version for Santoni).
  • πŸ› οΈ Castom firmware: LineageOS 16/17, Pixel Experience, Havoc-OS (check compatibility with santoni on the forum) XDA Developers).
  • ⚠️ Avoid firmware for other models (Redmi) 4/4A/4 Prime, even if they look similar!

⚠️ Attention: If your Redmi is 4X If you bought it in China, it may have a region lock, in which case unlocking the bootloader will require you to link to your Chinese Mi Account and wait 360 hours (15 days).

πŸ“Š What kind of firmware do you plan to install?
Official MIUI
LineageOS
Pixel Experience
Another custom
I haven't decided yet.

2. Unlocking the bootloader: step-by-step instructions

Without unlocking the bootloader, you won’t be able to install TWRP or custom firmware. Xiaomi requires proof of ownership of the device through account binding, a process that takes anywhere from a few minutes to 15 days (if the account is new).

Unlocking algorithm:

  1. Download Mi Unlock Tool from the official website.
  2. Sign in to Mi Account on your phone (Settings β†’ Mi Account).
  3. Enable Developer Options (7 times click on the MIUI version in Settings β†’ About Phone).
  4. Activate OEM Unlock and USB Debugging in Settings β†’ Additional β†’ For Developers.
  5. Connect your phone to your PC, launch the Mi Unlock Tool and follow the instructions.

If the tool is running a "Couldn't unlock" or "Wait 360 hours" error, it means:

  • πŸ”„ Your Mi Account is not linked to your device (wait 7 days after first linking).
  • πŸ“± The phone was previously unlocked and locked again (30 days waiting required).
  • 🌐 You're using it. VPN or proxy (unplug them before unlocking).

πŸ’‘

If the Mi Unlock Tool doesn’t see the device, try reinstalling the drivers manually through Device Manager (select Android Bootloader Interface).

3. Installation of TWRP Recovery on Redmi 4X

TWRP (Team Win Recovery Project) is a custom recovery that allows you to install firmware, backup and restore the system. Redmi 4X is critical to use a version that supports treble (if you plan to install firmware based on Android 9+).

Download the current version TWRP for Santoni from the official website or XDA. For a moment. 2026 yearly recommended version β€” 3.6.2_9-0.

Installation via Fastboot:

  1. Turn off the phone and press Volume Down + Power to log into the Fastboot.
  2. Connect the device to the PC and check the connection command: fastboot devices (serial number should be displayed).
  3. Please. TWRP Team: Fastboot Flash Recovery twrp-3.6.2_9-0-santoni.img
  4. Reboot to Recovery: Fastboot Boot twrp-3.6.2_9-0-santoni.img

After the first entrance to the TWRP You'll be asked to allow modifications to the system partition. Swipe for confirmation, or you won't be able to stitch. ZIP-file.

⚠️ Attention: If after installation TWRP The phone is loaded into stock recovery, which means that the device has Anti-Rollback protection on, in which case you need to flash a special patch or use Fastboot to turn off protection.

Data backup (photos, contacts, SMS)|Firmware model check (santoni)|Switch off (Mi Account removed)|Battery charge >60%-->

4. Firmware through TWRP: a step-by-step process

Now that TWRP is installed, you can start firmware. The process depends on the type of firmware (official MIUI or custom). There is an important nuance for Redmi 4X: custom firmware installation often requires formatting the /data partition into F2FS (if the firmware supports it).

Common algorithm:

  1. Copy. ZIP-Firmware file on the phone (internal memory or SD-map).
  2. Load to TWRP (Loudness Up + Nutrition).
  3. Backup of the current system (Backup) β†’ Select sections β†’ Swipe to Backup).
  4. Run Wipe β†’ Advanced Wipe and mark: Dalvik / ART Cache System Data (if you need a full cleanup) Cache

Install β†’ Choose. ZIP β†’ Swipe to Confirm Flash

GApps

Reboot β†’ System

Common mistakes and their solutions:

Mistake.Reason.Decision
Error 7Incompatibility of the firmware with the deviceCheck the firmware version (should be for santoni)
Failed to mount /dataPartition or incorrect format (ext4/f2fs) is damagedFormat /data to TWRP (Wipe β†’ Format Data β†’ file system type)
Updater process ended with ERROR: 1Lack of space in /system sectionUse firmware with a reduced system or clear the cache
Cyclical booting (bootloop)Incompatible core or modulesSweat boot.img separately via Fastboot
What to do if TWRP asks for a password?
After installation TWRP requesting a password, which means that the section /data It's encrypted: 1. Enter the last one. PIN-phone-code. 2. If you don’t remember, format. /data (All data will be deleted!). 3. To avoid the problem, disable encryption in MIUI before the firmware (Settings) β†’ Lockdown and protection β†’ Encryption).

5.Firmware through stock Mi Recovery

If you don't want to install TWRP or you need official firmware, you can use Xiaomi's stock recovery.

  • πŸ”„ Only official ones can be established. ZIP-Xiaomi firmware (Castom is not supported).
  • πŸ”’ No way to backup or modify partitions.
  • ⚠️ If a firmware error occurs, the device can be loaded into the Fastboot.

Instructions:

  1. Download the official firmware for santoni from Xiaomi website (file should be called type) miui_HM4X_V12.5.1.0.NCMMIXM_...).
  2. Rename the file to update.zip and place it in the root of internal memory.
  3. Turn off the phone and press Volume Up + Power to enter Mi Recovery.
  4. Select the language (if available) and click Install update.zip.
  5. Confirm the installation and wait for completion.

If the stock recovery refuses to install the firmware with the error "Signature verification failed", then:

  • πŸ“„ The firmware file is damaged (pump it over).
  • πŸ”§ The firmware is not designed for your model (check the file name for santoni compliance).
  • πŸ”’ The device has a locked boot loader (unlock it as described above).

πŸ’‘

Stock recovery Xiaomi does not support custom firmware installation or modified ZIP-It's a must-see for the files. TWRP.

6. Solving problems after firmware

Even if the firmware is successful, there may be problems, and here are the most common ways to fix them for the Redmi 4X:

Problem 1: Phone not turned on (black screen or Mi logo)

  • πŸ”Œ Connect charging for 30 minutes – it is possible that the battery ran out during firmware.
  • πŸ”„ Hold the Loud down. + Power for 10 seconds for forced reboot.
  • πŸ› οΈ If it doesn't help, go ahead. boot.img Fastboot: Fastboot Flash boot boot.img

Problem 2: No network (IMEI missing or "Emergency Calls Only")

  • πŸ”§ Restore. IMEI With tools like Maui META or SN Write Tool (requires NV-data backup).

Problem 3: Fast battery discharge after firmware

  • πŸ”‹ Reset battery statistics: in TWRP delete the file /data/system/batterystats.bin.
  • πŸ”„ Calibrate: completely discharge the phone, then charge to 100% without interruptions.
  • πŸ› οΈ Check if the process is not working in the background (via Settings) β†’ Battery).

Problem 4: Google Services Are Not Working (Google Play Services Error)

  • πŸ“¦ Refresh GApps (use version for your Android: 7.1 for your Android version) MIUI 10, 9.0 for MIUI 12).
  • πŸ”§ Clear the cache and data of Google Play Services in the settings.
  • πŸ”„ Install root rights and remove conflicting system applications (e.g. MiuiDaemon).

7.Rollback to stock firmware

If custom firmware is unstable or you want to return the warranty, you can roll back to the official MIUI.

  1. Download fastboot firmware for santoni from Xiaomi website (file with extension.tgz).
  2. Unpack the archive and put the files in the folder with Fastboot.
  3. Download your phone to Fastboot (Loudness Down + Power).
  4. Run the command for complete cleanup: fastboot erase userdata fastboot erase cache
  5. Swipe stock firmware: fastboot flashall (or alternately all sections: boot, system, recovery).
  6. Reboot: fastboot reboot

After the rollback:

  • πŸ”’ The bootloader will be blocked again (unless you disable the Anti-Rollback).
  • πŸ“± All data will be deleted (including internal memory).
  • πŸ”§ Re-unblocking will require 30 days to wait.

⚠️ Note: When you roll back to the version MIUI Anti-Rollback protection may work, and the phone will turn into a brick. Always check the Anti-Rollback version in the firmware name (for example, check the firmware name, ARB 4.0).

FAQ: Frequent questions about Redmi firmware 4X

Can I flash Redmi 4X without unlocking the bootloader?
No, Xiaomi's stock recovery allows you to install only official updates via update.zip. Custom firmware or TWRP requires unlocking the bootloader. The exception is the firmware through the Mi Flash Tool in Fastboot mode, but there you also need to unlock.
What version of Android can I install on Redmi 4X?
Officially Redmi 4X Android supports 7.1 Nougat (in the latest versions) MIUI 11/12). However, through custom firmware, you can install: Android 9 Pie (e.g. LineageOS) 16). Android 10 Q (unofficial ports, there may be bugs) Android 11 (Experimental builds, not recommended for daily use. For stable operation, it is better to choose firmware based on Android 9.
How to return the IMEI after the firmware?
If it's gone after the firmware. IMEI, You can restore it like this: Make a backup section modemst1 and modemst2 into TWRP (If it's not too late, use tools like Maui. META or SN Write Tool (requires NV-data backup) for Qualcomm chips (like Redmi). 4X) utility QCN Rebuilder. ⚠️ Entering IMEI Manually through the engineering menu (#4636##) can block the modem.
What if TWRP doesn’t see internal memory?
This is a typical problem for Redmi. 4X encryption /data. Solutions: Format /data into TWRP (All data will be deleted! ADB For file transfer: Adb push rom.zip /sdcard/ Connect. OTG-Then, copy the slate and copy it to the slate.
How to find out the Anti-Rollback version on Redmi 4X?
Anti-Rollback version (ARB) You can check: In the name of the official firmware (for example, V12.5.1.0.NCMMIXM_ARB4.0). Fastboot command: fastboot getvar anti In the engineering menu (##4636## β†’ Phone information. If you flash the firmware with a lower version ARB, phone's locked!