When you try to run a favorite app or hidden folder, and Xiaomi, Redmi or POCO requires you to enter a pattern lock or a digital code that you just don't remember, it happens quite often.This is a security mechanism that many users install for banking applications, gallery or instant messengers, but forget the combination after months of not using or updating the system. Unlike the screen unlock password, this code is stored separately and often tied to a Mi Account or a local security profile.
The challenge is that current versions of the MIUI shell and the new HyperOS have enhanced security protocols that don't allow you to get around the protection. However, there are several proven ways to restore access. If you've linked your Mi Account to the application protection feature, the recovery process will take literally a couple of minutes through a standard reset procedure, and if you haven't, you'll have to use more radical but effective methods to clean up security data.
In this article, we will discuss all the current methods of solving the problem, from a regular reset via an account to using special commands via a computer. It is important to understand that in some cases, removing protection will require removing the data of the Security application itself, which can lead to a reset of the blocker settings, but will not affect your personal photos or contacts.
Standard reset via tied Mi-account
The easiest and safest way to do this is to use a cloud account, and if you logged into your Xiaomi profile when you first set up your app lock and allowed security to synchronize, it will take a minimum of time to restore access, and the system will offer this option after several failed attempts to enter the code.
First, you need to enter the password incorrectly several times or draw the wrong pattern lock. Usually, after the 5th attempt, the screen will show the words "Forgot the password?" or "Forgot the pattern lock." By clicking on this link, the system will redirect you to the authorization page. Here you will need to enter the username and password from your Mi Account. After successful authorization, you will be asked to create a new combination.
- π Enter a new password twice to confirm security changes.
- π± Make sure your device is connected to the internet or your account will not be checked.
- π The old password will be completely deleted and replaced with a new one immediately after confirmation.
Note that this method only works if Application Protection was activated with authorization, and if you only used a local password without a cloud link, the system may not show a recovery link, so go to the next section of the instructions.
Use of the control question
Another regular mechanism that users often ignore when they first set up is the check question, and when you set up an application lock, MIUI often asks you a secret question and answer, which is a kind of insurance policy in case you forget the primary access code.
To use this method, you also need to make a few mistakes when entering your password. When an error window appears, look for the "Ask for a Check Question" button or link. After clicking, the system will ask you to enter the answer you asked earlier.
β οΈ Warning: If you don't remember the answer to the control question or have never set it, this method will be useless. Don't try to guess the answer indefinitely, as the system can temporarily block the recovery for several hours.
Successfully entering the correct answer will immediately jump to the new password creation screen, one of the few ways that doesnβt require an internet connection or email access if all the data has been stored locally in a secure area of the deviceβs memory.
Reset via data cleanup of the Security app
If standard methods don't work, you'll have to resort to a more radical but effective way: Application locking is part of the Security system component, and cleaning up the application's data resets all security settings, including passwords, graphic keys, and hidden space settings, returning them to factory settings.
To do this, you need to go to the application management menu. Since the settings menu itself can be password protected (if you have system application lock enabled), you need to act quickly or through Safe Mode if the password is on all menus. Go to Settings β Applications β All applications. Find the Security app (green shield icon) in the list.
βοΈ Resetting protection algorithm
In the menu that opens, click Clear (or Memory) and then select Clear All Data or Reset. The system will warn you that this action will delete the settings. Confirm the action. Then, when you try to enable the application lock, the system will behave as if you are doing this for the first time and ask you to set a new password.
- ποΈ This method does not delete your personal files, photos, contacts or installed apps.
- βοΈ Only the settings of the antivirus, cleaner and application blocker are reset.
- π Hidden space settings will also be reset, files from there may become unavailable without an additional backup.
Working with Hidden Space (Second Space)
A separate category of problems is related to the Second Space, which is a fully-fledged, isolated profile on Xiaomi's system that has its own password, different from the main profile password, and if you forget the code from the second space, the logic of the actions changes a little.
Often users confuse passwords: try to enter code from the main screen in the second space or vice versa. Make sure you are in the correct profile. If you are logging into the second space, try using the Forgot Password feature, which can be accessed via the profile switch if sync with Mi Cloud is configured.
In cases where access to the second space is permanently lost, the only option is to delete it. To do this, go to the main profile, open Settings β Second Space and select the deletion option. This action will completely destroy all data in the second profile, but return control of the device.
| Action. | Impact on the main profile | Impact on Hidden Space | We need access to.. |
|---|---|---|---|
| Resetting password through Mi Account | No. | Change of password | Internet and account |
| Cleaning up the data "Security" | No. | Complete resetting of settings | Phone settings menu |
| Removal of the second space | No. | Complete deletion of data | Main profile |
| Full reset (Hard Reset) | Deletion of all data | Deletion of all data | Recovery menu |
What happens to files in the second space when deleted?
Using ADB for Advanced Users
For those who are not afraid of the command line and have USB debugging enabled, there is a method of resetting via a computer, which allows you to delete the file that stores the password hash without completely cleaning the data of the Security application, which sometimes helps to save the hidden space settings.
You'll need a computer with ADB drivers installed and a USB cable. Connect your smartphone, enable debugging and type a command to obtain shell rights. Then you'll need to find and delete the gatekeeper.pattern.key file or a similar file in the /data/system/ directory, but newer versions of Android may have different paths. The safer way through ADB is to force the packet cleanup:
adb shell pm clear com.miui.securitycenterThis command is similar to manually clearing data through a menu, but it is performed remotely. It is effective if the phone interface is locked or unstable. Once the command is executed and the device is restarted, the application lock will be disabled.
β οΈ Attention: Use ADB requires pre-debugging of USB. If this feature was disabled before the password was lost, this method will not work.
The most important thing is to reset (Hard Reset)
If none of the above methods worked, or if the password from both the application lock and the Mi Account login is forgotten, the last option is a complete reset of the device to factory settings, which is guaranteed to remove any software lock, but will lead to the loss of all user data.
Turn off the phone completely to perform the reset. Then press the Volume Up + Power button combination (on some models Volume Down + Power) until the Mi logo or Recovery menu appears. From the menu, select the language (English), then Wipe Data β Wipe All Data. Confirm the action and wait for the process to be completed.
π‘
Before performing a full reset, make sure you remember data from your Google account and Mi Account. After the reset, the phone will require it to confirm ownership of the device (FRP protection).
Once you reboot, the phone will be like a new one, you can set up the app lock again, make sure you write down a new password or save it in the password manager to avoid a repeat of the situation, which is an extreme measure that should be resorted to only in desperate situations.
Prevention and safety advice
To prevent the βforgotten passwordβ issue from catching you off guard in the future, itβs recommended to stick to a few digital hygiene rules: Todayβs Xiaomi smartphones offer flexible settings that balance security and convenience.
First of all, always link security features to your account. Cloud key synchronization is the most reliable way to recover. Also use biometrics: a fingerprint or face unlock often works even when the digital code is forgotten, allowing you to at least log in to the application and change the password in the settings.
- π Write complex passwords to a secure location or use password managers.
- π Donβt use too simple combinations (1234, 0000) that are easy to pick up, but donβt make them too difficult to remember.
- π Regularly check the relevance of the attached phone number and email in the Mi Account.
π‘
Timely binding of the Mi Account and setting up the control issue at the first installation of application protection saves hours of time and nerves in the event of loss of access.
Keep in mind that the security of your data is in your hands. Regular system updates and careful privacy settings will help avoid many problems. If you use important applications, consider using built-in protections (FaceID within the application) that do not depend on the Xiaomi system blocker.