Xiaomi Redmi 4X firmware via computer: a complete guide with unlocking the bootloader

Xiaomi Redmi 4X (codenamed santoni) remains a popular budget smartphone even years after its release. However, over time, the regular MIUI firmware begins to slow down and updates from the manufacturer stop coming, firmware through the computer allows you to install a fresh version of MIUI, custom software like LineageOS or even restore the β€œbrick” after unsuccessful experiments.

This guide will take a look at everything from tool preparation to final system setup, and we’ll look at formal and informal methods, as well as critical nuances that are often overlooked in standard guides, such as how to get around MiFlash: β€œCan’t find device” or what to do if your phone isn’t detected in Fastboot mode.

Important: the procedure requires unlocking the bootloader, which resets all data. If you have never worked with ADB or Fastboot, we recommend that you first familiarize yourself with the basic concepts, this will save you from typical errors.

1. Preparation for firmware: what will be needed

Before you start, you can assemble everything you need, and even if you don't have one component, you can interrupt the process at a critical stage.

  • πŸ“± Smartphone Xiaomi Redmi 4X with a battery charge of at least 60% (preferably 80%), and discharge during firmware leads to a brick".
  • πŸ’» Computer on Windows 7/10/11 (64-bit). Nana macOS/Linux Possible problems with MiFlash drivers.
  • πŸ”Œ Original. USB-Cheap cables often don't transmit data to Fastboot.
  • πŸ”§ Programs: MiFlash Tool (official firmware tool) ADB & Fastboot (Google package) Xiaomi Drivers (download automatically when connected or manually here)
  • πŸ“ Firmware: Official MIUI (stable or development) from Xiaomi.Castom firmware (e.g. LineageOS 16 for santoni) from the forum XDA.

Downloaded firmware files are usually.tgz or.zip. Unpack them into a folder without Cyrillic characters (e.g., C:\MIUI\rom).

