Installing TWRP on Xiaomi Redmi Note 4X: a complete guide from unlock to firmware

Xiaomi Redmi Note 4X

mido

LineageOS

Pixel Experience

TWRP

Many users experience errors like FAILED (remote: 'dtb not found') or hanging on the Mi logo after a flawed firmware, most often due to missing steps: an unblocked bootloader, an inappropriate TWRP version, or ignoring file checksum checks. In this guide, we will look at all the steps from preparing a PC to the first boot to a new recovery, taking into account the specifics of the Redmi Note 4X (including versions with a Snapdragon 625) processor.

Important: If your smartphone is purchased in China or is linked to a Mi Account with an active Find Device function, unlocking the bootloader may require additional actions (see Frequent Problems section).

Preparation of the device and PC

Before you start installing TWRP, make sure your Redmi Note 4X meets the following key requirements:

  • πŸ”‹ Battery charge at least 70%, and the unlocking and firmware process can take up to 30 minutes, and discharging in the middle of the operation will lead to a brick.
  • πŸ“± Version. MIUI No older than 12.5 (MIUI 13+) Vulnerabilities used to unlock can be blocked.
  • πŸ–₯️ Windows computer 10/11 (64-bit) MacOS is not recommended due to problems with fastboot drivers.
  • πŸ”Œ Cable USB β€” It's original or certified. Cheap cables often don't fastboot data.

Also prepare the following tools:

Tool.Download linkNote
Mi Unlock ToolOfficial Xiaomi websiteRequires a Mi Account with a Linked Phone Number
Platform Tools (ADB & Fastboot)Android DevelopersUnpack into the root of the disk C:\platform-tools\
TWRP for midoOfficial website of TWRPChoose a version. 3.7.0_9-0 or newer (for Android) 10+)
Xiaomi driversMi PC SuiteInstall even if you don’t plan to use the Mi Suite

⚠️ Note: If you have previously installed custom firmware through fastboot, check the current status of the bootloader with the command: fastboot oem device-info In the answer, look for the line Device unlocked: true. If false - unlock is mandatory!

2 Unlocking the bootloader (Bootloader)

Without an unlocked bootloader, installing TWRP is impossible. Xiaomi officially allows unlocking, but the process can take up to 720 hours (30 days) for new accounts. Here's how to do it correctly:

  1. Activate Developer Options: Go to Settings β†’ About Phone β†’ MIUI version and tap 7 times on the build number.
  2. Back to Settings β†’ Additionally. β†’ For developers and include: πŸ”“ Unlocking OEM (It may not be available on some versions. MIUI) πŸ”Œ Debugging by USB

Connect the phone to the PC, select File Transfer mode and confirm debugging permission.

Launch the Mi Unlock Tool, log in to your Mi Account and follow the instructions. If you see the message "Wait 168/720 hours" - wait for the timer to end.

Once successfully unlocked, the phone will automatically reset to factory settings. Don't miss this step - it's necessary for TWRP to work properly in the future.

πŸ“Š How long have you waited for the bootloader to unlock on Xiaomi?
Less than 24 hours.
3-7 days
More than 7 days
I'm waiting.
I remember.

3. Install TWRP via Fastboot

Now that the bootloader is unlocked, you can start running TWRP firmware. Importantly, only use official builds from twrp.me. Unofficial versions may contain malicious code or may not support features like /data encryption.

Step-by-step:

  1. Download the twrp-3.x.x-x-mido.img file to the platform-tools folder.
  2. Open the command prompt in this folder (Shift + right mouse button β†’ β€œOpen PowerShell window here”).
  3. Turn off the phone and press Volume Down + Power to log into fastboot.
  4. Connect your phone to your PC and check for device detection by command: fastboot devices should show a serial number of the device.
  5. TWRP: fastboot flash recovery twrp-3.x.x-x-mido.img
  6. Important! Immediately after the firmware, go to recovery without booting into the system. twrp-3.x.x-x-mido.img Or manually: press the volume up + Power on-set.

It is further recommended that:

  1. Make a full backup of the current firmware (select the Boot, System, Data sections, EFS). Save the backup on SD-card.
  2. Format /data if you plan to install custom firmware (like LineageOS). To do this, go to Wipe β†’ Format Data and type yes.
  3. Install Magisk for root rights (optional). Download the latest Magisk.zip from GitHub and stream through Install.

πŸ’‘

If TWRP asks for a password when mounting /data and you didn't set it, it means that the partition is encrypted. To reset encryption, run Format Data (all data will be deleted!).

