How to install TWRP on Xiaomi Redmi Note 7: from unlock to firmware

Installing custom TWRP recavator on Xiaomi Redmi Note 7 (codename lavender) gives you access to advanced features from creating full system backups to firmware informal ROM. However, the process requires accuracy - an error at any stage can lead to a "brick" of the device. Unlike the standard recavator from Xiaomi, TWRP allows you to install ZIP-packets, modify system partitions and even recover data after failures.

This instruction is suitable for the Redmi Note 7 model (not to be confused with the Note 7 Pro or Note 7S!). Before you start, check the version of the device in Settings β†’ About Phone β†’ Model. The process includes three key steps: unlocking the bootloader through the official Xiaomi tool, Firmware TWRP through fastboot and preventing the recovery from being replaced with stock when restarted. Without an unlocked boot, installing TWRP is impossible - this is a security restriction from the manufacturer.

Important: After installation TWRP You will lose the opportunity to receive OTA-Also, some banking applications (such as Sberbank Online) may stop working due to the SafetyNet trigger.

Preparation of the device and PC

Before unlocking the bootloader and installing the TWRP, both the phone and the computer must be prepared, and skipping any of the items can lead to errors like fastboot: error: cannot load or hanging on the Mi logo.

On the phone:

  • πŸ“± Put the debugging on. USB: Go to Settings. β†’ About the phone, tap 7 times on the version MIUI, Then go back to the settings. β†’ Additionally. β†’ For developers and activate debugging.
  • πŸ”— Connect your device to your PC with the original cable (cheap cables often don’t transmit data to fastboot).
  • πŸ”‹ Battery charge should be at least 60% - when discharged during firmware, the phone may turn off.
  • πŸ“ Backup important data: Once the bootloader is unlocked, the phone will be reset to factory settings.

On your computer (Windows/Linux/macOS):

  • πŸ’» Install Android SDK Platform-Tools (includes fastboot and adb).
  • πŸ”§ For Windows, additionally install Mi Flash drivers (download from the official Xiaomi website).
  • πŸ“‚ Download the current version TWRP for lavender from the official website TWRP (file extension).
  • πŸ›‘οΈ Disable the antivirus – it can block fastboot as suspicious activity.
πŸ“Š What OS do you use for firmware?
Windows
Linux
macOS
Android (via Termux)

⚠️ Warning: If you use a laptop, connect it to a power source.Some users have reported firmware failures due to the laptop suddenly being turned off from the battery.

2 Unlock the bootloader through the Mi Unlock Tool

