Installation of TWRP on Xiaomi Redmi 4X: from unlocking the bootloader to firmware recaveri

Installing a custom TWRP recavator on Xiaomi Redmi 4X (codenamed santoni) opens up access to advanced features: backups via Nandroid, custom ROM firmware, root rights and even restoration of bricks after unsuccessful experiments. However, the process requires accuracy - an error at any stage can turn a smartphone into a useless brick. In this article, we will analyze all the steps from unlocking the bootloader to checking the health of TWRP, taking into account the nuances of a particular model.

The main difficulty for owners of Redmi 4X is the official policy of Xiaomi, blocking the bootloader by default. Without it, you can not flash TWRP. In addition, the model was released in several versions (for example, with Snapdragon 435 and 430 processors), which affects the choice of files recovery. We will look in detail how to determine the version of the device, where to download the right files and how to avoid common errors like Fastboot mode or endless download.

Important: The instruction is relevant for the MIUI-based Redmi 4X (including global and Chinese versions), but not for models with MediaTek processor or modifications like Redmi 4/4A/4 Prime. If you are not sure about the model, check it in Settings β†’ About Phone β†’ Model or through the command fastboot getvar product.

1. Preparation: What to do before installing TWRP

Before you start unlocking and firmware, gather everything you need. Without proper preparation, you risk getting a smartphone with a locked bootloader or damaged partitions.

Here's the mandatory set:

  • πŸ”Œ Charged smartphone (at least 70% battery) Fastboot firmware can take up to 10 minutes, and discharge in the process will lead to failure.
  • πŸ’» Windows computer 10/11 (or Linux/macOS driverless ADB/Fastboot). Virtual machines are not recommended due to problems with the USB-connection.
  • πŸ”— Cable USB (Cheap cables can interrupt data transmission, which is critical for Fastboot.
  • πŸ“ Firmware files: Official Mi Unlock Tool (last version). TWRP for santoni (links below in the table). ADB/Fastboot (for example, Android SDK Platform-Tools).

Also, make sure to back up important data β€” once you unlock the bootloader, the smartphone will be reset to factory settings. Use Mi Cloud, Google Photos or physical copying on your PC. Apps like Titanium Backup won't help without root rights.

⚠️ Attention: If your Redmi is 4X was purchased in China and runs on firmware for the China region, after unlocking the bootloader may require firmware global version MIUI for Google services to work correctly. Clarify the firmware version in Settings β†’ The phone. β†’ Version. MIUI.

πŸ“Š What is your experience with Android devices?
Never stitched.
I stitched it 1-2 times.
Experienced user
Developer/modderator

2 Unlock the bootloader on the Redmi 4X

The bootloader on all Xiaomi smartphones is locked by default, and unlocking it is a must before installing TWRP. The process takes up to 72 hours due to Xiaomi’s policy, which requires waiting after the account is tied to the device.

Instructions for unlocking:

  1. Link your Mi Account to your device: Go to Settings β†’ Mi Account and log in. Enable Settings β†’ Additional β†’ Developer β†’ Unlock OEM (if not, activate Developer Mode by clicking 7 times on About Phone Build Number). Connect your smartphone to your PC and confirm the binding in Mi Unlock Tool.
  2. Run Mi Unlock Tool: Download the utility from the official website and install. Run the program on behalf of the administrator, log in to the same Mi Account as your phone. Put the phone in Fastboot mode: turn it off, then press Volume down + Power until the rabbit appears in the hat-eared.
  3. Start unlocking: Connect your phone to your PC. The Mi Unlock Tool will show a message about a successful connection. Press Unlock. If you have a wait error, wait until the specified time (usually 72-168 hours).

Once successfully unlocked, the phone will automatically reset to factory settings. Don't worry, that's okay. Now you can start TWRP firmware.

Linked to the Mi Account to the device|Unlocking enabled OEM|Drivers installed ADB/Fastboot|Phone's loaded on 70%+|Data backup made.-->

3.Selecting the Right TWRP Version for Redmi 4X

The Redmi 4X came with two processor types: the Snapdragon 435 (most devices) and the Snapdragon 430 (less commonly), and using an inappropriate TWRP version will cause the device to fail to identify its modification:

  1. Install the Kernel Adiutor or CPU-Z app.
  2. Check the processor model in the Hardware Info section.
  3. Please refer to the table below:
ProcessorCode nameTWRP referenceNotes
Snapdragon 435santoniOfficial websiteThe most common version. Supports /data encryption.
Snapdragon 430santoni (revision)XDA DevelopersUnofficial builds. You may need to disable dm-verity.

Download a file with the.img extension (for example, twrp-3.7.0_9-0-santoni.img) and save it to the folder with the platform-tools (where adb.exe and fastboot.exe lie).

⚠️ Attention: If you download TWRP For other models (e.g. Redmi 4 or Redmi Note) 4X), The firmware will end in error and the phone may stop loading. Always check the device's code name through fastboot getvar product.

How to check the code name of the device?
Connect your phone in Fastboot mode to your PC, open the command line in the folder with the platform-tools and type: fastboot getvar product If the answer is product: santoni, then you have Redmi 4X. For other models (for example, mido is Redmi Note 4X), the instruction is not suitable!

4. Install TWRP via Fastboot

