The pattern lock in Xiaomi smartphone apps is a convenient way to protect personal data, but only as long as you remember it. If the pattern blocked access to a messenger, gallery or banking application, and you can not restore it, do not rush to drop the phone to factory settings. In 80% of cases, unlocking is possible without losing data - through hidden MIUI functions, debugging over USB or even cloud services.
In this article, we will discuss 5 working methods for removing graphics keys from applications on Redmi, POCO and Mi (relevant to MIUI 12-14), focusing on methods that do not require root rights and work on the latest versions of firmware, and learn why some applications (such as WhatsApp or SberBank Online) are blocked more severely than others and how to circumvent these restrictions.
Before you start, check two things: do you have a backup (at least in the Mi Cloud) and is your phone connected to your Xiaomi account, which will make it easier to recover if something goes wrong, and remember, methods using ADB or Fastboot require you to pre-set up your phone β if you didnβt, they wonβt work.
1. Reset the pattern lock via Mi Account (official method)
The safest method is to use a Xiaomi account that is linked, and it works if:
- π± The phone is connected to the Internet (Wi-Fi or mobile data).
- π Remember the username and password from Mi Account.
- π Find Device has been activated in the settings.
Instructions:
- Go to the Mi Account website and log in.
- Select the Find Device tab.
- The map will display your smartphone β click on it and select Unlock Device.
- Confirm the action via SMS or email.
After that, the pattern lock will be reset, but only to unlock the screen. If the key is on a particular application (for example, Gallery or Notes), you will have to use other methods. Also note that this method does not work on phones with MIUI Global Stable 14.0.5 and later - there the remote unlock function is disabled by default.
β οΈ Note: If you have previously disabled Find Device in your settings (Settings) β Mi Account β Find the device, it won't work, so move on to the method of using ADB.
2. Delete the key through ADB (without root)
The method is suitable for users who previously included debugging by USB (USB Debugging) in the developer settings. If you haven't, skip this section, it won't work.
You'll need:
- π₯οΈ Computer with Windows/macOS/Linux.
- π± USB-cable (preferably original).
- π οΈ Utility. ADB (You can download from the official Android website).
Step-by-step:
- Connect your phone to your PC and confirm your trust in the computer on your smartphone screen.
- Open the command prompt (or Terminal on macOS/Linux) and type:
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
rebootAfter the reboot, the pattern lock will be reset. If the su command is not working (no root), try an alternative option:
adb shell
pm clear com.android.providers.settings
rebootThis will clear lock settings for some system applications (such as Gallery or Contacts), but it wonβt help with banking programs β they store keys in their secure storage.
Debugging is on. USB|Drivers installed ADB|The phone is connected in file transfer mode|Backup copy of data created-->
β οΈ Attention: On phones with MIUI 14 HyperOS command rm /data/system/gesture.key It might not work because of the changed key storage structure, in which case you might try to delete the file. /data/system/locksettings.xml (if it exists).
3.Using Safe Mode to bypass locking
Safe Mode temporarily disables all third-party applications, including those that block access with a graphical key, which will help if the key is not on the system application (for example, not on Settings or Phone, but on Viber or Telegram).
How to start Safe Mode:
- Turn off the phone.
- Press the power button until the Xiaomi logo appears.
- Once the logo disappears, immediately press and hold the volume button until the phone boots.
- In the lower left corner of the screen will appear the inscription Safe mode.
In this mode:
- π Open the blocked application β the key may not be requested.
- π§ Go to Settings. β Applications and delete the blocking application data (e.g. AppLock or Security).
- π Restart your phone in normal mode.
The disadvantage of the method: Safe Mode disables all third-party applications, including launchers and widgets, and it does not work if the pattern lock is installed on the system application (for example, Messages or Calls).
Safe Mode|ADB|Mi Account|Reset to factory settings|None of the above.-->
4. Reset application settings (for individual programs)
If the pattern lock is only on one app (like WhatsApp or Gallery), you can try resetting it without completely resetting your phone.
- π The key is installed through the built-in App Lock function in MIUI.
- π¦ The application does not use its own encryption (for example, banking programs usually store keys in their storage).
Instructions:
- Go to Settings β Applications β Application Management.
- Find a blocked application (such as a gallery) and tap on it.
- Select Warehouse β Delete Data (or Clear Data)
- Confirm the action.
After that, the app will return to the factory settings, and the pattern lock will reset, but be careful: this method deletes all data inside the application (for example, chats in Telegram or stored notes). For some programs (for example, Google Photos), the data will sync with the cloud and recover after re-entry.
| Annex | Data reset will delete | Will it recover after entering? |
|---|---|---|
| MIUI Gallery | Local albums, settings | Not (unless there was a backup) |
| Chats, media files | Yes (if there was a backup in Google Drive) | |
| Telegram | Local chats, settings | Yeah (cloud synchronization) |
| Sberbank Online | Login / password, history of operations | No (re-authorization required) |
β οΈ Note: For applications like SberBank Online or Tinkoff, a data reset is equivalent to logging out of your account. You will need to re-enter your login/password and undergo two-factor authentication.
5. Unlock via TWRP (for advanced users)
If previous methods have failed and the phone has customized TWRP recaps, you can delete the files with the graphic keys manually.This method requires an unlocked bootloader and does not work on all Xiaomi models (for example, Redmi Note 10 Pro or POCO F3 with HyperOS may be limited).
What to do:
- Turn off your phone and press Power + Volume Up to log into TWRP.
- Go to Advanced β File Manager.
- Open /data/system/ and delete files: gesture.key locksettings.db locksettings.db-wal locksettings.db-shm
Reboot the phone.
If there are no files, try to delete them. /data/system/locksettings.xml or /data/system/device_policies.xml. Some of the keys are stored in /data/data/com.android.providers.settings/databases/settings.db β It can also be removed (but it will reset all system settings).
What if TWRP asks for a password?
After such manipulations, the pattern lock will reset, but some system functions (such as Mi Account or Google Pay) may have problems with operation, in which case you will have to do a complete reset.
6. Complete reset to factory settings (extreme case)
If none of these methods worked, you'll have to do a Hard Reset, which is factory reset, and it will delete all the data, including photos, messages, and apps, and only use this method if you:
- π You don't have important information on your phone.
- π₯οΈ There is a backup in Mi Cloud or on PC.
- π± The phone is not tied to the Mi Account (otherwise, after the reset, you will need to enter account data).
How to make a Hard Reset:
- Turn off the phone.
- Press Power + Volume Up to Enter Recovery Mode.
- Choose your language (if required).
- Go to Wipe Data β Wipe All Data.
- Confirm the action and wait for the completion.
Once you reboot, the phone will look like new, and if you forget the Mi Account data, you may have an activation problem after the reset, because Xiaomi blocks devices without a linked account, and then you have to contact support with proof of purchase.
π‘
Before Hard Reset, you must remove it. SIM-card and memory card β they can also be formatted during the resetting process.
FAQ: Frequent questions about unlocking the pattern lock
Can I remove the pattern lock from the banking application (SberBank, Tinkoff) without resetting?
Why did the pattern lock remain after being reset via ADB?
Does the method work with Mi Account on phones without SIM-map?
Can I recover data after a Hard Reset?
What if the phone requires an old pattern lock after reset?
π‘
If you often forget graphic keys, set up a backup PIN-code MIUI. To do this, go to the Settings. β Screen locking β The password is backed up and you need a digital code, which will help unlock your phone if you forget the pattern.