Xiaomi blocks the bootloader on all its devices. To install TWRP, it must be officially unlocked through the Mi Unlock Tool.The process takes 3 to 360 hours (depending on Xiaomi's policy) and requires an association of the Mi Account to the device.

Steps to unlock:

  1. Download the Mi Unlock Tool and unpack the archive.
  2. Launch it. miflash_unlock.exe on behalf of the administrator (for Windows).
  3. Sign in with the same Mi Account that is linked to your phone.
  4. Connect the phone in fastboot mode (turn off the phone, then press Power + Volume down until the hare appears in the eardress cap).
  5. In the program, press Unlock and confirm unlock.

Once successfully unlocked, the phone will automatically reset to factory settings. If the Mi Unlock Tool shows a "Couldn't unlock" error with a timer (e.g., 168 hours), wait for the specified time - this is Xiaomi's restriction for new accounts.

What if the Mi Unlock Tool can’t see the device?
1. Check that the phone is indeed in fastboot mode. 2. Update the drivers via Device Manager (should show "Android Bootloader Interface") 3. Try another one. USB-port (preferably) USB Launch the Mi Unlock Tool in Windows 7 Compatibility Mode.

Mistake.Reason.Decision
Couldn't unlock 50%Mi Account is not tied to phoneLog into your phone account, turn on synchronization
Current account is different from the account info on the deviceAnother account on PC and phoneUse one account everywhere
This device is lockedWaiting timer's not up.Wait for the specified time (3-15 days)
No device connectedDrivers not installedInstall Mi Flash or SDK Platform-Tools

3. Install TWRP via fastboot

Once the bootloader is unlocked, you can start the TWRP firmware. Using the official.img file and the fastboot flash recovery command. Importantly, do not disconnect the phone from the PC until the process is complete!

Step-by-step:

  1. Place the downloaded file twrp-3.7.0_9-0-lavender.img (version may differ in the folder with the platform-tools.
  2. Open the command prompt (or terminal) in this folder: Windows: Shift + PCM β†’ Open the PowerShell window here Linux/macOS: cd /path / to / folder

fastboot

fastboot devices

The serial number of the device must be displayed.

fastboot flash recovery twrp-3.7.0_9-0-lavender.img
fastboot boot twrp-3.7.0_9-0-lavender.img

bootloader unlocked (Unlocked status in fastboot) |

TWRP file downloaded for Lavender| model

Phone connected with original cable |

The command line is open on behalf of the administrator-->

Critical point: If you boot into the system after firmware, Xiaomi’s stock recavator will scratch TWRP. Therefore, immediately after the fastboot flash command, you need to boot into TWRP via fastboot boot.

⚠️ Note: On some versions MIUI post-installation TWRP Data decryption unsuccessful may occur. Solution: before rebooting to TWRP reset via Wipe β†’ Format Data β†’ Yes (this will delete all data!).

4.Preventing the replacement of TWRP with stock Recovery

Xiaomi aggressively protects its devices from modifications. Once the TWRP is installed, the system automatically flashes back the stock Recovery when it first boots, and to avoid this, you need to turn off the Recovery checking via fastboot or install the Disable Force Encryption patch.

Method 1: Disabling the check via fastboot (temporary solution):

fastboot flash vbmeta vbmeta.img


fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img

The vbmeta.img file can be extracted from stock firmware or downloaded here.

Method 2: Install a patch in TWRP (permanent solution):

  1. Download. ZIP-packet Disable_Dm-Verity_ForceEncrypt.
  2. Move the file to your phone or flash drive.
  3. V TWRP Choose Install β†’ Choose. ZIP β†’ Swipe to Confirm Flash.
  4. After installation, run Wipe β†’ Format Data (if required).

For custom firmware installation:

  1. Download. ZIP-firmware package (e.g. with XDA Developers).
  2. Move the file to your phone or microSD.
  3. In TWRP, select Wipe β†’ Advanced Wipe β†’ Dalvik, Cache, System, Data.
  4. Return to the main menu, click Install and select ZIP-packet.
  5. After installation, swipe Gapps (if required) and Magisk (for root rights).

SafetyNet Warning: Many banking applications (Sberbank, Tinkoff) and services (Google Pay) check the integrity of the system. Once TWRP and Magisk are installed, they may stop working.

  • Install Magisk and activate SafetyNet Fix and Universal SafetyNet Fix modules.
  • Hide root rights for specific applications through Magisk β†’ Settings β†’ MagiskHide.
  • Check SafetyNet status with the team: adb shell su -c "snet check"

7.How to return stock recavers and block the loader

If you decide to return the phone to its original state (for example, for sale or warranty repair), you must:

  1. Download stock firmware for Redmi Note 7 from the official Xiaomi website.
  2. Unpack. ZIP-archive and place the firmware folder in the root of the disk C:\.
  3. Install the Mi Flash Tool.
  4. Connect your phone in fastboot mode.
  5. In the Mi Flash Tool, select the firmware folder and press Refresh (the device should be displayed).
  6. Select Clean All mode and press Flash.

After the firmware runs the stock ROM, the bootloader will remain unlocked to lock it back:

fastboot oem lock

Warning: Locking the bootloader erases all data and can lead to a blink if the phone has unofficial firmware installed!

FAQ: Frequent questions about TWRP on Redmi Note 7

❓ Can we determine TWRP loader-free?
No. Xiaomi blocks customized recavator firmware at the bootloader level. Without official unlocking through the Mi Unlock Tool, TWRP installation is impossible. Alternative methods (such as exploits) for the Redmi Note 7 do not work due to security patches in MIUI.
❓ Why After Installation TWRP The phone asks for a password but does not accept it?
It's about data encryption (FBE β€” File-Based Encryption Solutions: Execute Format Data in TWRP (Or, file the Disable Force Encryption patch before you first boot into the system. If the password hasn't been set before, try leaving the field blank or entering it. default_password.
❓ How to update TWRP before?
Update is done similarly to the original installation: Download a new.img file TWRP. Connect the phone in fastboot mode. execute: fastboot flash recovery twrp-new.img fastboot boot twrp-new.img Do not update TWRP through the recovery itself (Install β†’ Install Image function) - this can lead to errors!
❓ Will it work? OTA-update TWRP?
No, the stock Recovery is responsible for the installation. OTA-After the replacement, TWRP You'll lose the ability to upgrade "over the air." Alternatives: Hand-held firmware of full packages MIUI through TWRP. Restore the stock recavator before upgrading (then re-installation) TWRP). Please note that updates through TWRP This may result in data loss or errors if the version MIUI Incompatible with your current firmware.
❓ Can I get a root license without TWRP?
Technically, but it's not recommended. Alternative methods (e.g., through Magisk in patched boot.img) require an unlocked bootloader and don't offer features like TWRP: You can't create a full backup system. It's hard to recover from a failed firmware. Access to system partition modifications is limited. TWRP remains the most reliable way to get root rights and install custom firmware.