Reflashing Xiaomi Redmi 4X: official and custom methods

Xiaomi Redmi 4X (codenamed santoni) remains a popular budget smartphone even years after its release. However, over time, official MIUI support ends, and users face slowdowns, lack of security updates or the desire to install custom firmware like LineageOS or Pixel Experience. Flashing allows the device to return to its former performance, but requires accuracy – errors can turn the phone into a β€œbrick”.

In this guide, we will look at all the steps from unlocking the bootloader to installing firmware through Fastboot or TWRP Recovery. We will focus on the nuances specific to the Redmi 4X, such as the problem with the incorrect operation of the proximity sensor after firmware custom software or the need to use old versions of the Mi Flash Tool tools (new often do not recognize the device), and you will find a firmware compatibility table and answers to frequent questions about restoring the IMEI or resetting the Anti-Rollback counter.

Preparation for Flashing: What You Need to Know Before You Start

Redmi 4X flashing is not just about downloading a file and pressing a button, but it has a few pitfalls to learn about in advance:

  • πŸ”“ Blocked bootloader. Xiaomi blocks the ability to install unofficial software by default. Unlocking requires binding Mi Account and waiting (sometimes up to 720 hours!).
  • πŸ“‰ Anti-Rollback protection, if you stitch through the version MIUI older than the current one, the phone may be locked. β†’ The phone. β†’ Version. MIUI.
  • πŸ”‹ Battery charge. The process can take up to 30 minutes - make sure the charge is at least 60 percent, or you risk getting a discharged phone in the middle of the firmware.
  • πŸ’Ύ Backup. Firmware erases all data, including photos in internal memory. Use Mi PC Titanium Backup or Suite (requires root).

Also check out your device! Redmi 4X came in several versions:

ModelCode name4G supportFeatures of firmware
Redmi 4X (Global)santoniBands 1/3/5/7/8/20Official global firmware available on Xiaomi website
Redmi 4X (China)santoniBands 1/3/5/7/8Requires manual installation of Google Services
Redmi 4X (India)santoniBands 1/3/5Dual VoLTE support, but limited frequency set

⚠️ Attention: If your Redmi is 4X purchased in China (domestic version), after firmware MIUI Mobile data may stop working. Solution: installing a ModemFix patch through TWRP.

πŸ“Š What kind of firmware do you plan to install?
Official MIUI (Stable)
Official MIUI (weekly)
LineageOS (Pixel Experience)
Another.

Unlocking the bootloader: Step 1 on the way to freedom

Without an unlocked bootloader, you can't install custom recovery or alternative firmware. Xiaomi has made it harder in recent years, but for the Redmi 4X, it's still working.

  1. Download the Mi Unlock Tool from the official website (version is not newer than 5.5.228.30 – newer devices may not support older devices).
  2. Sign in to your Mi Account on your phone and in the program (should be the same account!).
  3. Put the phone in Fastboot mode: turn it off, then press Volume down + Power.
  4. Connect to your PC and start unlocking in the Mi Unlock Tool.

You will likely see a waiting message (usually 168-720 hours) that is reset when:

  • πŸ”„ Re-flashing the official MIUI via Fastboot.
  • πŸ“± Changing your Mi Account on your phone.
  • ⏳ Reboot your phone in Fastboot mode without connecting to a PC.

⚠️ Note: If you see a "Couldn't unlock" error with code 86006 or 86012, it means that your account is not tied to the device. β†’ Additionally. β†’ For developers β†’ Mi Unlock status and re-connect your account.

πŸ’‘

If the unlock timer is accidentally reset, try connecting the phone to another one. USB-port (preferably 2.0) or use the original Xiaomi cable.Some users have solved the problem by disabling the antivirus on the PC.

Install TWRP Recovery: Your Key to Custom Firmware

TWRP (Team Win Recovery Project) is an alternative recovery that allows you to install informal firmware, backup and restore the system. Redmi 4X has two current versions:

  • πŸ“± Official (from the team) TWRP) β€” Supports data encryption, but may not work properly with some custom cores.
  • πŸ› οΈ Modified (e.g. from OrangeFox) – adds advanced features like screen brightness control to recovery.

Installation instructions:

  1. Download the latest version of TWRP for santoni from the official website (file with the extension.img).
  2. Rename the file to twrp.img and place it in the folder with ADB/Fastboot.
  3. Connect your phone in Fastboot mode and execute the command: fastboot flash recovery twrp.img
  4. Immediately after that, do: fastboot boot twrp.img (this will load the phone into TWRP to prevent the recovery of stock MIUI from overwriting).

β˜‘οΈ Pre-installing check TWRP

Done: 0 / 4

⚠️ Attention: If after installation TWRP The phone is loaded into stock recovery, so MIUI Solution: After the fastboot flash recovery command, download it immediately. TWRP and select Reboot from the menu β†’ Recovery. Then go to Mount. β†’ Enable MTP And copy the file to the phone. disable_forced_encryption.zip (search the forum XDA), Then you can run it through. It'll turn off the coercive encryption that's interfering with the work. TWRP.

Firmware selection: official MIUI vs custom builds

It all depends on your goals:

Type of firmwarePlusesConsRecommendation
Official MIUI (Stable)Maximum stability, OTG support, all camera features workSlowdown over time, advertising in system applicationsFor everyday use
Official MIUI (weekly)New features, bug fixes fasterPossible critical errors, fast battery dischargeFor enthusiasts ready for bugs
LineageOSClean Android, no ads, regular updatesSome functions do not work, for example, IR-blaster)For stock Android fans
Pixel ExperienceGoogle Pixel interface, good optimizationThere may be problems with the camera (no HDR+ mode)For Pixel fans
Havoc-OSMaximum customization, support for SubstratumLess stable than LineageOSFor experienced users