Now, to the firmware itself, the whole process takes no more than 5 minutes, but requires precise follow-up.

Step-by-step:

  1. Turn your phone into Fastboot mode: Turn off the device. Press Volume down + Power before the screen with the hare appears.
  2. Connect to your PC and check the connection: Open the command prompt in the folder with the platform-tools (press Shift + PCM β†’ Open the PowerShell window here). Enter the command: fastboot devices If the device is determined (the serial number appears), you can continue.
  3. Please. TWRP: Enter the command (replace). twrp.img The name of your file: fastboot flash recovery twrp-3.7.0_9-0-santoni.img Wait for the message. OKAY.
  4. Launch it. TWRP: Without turning off the cable, enter: fastboot boot twrp-3.7.0_9-0-santoni.img It'll temporarily load. TWRP without being written to permanent memory (in case of errors). TWRP You can use it constantly (see the next section).

If the fastboot flash recovery error appears after the command FAILED (remote: 'Not allowed in Lock State'), then the bootloader is not unlocked. Go back to step 2.

πŸ’‘

If after the firmware TWRP The phone loads into a standard Recovery, so the stock firmware overwrote it. TWRP plough disable_forceencrypt.zip (if you use encryption) or no_verity_opt_encrypt.zip self-indulgently TWRP.

5. Permanent installation of TWRP and overwriting protection

By default. MIUI at first load after the firmware TWRP It can automatically restore the stock Recovery:

  1. Load in TWRP: After the command fastboot boot (from the previous step), the phone should boot into the interface. TWRP. If the screen does not respond to touch, connect OTG-mouse.
  2. Turn off signature verification: Go to Mount β†’ Enable MTP (You can download files from your PC. no_verity_opt_encrypt.zip And move it to the phone. TWRP Click Install, select the downloaded file and swipe for firmware.
  3. Sweep Magisk (optional): If you need root rights, download Magisk and thread it in the same way.
  4. Reboot to System: Press Reboot β†’ System. If TWRP asks about installing an application, you can opt out.

After these actions, the stock recovery will not recover, and you will be able to use TWRP for backups, ROM firmware and other operations.

Use the correct version of TWRP for your processor.

- File. no_verity_opt_encrypt.zip Switch before the first load into the system.

- bootloader unlocked (checked by the command fastboot oem device-info).-->

6. Common errors and their solution

Even with the correct following of the instructions, problems can arise, and here are the most common ones and ways to fix them:

Mistake.Reason.Decision
FAILED (remote: 'Flashing is not allowed in Lock State')The bootloader is not unlockedRepeat the unlock process through the Mi Unlock Tool and wait for the timer to end.
The phone is not defined in fastboot devices.No drivers or USB issuesInstall Google Drivers USB Driver. Try another one. USB-port (preferably) USB 2.0).
TWRP is stitched but not launchedIncompatible version or corrupted fileDownload another version of TWRP (for example, the official version) and repeat the firmware.
After the firmware Magisk phone does not bootIncompatibility with the MIUI versionSweep Magisk-uninstaller.zip through TWRP or upgrade MIUI to the latest version.

If neither of these methods worked, try returning stock recaps and firmware through the Mi Flash Tool. Recovery instructions can be found on the Xiaomi.eu forum.

7. Additional features after installation of TWRP

Now that TWRP has been successfully installed, you can:

  • πŸ“± Install custom firmware (e.g. LineageOS, Pixel Experience, or MIUI from xiaomi.eu).
  • πŸ”„ Make full backups (including /data, /system and /boot) and re-establish them if necessary.
  • πŸ”§ Get root rights through Magisk for fine-tuning the system.
  • πŸš€ Remove embedded applications (bloatware) without risking damage to the system.
  • πŸ”’ Bypassing restrictions MIUI, for example, locking the installation APK source.

For beginners, we recommend starting with the backup of the current firmware. TWRP Select Backup, mark all partitions (except Cache) and save backup to SD-It's a card or a PC, and it'll save you if you don't get a firmware failure.

πŸ’‘

Always check for compatibility with the santoni model and Android version before installing custom firmware. For example, firmware for Android 10 will not work if your Redmi 4X runs Android 7/8.

FAQ: Frequent questions on TWRP on the Redmi 4X

Can I install TWRP without unlocking the bootloader?
Xiaomi blocks the entry to the recovery section on locked devices, and any attempt to circumvent this restriction leads to the FAILED error (remote: 'Not allowed in Lock State').
How to return stock recap after TWRP?
Download the official firmware for Redmi 4X from Xiaomi, unpack it and swipe the recovery.img file through Fastboot: fastboot flash recovery.img or use the Mi Flash Tool for a full flash flash flash.
Why does TWRP ask for a password when downloading?
This happens if encryption is enabled on the device. /data. To bypass password request: Download disable_forceencrypt.zip and run it through TWRP. Or do a reset via Wipe. β†’ Format Data (all data will be deleted!).
Can I upgrade MIUI with OTA with TWRP installed?
Technically, but not recommended. The OTA update will rewrite recovery, and you'll have to flash TWRP again. Better download the full firmware (.zip) and install it through TWRP.
How to check if TWRP is installed correctly?
Turn off your phone and press Volume Up + Power. If TWRP (Blue with Touch Control) boots, it's a success. If the stock Recovery loads (yellow text on a black background), repeat the firmware.