Unlocking the Xiaomi bootloader by code: official and alternative ways

Unlocking the bootloader on Xiaomi smartphones is a must-have for custom firmware installation, root rights or device recovery after software failures. Although the manufacturer tightened the rules in 2023, the process remains possible, although it requires more time and preparation. The unlock code is a unique key that Xiaomi attaches to the Mi Account after verifying user data.

Many people experience errors like Couldn't verify device or This device is locked, which are caused by incorrect steps or outdated instructions. In this article, we'll break down the official method through the Mi Unlock Tool, alternative ways to use old models and solve typical problems. Importantly, the procedure will reset all data on the device โ€” back up in advance.

๐Ÿ“Š What Xiaomi model you will unlock?
Redmi Note 12/13
POCO F5/X5
Mi 13/14
Redmi 10/11
Another model

Why Xiaomi is blocking the bootloader and why unlock it

The manufacturer has been blocking the bootloader on all devices since 2016 for security reasons, which protects the smartphone from:

  • ๐Ÿ”“ Installation of malware through custom firmware
  • ๐Ÿ“ฑ Unauthorized access to data in case of theft
  • ๐Ÿ”„ Disruptions due to incompatible modifications

But locking creates problems for power users, and without unlocked bootloaders, you can't:

  • ๐Ÿ› ๏ธ Install TWRP or other custom recovery
  • ๐Ÿ“ฒ Run LineageOS, Pixel Experience or other alternative OS
  • ๐Ÿ”ง Get root access through Magisk
  • ๐Ÿ”„ Restore the brick after a failed update

Since 2023, Xiaomi has tightened the requirements: now it requires binding to unlock SIM-Card-to-account and waiting up to 720 hours (30 days) for new devices. Older models (until 2021) can unlock faster in 72โ€“168 hours.

โš ๏ธ Warning: Unlocking the bootloader will void the software warranty. In some regions (e.g. EU), this may affect the hardware warranty as well โ€“ check with the authorized dealer.

Preparing for Unlocking: What to Do Before Starting

Before requesting the unlock code, follow the mandatory steps:

Link Mi Account to your device|Enable debugging on USB and OEM-unlock|Make sure the version MIUI less than 12.5|Disable all screen locks (PIN, graphical)|Connect the device to a stable Internet (Wi-Fi or mobile network)-->

