A forgotten password on Xiaomi is a situation that even experienced users face. The main problem: standard unlock methods (such as resetting via Recovery) erase all data from the device. But what if the phone stores important photos, contacts or work documents that are not backed up?
In this article, we will discuss 5 working ways to unlock Xiaomi (including Redmi, POCO, Black Shark models) without losing data β from official methods through Mi Account to advanced technical solutions using ADB and Fastboot. Importantly, the effectiveness of methods depends on the version of MIUI, phone model and security settings. For example, on devices with MIUI 14+ and encryption enabled, some methods may not work.
Before you start, check:
- πΉ Is the phone connected to the Mi Account (even if you do not remember the password from the account, it can be restored).
- πΉ Is debugging on-line USB (Settings β The phone. β Version. MIUI β 7 times tap to unlock the developer mode).
- πΉ Is there access to a computer with Xiaomi drivers and tools installed? ADB/Fastboot.
1 Unlocking through Mi Account (official method)
The most reliable and secure way is to use a tied Mi Account, which works on all Xiaomi devices if:
- π± The phone is connected to the Internet (via Wi-Fi or mobile network).
- π Mi Account was added to the device before blocking.
- π Find the device is active in the account settings.
Instructions:
- On the locked screen, tap Forgot Password? (or Forgot Password).
- Choose Restore through Mi Account.
- Enter the username (email or phone number) and password from the Mi Account.
- Confirm unlocking via SMS or email (if two-factor authentication is enabled).
If you do not remember the password from Mi Account, restore it on account.xiaomi.com. Warning: when you restore an account via SMS, the code will come to the number associated with Mi Account, not to the locked phone!
β οΈ Attention: On devices with MIUI 13+ and enabled data encryption (Settings) β Additionally. β Encryption) after unlocking through Mi Account, you may need to enter the old password to decrypt files. If you do not remember it, the data will not be available.
π‘
If the phone is synced to Mi Cloud, contacts, notes and photos will automatically recover from the cloud after unlocking (provided the sync has been set up in advance).
2. use ADB (if USB debugging is enabled)
The method is suitable for users who have activated USB debugging beforehand (Settings β Developers β USB debugging). If this feature has been enabled, you can delete the password file through ADB without resetting the data.
What you need:
- π₯οΈ Computer with Windows/Linux/macOS.
- π Cable USB (preferably original).
- π οΈ Installed Xiaomi drivers and tools ADB (You can download from the official website).
Step-by-step:
- Connect the phone to your computer and open the Command Prompt (Win + R β enter cmd).
- Enter the command to check the connection: adb devices If the device appears in the list, go further.
- Delete the file with the password: adb shell rm /data/system/gesture.key or for the pattern lock: adb shell rm /data/system/locksettings.db
- Reboot your phone: adb reboot
Once rebooted, the password will be reset, but all data will remain in place. Limitation: on MIUI 14+ with encryption enabled, this method may not work - the system will require the entry of an old password to decrypt.
Install Xiaomi drivers|Download ADB Tools|Enable debugging on USB on the phone (if possible)|Prepare original USB-cable-->
3. Unlock via Fastboot (for advanced users)
If USB debugging is disabled, but you have access to Fastboot mode, you can try resetting your password through TWRP firmware or modified boot.img. This is a risky method - if you make a mistake, the phone can turn into a "brick".
What needs to be done:
- Turn off your phone and press the Power button + Volume down to log into the Fastboot.
- Connect the device to your computer and check for detection: fastboot devices
- Download TWRP for your model (e.g. from twrp.me) and run it: fastboot flash recovery twrp.img fastboot boot twrp.img
- In TWRP, go to Advanced β File Manager and delete files: /data/system/gesture.key /data/system/locksettings.db /data/system/locksettings.db-wal /data/system/locksettings.db-shm
- Reboot the phone.
β οΈ Attention: Firmware TWRP On devices with a locked bootloader, you will completely reset the data. Before you try, check the bootloader status with the command: fastboot getvar unlocked If the answer is unlocked: no, the method will not work.
What if the phone does not turn on after TWRP firmware?
4. Reset password through service codes (for older models)
On some Xiaomi devices (mostly released before 2019), you can reset your password using service codes, a method that doesnβt work on all models and may require you to enter an IMEI.
Try the following combinations:
- π ##7378423## β Resetting the pattern lock (works on Redmi) 4/5/Note 4).
- π ##3646633## β Engineer Mode β Reset Password (requires superuser rights).
- π ##4636## β Usage Statistics β Reset the Lock Screen application data.
If the codes don't work, try another method. Importantly, on new devices (MIUI 12+), service codes are usually locked.
| Model phone | Does the service code work? | Alternative method |
|---|---|---|
| Redmi Note 3/4 | β Yes, code ##7378423##) | ADB or Mi Account |
| Mi 8/9 | β No. | Fastboot or TWRP |
| POCO F1 | β οΈ Partially (root required) | ADB with superuser rights |
| Redmi 10/11 | β No. | Only Mi Account or reset |
5 Password bypass through Safe Mode (if a third-party launcher is installed)
If a third-party launcher is installed on the phone (for example, Nova Launcher, Apex), you can try to bypass the lock using Safe Mode.
- π― The lock screen displays a widget or launcher icon.
- π Safe Mode disables third-party apps, including screen locking.
Instructions:
- Press the power button to appear off menu.
- Tap and hold off to Turn off (or Power off) before a request to switch to Safe Mode appears.
- Confirm the transition. The phone will restart in safe mode.
- If the screen lock is disabled, delete the password file through Settings β Applications β Launcher β Clear the data.
- Restart your phone in normal mode.
β οΈ Attention: MIUI 13/14 Safe Mode does not disable the standard screen lock.The method works only with third-party launchers!
6. Contact the Xiaomi Service Center (guarantee cases)
If none of the methods worked, you can contact the official Xiaomi service center.
- π The phone has a warranty (usually 12-24 months).
- π You have documents confirming the purchase (check, box with the box). IMEI).
- π± The phone was not unlocked through Bootloader or stitched with unofficial software.
What to do:
- Find the nearest service center on Xiaomiβs website.
- Bring your phone, check and passport.
- Explain the situation β in most cases, engineers will be able to unlock a device without losing data if it has not been reset before.
The cost of the service depends on the model and the reason for blocking. In warranty cases, unlocking is usually free. If the phone was purchased from the official Xiaomi store (for example, on the Mi Store or AliExpress with a guarantee), the chances of successful unlocking are higher.
π‘
Official service is the only legal way to unlock without the risk of damaging the phone, and self-activating with firmware and resets can be a no-guarantee!