How to Refuse Xiaomi 9T (Redmi K20) independently: from unlocking to installing custom firmware

Reflashing the Xiaomi smartphone 9T (also known as the Redmi K20 codenamed davinci โ€“ a task that users face for various reasons: from wanting to update an outdated version MIUI It's a process that requires care, but a mistake at any stage can turn a device into a brick. In this article, we'll look at everything from preparing and unlocking a bootloader to choosing a firmware and solving typical problems.

Many people are afraid to stitch their smartphones themselves, fearing losing their warranty or data. Indeed, the official warranty Xiaomi is removed after unlocking the bootloader, but with careful follow-up, the risks are minimal. TWRP So there's a very different complexity and consequences, and we're going to look at both, and we're going to look at alternatives like this. OTA-Renewal for those who are not ready for radical change.

Before you start, answer two questions: Why do you need to flash it, and what do you expect to see? If the goal is simply to upgrade to the latest version of the system. MIUI, If you want to have a clean Android without Xiaomi shell or want root rights to deep customize the system, then you can not do without unlocking the bootloader and custom recovery.

๐Ÿ“Š Why do you want to re-examine Xiaomi? 9T?
Update MIUI to the latest version
Install custom firmware (LineageOS, Pixel Experience)
Get root rights
Fix errors after a failed update
Other

1. Preparation for flashing: what to do before the start

The first step is to save all the important data. Flash it, especially through Fastboot or TWRP, Use Xiaomi Cloud, Google Drive or physical copying to your PC for backup:

  • ๐Ÿ“ฑ Contacts (export to) VCF-file)
  • ๐Ÿ“ท Photo and video (copy to external drive)
  • ๐Ÿ”‘ Logins and passwords (use managers like Bitwarden)
  • ๐ŸŽฎ Game Save (check if the game supports cloud backup)

Next, check the current firmware version and device model. To do this, go to Settings. โ†’ You're gonna need a phone:

  • ๐Ÿ“‹ Model of the device (should be) M1903F10I or M1903F11I global version)
  • ๐Ÿ”ข Version. MIUI (for example, MIUI Global 14.0.5)
  • ๐Ÿ”‘ bootloader status (unlocked/locked โ€“ checked by the fastboot oem device-info command)

It is equally important to prepare the computer:

  • ๐Ÿ–ฅ๏ธ Install Android SDK Platform-Tools (for fastboot and adb)
  • ๐Ÿ”Œ Connect your smartphone with the original cable (cheap cables can cause data transmission errors)
  • ๐Ÿ”‹ Battery charge should be at least 60% โ€“ this is critical to avoid failures during firmware

โš ๏ธ Attention: If your Xiaomi 9T It was purchased in China (the C-suffix version in the model), and it may take up to 360 hours (15 days) to unlock the bootloader after the Mi Account is linked to the device.

2 Unlock the bootloader: step zero for any firmware

Without an unlocked bootloader, you can't install custom recavators or firmware through Fastboot. The process is officially supported by Xiaomi, but has nuances. Here's a step-by-step instruction:

Step 1: Linking your Mi Account to your device

  • ๐Ÿ“ฑ Go to Settings. โ†’ Xiaomi account โ†’ Mi Cloud and log in.
  • ๐Ÿ”— Enable sync and make sure the device is tied to your account.
  • ๐Ÿ”’ B Settings โ†’ Additionally. โ†’ For developers, activate OEM-unlocking and debugging USB.

Step 2: Request Unlocking via Mi Unlock Tool

  • ๐Ÿ–ฅ๏ธ Download Mi Unlock Tool and run on behalf of the administrator.
  • ๐Ÿ”Œ Connect your phone in Fastboot mode (clip Volume Down) + Power with the device switched off).
  • ๐Ÿ”‘ Log in to the same Mi Account as on your phone and follow the program instructions.

When you send a request, you may receive a waiting message, which is typically 72 to 168 hours for global versions, up to 360 hours for Chinese versions, and the unblock status can be checked by the team:

fastboot oem device-info

Search for Device unlocked: true.

โš ๏ธ Warning: If you bought your phone with your hands, make sure the previous owner untie your Mi Account from the device. Otherwise, unlocking will not be possible without its data.

Linked to the Mi Account to the device|On. OEM-unlocking|Installed drivers Fastboot on PC|Battery charge >60%|Original. USB-cable-->

3. firmware selection: official MIUI vs custom builds

The type of firmware depends not only on the functionality, but also on the stability of the device.

Type of firmwareAdvantagesDeficienciesComplexity of installation
Official MIUI (Fastboot/Recovery)Stability, support OTA-Updates, retaining warranty (unless the bootloader is unlocked)Shell MIUI Advertising, limited customizationโญโญ (easily)
LineageOS (Pixel Experience)Clean Android, no Bloatware, regular updatesThere are possible bugs with the camera or sensors, no OTAโญโญโญโญ (difficult)
Port from other devices (e.g. port from other devices, MIUI from Redmi K30)New functions, informal supportHigh risk of unstable work, lack of updatesโญโญโญโญโญ (difficult)

