After five incorrect attempts to enter the pattern key, the Xiaomi Redmi smartphone locks the screen and prohibits access to the system for 30 seconds or several hours, leaving the owner without important contacts and photos.

Fortunately, the ecosystem Android and shell MIUI offer several ways to solve this problem. The effectiveness of each method depends on the version of the operating system, the presence of bound Mi account and enabled USB debugging. Some methods allow you to save data, others require a complete reset of the device to factory settings. In this article, we will analyze in detail all the available options, from the simplest to advanced engineering solutions.

Resetting the lock via Mi account

The most civilized and safest way to unlock a device is to use the manufacturer’s cloud service. If you have previously logged into your profile on your phone and enabled the Find My Device function, then you have a chance to remove the lock without losing data. This method works on older firmware versions MIUIwhere the unlocking service was integrated directly into the password entry screen.

First, you need to enter the wrong pattern five times in a row. After this, the message “Forgot your key?” should appear on the lock screen. or “Forgot your password?” By clicking on this button, the system will prompt you to log in. You will need to enter the login and password for your Mi accountthat was used on this device. Make sure that the smartphone is connected to the network Wi-Fi or mobile data, otherwise the verification of credentials will not pass.

⚠️ Attention: On new versions MIUI 12 and higher, as well as on devices linked to an account for security purposes, this function may be disabled by the developers. If the recovery button does not appear, you will have to use other methods.

Successful authorization will allow you to set a new password or completely disable screen protection. This is an ideal scenario as it does not affect the user's files. However, it is worth remembering that if the phone was bought secondhand and the previous owner did not log out of his account, you will not be able to unlock it in this way - the protection will work. FRP (Factory Reset Protection).

💡

If you do not remember the password for your Mi account, restore it in advance through a computer on the official website mi.com before trying to unlock the phone.

Full reset via Recovery Mode

If the cloud method did not work or the account was not linked, the only option is a hard reset, known as Hard Reset. This process completely erases all user data from the phone's internal memory, returning it to its factory state. The pattern will be deleted along with all photos, applications and settings.

To get into recovery mode, you must completely turn off your smartphone. Then hold down the Volume Up button and the Power button at the same time. Hold them until the logo Redmiappears, then release the power button, but continue to hold the volume. You will be taken to the main menu Recovery, which is controlled by the volume buttons, and the choice is confirmed by the power button.

☑️ Algorithm of actions in Recovery

Done: 0 / 5

In the menu, select item Wipe Dataand then Wipe All Data. The system will ask you to confirm the action, usually this is a button Confirm. The formatting process may take several minutes. When finished, select Reboot and then Reboot to System. When you first boot, the phone will behave like new, requiring initial setup.

⚠️ Attention: After resetting, the phone will require you to enter the password for the Google account or Mi account that was previously synchronized with the device. This is an anti-theft protection that cannot be circumvented by simple formatting.

It is important to note that on some models with data encryption, access to Recovery mode may also be blocked by the password entry screen. In this case, this method will not work, and you will need to use specialized software for your PC.

Using USB and ADB debugging

For advanced users who had previously enabled USB debugging in the developer menu, it is possible to delete the lock file through the computer. This method requires the installed driver ADB (Android Debug Bridge) on the PC and connecting the smartphone with a cable. If debugging was not activated before blocking, this method, unfortunately, is not applicable.

Connect your phone to your computer and open a command line or terminal in the folder with the ADB utility. Enter the command to check the connection:

adb devices

If the device is detected, you can try to delete the file responsible for storing the pattern key. In older versions of Android this is a file gesture.key, in new versions - locksettings.db. The removal command is as follows:

adb shell rm /data/system/gesture.key

After executing the command, you must reboot the device. You can enter any pattern on the lock screen and the phone should unlock. This method does not delete personal data, which makes it extremely attractive, but its performance is highly dependent on the firmware version and access rights.

What to do if ADB does not see the device?

Make sure the correct driver is installed. Try a different USB cable or port. If the phone is charged less than 20%, connect it to the charger for a few minutes before connecting to the PC.

It is worth considering that modern versions Android have enhanced partition protection /data/system, so deleting the key file may not lead to the desired result without the presence root-rights. In such cases, the system can automatically recreate the lock file upon reboot.

📊 Did you manage to unlock your phone without losing data?
Yes, via Mi account
Yes, via ADB
No, I had to reset
Haven't tried it yet

Find My Device service from Google

