How to unlock Xiaomi Redmi 7A if you forget your password without losing data

Forgotten password on Xiaomi Redmi 7A β€” The main problem is that most standard unlocking methods (such as resetting via Recovery) lead to a complete cleanup of internal memory. However, there are ways to get around protection without losing data β€” photos, contacts, messages and applications. In this article, we will discuss the working methods for different types of locking: a pattern lock, PIN-code, password and even a linked Mi Account.

It's important to understand that success depends on several factors, such as the MIUI version, USB debugging (ADB), Google account tied, and battery status, such as if the phone has Find Device enabled, the chances of saving data are much higher. We have compiled current methods for 2026, tested on MIUI 12-14 firmware for Redmi 7A (codenamed pine).

Before you start, check:

  • πŸ”‹ Battery level (at least 30%, otherwise the phone may turn off during the process).
  • πŸ”Œ Availability of original USB-cables (cheap cables often do not transmit data to the ADB).
  • πŸ’» Access to a computer with Windows/Linux (c ADB or Fastboot).
πŸ“Š What type of lock you have on Xiaomi Redmi 7A?
pattern lock
PIN-code
Password.
Mi Account Account
I remember.

1 Unblocking through Google account (if linked)

This method works if Redmi 7A previously added a Google account and enabled sync, Suitable for devices running MIUI before version 12.5 (newer versions may disable the feature).

Instructions:

  1. On the lock screen, enter any password/key 5 times in a row until the message β€œForgot the password?” appears.
  2. Click on this caption β†’ select β€œRestore via Google”.
  3. Enter the login and password from the Google account that was linked to the phone.
  4. Create a new password or pattern lock.

⚠️ Note: If Google enters the data and you have an error called β€œImpossible to connect to the server”, check your Internet connection (mobile data is better than Wi-Fi). Also make sure that the phone does not have a factory reset via Find My Device – in this case, the data will be erased.

Why is it that Google’s new MIUI recovery is not working?
Since MIUI 13, Xiaomi has removed the ability to reset passwords through a Google account for security reasons, due to data leaks and abuse of the feature by fraudsters, and instead, the manufacturer is actively promoting authorization through Mi Account.

2.Use ADB (Android Debug Bridge) to delete the lock file

The method is suitable if on Redmi 7A The previous debugging was included USB (USB Debugging is the only way to unlock your phone without losing data if you forget your pattern lock or PIN-To work, you will need a computer with installed Xiaomi drivers and tools ADB.

Step-by-step:

  1. Download and install Platform Tools (includes ADB and Fastboot).
  2. Get Redmi on board. 7A computer-to-computer USB-cable.
  3. Open the command prompt (cmd) in the folder with ADB and execute the commands:
adb devices


adb shell




su




rm /data/system/gesture.key




rm /data/system/password.key




rm /data/system/locksettings.db




rm /data/system/locksettings.db-wal




rm /data/system/locksettings.db-shm




reboot

After the restart, the phone unlocks, but you may need to reconfigure the pattern lock. If the commands don't work, try an alternative:

adb shell am start -n com.android.settings/.ChooseLockGeneric

⚠️ Attention: On some firmware MIUI Lock files can be stored in other folders (for example, in the, /data/system/users/0/). If the lock remains after the reboot, check for gatekeeper.password.key or gatekeeper.pattern.key files and delete them.

Install Platform Tools on PC|Enable debugging on USB on the phone (if previously available)|Download Xiaomi drivers for your OS|Connect your phone to the original cable|Check the visibility of the device by the team `adb devices`-->

3. bypass Mi Account through the test menu (for older versions of MIUI)

If Redmi 7A blocked by a Mi Account (for example, after a reset or purchase of a used phone), you can try to bypass the check through the test menu. MIUI 11 and demands SIM-mobile-internet cards.

Instructions:

  1. Put it in. SIM-card on your phone and turn it on.
  2. On the lock screen, dial ##3646633## (code for logging into the engineering menu).
  3. Go to the Connectivity section β†’ Wi-Fi.
  4. Click on "Menu" β†’ "Advanced" β†’ "Disconnect" (this will disable the Mi Account verification).
  5. Return to the lock screen and try to enter any password.

If the method does not work, try an alternative method:

  • πŸ“± Connect your phone to Wi-Fi on the lock screen.
  • πŸ”„ Restart the device (clip the power supply) + Volume up for 10 seconds).
  • πŸ”“ After the reboot, it may be possible to skip the account check.

