How to unlock Xiaomi Redmi 7: from pattern lock to Mi Account

Xiaomi Redmi 7 remains a popular budget smartphone even years after the release, but its owners often face the problem of blocking: a forgotten pattern lock, PIN-It's a code or a Mi Account that requires confirmation after reset, and unlike the flagship models, there's no fingerprint scanner on all the modifications, which increases the risk of locking the device. This article covers all the current ways of unlocking - from official to engineering, taking into account the features of the firmware Redmi 7 (codename onc).

Important: Methods vary depending on the type of lock and version MIUI. For example, bypassing Mi Account on older versions MIUI 12.5 requires additional manipulation of the EDL-Recovery on some firmware may result in a loss IMEI β€” We'll analyze each scenario with risk warnings and step-by-step instructions.

If you’re looking for a way to unlock Redmi 7 without losing data, go straight to the pro section. ADB-For cases with a Mi Account reference, you will need access to mail or backup phone, but there are alternative methods as well (see the method comparison table below).

πŸ“Š What type of lock your Redmi 7 has?
pattern lock/PIN
Mi Account (requires login)
Forgot the password from the account
The device is locked after firmware
Another option

1. Unlock via Safe Mode (if the pattern lock is forgotten)

This method works if Redmi 7 has only a pattern lock or PIN installed, but there is no binding to Mi Account.The point is to boot the phone in safe mode, where all third-party applications, including the screen locker, are disabled.

Algorithm of action:

  1. Turn off Redmi 7 with a long press on the power button.
  2. Press the power button and hold it until the Xiaomi logo appears.
  3. As soon as the logo appears, release the power button and immediately press the volume down button.
  4. Hold the volume button until the phone boots into Safe Mode (the screen will read β€œSafe Mode” at the bottom).

In this mode:

  • πŸ”“ Try unlocking the screen – sometimes the pattern lock is reset.
  • πŸ“± If the key is still active, go to Settings. β†’ Annexes β†’ All applications.
  • πŸ” Find the Lock Screen app (or com.android.keyguard) and clear its data.
  • πŸ”„ Restart your phone – the lock should disappear.

⚠️ Warning: If you want to enter Mi Account after you restart, this method didn't work. ADB or hard reset.

πŸ’‘

If Safe Mode doesn’t turn on the first time, try repeating the steps by holding the volume button longer – sometimes it takes 10-15 seconds.

2.Reset via Recovery Mode (Hard Reset)

It's a radical way of erasing all the data from your phone, including photos, contacts and apps.

  • πŸ” Forgot the pattern lock and password from Mi Account.
  • πŸ“± The phone does not respond to other unlock methods.
  • πŸ”„ You need to return the phone to the factory settings before selling.

Step-by-step:

  1. Turn off Redmi 7.
  2. Press the power button and the volume button at the same time.
  3. Hold them for 10-15 seconds until the Recovery Mode menu (the logo of Xiaomi with Android robot) appears.
  4. Use volume buttons for navigation and power button to select the item.
  5. Select Wipe Data β†’ Wipe All Data (on some Factory Reset firmware).
  6. Confirm the action and wait for the process to be completed.
  7. Choose Reboot. β†’ Reboot to System.
AdvantagesDeficiencies
βœ… It works on any firmware.❌ Deletes all data without recovery
βœ… No need for PC or special programs❌ Maybe she can. IMEI loose-leaf
βœ… Bypasses the pattern lock and PIN❌ It doesn’t help if your phone is tied to your Mi Account.

⚠️ Note: On some versions MIUI 11-12 after Hard Reset, the phone may require you to enter the Mi Account information that was previously linked. If you do not remember the username / password, go to the section about bypassing the account.

3. Unlock through ADB (without data loss)

This method allows you to delete a password file via Android Debug Bridge (ADB) without erasing user data.It works if the phone is debugging on USB and has access to a PC.

What you need:

  • πŸ–₯️ A computer with installed Xiaomi drivers and ADB.
  • πŸ”Œ USB-cable (preferably original).
  • πŸ“± Included debugging by USB (Settings β†’ The phone. β†’ Version. MIUI β†’ 7 times to press to unlock the developer settings).

Instructions:

  1. Connect Redmi 7 to your PC via USB.
  2. Open the command line (Windows) or the terminal (Mac/Linux) and type:
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 reboot, the lock should disappear. If there is a su: not found error, then there is no root permission on the phone - try an alternative way:

adb shell


cd /data/data/com.android.providers.settings/databases




sqlite3 settings.db




update system set value=0 where name='lock_pattern_autolock';




update system set value=0 where name='lockscreen.lockedoutpermanently';




.quit




reboot

β˜‘οΈ Preparation for unblocking through ADB

Done: 0 / 5

⚠️ Note: If after execution of commands the phone still requires a password, then the lock is implemented at the level MIUI, It's not Android. It's only Recovery reset or Mi Account bypass.

4. bypassing the lock Mi Account (if the login / password is forgotten)

Xiaomi smartphones are linked to the Mi Account, and after resetting settings or firmware, they may require authorization. If you don't remember your account details, there are several ways to bypass:

Method 1: Through the official Xiaomi website

  • 🌐 Go to account.xiaomi.com.
  • πŸ” Click β€œForgot your password?” and enter your linked email or phone.
  • πŸ“§ Follow the instructions to restore access (confirmation code will come to the mail or SMS).

