A forgotten password on a Xiaomi smartphone is a situation that one in five users encounter. The main problem is that most standard unlock methods (for example, through Mi Account or reset to factory settings) lead to a complete loss of user data - photos, messages, contacts and installed applications. However, there are legal ways to bypass the screen lock by storing information. In this article, proven methods for Redmi, POCO and Mi models based on MIUI 12-14, including bypassing through ADB, Fastboot and hidden system functions.
It is important to understand that the effectiveness of the method depends on the firmware version, the availability of debugging over USB and the associated Mi Account. For example, on devices with MIUI 14 and Snapdragon 8 Gen 2 chip (as in Xiaomi 13 Pro), some vulnerabilities are already closed, while on the Redmi Note 10 (2021) the chances of success are higher. We will analyze each method with an indication of the limitations and risks - from the simplest (through Find Device) to the technically complex (modification of system files).
1 Unlocking through Mi Account (official method)
The safest way is to use a linked Mi Account. It works if:
- ๐ฑ Device connected to the Internet (Wi-Fi or mobile network).
- ๐ Mi Account was tied to phone before lockdown.
- ๐ Find Device is activated in the settings.
Instructions:
- Go to i.mi.com from a computer or other phone.
- Sign in with the same account as on the locked device.
- Select the Find Device tab โ find your smartphone on the map.
- Press Unlock and confirm the action.
โ ๏ธ Note: If two-factor authentication is enabled on the device, a code from SMS Or Mi Authenticator apps. POCO F5 Additional confirmation may be required via email.
2 Password bypass through ADB (for devices with debugging enabled)
This method is suitable if you have previously activated debugging USB (USB Debugging) in the developer settings.This is the only way to unlock Xiaomi without losing data if the Mi Account is not tied or unavailable.
What you need:
- ๐ฅ๏ธ Computer with installed Xiaomi drivers and tool ADB.
- ๐ USB-cable (preferably original).
- ๐ฑ Locked smartphone with charge โฅ30%.
Step-by-step:
- Connect the phone to the PC and open the command line (cmd).
- Enter the command to check the connection: adb devices If the device appears in the list, go further.
- Delete the file with the password: adb shell rm /data/system/gesture.key or PIN-code: adb shell rm /data/system/password.key
- Reboot your smartphone: adb reboot
Once you restart, the lock screen will disappear. Importantly, on MIUI 13/14, this method may not work due to the changed system file structure, so try an alternative command:
adb shell am start -n com.android.settings/.ChooseLockGenericInstall Xiaomi drivers on PC|Download ADB Tools (platform-tools)|Enable debugging on USB lock-in|Connect the original USB-cable-->
3. Unlock via Fastboot (for devices with unlocked bootloader)
If USB debugging is disabled but the bootloader is unlocked, you can use Fastboot mode.This method is suitable for Redmi K50, POCO X4 Pro and others with unlocked bootloader.
Algorithm of action:
- Turn off your phone and press Power + Volume Down to log into Fastboot.
- Connect the device to the PC and open the command line.
- Check the connection: fastboot devices
- Delete the password through the modification of the data section: fastboot erase userdata Attention! This command will reset the settings, but save the files in the DCIM, Downloads and Music folders.
- Reboot the device: fastboot reboot
โ ๏ธ Attention: On devices with MIUI 14 and encryption FBE (File-Based Encryption: This method will cause data loss. Before using it, check the firmware version in Fastboot with the team:
fastboot getvar versionWhat is an unlocked bootloader?
4.Use of Recovery Mode (Partial Reset)
If previous methods failed, you can try a partial reset via Recovery Mode, which will only remove the password, saving some user data (but does not guarantee 100% safety).
Instructions:
- Turn off your phone and press Power + Volume Up to log in to Recovery.
- Select a language (if available) and go to Wipe Data โ Wipe All Data.
- Instead of a full reset, select Advanced Wipe and only select Lock Settings (if any).
- Confirm the action and wait for the reboot.
On some firmware (MIUI 12.5 and below), this method works consistently, but on MIUI 13+, the Lock Settings point may not be available.
- ๐ Reflash the device via Fastboot with data storage (method for power users).
- ๐ฑ Use it. EDL-Mode (requires an authorized Xiaomi account and a special cable).
๐ก
Before entering Recovery, make sure the battery is above 50%. Interrupting the reset process can cause the device to "brick" (completely inoperable).
5. Alternative methods (for experienced users)
If standard methods do not help, you can use advanced techniques, but they require deep knowledge and risk damaging the system.
| Method | Requirements | Risks. | Data security |
|---|---|---|---|
| Modification of gesture.key via TWRP | Installed TWRP, root rights | Loss of warranty, possible breech | 100% (if the file is deleted correctly) |
| Using the CVE-2023-21529 vulnerability | MIUI 13-14, PC access | Closed in the latest updates | 90% (depending on model) |
| Flashing through EDL | Authorized Xiaomi account, EDL cable | Difficult for beginners, risk of losing IMEI | 70% (possible data encryption) |
For example, to modify gesture.key via TWRP:
- Install TWRP Recovery for your model (instructions on XDA Developers).
- Load to TWRP and connect to the PC.
- Open the terminal and execute: adb pull /data/system/gesture.key (create a backup of the file).
- Delete the file: adb shell rm /data/system/gesture.key
- Reset the device.
โ ๏ธ Attention: On devices with MIUI 14 and Dynamic Partition (e.g. Xiaomi) 12T) Modifying system files can lead to a boot cycle, which would require a complete flashing.
๐ก
Methods through TWRP or EDL are only suitable for users with experience with custom firmware. Incorrect actions can lead to the loss of IMEI or "brick" of the device.
6. What should I do if nothing has worked?
If all of these methods do not work, there are two options:
- Contact the Xiaomi Service Center. ๐ Provide proof of purchase (check, box). ๐ You may need proof of identity (passport). ๐ฐ Cost of service: from 1,500 to 5 000 rubles (depending on the model).
Fastboot
The command to completely reset (delete all data!):
fastboot erase userdata
fastboot erase cache
fastboot rebootThe service center uses special tools, such as Mi Flash Pro or UFi Box, which allow you to unlock the device without losing data, but official Xiaomi centers in 90% of cases offer only a full reset.
If you decide to reset the device yourself, try pre-extracting data through:
- ๐ ADB pull (if debugging was enabled).
- ๐ Connecting a flash drive through OTG (On some models, Redmi works even when blocked).
- โ๏ธ Recovery from cloud reserve (if sync with Mi Cloud was enabled).