5. Frequent errors and their solutions

Even when following instructions, users often encounter problems, and here are the most common ones and ways to fix them:

Mistake.Reason.Decision
FAILED (remote: 'dtb not found')Incompatible version of TWRP or corrupted img fileDownload the official build for mido
Hanging on the Mi logo after firmwareWrong order of action (boot to the system instead of TWRP)Repeat the TWRP firmware and immediately boot into recovery.
E: Unable to mount /dataPartition encrypted or damagedRun Format Data in TWRP (Data Loss!)
Mi Unlock Tool Shows β€œCouldn’t Unlock”Account not tied to device or waiting is not completedCheck the binding in Settings β†’ Mi Account β†’ Mi Cloud β†’ Find Device

If the touch screen doesn’t work after installing the TWRP, try:

  • πŸ”„ Re-flash another version TWRP (for example, XDA).
  • πŸ”§ Connect OTG-mouse to navigate the menu.
What to do if your phone turns into a brick?
If, after the manipulation, TWRP phone not turned on (black screen, vibration without logo), try it: 1. Load in EDL-mode (clamp Volume upwards) + Loudness down + Power on a phone turned off). 2. Swipe stock firmware through Mi Flash Tool (you can download it on the [en.miui.com](https://en.miui.com/a-234.html)). 3. If EDL Not defined – check out Qualcomm drivers HS-USB QDLoader 9008.

6. firmware custom OS through TWRP

Now that TWRP has been successfully installed, you can start firmware custom operating systems like LineageOS, Pixel Experience or HavocOS.

  1. Download. ZIP-firmware file and, if necessary, GApps (e.g., Open GApps in the pico or nano variant).
  2. Transfer files to your phone (via the phone) MTP into TWRP or SD-map).
  3. V TWRP run the Wipe β†’ Advanced Wipe and mark: 🧹 Dalvik / ART Cache 🧹 System 🧹 Data (if a clean installation is required) 🧹 Cache

Install the firmware through Install, then (if necessary) GApps and Magisk.

Reboot to the system. The first boot can take up to 10-15 minutes.

Important for the Redmi Note 4X: Some custom firmware requires an additional patch to make the camera work properly (e.g., fix for libcamera). XDA or 4PDA.

πŸ’‘

Always check that the firmware is compatible with your device’s codename (mido for Redmi Note 4X). Installing firmware for another model (e.g., mido vs nikel) will result in a hard brick!

7. Stock firmware recovery

If the experiments with custom OSes were unsuccessful or you want to return the phone to its original state, you can restore stock MIUI in two ways:

  1. Through TWRP: Download the official ZIP mido firmware. Sweat it through Install to TWRP (without wipe if you want to save data).

Fastboot (if TWRP doesn't work):

  • Download fastboot firmware from the official Xiaomi website.
  • Unpack the archive and launch it. flash_all.bat (Windows or flash_all.sh (Linux/Mac).

Once the stock firmware is restored, the TWRP will be removed and the bootloader will remain unlocked. To return the stock recovery, do:

fastboot flash recovery stock_recovery.img

(file stock_recovery.img You can get it from the official firmware).

FAQ: Answers to Frequent Questions

❓ Can we determine TWRP loader-free?
No. Xiaomi blocks the entry to the recovery section on locked devices. Any bypass methods (for example, through vulnerabilities in MIUI) work unstable and can lead to a brick.
❓ Why after the firmware? TWRP The phone doesn't see internal memory?
This is due to the encryption of /data in MIUI. Solutions: Run Format Data in TWRP (data will be deleted!) Or enter the password/pattern lock that was in the system before the TWRP firmware.
❓ How to update TWRP before?
Download a new.img file and run it through your current TWRP: Go to Install β†’ Install Image. Select the downloaded file and specify the Recovery section. Reboot to recovery. Don't use fastboot to update TWRP - this can lead to data loss!
❓ Does Google Pay work after installing Magisk?
Not if MagiskHide is enabled. Contactless payments: Install SafetyNet Fix. In Magisk settings, enable MagiskHide and add Google Play Services to the hidden app list. Check SafetyNet status through the SafetyNet Test app.
❓ Can I return the official guarantee after unlocking?
No, not technically. Xiaomi will cancel the warranty when unlocking the bootloader. However: If you return the stock firmware and lock the bootloader (via fastboot oem lock), the service center may not notice the interference. In some countries (for example, Russia, the EU), the refusal of warranty repairs due to unlocking can be challenged through consumer protection law.