Details on each item:

  1. Mi Account binding. Go to Settings โ†’ Xiaomi account and log in. Make sure your profile has your real name, email and phone number โ€“ this will be required to confirm.
  2. Oh.EM-Unlock it. Activate it in Settings. โ†’ The phone. โ†’ Version. MIUI (Tap 7 times to turn on Developer Mode, then return to Settings โ†’ Additionally. โ†’ For developers and include: ๐Ÿ”ง Debugging by USB ๐Ÿ”“ Unlocking OEM

Verification of the MIUI version

Mi Unlock Tool

Settings โ†’ Updating the system

If the lock screen is installed PIN-The code or pattern lock must be removed, otherwise the Mi Unlock Tool will give the error Current account is different from the account info on the device.

๐Ÿ’ก

If you have a two-sim smartphone, insert SIM-card in slot 1 - this will accelerate the process of linking the account to the device.

Unlocking with Mi Unlock Tool

This is the only legal method that Xiaomi has approved, and it's three steps: linking the device to the account, waiting, and unlocking it, and let's take a closer look at each step.

Step 1: Linking your device to your Mi Account

After logging into Mi Account and enabling OEM-unlock:

  1. Connect your smartphone to your PC through the original USB-cable.
  2. Start the Mi Unlock Tool (download the latest version from the official website).
  3. Sign in to the tool under the same account as on the phone.
  4. Click on Bind Account and Device.

If you see the Added successfully message. Wait XX hours, the link was successful.

Year of release of the deviceMinimum waiting timeMaximum waiting time
2023โ€“2026720 hours (30 days)โ€”
2021โ€“2022168 hours (7 days)720 hours
2019โ€“202072 hours (3 days)168 hours
Until 20190 hours72 hours

Step 2: Unlocking the bootloader

After the waiting time has expired:

  1. Turn off your smartphone and press Volume Down + Power to log into the Fastboot.
  2. Connect the device to your PC and start the Mi Unlock Tool.
  3. Press Unlock and confirm the action.

Instructions:

  1. Turn off your smartphone and press Volume Up + Volume Down + Power for 10-15 seconds to enter the EDL.
  2. Connect the device to the PC โ€“ Qualcomm HS-USB QDLoader 9008 should appear in the Device Manager.
  3. Start the Mi Flash Tool, select the firmware and press Flash.

โš ๏ธ This method will reset IMEI Recovery will require a backup of the NV data or a service center.

What to do if EDL-no-go?
If the smartphone does not enter EDL, try: 1. Disable the battery for 5 minutes (if it is removable). 2. Use Testpoint (closing contacts on the board) - requires disassembling the device. 3. Connect via USB-externally powered hub (sometimes helps with a "dead" device).

Method 2: Exploit for MediaTek (MTK)

Devices on MediaTek processors (Redmi 9A, POCO C31) can be unlocked through a vulnerability in BROM.

  • ๐Ÿ”ง Programme SP Flash Tool or MTK Bypass Tool
  • ๐Ÿ“‚ Stock firmware in scatter.txt format
  • ๐Ÿ–ฅ๏ธ MediaTek Preloader Driver

Algorithm:

  1. Install the driver and start the SP Flash Tool.
  2. Select scatter.txt from the firmware.
  3. Connect the switched off smartphone to the PC โ€“ the program must determine it.
  4. Press Download and wait for the firmware to finish.

After that, the bootloader will be unlocked, but you may need to re-assign the Mi Account.

Typical errors and their solutions

Even if you follow the instructions accurately, users are faced with errors.

Error codeReason.Decision
Couldnโ€™t verify deviceDisparity of accounts on PC and phoneRe-link your account to Mi Unlock Tool and try again
This device is lockedWaiting time has not expired.Wait for the specified number of hours (check the status in Mi Unlock)
Mi Flash not respondingProblems with drivers or cableInstall the LibUSB-Win32 driver and use the original cable
Anti-rollback check failTrying to flash the old version of MIUIUpdate to the latest official firmware before unlocking

If the Mi Unlock Tool is a Network error, try:

  • ๐ŸŒ Change region in Mi Account settings to China or India.
  • ๐Ÿ”„ Use it. VPN servers in China or Singapore.
  • โณ Wait 24 hours and try again (sometimes Xiaomi servers are overloaded).

๐Ÿ’ก

If the unlock is delayed for more than 30 days, check if the email or phone number in Mi Account has changed. Even small changes in the profile reset the waiting timer.

What to do after successful unblocking

After unlocking the loader:

  1. Install custom recovery (e.g. TWRP) via the command: fastboot flash recovery twrp.img fastboot boot twrp.img
  2. Back up the persist section (responsible for IMEI and serial number): adb pull /dev/block/bootdevice/by-name/persist persist.img
  3. Squeeze Magisk to obtain root rights (optional).

โš ๏ธ Note: On some models (Xiaomi 13, Redmi) K60) When unlocked, encryption may be lost, so to avoid losing files, transfer them to an external drive before further manipulation.

If you plan to flash custom firmware, make sure it is compatible with your model, for example, for the POCO X3 Pro, Pixel Experience is suitable, and for the Redmi Note 10 Pro, LineageOS 20 is suitable.

FAQ: Frequent questions about unlocking Xiaomi

Can I unlock Xiaomi without waiting 720 hours?
Officially, no. But for older models (before 2021), sometimes changing your account region to China and re-assigning helps, and there are gray services that offer unlocking for money, but they don't guarantee data security.
Why can't Mi Unlock Tool see my device?
Check: Android Fastboot drivers installed. Debugging enabled USB and unlock OEM. Do you use the original cable (not all) USB-If the problem persists, try running the Mi Unlock Tool on behalf of the administrator.
Can I unlock Xiaomi without a computer?
No. Unlocking the bootloader requires a Windows PC (officially, the Mi Unlock Tool does not support macOS or Linux). Alternative methods through the ADB terminal also require a connection to a computer.
What happens if the unblocking process is interrupted?
If you interrupt the Mi Unlock Tool during unlocking, the device may stop booting (soft-brick state). In most cases, this is corrected by reconnecting to the PC and continuing the process. In rare cases, you will need firmware through EDL.
How to check if the bootloader is unlocked?
Turn off your smartphone and log in to Fastboot (Loudness Down) + If you see the message Unlocked or Device is unlocked at the bottom of the screen, you can also check the command: fastboot oem device-info Search for Device unlocked: true.