Method 2: Through EDL-The mode (for advanced users)

If the official method doesn’t work, you can flash the phone into Emergency Download Mode (EDL), but it requires:

  • πŸ–₯️ PC with Mi Flash Tool installed.
  • πŸ“ Firmware for Redmi 7 (codename onc).
  • πŸ”§ Screwdriver for disassembling the phone (you need to close the contacts test point).

Step-by-step:

  1. Turn off the phone and remove the back cover (on Redmi 7 it is removable).
  2. Find a test point (usually next to the SIM card jack) and close the contacts with tweezers.
  3. Connect your phone to your PC via USB, and it should be defined as Qualcomm HS-USB QDLoader 9008.
  4. Start the Mi Flash Tool, select the firmware and press Flash.
What happens if you interrupt the firmware in EDL?
Interrupting the firmware process in EDL mode can lead to the phone β€œbricking” β€” it will stop turning on and require repair in the service center. This mode is low, so any errors can lead to loss of service.

Method 3: Through Fastboot (without disassembly)

Less risky method, but requires unlocked bootloader:

  1. Load your phone to Fastboot Mode (Power button + Volume down).
  2. Connect to the PC and check the connection with the command:
fastboot devices
  1. Enter the command to reset FRP (Factory Reset Protection):
fastboot oem clean_frp
  1. Reboot the phone:
fastboot reboot

πŸ’‘

Bypassing Mi Account via EDL or Fastboot can result in a device being locked if it has been stolen. Xiaomi tracks such activities and can block IMEI.

5. Unlock with Find My Device (if your phone is connected to Google)

If a Google account has been set up on Redmi 7, you can try to unlock it through Find My Device, which works even if you have forgotten your graphical key, but:

  • πŸ“Ά The phone must be connected to the Internet (Wi-Fi or mobile network).
  • πŸ”‹ The battery level should be above 5%.
  • πŸ“ Find the device must be enabled in Google settings.

Instructions:

  1. Go to the Find My Device website.
  2. Sign in with the same Google account that is linked to your phone.
  3. Select your Redmi 7 from the list of devices.
  4. Click Lock the device and enter a new password.
  5. Confirm the action – the phone will appear field to enter a new password.

After unlocking, don’t forget to delete the old pattern lock in the security settings.

Alternative methods: OTG-cable

If none of the above methods worked, you can try the lesser known tricks:

Method 1: Unlocking through OTG-cable

Suitable if the lock screen has an emergency call button:

  1. Put it on the phone. OTG-cable USB-mouse.
  2. Click Emergency and enter ##4636###.
  3. With the mouse, go to the Settings menu and turn off the screen lock.

Method 2: Service codes for resetting

Some of the Redmi 7 firmware supports hidden commands:

  • πŸ“ž Enter the dial number: ##7780### - reset settings (retained data).
  • πŸ“ž Enter *2767*3855# β€” Full reset (removes everything, including firmware).

⚠️ Attention: Code *2767*3855# may result in loss IMEI on some versions of Redmi 7. Use it only as a last resort!

Comparison of all Unlocking Methods

MethodPC requiredData retainedWorks with Mi AccountDifficulty
Safe Mode❌ No.βœ… Yes.❌ No.⭐⭐ (simple)
Hard Reset (Recovery)❌ No.❌ No.❌ No (requires Mi Account)⭐ (simple)
ADBβœ… Yes.βœ… Yes.❌ No.⭐⭐⭐ (middle-class)
Bypassing Mi Account (EDL)βœ… Yes.❌ No.βœ… Yes.⭐⭐⭐⭐⭐ (difficult)
Find My Device❌ No.βœ… Yes.❌ No.⭐⭐ (simple)

FAQ: Frequent questions about unlocking Xiaomi Redmi 7

πŸ”’ Can you unlock Redmi 7 without losing data?
Yes, if you have USB debugging enabled and you have access to your PC, use ADB. Safe Mode will also help if you lock it with a pattern lock only. Otherwise, the data will be lost.
πŸ“± What to do if your phone asks for Mi Account after Hard Reset?
This means that the device is linked to a Xiaomi account.Options: Restore access to the Mi Account through the official website.Use EDL-Firmware mode (requires disassembly of the phone). Contact the Xiaomi service center with documents on the phone.
⚑ Why did the network signal disappear after unlocking?
This means that the IMEI has been reset. It can be restored: Through the engineering menu: type ##4636## β†’ Phone information β†’ SIM β†’ enter the original IMEI. Swipe the phone through Fastboot with IMEI in commands. Attention: Changing the IMEI may be illegal in some countries. Use the original values from the sticker under the battery.
πŸ”§ How to unlock bootloader on Redmi 7?
To unlock bootloader: Link the device to Mi Account in Settings β†’ Additional β†’ Developer β†’ Mi Unlock Status. Download Mi Unlock Tool. Download the phone to Fastboot and connect to the PC. Follow the program instructions (it may take 7-30 days to wait).
πŸ› οΈ How much does it cost to unlock Redmi 7 in the service center?
Cost depends on the type of lock: pattern lock/PIN: 500–1500 β‚½ (Recovery reset. Mi Account: 1500–3000 β‚½ (roundabout EDL or official account restoration). IMEI/firmware: 2000–5000 β‚½ (In official Xiaomi services, unlocking the Mi Account can be free of charge when you present a check for a purchase.