⚠️ Note: If you are running custom software, make sure it is compatible with the Redmi model. 4X (santoni.Redmi firmware installation 4/4A/4 Prime will cause the device to fail.

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

2 Unlocking the bootloader: a mandatory step

Xiaomi blocks the bootloader on all devices. Without it, Fastboot firmware is impossible. The process takes 3 to 360 hours (depending on Xiaomi's policy) and requires a Mi Account to be linked.

Instructions:

  1. Activate Developer Mode: Go to Settings β†’ About Phone. Tap 7 times on MIUI until the notification β€œYou are a developer” appears.
  2. Enable USB debugging: Return to Settings β†’ Additional β†’ Developer. Activate USB debugging and OEM unlock.
  3. Link your Mi Account: In the same menu, find Mi Unlock Status and click Add Account and Device. Sign in to your Xiaomi account (if not, sign up).
  4. Download the Mi Unlock Tool and run it on behalf of the administrator.
  5. Connect the phone in Fastboot mode (turn off the device, then press Volume down + Power until the hare appears in the eardress cap).
  6. In the program, click Unlock and wait until it is completed. If you receive a message to wait, wait for the specified time (usually 168 hours for new accounts).

⚠️ Warning: Once the bootloader is unlocked, the smartphone will completely reset. back up the data via Mi Cloud or locally on your PC.

What if the Mi Unlock Tool can’t see the device?
1. Check if Xiaomi drivers are installed (Android Bootloader Interface should be displayed in the Device Manager). 2. Try another one. USB-port (preferably) USB 2.0 on the back of your PC. 3. Disable the antivirus – it can block the Mi Unlock Tool. 4. Run the program in Windows 7 compatibility mode (right-click on the executable file). β†’"Properties" β†’"Compatibility").

3. Selection of firmware: official vs custom

The type of firmware depends on the functionality and stability of the device. Let's consider the pros and cons of each option:

Type of firmwareAdvantagesDeficienciesRecommendations
Official MIUI (Stable)Maximum compatibility with iron OTA-Updates are available for all functions (NFC, IR-blaster.)Lots of Bloatware (pre-installed apps) Ads in system menu Delays with security updatesThe Best Choice for Everyday Use
Official MIUI (Development)New features before stable version Fewer bugs than custom firmwarePossible errors Frequent updates (once a week)For enthusiasts ready for small bugs
LineageOS (Pixel Experience)Clean Android without ads Longer supported updates More features for customizationIt may not work. NFC, IR-blaster, camera No OTA-Updates (must be hand-stitched) Risk of unstable operationFor experienced users who need a β€œclean” Android

For Redmi 4X, the official firmware is divided into:

  • Global (for the international market, support for Google services).
  • China (without Google services, but with a lot of MIUI features)
  • EEA (for Europe, compliant with GDPR)

The critical nuance is that if you're running a China version on a global model (and vice versa), the network may disappear after the firmware is run, and you'll need to flash modem separately.

πŸ’‘

Before you run custom software, check on the XDA forum to see which features don’t work. For example, LineageOS 16 for santoni may not have a camera running correctly, and Pixel Experience may have NFC.

4. Firmware through MiFlash: step-by-step instructions

This method is suitable for installing the official MIUI. If you have chosen custom firmware, skip this section and go to the firmware via TWRP.

Install Xiaomi drivers|Unpack the firmware in a folder without spaces|Disable the antivirus|Charge the phone. >60%|Connect the original USB-cable

-->

Steps:

  1. Turn off the phone and put it in Fastboot mode (clip Volume Down + Power).
  2. Connect the device to a PC. Android Bootloader Interface should appear in Device Manager.
  3. Run MiFlash on behalf of the administrator.
  4. Click Select and point the way to the folder with unpacked firmware.
  5. At the bottom of the window, select firmware mode: Clean all – complete cleaning (recommended when changing the version of MIUI); Clean all and lock – cleaning + lock the bootloader (only if you complete experiments); Save user data – data storage (not always working correctly).

Refresh

Redmi 4X

Flash

If the process is suspended during the waiting for the device:

  • πŸ”„ Reconnect. USB-cable.
  • πŸ”§ Reinstall drivers manually through Device Manager (select Android Bootloader Interface driver from MiFlash folder).
  • πŸ–₯️ Try another PC (sometimes the problem is in conflict with others) ADB-driver).

⚠️ Warning: If the phone doesn't turn on after 15 minutes, don't panic. The first turn on after Clean all can take up to 20 minutes. If after that time the screen remains black, repeat the firmware by selecting a different mode (Clean all and lock often helps with freezes).

5. Install custom firmware through TWRP

Custom firmware (LineageOS, Pixel Experience, HavocOS, etc.) requires custom recavers - usually TWRP. The official version for Redmi 4X can be downloaded here.

Instructions:

  1. Download TWRP for santoni (file with.img extension).
  2. Move the downloaded file to a folder with ADB (e.g., C:\platform-tools).
  3. Open the command prompt in this folder (Shift + right click β†’ Open the PowerShell window here).
  4. Connect your phone in Fastboot mode and execute the command: fastboot flash recovery twrp-3.7.0_9-0-santoni.img fastboot boot twrp-3.7.0_9-0-santoni.img (Replace the file name with the current one).
  5. The phone will reboot to TWRP. Backup the current firmware (Backup β†’ Select partitions β†’ Swipe for confirmation).
  6. Transfer the custom firmware file (.zip) to your phone or flash drive.
  7. In TWRP, select Wipe β†’ Advanced Wipe and select Dalvik / ART Cache System Data Cache

Swipe for confirmation.

Install

Reboot System

The first turn on can take up to 10 minutes. If the system does not load for more than 20 minutes, repeat the steps, making sure that:

  • πŸ“Œ The firmware is compatible with Santoni.
  • πŸ“Œ You have made Wipe all of the sections mentioned.
  • πŸ“Œ Firmware file is not damaged (check checksum) MD5).

πŸ’‘

