How to delete your Xiaomi password without losing data

The situation of forgetting the security code on your Xiaomi, Redmi or POCO is familiar to many users: the screen remains locked, and important photos, work documents and contacts are stored inside the smartphone. Standard instructions often offer the only radical solution - a complete reset to factory settings, which inevitably leads to the destruction of all information.

However, there are methods to remove the password on the Xiaomi without losing data and return access to the device. In this article, we will discuss proven ways to bypass the lock screen for different versions of MIUI firmware and the new HyperOS, as well as consider the nuances of working with the Mi Account and third-party utilities.

The effectiveness of each method depends on the version of the operating system, the model of your gadget and whether certain debugging functions were pre-enabled, and we will analyze the algorithms of actions in detail so that you can choose the most secure and suitable option for your particular situation.

πŸ“Š What type of lock is on your Xiaomi?
pattern lock
PIN-code
Digital password
Fingerprint.
Face ID

Use of Mi Unlock Status and Mi Account

The most legal and safe way to unblock a device is if it was tied to a Mi Account. In some versions of the MIUI shell, it is possible to unlock through the company's official website if the smartphone has access to the Internet.

Log in to your account using the same credentials as on your locked phone. From the device management menu, find your smartphone and select Find Device. If geolocation is active, the system will offer several actions, including remotely unlocking or resetting your screen password without deleting files.

This method doesn’t work on all firmware versions, as Xiaomi is gradually closing these loopholes for security reasons. However, if your phone is relatively old or runs on the MIUI 10-12 version, the chance of successfully restoring access is very high.

⚠️ Attention: To successfully perform this procedure, a locked smartphone must be connected to a Wi-Fi network or mobile Internet.

If the standard site interface doesn’t offer unlock options, try using ADB Command Prompt Restore mode, but only if USB debugging was previously enabled.This is a more complex technical method that requires a PC and an ADB driver installed.

πŸ’‘

If you just changed your Mi Account password, wait 24 hours before trying to unlock your device.

Bypassing the lock through Safe Mode

Safe Mode is effective when a third-party application, rather than system protection, sets the screen lock, and users often install locker programs that conflict with the system or contain bugs that prevent the correct code from entering.

To enter safe mode on most Xiaomi models, you must:

  • πŸ”˜ Press and hold the power button until the turn off menu appears.
  • πŸ”˜ Press and hold your finger on the item Turn off on the screen.
  • πŸ”˜ In the window that appears, confirm the transition to Safe Mode.

After the reboot, the bottom left corner of the screen will show "Safe Mode" in which third-party apps will not start. If the lock was caused by third-party software, you will access the desktop, you will need to find the guilty application in the settings and remove it.

Once you remove the problem software, just restart the phone in the normal way, the system will return to normal mode, and the lock should disappear, which does not require a connection to the computer and is completely secure for user data.

What if the switch off button does not respond to a long press?
On some models with the new HyperOS, the Safe Mode call menu is hidden. Try to press the volume button as soon as the Mi logo appears when you boot. Hold it until the system is fully loaded.

Reset password through ADB and delete key files

For advanced users who have had pre-debugging over USB, there is a technical way to delete files responsible for storing access keys, which requires a connection to a computer and use the Android Debug Bridge platform.

The method is to delete the gesture.key or password.key system files, which store the hashes of graphic keys and passwords, and after they are deleted, the system forgets that the screen should be blocked, and lets the user inside.

The sequence of actions is as follows:

  1. Connect your phone to your PC through USB-cable.
  2. Open the command line on your computer in the folder with ADB.
  3. Enter the command to check the connection: adb devices.
  4. If the device is identified, enter a command to remove the keys:
adb shell rm /data/system/gesture.key


adb shell rm /data/system/password.key




adb shell rm /data/system/locksettings.db

Once the commands are executed, you need to restart the device. It is important to understand that on modern versions of Android 11, 12, 13 and 14, access to the /data/system partition without root permissions is often closed, even with debugging enabled, so this method may not work on new smartphones without first obtaining superuser rights.

