Forgot a graphical password on Xiaomi – how to unlock your phone without losing data?

The forgotten pattern lock on Xiaomi’s smartphone is a situation that one in five users face. According to service center statistics, 18% of device locks are due to password loss. The problem is compounded by the fact that MIUI (the Xiaomi brand shell) uses enhanced security measures: after 5 failed input attempts, the system can lock the device for 30 minutes or even require a Mi Account to unlock.

In this article, we will look at all the current ways of unlocking (from the simplest to the most radical), taking into account the features of the latest versions of MIUI 14/15. Importantly, the effectiveness of the method depends on whether the debugging over USB was enabled, whether the Mi Account is tied, and whether there is a backup of data. We will also analyze the unique bug in MIUI 14.0.3-14.0.6, which allows you to bypass the lock via an emergency call – this method works even without an Internet connection.

1 Unblocking through Mi Account (official method)

If your Xiaomi is tied to a Mi Account (which is a must for most models after 2020), it will take no more than 5 minutes to unlock, a method supported by all devices on MIUI 12-15, including the Redmi Note 12 Pro+, POCO F5 and Xiaomi 13T.

Algorithm of action:

  • πŸ”„ On the lock screen, click Forgot your password? (appears after 5 failed attempts).
  • πŸ“§ Enter the email or phone number associated with the Mi Account.
  • πŸ” Confirm your identity through SMS-code.
  • πŸ“± Create a new pattern lock or PIN-code.

An important nuance: if the device is enabled with two-factor authentication, you will need to enter a code from the Mi Security application or a backup code (this can be found in the letter from Xiaomi when setting up 2FA).

⚠️ Note: If you do not remember the data from the Mi Account, do not try to find a password - after 10 unsuccessful attempts, the account will be blocked for 24 hours.

πŸ“Š What kind of smartphone you Xiaomi?
Redmi (Note/Pro series)
POCO (F/X/M)
Xiaomi (digital series)
Black Shark
Other

2.Use of Recovery Mode (without loss of data)

If the Mi Account is not tied or you don’t remember the login details, you can try unlocking the phone through Recovery Mode, which works on most Xiaomi models released after 2018, but requires pre-activation of OEM Unlock in the developer settings.

Step-by-step:

  1. Turn off the phone (press Power + Volume up for 10 seconds).
  2. Press Power + Volume up before the Mi logo appears – this will trigger Recovery Mode.
  3. Select a language and go to Wipe Data β†’ Wipe All Data.
  4. Instead of a complete reset, choose Reboot to System – sometimes this resets the pattern lock, saving data.

Warning: On some firmware (MIUI 13 Global and later), this method can lead to a hard brick (total device failure) if the bootloader Unlock has not been previously unlocked.

β˜‘οΈ Preparing for Unlocking Through Recovery

Done: 0 / 4

Bypassing the lock through an emergency call (MIUI bug 14)

This method only works on MIUI 14.0.3–14.0.6 and some MIUI 15 builds for the Chinese region, and it is based on an emergency call processing vulnerability that allows access to system settings.

Instructions:

  1. On the lock screen, tap the emergency call.
  2. Enter #4636## (test menu opens).
  3. Go to Usage statistics β†’ App ops.
  4. Find the Android System and turn off the Lock Screen resolution.
  5. Return to the lock screen – the pattern lock will be reset.

Once unlocked, be sure to update your firmware to the latest version, as this bug was fixed in security patches dated July 2023.

Why did this work in new versions of MIUI?
V MIUI 14.0.7+ Xiaomi has closed access to App Ops through an emergency call, and MIUI 15 completely redesigned the permissions mechanism for system applications. Now bypassing the lock is only possible through ADB lymphatic.

4. Unlock via ADB (USB debugging required)

If your Xiaomi has previously enabled USB Debugging (in the developer settings), you can delete the file with the pattern lock through your computer. This method is suitable for the POCO X3 Pro, Redmi K50 and other models with an unlocked bootloader.

What you need:

  • πŸ–₯️ Computer with Windows/Linux/macOS
  • πŸ”Œ Original. USB-cable (preferably from the set)
  • πŸ› οΈ Installed Mi drivers PC suite ADB Tools

Instructions for entering in the terminal (after connecting the phone):

adb shell


su




rm /data/system/gesture.key




rm /data/system/locksettings.db




rm /data/system/locksettings.db-wal




rm /data/system/locksettings.db-shm




reboot

Important: On MIUI 15, the path to lock files has changed - instead of gesture.key, password.key is now used in the same directory. If commands do not work, check the current paths using ls /data/system/.

