How to remove the pattern lock from the applications on Xiaomi: from Safe Mode to ADB

A forgotten graphical key to a Xiaomi app can be a real headache, especially when it comes to banking services, messengers or work accounts. Unlike unlocking the phone screen, where MIUI offers standard options (like binding to a Mi Account), deprotecting individual programs often requires custom solutions. In this article, we will examine 5 proven methods that work on Redmi, POCO and Xiaomi smartphones running MIUI 12/13/14 – from safe mode to ADB commands.

It's important to understand that not all methods are universal. For example, resetting through Safe Mode is suitable for stock applications (like Gallery or Notes), but it will not help with WhatsApp or SberBank Online. And methods with ADB will require on-board debugging over USB β€” if it is not activated in advance, you will have to look for workarounds. We have assigned instructions by difficulty level: from simple (for beginners) to technical (for experienced users).

1. Safe Mode: Temporary disabling of the pattern lock

Safe Mode disables all third-party applications, including their security settings, and is suitable for unlocking Xiaomi stock programs – for example, if you have forgotten the key to Notes, Calendar or Files.

How to activate:

  • πŸ”„ Turn off the smartphone, then press the power button before the logo appears MI.
  • πŸ‘† Once the logo appears, release the power button and hold the volume down button until Safe Mode loads (there will be an inscription at the bottom of the screen).
  • πŸ“± Go to the app that forgot the key – the protection must disappear.
  • πŸ”“ Install a new pattern lock or turn off protection in the app settings.
  • πŸ”„ Restart your phone in normal mode.

⚠️ Warning: Safe Mode doesn't have third-party apps (like WhatsApp or Telegram) and if the key is on it, it won't work. MIUI 14 can block changing security settings even in Safe Mode – in this case, move on to the next method.

πŸ“Š What kind of smartphone you Xiaomi?
Redmi Note 10/11/12
POCO X3/X4/X5
Xiaomi 11/12/13
Other

2. Reset application settings through the system menu

If Safe Mode doesn’t work, try resetting the settings of a particular application through the system menu, which will delete the stored pattern lock, but will not affect other data (for example, correspondence in messengers or files in the cloud), the method works for most programs, except for those that store the keys on servers (for example, banking applications).

Step-by-step:

  1. Open Settings β†’ Applications β†’ Application Management.
  2. Find the desired application (for example, Gallery or Notes) in the list and tap it.
  3. Select Warehouse and Cache β†’ Clear the Data.
  4. Confirm the action. The app goes back to factory settings, and the pattern lock resets.

For some system applications (such as Settings or Phone), the Clear Data option may be blocked.

  • πŸ”§ Use it. ADB (section 4 of this article).
  • πŸ”„ Try rolling back the app update (if available on Google Play).

β˜‘οΈ Preparation for the resetting of the annex

Done: 0 / 4

3. Delete gesture.key file via file manager (root not required)

Some Xiaomi apps (like Notes or Calendar) store a graphical key in a local gesture.key file that can be manually removed through the file manager β€” no root and ADB. The method works on MIUI 12-14, but may not work on recent updates due to changes in encryption.

Instructions:

  1. Install a file manager with access to system folders, such as MiXplorer or FX File Explorer.
  2. Cross the path: /data/data/[name-packet]/shared_prefs/ For example, for Notes, the path will be: /data/data/com.miui.notes/shared_prefs/
  3. Find the gesture.key file (or similar, for example, lock_pattern.key) and remove it.
  4. Reboot your phone. The next time you run the app, the protection will be reset.

How to find out the name of the application package:

  • πŸ“± Use the App Inspector app (available on Google Play).
  • πŸ” Or Google for β€œpacket name [app name].” For example, for Xiaomi Gallery, it’s com.miui.gallery.