Custom firmware often requires additional patches, such as Open GAPPS for Google services in LineageOS (choose arm64 β†’ pico for Redmi 4X).

6. Solving common errors

Even with the correct following of the instructions, problems can arise, and let's look at the typical errors and how to fix them:

Mistake.Reason.Decision
MiFlash:"Can't find device"No drivers or conflict with others ADB-deviceRemove all Android devices in Device Manager. Reinstall drivers from the MiFlash folder. USB-port.
Fastboot:"FAILED (remote: device is locked)"The bootloader is not unlockedReturn to the step with the Mi Unlock Tool and wait until the unlock is completed.
TWRP:"Unable to mount /data"Encrypted data section (if password was set)In TWRP, select Wipe β†’ Format Data, enter Yes and confirm.
The phone does not turn on after the firmwareIncompatible firmware or interrupted processRepeat the firmware with Clean all. If it doesn't work, run the China version of MIUI, then the global version.
No network after firmwareSwitched version for another region (for example, China on the global model)Sweat modem from your region’s stock firmware through TWRP.

If none of the methods worked, try to sew through EDL-(Access loading mode) This will require:

  1. Special cable (EDL cable) or closing contacts on the board.
  2. MiFlashPro or QFil.
  3. Firmware in.mbn format (can be extracted from the official.tgz).

⚠️ Attention: Firmware through EDL β€” If you're not sure about your skills, you can go to the service center if you're not sure about your skills.

7. System optimization after firmware

After successful firmware, it is recommended to follow several steps to improve performance and stability:

  • πŸ”§ Disable unnecessary services: Go to Settings β†’ Annexes β†’ Application management: Disable pre-installed services (Mi Video, Mi Music, Mi Browser, etc.) if you are not using them.
  • ⚑ Activate Performance Mode: Enable Settings β†’ Battery β†’ Performance mode. Turn off animation: in Settings β†’ About the phone tap 5 times on the version MIUI, then in Settings β†’ Additionally. β†’ For developers, install Windows animation = 0.5x.
  • πŸ›‘οΈ Set up security: Update Google Play Protection in Settings β†’ Google β†’ Security: Set a strong password or pattern lock (do not use it) PIN β€” easier to pick up).

For custom firmware (LineageOS, etc.):

  • Install Magisk for root rights (download Magisk.zip and run through TWRP).
  • Set up SELinux in Permissive mode (if some features don’t work).

If after the firmware noticed overheating or rapid discharge of the battery:

  1. Check the active processes in Settings β†’ Battery β†’ Battery use.
  2. Calibrate the battery: completely discharge the phone, then charge to 100% without interruption.
  3. If the problem persists, run the kernel with optimized settings (e.g., FrancoKernel for santoni).

8. FAQ: Answers to Frequent Questions

Can I flash Redmi 4X without unlocking the bootloader?
No. Xiaomi locks firmware through Fastboot and TWRP without unlocking. The only workaround is firmware through EDL, but it requires special hardware and is risky for beginners.
How to return the official firmware after custom?
Download the official MIUI for Redmi 4X and run it through MiFlash in Clean all and lock mode. If the bootloader has been unlocked, it can be blocked again with this option.
Why is the camera or NFC not working after the firmware?
This is a typical custom firmware problem. Solutions: For the camera: patch Camera2API or install alternative software (GCam). For NFC: check if your firmware supports this feature (many custom builds disable NFC for santoni).
How to update the firmware after installing the custom?
The scalings are not supported. OTA-Update: Download the new firmware (.zip). Reboot to TWRP. Backup your current system. Swipe the new.zip without Wipe (if you upgrade over) or with Wipe. Cache/Dalvik (If recommended by the developer).
What if after firmware, the phone asks for a password from the old Mi Account?
This happens if you have a Mi Account attached before the firmware and then a reset is made. Solutions: Enter your old account details (if you remember). If you don't remember, run the firmware through MiFlash with the Clean all and lock option, then unlock the bootloader again. At the very least, contact Xiaomi with proof of ownership of the device (check, box, etc.).