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Β»).
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 antiIf 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:
- 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.
- Turn off your phone and press Volume Down + Power to enter Fastboot mode (the screen will feature a hare in a hat-eared hat).
- Connect your phone to your PC and check for device detection by command: fastboot devices should show a serial number of the phone.
- Please. TWRP team (replace) twrp.img The name of your file: fastboot flash recovery twrp-3.7.0_9-0-santoni.img
- 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?
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:
- On the home screen, select Wipe β Format Data (this will delete all data but prevent encryption issues).
- Enter yes to confirm.
- Go to Reboot β Recovery to reboot back to TWRP (this is necessary to apply the changes).
- 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 unlocked | Repeat the unlocking process with the Mi Unlock Tool |
| Invalid sparse file format at header magi | TWRP file damaged | Download 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 /data | Encryption is on. | Data format in TWRP or disable_force_encrypt.zip |
| The phone does not turn on after the firmware | Boot or System partition damaged | Fly the original firmware through the Mi Flash Tool in EDL mode |
If after installing TWRP, the phone boots to bootloop (cyclic reboot), try:
- Press Volume up + Power to enter TWRP.
- Switch Magisk (if you install a root) or DM-Verity Disabler.
- 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).