⚠️ Note: Deleting incorrect files can cause the application to crash. If you are not sure about the name of the package, use the method with the help of the application. ADB (Section 4: It's safer.

AnnexPacket nameThe path to the key file
Notescom.miui.notes/shared_prefs/gesture.key
gallerycom.miui.gallery/shared_prefs/lock_pattern.xml
Calendarcom.android.calendar/shared_prefs/calendar_lock.key
File Manager (File Manager)com.mi.android.globalFileexplorer/shared_prefs/secure_prefs.xml

4. Unlock through ADB (for power users)

If the previous methods did not work, and debugging USB (USB Debugging was enabled before blocking, you can use Android Debug Bridge (ADB). This method allows you to reset the pattern lock for any application, including third-party messengers and banking services. USB unreactivated, ADB It will not help – you will have to use the reset to the factory settings (section 5).

Step-by-step:

  1. Download and install ADB Tools on your computer (e.g., Google’s official Platform Tools).
  2. Connect your phone to your PC through USB-cable (use the original Xiaomi cable for a stable connection).
  3. Open the command prompt (cmd in Windows or Terminal in macOS/Linux) and type: adb devices If the device appears in the list, go further. If not, check the drivers or enable USB Debugging in Settings β†’ About Phone β†’ MIUI version (tap 7 times according to version, then return to Additional Settings β†’ For Developers).
  4. Enter the command to reset the key (replace). [package_name] to the application package: adb shell pm clear [package_name] For example, for WhatsApp: adb shell pm clear com.whatsapp
  5. Reboot the phone. The app will be reset to factory settings.

If the pm clear command fails (e.g. due to MIUI limitations), try an alternative method:

adb shell


su




cd /data/data/[package_name]/shared_prefs/




rm gesture.key




exit




exit

⚠️ Note: Commands with su require root rights. If they don't exist, use only pm clear. ADB Some applications (e.g. SberBank Online) may require re-authorization.

πŸ’‘

If ADB doesn’t see the device, try switching the USB connection mode in Xiaomi’s notification curtain to File Transfer (MTP) and then again to Debug over USB (if available).

5. Reset to factory settings (extreme case)

If none of these methods work, you'll have to reset your phone completely, which will delete all the data, including your graphic keys, your accounts, and your files. Xiaomi has two ways to reset:

  • πŸ”„ Using the Recovery menu: Turn off the phone. Press the power button. + Volume up button until Recovery menu appears. select Wipe Data β†’ Wipe All Data (control - volume buttons, confirmation - power button) After reset, the phone will reboot to its original state.
  • πŸ“± Through settings MIUI: Go to Settings. β†’ The phone. β†’ Setting reset. Select Erase all data and confirm.

After discharge:

  • πŸ”“ The pattern lock will be removed from all applications.
  • πŸ“² Reset your phone (including linking to your Mi Account).
  • ☁️ Data from cloud services (such as Google Drive or Mi Cloud) can be restored after authorization.

⚠️ Note: Some Xiaomi models (e.g. Redmi Note 10 Pro) POCO X3 Pro) after reset, you may need to enter data from the associated Mi Account. If you do not remember the password, use the recovery service.

What if the phone asks for an old pattern lock after reset?
This means that the device has activated the MIUI data protection function. In this case: 1. Connect the phone to the PC and use ADB to delete the file /data/system/gesture.key (root required). 2. Or reset via Fastboot with the firmware of the clean version of MIUI (instructions are available on the 4PDA forum). 3. If nothing helps, contact the Xiaomi service center with a proof of purchase (check or box).

6.Alternative methods: bypassing protection through Mi Account and third-party utilities

If the standard methods did not help, you can try workarounds, but they are not suitable for all cases:

  • πŸ”‘ Restore with Mi Account: Some Xiaomi apps (like Notes or Gallery) are tied to your Mi Account. Try: Remove the app and install it again from Google Play. When you first start, log in to the same Mi Account you used before. In some cases, the protection will automatically reset.

Third-party utilities (for root only):

Software like App Lock Remove or Xposed Framework can delete a graphical key, but require superuser rights.

  • 🚨 Possibility of damaging system files.
  • πŸ”’ Violation of security policy MIUI (This can lead to blocking of certain functions).

Appeal in support:

For banking applications like Sberbank Online or Tinkoff, the only safe way to do this is to call in the bank's support with proof of identity, and they can reset protection remotely.

πŸ’‘

Before using third-party utilities, check their reputation on forums (like 4PDA or XDA Developers).Many "unlockers" contain malicious code or do not work on the latest versions of MIUI.

FAQ: Frequent questions about removing the pattern lock on Xiaomi

Can I remove the pattern lock without losing data?
Yes, but only if: πŸ“± The app is stock (Notes, Gallery) and you use Safe Mode or remove gesture.key. πŸ”Œ You've got debugging on. USB (method ADB). For third-party applications (for example, Viber or SberBank) without data loss, it is almost impossible to bypass the protection - you will have to reset your settings or contact the service in support.
Why does the app ask for a pattern lock again after being reset via ADB?
This happens if: πŸ” The key syncs to the cloud (e.g., in Google Notes or Mi Cloud). πŸ“² The app uses its own encryption (e.g. WhatsApp stores the key on its servers).Solution: delete the app, clear the Google Play Services cache and install it again.
Does the method work with gesture.key removal on MIUI 14?
Starting with MIUI 13, Xiaomi tightened protection for system files: βœ… The method works for older models (Redmi Note 8, Mi 9) and applications that are not updated through Google Play. ❌ On new smartphones (Redmi Note 12, Xiaomi 13), gesture.key can be encrypted or moved to a protected area. ADB or reset via Safe Mode.
How do I know if USB debugging is enabled if my phone is locked?
If you don't remember if you've activated USB Debugging, check this: Connect your phone to your PC. Open Windows or type in the terminal (macOS/Linux) the command: lsusb If there's a device named Xiaomi and ADB Interface status on the list, debugging is enabled. If debugging is off and the phone is locked, only reset via Recovery remains.
Can I unlock a pattern lock on Xiaomi without a computer?
Yes, but the options are limited: πŸ“± Safe Mode (Article 1). πŸ”„ Resetting the application settings (section 2). ☁️ Recovery via Mi Cloud (if the key is linked to the account (ADB, Delete gesture.key – computer is required.