How to remove the pattern lock from the applications on Xiaomi: instructions for MIUI 12-14

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:

  1. Go to the Mi Account website and log in.
  2. Select the Find Device tab.
  3. The map will display your smartphone – click on it and select Unlock Device.
  4. 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:

  1. Connect your phone to your PC and confirm your trust in the computer on your smartphone screen.
  2. 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




reboot

After 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




reboot

This 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:

  1. Turn off the phone.
  2. Press the power button until the Xiaomi logo appears.
  3. Once the logo disappears, immediately press and hold the volume button until the phone boots.
  4. 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:

  1. Go to Settings β†’ Applications β†’ Application Management.
  2. Find a blocked application (such as a gallery) and tap on it.
  3. Select Warehouse β†’ Delete Data (or Clear Data)
  4. 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.

AnnexData reset will deleteWill it recover after entering?
MIUI GalleryLocal albums, settingsNot (unless there was a backup)
WhatsAppChats, media filesYes (if there was a backup in Google Drive)
TelegramLocal chats, settingsYeah (cloud synchronization)
Sberbank OnlineLogin / password, history of operationsNo (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:

  1. Turn off your phone and press Power + Volume Up to log into TWRP.
  2. Go to Advanced β†’ File Manager.
  3. 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?
If you are logging into File Manager TWRP If you ask for a password, it means that the disk is encrypted: 1. Connect your phone to your PC through ADB mode TWRP. 2. Enter the command: adb pull /data/system/gesture.key 3. Delete the file locally on your PC, then return the empty file back: adb push empty_file /data/system/gesture.key 4. Reboot the phone.

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:

  1. Turn off the phone.
  2. Press Power + Volume Up to Enter Recovery Mode.
  3. Choose your language (if required).
  4. Go to Wipe Data β†’ Wipe All Data.
  5. 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?
No. Banking apps use their own encryption, and their data is stored in a secure Android Keystore, and the only way to do that is to reset the app data (which is equivalent to logging out of your account) or to reset your phone completely. Some banks (like Tinkoff) allow you to reset access through support, try emailing them.
Why did the pattern lock remain after being reset via ADB?
This means that the app uses its own lock mechanism, which is not related to system settings, for example, WhatsApp or Viber can store the key in their storage, in which case only a reset of the data of a particular application or a complete reset of the phone will help.
Does the method work with Mi Account on phones without SIM-map?
Yes, but the phone must be connected to Wi-Fi, and the key is that Find Device is activated before you lock it, and if you've disabled it or never turned it on, unlocking it through your account won't work.
Can I recover data after a Hard Reset?
Partially. If you have synced with Mi Cloud enabled, you will recover: Contacts. Messages (if they were saved to the cloud). Some settings of system applications. Photos, videos and application files (for example, chats on Telegram or WhatsApp) will only be restored if a local backup was created or they were synced with cloud services (Google Photos, iCloud, etc.).
What if the phone requires an old pattern lock after reset?
This means that the reset was not completely reset and there are traces of the old key in the system. Try: Re-reset via Recovery Mode (not through the phone settings!). If the phone asks for the key when you log in to Mi Account, use password recovery. On some models (for example, Redmi 9 or POCO X3), it helps to firmware the phone through Fastboot with full formatting (fastboot erase userdata).

πŸ’‘

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.