TWRP on Xiaomi Redmi 4X: full instructions from unlock to firmware

Why is TWRP on Redmi 4X a must?

Xiaomi Redmi 4X (codenamed santoni) is still popular with custom firmware enthusiasts because of its hardware and a vibrant community of developers. However, the regular MIUI recaps severely limit the user’s ability to install unofficial firmware, make full backups or modify system partitions. Here comes the TWRP (Team Win Recovery Project), an open-source custom recovery.

With TWRP, you can:

  • πŸ“¦ Install custom firmware (LineageOS, Pixel Experience, HavocOS, etc.)
  • πŸ”„ Make full backups (nandroid backup) of all parts of the phone
  • ⚑ Switch Modified Magisk Cores and Modules for Root Rights
  • πŸ› οΈ Restore the phone after the β€œbrick” (if the bootloader is not blocked)

But before installing it, it’s important to understand that the process requires unlocking the bootloader, which resets the phone to factory settings and can take away warranty. On the Redmi 4X with firmware newer than the MIUI 10, you may also need to bypass Anti-Rollback protection.

This is a good guide for Xiaomi Redmi. 4X (santoni) based on Qualcomm Snapdragon processor 435. If you have a different model (e.g. Redmi). 4/4A/4 Prime, methods may not work! Clarify your device's code name in settings (Settings) β†’ The phone. β†’ Version. MIUI, slip 7 onceΒ»).

πŸ“Š What are you setting up for? TWRP on the Redmi 4X?
Custom firmware
Ruth-Right (Magisk)
Backup system
Recovery from the brick
Other

Preparation: What to do before installing TWRP

Installing a custom recavery is a process that requires care, and failure at any stage can lead to a "brick" of the device.

⚠️ Attention: Unlocking the bootloader on Xiaomi is officially supported by the company, but resets all data on the phone, including photos, contacts and apps. Create a backup of important files to your PC or cloud!

  • πŸ“± Check out the phone model: it should be a Redmi 4X (For this purpose, enter in the terminal ADB Command: adb shell getprop ro.product.device Response should be santoni.
  • πŸ”‹ Battery charge at least 70%. Interrupting the process due to discharge can make the phone inoperable.
  • πŸ–₯️ Install it on a PC: ADB and Fastboot (part of Android) SDK Platform-Tools) Xiaomi Drivers (download from the official website) Mi Unlock Tool (tool for unlocking the bootloader)
  • πŸ“₯ Download the current version TWRP for santoni from the official website (file with extension.img).

If you have previously blocked the bootloader or updated the firmware through MIUI OTA, check the status of Anti-Rollback. On Redmi 4X, you can do this through the command:

fastboot getvar anti

If the anti value is 3 or higher, a special firmware will be required to bypass the protection.

Make a data backup|Model testing (Santoni)|Installation ADB/Fastboot and drivers|Download TWRP for santoni|Battery charge β‰₯70%|Anti-Rollback check-up-->

Step 1: Unlock the bootloader on Redmi 4X

Without an unlocked bootloader, TWRP installation is impossible. Xiaomi allows you to officially unlock the bootloader, but the process requires a Mi Account and waiting (usually 72-168 hours).

Instructions:

  1. Enable Developer Options: Go to Settings β†’ About Phone. Tap 7 times on MIUI Version. Go back to Settings β†’ Additional β†’ Developer.

USB debugging

Unlocking the OEM

Connect the phone to the PC and confirm the debugging permission.

Mi Unlock Tool

Mi

Couldn’t unlock

⚠️ Note: If you have previously used unofficial unlocking methods (for example, through the EDL), Mi Account can be blocked, and you need to create a new account and wait 30 days.

Once successfully unlocked, the phone will automatically reset. Don't be afraid, that's okay. Now you can start TWRP firmware.

1. delete the Mi Account from your phone and add again.

2. connect to another Wi-Fi network (sometimes the lock is IP-related).

3. Use the Mi Unlock Tool version not newer than 5.5.224.30 (new versions may have additional checks).-->

Step 2: Install TWRP via Fastboot

Now that the bootloader is unlocked, you can flash TWRP.

  1. Turn off your phone and press Volume Down + Power to enter Fastboot mode (the screen will feature a hare in a hat-eared hat).
  2. Connect your phone to your PC and check for device detection by command: fastboot devices should show a serial number of the phone.
  3. Please. TWRP team (replace) twrp.img The name of your file: fastboot flash recovery twrp-3.7.0_9-0-santoni.img
  4. After successful firmware, don't restart your phone in the usual way! instead, hold Volume Up + Power to go straight to TWRP.
What if the fastboot can’t see the device?
1. Check the cable connection (try another one). USB-port, preferably 2.0). 2. Install drivers manually through Device Manager (select "Android Bootloader Interface"). 3. Disable driver signatures in Windows (use bcdedit command for this). /set nointegritychecks on in CMD on behalf of the administrator). 4. Try using Linux or macOS – there are less driver problems.

Step 3: First TWRP Start and Configure

Once you have a successful firmware, you will end up in the TWRP interface. The first thing to do is to disable the forced encryption (if enabled), otherwise the system may not boot.