For beginners, we recommend starting with the official firmware, which can be downloaded at en.miui.com.

  • ๐ŸŒ Region: Choose Global for International or China for Chinese.
  • ๐Ÿ”ข Android Version: For Xiaomi 9T Firmware based on Android 10-12.
  • ๐Ÿ“ฆ File type:.tgz for Fastboot or.zip for Recovery.

If you are a custom firmware user, check out XDA-Developers forums.

  • ๐Ÿค– LineageOS โ€“ as close as possible to Android stock.

๐Ÿ’ก

Before downloading custom firmware, check the date of the last update on the forum. If the build has not been updated for more than 6 months, there is a risk of incompatibility with new versions of GApps or the kernel.

4.Fastboot Firmware: The Official Method from Xiaomi

This method is suitable for setting an official MIUI And it requires an unlocked bootloader:

Step 1: Preparing files

  • ๐Ÿ“ฅ Download the firmware in.tgz format and unpack it into a folder with fastboot.
  • ๐Ÿ“‚ The file should appear in the folder. flash_all.bat (for Windows or flash_all.sh (for Linux/Mac).

Step 2: Transfer your phone to Fastboot mode

  • ๐Ÿ”Œ Turn off the device.
  • ๐Ÿ”˜ Hold the Loud down. + Power before the appearance of the Fastboot logo.

Step 3. Starting the firmware

  • ๐Ÿ–ฅ๏ธ Connect your phone to your PC and start it. flash_all.bat.
  • โณ Wait until the process is completed (usually takes 5-10 minutes).

If the process is interrupted with an anti-rollback error, you are trying to install an older version. MIUI, It's not the one that's already on the device, and in that case, you're going to have to look for the firmware with the highest number of the anti-rollback or use it. TWRP circumvention.

โš ๏ธ Warning: Once you've run your Fastboot, your phone will automatically reset to factory settings. Don't try to interrupt the process, wait until the system is fully loaded.

๐Ÿ’ก

Fastboot firmware is the most reliable way to return the device to the โ€œfactoryโ€ state, but it is not suitable for installing custom firmware or modified cores.

5. Installation through TWRP: root-stitch

If you want to install LineageOS, get root rights or make a backup through Nandroid, you will need a custom recavery. TWRP. The process is more complicated than through Fastboot, but opens up more possibilities.

Step 1: Installation of TWRP

  • ๐Ÿ“ฅ Download the current version TWRP for davinci from the official website.
  • ๐Ÿ–ฅ๏ธ Move the file. twrp.img fastboot.
  • ๐Ÿ”Œ Connect your phone in Fastboot mode and execute the command: fastboot flash recovery twrp.img
  • ๐Ÿ”˜ After successful installation, reboot to the Recovery, holding Volume up + Nutrition.

Step 2: Custom OS firmware

  • ๐Ÿ“ Download the firmware (for example, lineage-19.1-davinci.zip) GApps (if you need Google services).
  • ๐Ÿ“ฑ Transfer files to your phone or external SD-map.
  • ๐Ÿ”ง V TWRP run the Wipe โ†’ Advanced Wipe and mark: ๐Ÿงน Dalvik / ART Cache ๐Ÿ—ƒ๏ธ System ๐Ÿ“„ Data ๐Ÿ”„ Cache
  • ๐Ÿ“ค Return to the main menu and select Install, then specify the path to the firmware file.
  • ๐Ÿ”„ After installing the OS, repeat the step for GApps (if necessary).

Step 3. First download

  • โณ The first download can take 10-20 minutes โ€“ do not interrupt the process.
  • ๐Ÿ”ง If the system does not load for more than 30 minutes, return to the TWRP And check the error logs.
What if TWRP doesnโ€™t see internal memory?
After installation TWRP internal memory is not mounted, the reason may be encryption. Solution: 1. TWRP Go to Wipe. โ†’ Format Data (this will delete all data!). 2. Enter yes for confirmation. 3. Reboot to the recavers and try again to install the firmware.

Typical errors and their solutions

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

Mistake.Reason.Decision
Fastboot: FAILED (remote: 'Flashing is not allowed in Lock State')The bootloader is not unlockedUnlock the bootloader through the Mi Unlock Tool
E: Unknown command [log] in TWRPIncompatible version of TWRPDownload the current build for Davinci
The phone does not turn on after the firmwareIncorrectly selected firmware or interrupted processRepeat the firmware via Fastboot with the official MIUI
Anti-rollback check failReversed to an older version of MIUIFind the firmware with the highest number of antirollback

If after firmware the phone hangs on the logo, try:

  • ๐Ÿ”˜ Hold the Loud up. + Food for entry TWRP repeat.
  • ๐Ÿ–ฅ๏ธ Scroll down the official MIUI Fastboot (this will bring the device back to life 90% of the time).

For errors related to data encryption (for example, requesting a password after installing custom firmware), formatting the Data partition in TWRP.Remember will help: this will delete all user data!

7.Getting root rights: Magisk and its alternatives

If the purpose of the firmware is to obtain root rights, after installing a custom OS or an official one MIUI through TWRP You can use Magisk:

Step 1 Installation of Magisk

  • ๐Ÿ“ฅ Download the latest Magisk release from GitHub (file) Magisk-v26.4.zip).
  • ๐Ÿ“ฑ Transfer the file to the phone.
  • ๐Ÿ”ง V TWRP Choose Install and point the way to Magisk.zip.
  • ๐Ÿ”„ After installation, restart.