An alternative to the Xiaomi branded service is the standard solution from Google - Find My Device. This tool allows you to manage your locked device remotely through any browser. The main condition is that the phone must be turned on, connected to the Internet and have active synchronization with your Google account.

Go to the official website of the service from a computer or another smartphone. Log in using the same Google account that is used on the blocked one Redmi. Select your model from the list of devices. You will be offered three actions: call, block or erase data.

Action Influence on data Requirements
Call No influence Internet, sound on
Block Change password Internet, Google account
Erase data Full deletion Internet, battery charge

Select the “Erase Device” option. This will initiate a remote factory reset. Once the process is complete, the phone will reboot and the pattern will be removed. However, as in the case of Recovery Mode, all files in the internal memory will be irretrievably lost.

The “Lock” function allows you to set a new temporary password that will replace the forgotten pattern. This is a rare chance to save data, but it is unstable on shells with deep system changes, such as MIUI. Often the system ignores a remote command to change the password if the screen is already locked by the user.

Bypassing the lock through interface vulnerabilities

In certain firmware versions Android and MIUI there are bugs that allow you to access settings or the dialer without entering a password. These loopholes are periodically closed with security updates, but on devices that have not been updated for a long time, they may work. One of the known methods is associated with an emergency call.

On the lock screen, tap the “Emergency Call” button. Enter a special code or character sequence that causes the interface to crash. For example, typing a bunch of asterisks and copying the line via the clipboard will sometimes open the notification or settings panel. From there, you can go to the applications menu and launch a third-party launcher or utility to reset the key.

⚠️ Warning: Methods with vulnerabilities are unpredictable. On modern security patches of 2023-2026, they are usually already fixed. Do not waste a lot of time if the first attempts do not yield results.

Another option is to use a voice assistant Google Assistant. Try activating it with the power button or long pressing the home button if possible from the lock screen. Ask your assistant to open Settings, Browser, or Task Manager. If the command is executed, you will gain access to the system.

💡

Interface vulnerabilities are a temporary solution that only works on specific older versions of software and does not guarantee success.

Flashing the device via Fastboot

If none of the software methods help, there remains a radical, but the most reliable way - flashing the device in mode Fastboot. To do this you will need a computer, a special cable and a utility Mi Flash Tool. This method completely overwrites the system partition of the phone, guaranteed to delete any password.

First, you need to download the official firmware for your specific model Redmi from the developers' website. Unzip the archive on your computer. Then put your phone into Fastboot mode by turning it off and holding down the Volume Down and Power buttons. Connect your smartphone to the PC.

Run Mi Flash Tool, select the path to the folder with the firmware and click the “Flash” button. It is important to select the data cleaning mode - clean all. The process will take from 5 to 15 minutes. After successful firmware, the phone will boot into a clean system without any traces of the previous blocking.

⚠️ Attention: Incorrect firmware or disconnecting the cable during the process can lead to complete failure of the device (brick). Make sure the battery charge is at least 50%.

This method requires technical literacy and caution. An error in selecting the firmware model can lead to inoperability of the communication modules or touch screen. It is recommended to check the device ID before starting the procedure.

Where to download the firmware?

Official firmware is available on the website miui.com or through specialized forums like w3bsit3-dns.com and XDA Developers. Always check the hash amount of the file before installation.

What to do if the phone asks for a password after resetting the settings?

This protection worked FRP (Factory Reset Protection). You need to enter the login and password for the Google account that was synchronized with the phone before the reset. If you do not remember them, you will need a procedure for bypassing FRP, which is individual for each version of Android.

Is it possible to unlock Redmi without losing photos and contacts?

Without losing data, it is only possible through the “Find My Device” service from Mi or Google, if the function has been configured in advance. In all other cases (Recovery, Fastboot), the internal memory will be completely cleared.

How many times can you enter the wrong key?

Usually 5 attempts are given. After this, input is blocked for 30 seconds. With repeated unsuccessful attempts, the blocking time increases to 1, 5, 15 minutes or more. After many errors, the phone may prompt you to reset the data.

Will removing the SIM card help you remove the lock?

No, removing the SIM card does not affect the lock screen pattern or password in any way. This data is stored in the internal memory of the phone and does not depend on the network module.

Is it possible to remove the key through a service center?

An official Xiaomi service center can unlock the device only if you provide a purchase receipt and a box confirming ownership. Otherwise, they will refuse the service due to the privacy policy.