Actions in TWRP:

  1. On the home screen, select Wipe β†’ Format Data (this will delete all data but prevent encryption issues).
  2. Enter yes to confirm.
  3. Go to Reboot β†’ Recovery to reboot back to TWRP (this is necessary to apply the changes).
  4. Now you can sew Magisk (for root rights) or custom firmware.

If the phone does not boot into the system after formatting Data, check:

  • πŸ”Ή Correctness of the version TWRP (Santoni is 3.7.0 or newer).
  • πŸ”Ή The presence of firmware in the phone (if you have formatted System, you need to flash it again).
  • πŸ”Ή The state of the Vendor partition (on some firmware it also needs to be flashed).

πŸ’‘

Formatting the Data partition in TWRP removes encryption, but also erases all user data. If you need to save files, copy them to your PC via MTP to TWRP (plug your phone and select Mount β†’ Enable MTP).

Solving Common Errors When Installing TWRP

Even with the exact following of the instructions, there can be problems.

Mistake.Reason.Decision
FAILED (remote: 'Flashing is not allowed in Lock State')The bootloader is not unlockedRepeat the unlocking process with the Mi Unlock Tool
Invalid sparse file format at header magiTWRP file damagedDownload the image again from the official website
The phone is loaded into MIUI Recovery instead of TWRP.It's the Anti-Rollback.Flush the patched firmware (e.g. MIUI 9.6.1.0)
E: Unable to mount /dataEncryption is on.Data format in TWRP or disable_force_encrypt.zip
The phone does not turn on after the firmwareBoot or System partition damagedFly the original firmware through the Mi Flash Tool in EDL mode

If after installing TWRP, the phone boots to bootloop (cyclic reboot), try:

  1. Press Volume up + Power to enter TWRP.
  2. Switch Magisk (if you install a root) or DM-Verity Disabler.
  3. Run Wipe β†’ Advanced Wipe and mark Dalvik, Cache, Data.

If nothing helps, go back to stock firmware via the Mi Flash Tool in Clean All mode (but that will remove TWRP!).

What to do after installing TWRP?

Now that TWRP has been successfully installed, new opportunities are opening up for you:

  • πŸ“² Installation of custom firmware: Download ZIP-Firmware file (e.g. LineageOS or Pixel Experience for santoni) Transfer it to your phone via MTP into TWRP. V TWRP Choose Install β†’ Choose. ZIP β†’ Swipe to Confirm Flash.
  • πŸ” Getting root rights: Download the latest version of Magisk from GitHub. ZIP-file-through TWRP. Install Magisk Manager app for root rights management.
  • πŸ’Ύ Backup creation: In TWRP Choose Backup. Mark Boot, System, Data, EFS (If you have, save the backup on SD-card.

⚠️ Note: After installing custom firmware, Widevine may stop working L1 (drop down L3), What will block viewing of high-resolution video on Netflix, Disney+ Solution: scroll through the MagiskHide Props Config module and change the print of the device.

If you plan to use Google Pay or banking apps, please note that root rights and custom firmware can block their operation.

  • πŸ”Ή MagiskHide (hiding the root from apps).
  • πŸ”Ή SafetyNet Fix firmware.
  • πŸ”Ή Use of alternative payment systems (for example, Samsung Pay via Magisk module).

FAQ: Frequent questions on TWRP on the Redmi 4X

Can I install TWRP without unlocking the bootloader?
No, on the Xiaomi Redmi 4X (as on all modern Xiaomi smartphones), installing a custom recavator requires an unlocked bootloader.The workarounds (for example, through vulnerabilities in EDL) are unstable and can lead to a "brick."
Why does the phone not boot after TWRP firmware?
There are several reasons: incompatible version TWRP (Download the image specifically for santoni. Boot or System damaged partitions (swipe the stock firmware through the Mi Flash Tool). Encrypted (execute Format Data in the TWRP). Anti-Rollback conflict. Try going to the patch. TWRP (Loudness up + Meals) and sew disable_dm_verity_forceencrypt.zip.
How to return stock recap after TWRP?
To restore the original MIUI recovery: Download the Redmi 4X stock firmware from the official website. Unpack the ZIP and find the recovery.img file. Run it through Fastboot: fastboot flash recovery recovery.img Reboot the phone. Note that this will not block the bootloader, but will return the regular recovery.
Can I upgrade TWRP to Redmi 4X?
Yeah, but not through. OTA. Download the new version of.img from twrp.me and run it through Fastboot: fastboot flash recovery. twrp-new_version.img Or straight out of TWRP: Choose Install β†’ Install Image β†’ Select a file β†’ Recovery.
Will OTG and MTP work on TWRP on Redmi 4X?
Yes, but with nuances: MTP (file transfer) works after connecting to a PC and selecting Mount β†’ Enable MTP in TWRP. OTG (flash drives/mouse) is supported, but may require additional drivers in some versions of TWRP. If the device is not defined, try another cable or USB 2.0 port. On Redmi 4X, it sometimes helps to reconnect the cable after you log in to TWRP.