Step 2. Root check

  • ๐Ÿ“ฑ Install the Magisk Manager app (download as a download) APK same GitHub).
  • ๐Ÿ” Run it and check for Magisk status โ€“ it should have a green icon.

Step 3: Hiding root for banking applications

  • ๐Ÿฆ Many banking applications (e.g. SberBank Online) block access on rooted devices.
  • ๐Ÿ”ง In Magisk, activate the MagiskHide option and add apps to the Hidden List.
  • ๐Ÿ”„ Reset the device.

โš ๏ธ Note: Some firmware (for example, MIUI Global) have built-in protection against Magisk, in which case you will either have to abandon root or switch to custom firmware without Dm-Verity.

8.Recovery after failed firmware

If something goes wrong, Xiaomi will do it. 9T Stop turning on or booting into a bootloop, don't panic. 99% of the time, the device can be brought back to life.

Method 1. Firmware through Fastboot

  • ๐Ÿ–ฅ๏ธ Download the official firmware in.tgz format.
  • ๐Ÿ”Œ Connect your phone in Fastboot mode (even if it doesn't turn on, try pinching Volume Down). + Power on the device switched off).
  • ๐Ÿ“‚ Unpack the firmware and launch it. flash_all.bat.

Method 2: Use of the Mi Flash Tool

  • ๐Ÿ“ฅ Download the Mi Flash Tool.
  • ๐Ÿ“ Select a folder with unpacked firmware.
  • ๐Ÿ”˜ In the tool settings, select Clean All (full reset).
  • ๐Ÿ–ฅ๏ธ Press Flash and wait until it is completed.

Method 3: Flashing through EDL-regime (for โ€œbricksยป)

  • โš ๏ธ This method requires an authorized Xiaomi account and a special cable (EDL cable or circuit of contacts on the board).
  • ๐Ÿ› ๏ธ Used to recover devices that donโ€™t respond to buttons and arenโ€™t defined in Fastboot.
  • ๐Ÿ”ง Instructions for working with EDL Search for XDA-Developers (requires experience).

๐Ÿ’ก

If the phone does not respond to any combination of buttons, but is defined by the computer as Qualcomm HS-USB QDLoader 9008, so it's in the EDL-This is the last chance to bring him back to life without a soldering iron.

FAQ: Frequent questions about Xiaomi flashing 9T

โ“ Can I get a Xiaomi stitch? 9T loader-free?
No, any firmware through Fastboot or custom recavery installation requires an unlocked bootloader. OTA or recovery (but this will not allow you to install custom firmware).
โ“ How to know if the bootloader is unlocked?
Turn off your phone and press Volume Down + Power to log in to Fastboot. If the bottom of the screen says Unlocked, the bootloader is unlocked. You can also check with the command: fastboot oem device-info Look for Device unlocked: true.
โ“ Which firmware is better to choose for Xiaomi 9T?
Depends on the goals: ๐Ÿ”น For stability, the official MIUI Global. ๐Ÿ”น For pure Android โ€“ LineageOS or Pixel Experience. ๐Ÿ”น For maximum performance, ArrowOS with the Perseus kernel. For beginners, we recommend starting with the official firmware.
โ“ Why does not the camera or fingerprint sensor work after firmware?
This is a typical custom firmware problem, associated with the lack of proprietary drivers from Xiaomi: ๐Ÿ”ง Set a special fix for the camera (see for the camera). XDA). ๐Ÿ”„ Try another firmware build (e.g., marked with camera fix). ๐Ÿ“ฑ Get back to the official one. MIUI, if the functionality is critical.
โ“ How to return the guarantee after unlocking the bootloader?
Unlocking the bootloader removes Xiaomiโ€™s warranty, but some service centers may turn a blind eye if the problem is not related to the software part (such as a broken screen: ๐Ÿ”ง Make it official. MIUI via Fastboot. ๐Ÿ”’ Block the bootloader with the command fastboot oem lock (risky - can lead to a brick!). ๐Ÿ“ฑ Reset the unlock counter in the Mi Unlock Tool (not always working).