Xiaomi Security Code: Where to Find and How to Unlock Your Device

Owners of Xiaomi, Redmi and Poco smartphones often face a situation where the device is blocked and requires the input of a special code. SIM-A card, a Mi Account password, or a screen unlock code, and understanding what security code the system is asking for is the first step to regaining access to your data.

In this article, we will take a closer look at all the types of security codes used in the MIUI and HyperOS shell, where to look for them, how they are generated, and what to do if standard methods do not work. Data security is a priority, so you can not ignore these requests.

Users often confuse the bootloader unlock code with the account access code, and it is important to distinguish between these concepts clearly, since the methods of their recovery are radically different, and errors can lead to a complete locking of the device.

The main types of security codes in MIUI

The Android system in conjunction with the shell from Xiaomi uses several layers of protection. The first layer is the screen unlock code (PIN, pattern lock, password), the second layer is the protection of the Mi Account account, which binds the device to the owner.

The third, deeper layer, is the bootloader, the Unlock Code is issued specifically to reset system constraints, and the security code in the context of unlocking the bootloader is a unique identifier that is tied to a particular device.

⚠️ Warning: Attempting to find a bootloader unlock code by brute force will block the ability to unlock for 168 hours or more.

There's also code. PUK, which is requested by three times incorrect input PIN-code SIM-This code is not related to the Xiaomi system, but is provided by your mobile operator.

Where to find the Mi Account unlock code

If you turn on your phone or reset your settings, the system asks you to enter your Mi Account password, it means that Find Device protection has worked. There is no code as such here - it is the password you set when you registered.

To restore access, go to the official website id.mi.com or account.xiaomi.com. Click on the "Forgot Password" button and follow the instructions. You will need access to the linked phone number or email.

If the phone number is no longer available, the recovery process becomes more complicated, you have to fill out a support application form, providing checks about the purchase of the device, and the Mi ID is a key element in this security chain.

Never try to bypass this protection with third-party software, which often results in the phone turning into a brick or staying locked permanently.

📊 What type of lock is bothering you?
Screen password
Blocking Mi Accounts
Forgot. PIN SIM-map
Unlocking the loader

Unlocking code of the bootloader (Bootloader)

For advanced users who want to get root rights or install custom firmware, you need to unlock the bootloader, which generates a unique unlock code, and you need to use the official Mi Unlock Tool utility on your computer.

The procedure for obtaining the code is as follows:

  • 🔒 Link your Mi Account in your phone settings (Settings) → Advanced settings → For developers).
  • 💻 Download and install Mi Unlock Tool on Windows PC.
  • 📱 Transfer the phone to Fastboot mode (clamping the volume buttons).
  • 🔓 Enter the username and password of the Mi Account in the program on PC to receive the code.

The unlock timer is counted by the company’s servers.

fastboot oem unlock

This command is entered into the console after permission is obtained, but in modern versions of MIUI the entire process is automated through the Mi Unlock interface.

☑️ Preparation for unlocking the loader

Done: 0 / 4

Resetting the screen security code through Recovery

If you have forgotten the pattern lock or PIN-The only official way to do this is to completely reset your files, but you can get back to the system.

Turn off the phone completely to enter, then press the power button and Volume Up + Power at the same time, and hold them until the Mi or Poco logo appears.

In the Recovery menu, you can navigate with volume buttons, and you can choose with a power button (on older models) or a touch (on new ones). Select Wipe Data, then Wipe All Data, and confirm the action.

⚠️ Note: After resetting the settings via Recovery, the phone will ask for the password from the Mi Account that was synced earlier.

On new devices with FRP (Factory Reset Protection) enabled, simply resetting buttons may not help if you don’t know your Google or Mi credentials.

Table of codes of engineering menu and diagnostics

There are special Android systems USSD-These are commands and codes for logging into the engineering menu, which help check the condition of components, but are not designed to remove security locks.

Team team.FunctionDescription
##64663##CIT MenuEngineering menu for testing sensors, screen and sound
##4636##TestingInformation on telephone, battery and usage statistics
*#06#IMEIDisplay of the serial number and IMEI of the device
##7780##ResetResetting settings (requires confirmation)

These codes are safe to use if you're just looking at the information, but changing the parameters in the CIT can disrupt the calibration of the sensors.

Using ADB to manage access

For users with a computer, the ADB (Android Debug Bridge) tool provides a powerful way to interact with the device, but the ADB must be pre-enabled in USB debugging mode.

If debugging is enabled but the phone is locked, you can try to delete files that store access keys (only on older versions of Android without encryption).

adb shell rm /data/system/gesture.key


adb shell rm /data/system/password.key

Once the commands are executed, the device must be restarted. On current versions of MIUI 12/13/14 and HyperOS, this method usually does not work due to the increased encryption of the /data partition.

⚠️ Attention: Use ADB Incorrect deletion of system files can lead to a cyclic reboot (bootloop).

It’s more of a method for developers than for regular users looking for a “security code.”

Problems with SIM-map PUK-code

Often users search for “Xiaomi code” when the phone writes “Enter” PUK». It's a mistake: the phone asks for a code from the SIM card. PIN-code, SIM card is blocked.

PUK-The personal unlocking key is 8 digits, which you can't find, and it's on the plastic card that came with the SIM card, or in your mobile phone's personal account.

After input PUK-The system will ask you to come up with a new one. PIN-Be careful if you type 10 times incorrectly PUK, SIM card will burn down completely, and you will have to go to the communication salon for a replacement.

Don’t confuse this code with Network Unlock Codes, which are required if the phone is locked to a specific carrier.

Frequently Asked Questions (FAQ)

Can I unlock Xiaomi without a computer?
Full unlocking of the bootloader without a computer is impossible, as you need the Mi Unlock Tool. You can only remove the password from the screen through the Recovery menu (with loss of data) or knowing the password from Mi Akka. Without data loss and without a PC, you can not unlock a modern Xiaomi.
Where to find the PUK code for a SIM card?
The PUK code is on the plastic card holder you received when you bought a SIM card, and can also be found in the personal account of your mobile operator (MTS, Beeline, MegaFon, Tele2, etc.) in the number information section.
What is the security code in the “Protection” application?
Xiaomi’s built-in Security app can ask for a password if App Protection is enabled, which you set yourself in the app’s settings, and if you forgot, only resetting the app’s settings through Android system settings will help.
Will the unlock code from another Xiaomi phone work?
No. The bootloader unlock code is unique to each device and is tied to its IMEI and serial number at the time of the Mi Unlock request. It is impossible to use someone else's code.
How long will it take to wait after the account is linked?
The standard waiting time is 168 hours (7 days) in some regions or for new accounts, the timer can be extended to 30 days.