β˜‘οΈ Pre-use checks ADB

Done: 0 / 4

Comparison of Unlocking Methods

The choice of the particular method depends on your preparation and the condition of the device. Below is a table that will help you navigate the effectiveness of different methods for different scenarios.

MethodThe need for a PCRisk of data lossRequirements
Mi Account.No (browser needed)0%Internet on the phone, tied account
Safe regimeNo.0%Blocking by a third-party application
ADB (key removal)Yes.Low.USB Debugging enabled, older versions of Android
Service centreNo.High-pitchedChecks, warranty, time.

* In official service centers, data is often stored, but in private workshops, a full reset is most often used. As you can see from the table, the availability of pre-preparedness (account, debugging) is the decisive factor.

Don’t rely on the β€œmagic” apps from Play Market that promise to unlock any phone in one click, and 99% of the time they either require debugging already enabled or are fraudulent.

πŸ’‘

No software method guarantees 100% results on modern versions of Android without data loss unless pre-production has been done.

Use of the Smart Lock function

The Smart Lock feature in Android allows you to automatically disable your password request in certain trusted situations, and if you have previously configured this feature, deleting your password can happen automatically.

There are several types of trusted conditions:

  • πŸ“ Trusted places: The phone unlocks when you are at home or at work (required) GPS).
  • πŸ“± Trusted devices: The screen remains open when a specific Bluetooth gadget is connected (earbuds, watches, car).
  • πŸ—£οΈ Voice matching: unlocking by voice command (works unstable).

Try to remember if you've ever connected a Bluetooth headphone or a smartwatch, and if you turn it on and put it on your phone, it can recognize a trusted device and let you go to your desktop without entering code, which is one of the most underappreciated ways.

Also check if you were in the range of your home Wi-Fi or a location you thought was safe at the time of lockdown, which in some cases helps bypass the lock screen, although modern versions of the lock screen are not. MIUI They can still ask. PIN-code.

Frequent errors and precautions

When users try to delete their password on shaomi, they often make mistakes that make things worse. The main mistake is to repeatedly enter the code incorrectly. After a certain number of attempts, the phone is locked for a while, and then may require you to log in to your Mi Account, which you may also have forgotten.

⚠️ Warning: Don't try to disassemble your smartphone or turn off the plumes in the hope of resetting your memory. In modern devices, the memory is soldered on the board, and physical intervention will only cause the device to break down.

Another common mistake is using untested software to hack, and programs that require root rights or suspicious profiles may contain viruses or Trojans that steal your data after you do get access.

Always check the source of the information. Xiaomi’s official support and XDA-Developers developer forums are the most reliable sources. If none of the gentle methods worked, you can either carry the phone to the service with a check of purchase (they can unblock FRP), or accept the loss of data in order to bring the device back to life.

Why does the phone require an account after a reset?
It's a FRP (Factory Reset Protection) protection mechanism that prevents the use of a stolen phone, and you can only remove it if you know the login and password from the last synchronized Google or Mi Account.

Questions and Answers (FAQ)

Can you unlock Xiaomi without losing data if USB debugging is not enabled?
The odds are slim. Without USB debugging enabled or a pre-configured Mi Account with device search functionality, software methods are virtually powerless against modern Android protection, leaving only guessing the password or a complete reset.
Will Deletion of Gesture.key Files Work on Android 13 and HyperOS?
Most of the time, no. Starting with Android 11, the /data/system partition is closed to the user without root permissions, even through ADB.
What if the phone says "Device locked" after resetting?
This is FRP protection. You need to enter the Google account information that was synced to the phone before the reset, and if you don't remember it, you'll need to contact the service center with the purchase documents to confirm ownership.
Will Google’s Find My Device app help?
Find My Device allows you to remotely lock your device or erase data, but the feature to delete the screen password without resetting data has been missing for several years for security reasons.