⚠️ Attention: On new versions MIUI (12+) This method does not work due to enhanced security, and after bypassing Mi Account, the phone can be blocked again the next time you connect to the Internet (if the account was not deleted from the device through official channels).

4. Unlock through Recovery and Fastboot modes (partial data loss)

If previous methods didn’t work, you can try unlocking Redmi 7A via Recovery or Fastboot, but with minimal data loss, such as resetting only lock settings (without clearing user files).

Method 1: Reset via Recovery (Photos and videos are saved, but applications are removed):

  1. Turn off the phone.
  2. Press Power + Volume Up to Enter Recovery.
  3. Select "Wipe Data" β†’ "Wipe All Data (Do not choose Format Data!).
  4. Confirm the action and wait for the reboot.

Method 2: Delete lock files via Fastboot (requires an unlocked bootloader):

fastboot flash cust cust.img


fastboot reboot

⚠️ Attention: On Redmi 7A Fastboot commands will not work without official unlocking through the Mi Unlock Tool. Also, after resetting via Recovery, you may need to re-authorize your Mi Account if it was tied to you.

πŸ’‘

Before resetting via Recovery, remove the memory card (microSD) – it does not clear, but can be damaged by unstable power.

5. Official ways to unlock from Xiaomi

If none of the methods worked, you can contact the official service center Xiaomi, the manufacturer provides two options for unlocking:

MethodTimelineCostData retention
Unlocking through Mi Account (if tied)1-3 daysFree of charge.Yes.
Contact the service center with documents3-7 days1 000–3 000 β‚½No (full reset)
Remote unlocking through Find DeviceInstantly.Free of charge.No.

To unlock through Mi Account:

  1. Go to account.xiaomi.com.
  2. Log in to your account.
  3. Select "Find the device" β†’ "Unlock".
  4. Confirm the action via SMS or email.

Critical: If the phone was bought from hand and tied to someone else's Mi Account, official unlocking is only possible if there is a check or a sales contract.

6. Alternative methods (for experienced users)

If you're willing to take a chance, you can try informal firmware or tools like the Mi Flash Tool, but these methods require an unlocked bootloader and can lead to complete data loss or a phone "brick."

Ways for Advanced Users:

  • πŸ”§ Custom Recovery firmware (TWRP) and manually delete lock files.
  • πŸ“₯ Using the Mi Flash Tool to flash your phone while saving partition /data.
  • πŸ”“ Exploitation of vulnerabilities in MIUI (For example, through DirtyCOW for older versions of Android).

⚠️ Warning: Unofficial firmware may contain malicious code or disrupt the Widevine module (issues with Netflix, banking applications). Also, after firmware custom Recovery can work Anti-Rollback protection, and the phone will stop turning on.

πŸ’‘

The best way to avoid data loss is to back up regularly through Mi Cloud or locally on your PC. Even if the phone is locked, files from the backup can be recovered after unlocking.

FAQ: Frequent questions about unlocking Xiaomi Redmi 7A

Can I unlock Redmi 7A without a computer?
Yes, but only if you had a Google account or a Mi Account attached, otherwise you'd need a PC to work with ADB or Fastboot, and without a computer, you could try resetting through Recovery, but that would cause you to lose some of your data.
What if the phone asks for an old password after unlocking?
This means that the lock files are not completely deleted. Try repeating the procedure through ADB by deleting additional files: rm /data/system/locksettings.db rm /data/system/locksettings.db-wal rm /data/system/locksettings.db-shm If it doesn't work, reset via Recovery (but the data will be lost).
Can I unlock Redmi 7A through service codes?
Redmi 7A doesn't have any service codes to reset your password. Codes like ##7780## or *2767*3855# either don't work or cause a complete reset. The only valid code is ##3646633## to log in to the engineering menu (see section 3).
How to unlock your phone if you forget your Mi Account?
If you have forgotten your Mi Account login or password, restore access through the recovery page. If your account is not yours (for example, a used phone is purchased), contact the previous owner to unblock the device.
Why do some applications not work after unlocking?
This is due to a system integrity breach (e.g., after deleting files via ADB or firmware custom Recovery). Solution: Reinstall problematic apps. Update Google Play services to Settings β†’ Apps. Reset (not data!) to Settings β†’ Additional. If the problem persists, you may need to completely flash your phone.