The forgotten pattern lock on Xiaomiβs smartphone is a situation that thousands of users face every day. The main problem is that most standard unlock methods (such as Mi Account) require a factory reset, resulting in complete loss of data β photos, messages and applications. However, there are ways to get around locking without formatting memory if you act carefully and use hidden firmware functions.
In this article, we will discuss 5 working methods of unlocking Xiaomi (including the Redmi Note 10/11/12, POCO X3/X4, Mi 11/12 and others) with data storage. Importantly, the effectiveness of each method depends on the version of MIUI, the status of the bootloader and the availability of backups. Some methods require a PC, others work directly on the phone β choose the appropriate option.
Why Standard Methods Don't Work Without Data Loss
Most guides on the Internet offer to reset your phone via Recovery Mode or Find Device, but these methods have critical drawbacks:
- π Reset via Recovery: Deletes all data in the section /data, including internal memory.
- π Find Device (i.mi.com): Requires a tied Mi Account and active internet, but even then resets settings.
- π§ Fastboot: Commands like fastboot erase userdata erase user data.
The reason is MIUI architecture: the pattern lock is stored in the encrypted /data/system/gesture.key partition, which is associated with the user profile. Standard methods simply delete this partition, not bypass the lock.
β οΈ Note: If the phone has data encryption enabled (in the security settings), the chances of saving files without a backup are near zero. β Additionally. β Encryption and accounts.
Method 1: Unlock via ADB (if USB debugging is enabled)
The most reliable way to avoid data loss is to use ADB (Android Debug Bridge), but it only works if USB debugging has been activated in Settings β About Phone β MIUI version (7 times press to unlock the developer mode).
If debugging is enabled, follow the instructions:
- Connect your phone to your PC via USB.
- Open the command prompt (cmd on Windows or Terminal on macOS/Linux).
- Enter the commands in order adb shell su rm /data/system/gesture.key reboot
After the restart, the phone will prompt you to enter a new pattern lock. If the su command is not working (no root rights), try an alternative option:
adb shell am start -n com.android.settings/.ChooseLockGenericMake sure the debugging is done USB included|Install ADB-PC drivers|Connect your phone to the original cable|Check the visibility of the device by the team `adb devices`-->
β οΈ Attention: On new versions MIUI 14+ This method may not work because of the increased protection, so if you get the phone hanging on the logo after the command, move on to the next method.
Method 2: Use Safe Mode (if the key is recently installed)
If the pattern lock was installed less than 24 hours ago, you can try bypassing it through Safe Mode.This mode temporarily disables third-party apps, including screen locking from Xiaomi.
Instructions:
- Press the power button until the shutdown menu appears.
- Press and hold the βStopβ option (or βStop Powerβ) before a request to switch to Safe Mode appears.
- Confirm the transition. After downloading, delete or reconfigure the pattern lock to Settings β Lock screen.
If the Safe Mode option doesnβt appear, try an alternative method:
- π Turn off the phone.
- π Press the power button. + volume down until the Mi logo appears.
- π± Release the buttons and immediately press the volume down, holding until full load (the watermark "Safe Mode" should appear at the bottom of the screen).
π‘
If the lock is still in Safe Mode, try installing a new pattern lock over the old one β sometimes the system allows you to do this without resetting.
Method 3: Unblock with Mi Account (if an account is linked)
Xiaomiβs official way of unlocking is through Mi Account, but it only works if you meet three conditions:
- π± Phone linked to Mi Account (checked at account.xiaomi.com).
- π Internet access (via Wi-Fi or mobile network).
- π No encryption is enabled on the phone (see warning above).
Steps:
- On the locked screen, click "Forgot Password?" (or "Forgot Pattern").
- Select "Login through Mi Account" and log in.
- Follow the instructions for resetting the pattern lock.
| Xiaomi model | Support for unlocking through Mi Account | Data retention |
|---|---|---|
| Redmi Note 10/11 | Yes. | Partially (photos and files will be saved, but settings will reset) |
| POCO X3/X4 | Yes. | Yes (unless there is encryption) |
| Mi 11/12 | Yes, but requires SMS confirmation. | No (reset to factory) |
| Redmi 9A/9C | Yes. | Yes. |
β οΈ Attention: On models with MIUI 13+ After unlocking through Mi Account, you may need to confirm SMS, which will come to the number linked to the account. SIM-The card is inactive β the method will not work.
Redmi Note 10/11/12|POCO X3/X4/X5|Mi 11/12/13|Redmi 9/9A/9C|Another model-->
Method 4: Bypassing locking via TWRP (for hardened phones)
If your Xiaomi has a custom TWRP recavator installed, the chances of unlocking without losing data increase, a method that is suitable for users who have previously unlocked the bootloader and installed unofficial firmware.
Instructions:
- Turn off the phone.
- Press the power button + volume up to enter TWRP.
- Go to Advanced β File Manager.
- Delete files: /data/system/gesture.key /data/system/locksettings.db /data/system/locksettings.db-wal /data/system/locksettings.db-shm
- Reboot the phone.
If the phone requests after deleting the files PIN-code SIM-It's not blocking the screen, so it worked. If it's not, try the extra step:
What if TWRP doesnβt see the /data folder?
Warning: On some models (Mi 10T, POCO F3), anti-rollback may be triggered after locksettings.db manipulation, leading to a device breakage. Before you act, check your modelβs compatibility on the 4PDA or XDA Developers forums.
Method 5: Unlocking through service codes (hidden menus)
A little-known way is to use service codes to reset locks, which doesn't work on all models, but can help if other methods aren't available.
Try the following combinations:
- π Dial on the dial keyboard: ##7780## (soft reset, saves data).
- π’ To reset the pattern lock: ##3646633## (Engineering Mode, then go to Security β Lock Screen β Clear Password).
- π Alternate code: ##1998## (powered by some Redmis).
If you enter a Chinese menu, use Google Translate with a camera-based text recognition feature, and look for items with the words lock, password, or gesture.
π‘
Service codes are the riskiest method. Wrong actions can result in an IMEI reset or network loss. Use only if you are sure of compatibility with your model.
What to do if nothing helps: extreme measures
If all of these methods fail, there are two options:
- Contact the Xiaomi service center with proof of purchase (check). Official centers can unlock the phone without losing data, but this is a paid service (from 1000 to 3000 rubles).
Before visiting the service center:
- π Prepare documents for the phone (box, check, warranty card).
- π Make sure your phone is at least 50% charged β some centers are refusing to service discharged devices.
- π Check if your model is guaranteed (unlocking it may invalidate it).
If you decide to reset your phone via Fastboot, try extracting data through the first DD-Skills (will require skills to work with) ADB Instructions are available on 4PDA in your model themes.