For official MIUI, download firmware only from the official website or Xiaomi Firmware Updater. Look for firmware on XDA Developers (Redmi 4X section).

What is Anti-Rollback and why is it important for the Redmi 4X?
Anti-Rollback is Xiaomi’s protection mechanism that locks the device if you’re trying to flash an older version of MIUI. For example, if your phone is running a MIUI 12 and you’re trying to install a MIUI 11, the phone will lock with the β€œAnti-Rollback Check” error. For Redmi 4X, the critical version is MIUI 9.2.2.0. If your current version is newer, you can’t stitch the old builds! The solution is to flash a special patch or use a security bypass firmware (se 4PDA with the β€œARB bypass”).

Fastboot Firmware: Method for Official MIUI Builds

This method is suitable for installing stock MIUI and recommended by Xiaomi.

  • πŸ’» Windows PC (on) Linux/Mac There may be problems with drivers).
  • πŸ“‚ Firmware in.tgz format (unpack it into a folder).
  • πŸ› οΈ Mi Flash Tool (2018.5.18.0) – Newer ones don’t support Redmi 4X).

Step-by-step:

  1. Install Qualcomm HS-USB QDLoader 9008 drivers (search the network if the Mi Flash Tool does not see the device).
  2. Unpack the firmware in a folder without Cyrillic characters (for example, C:\MIUI\).
  3. Start the Mi Flash Tool, select the folder with the firmware.
  4. Connect your phone in Fastboot mode (clip Volume Down + Power).
  5. In the Mi Flash Tool, press Refresh – the device must be defined as COMX.
  6. Select firmware method: Clean all – clean (recommended). Clean all and lock – clean + lock the bootloader (only if you want to return the phone to stock state).

Flash

πŸ’‘

If the Mi Flash Tool freezes in the β€œwaiting for device” stage, try: 1) reconnect the phone to another device. USB-port; 2) run the program on behalf of the administrator; 3) disable driver signature verification in Windows.

Firmware through TWRP: installing custom assemblies

This method is suitable for installing LineageOS, Pixel Experience or other custom firmware.

  • βœ… Installed TWRP Recovery (see section above).
  • βœ… Downloaded firmware in.zip format (do not unpack!).
  • βœ… Downloaded GApps package (if firmware without Google Services). 4X Pico or nano is a good option.
  • βœ… Backup done through TWRP (Backup menu, select Boot, System, Data).

Instructions:

  1. Boot to TWRP: Turn off the phone, press Volume up + Power.
  2. In TWRP, select Wipe β†’ Advanced Wipe and mark: Dalvik / ART Cache System Data Cache Then swipe for confirmation.
  3. Return to the main menu, select Install and specify the path to the firmware file.
  4. After installing the firmware (don't restart!), install GApps (if necessary).
  5. Optionally, if the firmware requires Magisk to root, install it at this stage.
  6. Select Reboot System.

⚠️ Note: If after firmware custom software stopped working sensors (for example, proximity sensor or gyroscope), download and run through TWRP patch santoni-sensors-fix.zip. It can be found on the forum. XDA smack-in.

Solving problems after firmware

Even if you install it properly, you can have problems, and here are the most common ways to fix them:

Problem.Possible causeDecision
Phone not turned on (black screen)Incorrect firmware or interrupted processRepeat the firmware through Fastboot with the choice of Clean all
No mobile network (IMEI reset)The modem or nvram partition is damagedRestore IMEI via SN Write Tool or run the stock modem via TWRP
Fast battery dischargeUnoptimized firmware or background processesInstall a kernel with improved power management (e.g. FrancoKernel)
The camera is not working (Cannot connect to camera)No drivers or conflict with GAppsSweep the patch. Camera2API_enabler.zip Or reinstall firmware without GApps
Phone overheatsToo high frequency of the processor in the custom coreInstall Kernel Adiutor and limit the maximum frequency

How to restore IMEI to Redmi 4X after firmware?
1. Download the SN Write Tool and drivers for Qualcomm (look for 4PDA). 2. Enter the phone in EDL mode: turn it off, press Volume Up + Volume Down + Power (should be defined as Qualcomm HS-USB QDLoader 9008). 3. In SN Write Toolram, select the firmware file with the nvram partition and press Start. 4. Once complete, restart the phone. IMEI should recover.

FAQ: Answers to Frequent Questions

Can I flash Redmi 4X without unlocking the bootloader?
No. Xiaomi blocks the installation of unofficial firmware at the hardware level. The only exception is the upgrade via Settings β†’ System Update, but this only works for official MIUI builds.
How to return the stock firmware if the phone does not turn on?
If the phone is detected in Fastboot (when connecting to a PC, the indicator lights), run the official MIUI through the Mi Flash Tool with the choice Clean all. If the phone does not respond (black screen), try to put it in EDL mode (see spoiler above) and flash it through Mi Flash Pro.
What version of Android can I install on Redmi 4X?
Officially, the device supports Android 7.1.2 (MIUI 12).However, custom firmware allows you to install Android 10 or even 11 (for example, LineageOS 18.1). Newer versions (Android 12+) will not work due to the limitations of iron (Snapdragon 435 processor and 2/3 GB of RAM).
Why doesn’t NFC work after the firmware?
The Redmi 4X doesn't have an NFC chip, so no firmware will add this feature, and if you have an NFC in the settings, it's a firmware bug, and it won't work anyway.
How to update TWRP to the latest version?
Download a new TWRP.img file and run it through the current recovery version: Boot to TWRP. Select Install β†’ Install Image. Specify the path to the new TWRP file. Select Recovery and swipe. Do not update TWRP through Fastboot if you have custom firmware installed - this can lead to the rubbing of stock MIUI recovery.