Forgot the security code from Xiaomi's smartphone and can't unlock the screen? Or bought a used device and the previous owner didn't remove the protection? This problem is familiar to many users - according to statistics, about 15% of calls to service centers are associated with password loss. Fortunately, Xiaomi has several official and alternative ways to restore access, and most of them do not require the use of specialists.
In this article, weβll look at all possible sources of security code, from standard storage locations (Mi Account, backups) to little-known tricks using ADB and engineering menus. Weβll focus on methods that work even without being tied to a Xiaomi account, because this is the most common request from users. If youβre trying to unlock a device after youβve dropped or bought it from hand, hereβs the solution.
1.Official method: Recovery through Mi Account
The most reliable and recommended method by the manufacturer is to use a tied Mi Account, which works on all Xiaomi, Redmi and POCO devices released after 2016, the main condition is that the phone must be connected to the Internet (via Wi-Fi or mobile network).
To restore access:
- π Reboot the device and tap the lock screen Have you forgotten your password? (or Forgot password?).
- π§ Enter an email or phone number linked to Mi Account, and it will receive a confirmation code.
- π Enter the received code and follow the instructions to create a new password.
If the button Forgot the password? is inactive or not, it means that:
- π« Device not tied to account (handheld purchase without resetting).
- π No internet connection (check your Wi-Fi settings or SIM-map).
- π The phone is in Fastboot or Recovery mode.
β οΈ Note: If you bought your phone with your hands and the previous owner didnβt untie your Mi Account, you wonβt be able to restore access through this method, which would require a full reset with deletion of your account (see section 4).
2. Where the security code is stored in the device settings
If you havenβt forgotten your password completely, but want to change it or find out the current one, check the following sections in the Xiaomi menu:
- Settings β Passwords and security β Screen lock β this displays the type of protection (PIN, pattern lock, fingerprint).
- Settings β Accounts β Mi Account β Security β if synchronization is enabled, a backup copy of the password can be stored here.
- Settings β Additional β Privacy β Data Protection β on some models (Mi 11, Redmi Note 10) there is duplicate information about the lock.
On devices with MIUI 12+ added the function βReserveβ PIN-If you have installed it, try entering the combination 123456 or 000000 on the lock screen - sometimes this works as an emergency option.
How do I find out the MIUI version?
| Xiaomi model | The path to lock settings | Does it support a backup PIN? |
|---|---|---|
| Redmi Note 9/10 | Settings β Passwords β Screen lock | Yes (MIUI 12.5+) |
| Mi 11/12 | Settings β Security β Blocking | Yes. |
| POCO X3/F3 | Settings β System β Blocking | No. |
| Black Shark 4/5 | Settings β Game β Security | Only for the game profile |
3. Alternative sources: where else can the code be stored
If standard methods donβt help, check out these places β users often save passwords in non-obvious files or services:
- π± Backups in Google Drive: If you have synced data with a Google Account, try restoring settings via drive.google.com (Section "Backups").Look for files called backup_miui_*.ab.
- π Notes or Notebook: Many save passwords in Notes apps, Google Keep or even in Calendar as an event.
- πΎ Guest.key or password.key: Some firmwares store passwords in a folder /data/system/. It can only be accessed through root or ADB.
- π§ Emails: Search for emails from no-reply@account.xiaomi.com β When you change your password or bind the device, notifications come there.
If you have access to a computer that your phone has been synced to, check:
- π₯οΈ folder C:\Users\Your name\AppData\Local\Xiaomi\MiPhoneManager β Log files with device data can be stored here.
- π Browser history for queries like "Mi Account forgot password" or "unblock Xiaomi".
π‘
If you used Mi Cloud for backup, try recovering data on another Xiaomi device. To do this, log in to the same account and select Restore from Backup in Settings.
4.Reset the security code through Recovery and Fastboot modes
If all the soft methods are exhausted, there's a hard reset, which will delete all the data from the device, including the attached Mi Account, but will return access to the phone, suitable for devices purchased with hands or after a failed upgrade.
Instructions for Recovery Mode:
- Turn off the phone.
- Press Volume Up + Nutrition (on some models Volume Down + Nutrition).
- From the Recovery menu, select Wipe Data β Wipe All Data (use volume buttons for navigation, power for confirmation).
- After resetting, the phone will reboot to its original state.
For devices with a blocked Mi Account (after reset requires entering the username / password of the previous owner), you will need to unlock via Fastboot:
fastboot oem unlock
fastboot flashing unlockThese commands will remove the account binding, but only work on devices with the unlocked bootloader. Xiaomi models after 2019 will require official permission from the manufacturer (application on the Xiaomi website).
Turn off your Google Account (if possible)
Make a backup copy of important data
Charge your phone at least 50%
Prepare the original. USB-cable-->
β οΈ Note: On Xiaomi devices with MediaTek chip (e.g. Redmi) 9A, POCO C31) Recovery reset could lead to loss IMEI. Before the procedure, save a backup copy of the folder /nvram.
5.Use of ADB and Engineering Menu (for Advanced)
If you have access to USB-debugging (was enabled before blocking), you can try to delete the file with the password through ADB. This method works for MIUI 10β14 and does not require root rights.
Step-by-step:
- Connect your phone to your PC and open the command line in the folder with ADB.
- Enter the commands: 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 screen lock should disappear.
If ADB doesnβt help, try the engineering menu:
- π Dial on the phone keyboard ##4636##.
- π§ Go to the Testing section β Security β Lock Screen.
- ποΈ The current type of lock and the option of its reset can be displayed here.
π‘
Method ADB It only works if it only works USB-The debugging was enabled before the device was locked, and if it wasn't activated in advance, it's useless.
6. Contacting a service center: when nothing helps
If all of these methods do not work, you can contact the official Xiaomi service center.
- π Devices with the previous ownerβs Mi Account blocked.
- π± Phones after a failed firmware update (bricked).
- π οΈ Devices with damaged memory (E:Unable to mount) /data).
The cost of unlocking the service varies from 500 to 3000 rubles depending on the model and the reason for the lock.
- π’ Moscow: 16 Leo Tolstoy St. (at the Afimall shopping center").
- π’ St. Petersburg: Ligovsky Prospect., 108/110 (gallery").
- π’ Regions: Addresses can be found on Xiaomi Service.
Prepare before your visit:
- π Check or warranty card (if the phone is guaranteed).
- π Passport (to confirm possession).
- π± Charger (in the service can check the performance).
β οΈ Warning: Unofficial workshops often offer Mi Account bypasses for RUB 1,000-1,500, but this violates Xiaomiβs policy.
7. How to avoid loss of security code in the future
To avoid encountering a locked device problem again, follow these rules:
- π Use password managers: Save codes in Google Password Manager, KeePass, or 1Password.
- π§ Link Mi Account: Even if you buy a phone with your hands, untie your old account and link your phone.
- π± Put the backup on. PIN: V MIUI 12+ This is done in the settings β Passwords. β Standby PIN.
- π Regularly update the firmware: In new versions MIUI Emergency unlocking functions are added through SMS.
If you often forget passwords, set up biometric authorization:
- π Fingerprint (works even when the screen is off on Mi) 10T, Redmi Note 11).
- ποΈ Face recognition (configure in Settings) β Biometry).
π‘
Create a text file on Google Drive called Xiaomi Passwords and save all access codes there. Set up Access Only for You and enable two-factor authentication on your Google account.