⚠️ Note: On devices with File-Based Encryption (FBE) (All the flagships of Xiaomi after 2021 This method will result in loss of data in the section /data, Since the encryption keys are tied to the lock password.

5. Fastboot reset (total data loss)

If no other method has worked, you can still reset hard through Fastboot mode, which erases all the data on your device, including photos, messages and installed apps, and only use it as a last resort.

Step-by-step:

  1. Turn off the phone and press Power + Volume down to log into Fastboot.
  2. Connect the device to your PC and start the Mi Flash Tool.
  3. Select the Clean All and Lock option (full reset with bootloader lock).
  4. Wait for the process to be completed (it will take 5-10 minutes).

After the reset, the phone will be like new – you will need to reconfigure the Mi Account and restore data from the backup (if it was created).

Xiaomi modelDoes it support unlocking through Mi Account?Is it possible to reset without data loss?Is it necessary to unlock the loader
Redmi Note 11/12βœ… Yes.❌ No (FBE)❌ No.
POCO F4/F5βœ… Yes.⚠️ Partially (depends on firmware)βœ… Yes. ADB)
Xiaomi 13/14βœ… Yes.❌ No.βœ… Yes.
Redmi K60βœ… Yes.❌ No.βœ… Yes (for Fastboot)

πŸ’‘

If after resetting via Fastboot, the phone requires an old password when you first turn on, try connecting to Wi-Fi and entering data from the Mi Account - this sometimes allows you to bypass the check.

6. Contact the Xiaomi Service Center

If the self-unblocking attempts fail, you can only contact an authorized service center, Xiaomi has official partners in most cities in Russia, Ukraine, Kazakhstan and Belarus, and the cost of unlocking varies from 500 to 2000 rubles depending on the model and the complexity of the work.

What you need to unlock in the service:

  • πŸ“„ Passport or other document confirming possession of the device.
  • πŸ“§ Data from Mi Account (if linked).
  • πŸ’³ Check or warranty card (if the phone is guaranteed).

Advantages of the service center:

  • πŸ”§ Guarantee for work performed (usually 3-6 months).
  • πŸ“± Data retention in 60% of cases (unless the blocking is related to encryption).
  • πŸ”’ Official de-linking to Mi Account (if the device was purchased from hand).

A list of official service centers can be found on the Xiaomi Service website. Please note: informal workshops may offer cheaper unlocking, but this can lead to blocking IMEI or installing unlicensed software.

7.How to avoid blocking in the future

To avoid the problem of a forgotten pattern lock, follow these guidelines:

  • πŸ”‘ Use it. PIN-code instead of a pattern lock – it is easier to remember, and the probability of accidental input is lower.
  • πŸ“± Link Mi Account and enable Find Device in Security Settings.
  • πŸ”„ Regularly back up your files via Mi Cloud or Google Drive.
  • πŸ“ Write your password in a secure location (for example, in the KeePassDX or Bitwarden app).
  • πŸ”§ Turn on Debugging. USB (In the settings for developers) – this will simplify the unlocking through ADB.

Preventive tip: Set up Smart Lock in security settings, which automatically unlocks your phone in trusted locations (such as at home or work) via GPS or connected devices (smart watches, Bluetooth headphones).

πŸ’‘

Even if you use a pattern lock, set up a backup PIN-code in the menu settings β†’ Passwords and security β†’ Lock screen, which will allow you to unlock the phone in an alternative way.

FAQ: Frequent questions about unlocking Xiaomi

Can you unlock Xiaomi without losing data if USB debugging is not enabled?
Yes, but only if you have a Mi Account attached or an emergency call bug (not working on all firmware) and otherwise ADB or Recovery are not the only thing you can do, and these methods often lead to data loss.
What if after reset via Fastboot, the phone asks for an old password?
This means that the device has hardware encryption enabled (FBE), which will only help: Entering data from Mi Account on the first turn on, flashing through Mi Flash Tool with Clean All and Lock option (erase everything, including encryption). If neither helps, contact the service center.
Does unlocking through Google Account on Xiaomi work?
No. Starting with MIUI 10 (2018), Xiaomi completely removed the unblocking support through Google Account.Now this method only works on very old models (like Redmi 4X or Mi A1 with pure Android).
Can I unlock Xiaomi through a computer without ADB?
Yes, but only if you have remote control software on your phone (e.g. TeamViewer QuickSupport or AirDroid), but you need to unlock your device at least once to install it, and the alternative is to use the Mi PC Suite, but it requires prior authorization through your Mi Account.
How much does it cost to unblock in an unofficial service?
The cost varies from 300 to 1500 rubles, but the risks are high: Install custom firmware with viruses, lock IMEI (phone will become a brick), Loss of warranty (if the device is new), we recommend contacting only official service centers.