How to open Xiaomi Mi 4: unlock the bootloader, reset password and restore the system

The Xiaomi Mi 4, released in 2014, is still a popular device due to its reliability and the ability to install modern firmware. However, owners often face access problems: a forgotten pattern lock, a locked bootloader after a failed update, or buying a used phone with a tied Mi Account. In this article, we will analyze all the current ways to unlock the Mi 4 – from official methods to bypassing protection through the engineering menu.

It is important to understand that the procedures for the Mi 4 differ from the new Xiaomi models due to the outdated architecture (Qualcomm Snapdragon 801) and the bootloader version. For example, it does not work unlocking through Fastboot using the Mi Unlock Tool utility for modern devices. We will focus on methods that are guaranteed to work in 2026, including bypassing. FRP (Factory Reset Protection) and reset via Recovery.

If your Mi 4 doesn’t turn on, hangs on the logo, or requires a password after a reset, you’ll find solutions for each situation in this article. For convenience, we’ve divided the instructions by lock type and difficulty level, from simple actions for beginners to advanced methods for power users.

1. Determine the type of lock on Xiaomi Mi 4

Before you start unlocking, you need to diagnose the problem accurately. The Mi 4 can be locked on three levels:

  • πŸ”’ Screen lock: pattern lock, PIN-code or password set by the user.
  • πŸ“± Mi Account: Linking to a Xiaomi account that requires a login/password after resetting.
  • πŸ”§ Bootloader: locking at the firmware level, preventing the installation of custom software.

To determine the type of lock, pay attention to the behavior of the phone:

Symptoms.Probable causeDecision
The phone turns on but asks for a pattern lock/PINScreen lockingReset via Recovery or bypass through ADB
After reset, you need a login / password from Mi AccountFRP (Factory Reset Protection)Bypassing the test menu or firmware without checking
You can’t flash custom software, Device is locked errorLocked loaderOfficial Unlocking via Mi Unlock (old version)
The phone is not turned on, the red indicator flashes.Hardware failure or damaged firmwareFirmware via EDL Mode (Emergency Mode)

Critical feature of the Mi 4: on this model it is impossible to unlock the bootloader through the official Mi Unlock Tool of the new version (2023)+). You need to use the utility version 2.3.803.1 or lower, otherwise the device will not be recognized.

⚠️ Note: If the phone was purchased from hand and tied to someone else's Mi Account, official unlocking is impossible without the data of the previous owner. EDL tyre-free.

2. unlocking the screen: resetting the pattern lock or PIN-code

If you forget the lock screen password but the phone is turned on, there are several ways to regain access without losing data (unless it is encrypted).

Method 1: Recovery Mode (Data Loss)

The most reliable method is to reset the settings through standard recovery. CWM recovery TWRP (custom-set).

  1. Turn off the phone.
  2. Press Volume Up + Power before the Mi logo appears.
  3. In the Recovery menu, select Wipe Data/Factory Reset (control – volume buttons, confirmation – power button).
  4. After reset, reboot through Reboot System Now.

Warning: This method deletes all data on the phone, including photos, messages and apps. If encryption is enabled on the phone, you may need to enter a password even after reset.

Method 2: Bypassing the lock through ADB (without data loss)

If the phone is debugging on USB (USB Debugging, you can delete a password file through a computer, and this method only works when you connect to a previously authorized PC.

Install Qualcomm drivers for Mi 4|Download and unpack ADB Tools|Connect your phone to your PC in charge mode|Start the command line on behalf of the administrator-->

adb shell


su




rm /data/system/gesture.key # for pattern lock




rm /data/system/password.key # for PIN/password




reboot

If the commands are executed without errors, the phone will restart without locking the screen. Importantly, some firmware may call the files differently (for example, locksettings.db), and you will need to edit them through SQLite.

⚠️ Attention: On firmware MIUI 10+ With encryption enabled, this method will not work – the data will be blocked before entering the password.

pattern lock|PIN-code|Password.|I remember.|Other-->

3.Traffic bypass FRP (Mi Account) after resetting settings

If after resetting via Recovery, the phone requires data from Mi Account that you do not know, this means activation of Factory Reset Protection (FRP). On the Mi 4, this protection can be circumvented in several ways.

Method 1: Test Mode (Test Mode)

This method works for most versions. MIUI for Mi 4:

  1. On the account entry screen, click on the login field.
  2. Enter any text, highlight it and select Share β†’ Message.
  3. In the recipient field, type ##4636## and send it.
  4. You'll open the test menu. Go to Settings and turn off Factory Protection.

If this method does not work, try an alternative:

  • πŸ“± On the account login screen, click Add Account.
  • πŸ” Select Google and enter any email, then click Forgot Password?.
  • πŸ”— In the browser that opens, go to the site miui.com/unlock Download the unlock utility (if the phone is connected to Wi-Fi).

Method 2: Fastboot Firmware with Deletion FRP

If the menu crawling doesn't work, you'll need to flash the modified firmware without checking your Mi Account.

  1. Download the firmware. MIUI for Mi 4 (Cancro version) from en.miui.com.
  2. Unpack the archive and delete the file frp_lock.img (if there is).
  3. Fastboot commands: fastboot flash system system.img fastboot erase frp

πŸ’‘

If after firmware the phone hangs on the logo, reset through Recovery (Wipe Data).

4. Unlock the bootloader on Xiaomi Mi 4

To install custom firmware (LineageOS, Pixel Experience) or obtain root rights to the Mi 4, you need to unlock the bootloader.

Step 1: Getting permission to unblock

Even on older Xiaomi models, you need to link your account to your device:

  1. Turn on the phone and go to Settings β†’ The phone. β†’ Version. MIUI (Press 7 times to activate the developer mode).
  2. Back to Settings β†’ Additionally. β†’ For developers and turn on OEM-unlocking and debugging USB.
  3. Link your Mi Account to Settings β†’ Accounts.

Step 2: Unlock with Mi Unlock Tool (old version)

Download the Mi Unlock Tool version 2.3.803.1 (new versions do not support Mi 4):

  • πŸ–₯️ Install Qualcomm drivers for Mi 4 (download at forum.xda-developers.com).
  • πŸ“± Transfer the phone to Fastboot mode (clip Volume Down) + Nutrition).
  • πŸ”— Connect to your PC and launch the Mi Unlock Tool. Sign in with the same account you have on your phone.
  • πŸ”“ Press Unlock and wait until it is completed (usually 10-15 seconds).

What if the Mi Unlock Tool can’t see the device?
1. Check the utility version - should not be newer than 2.3.803.1. 2. Install the drivers manually through Device Manager (select "Qualcomm" HS-USB QDLoader 9008”). 3. Try another one. USB-port (preferably) USB Disable the antivirus - it can block the work of the utility.

⚠️ Warning: Once the bootloader is unlocked, the phone will reset to factory settings.

5. Recovery through EDL Mode (Emergency Mode)

If the Mi 4 doesn’t turn on, hovers on the logo, or doesn’t respond to buttons, firmware may need to be installed through the device. EDL Mode (Emergency Download Mode) is a method used to restore bricks).

How to enter EDL Mode on Mi 4

There are two ways:

  1. Hardware method: Turn off the phone. Press Volume up. + Loudness down + Power for 10-15 seconds. Connect to a PC β€” Qualcomm should appear in Device Manager HS-USB QDLoader 9008.
  2. Programming method (through ADB): adb reboot edl

Firmware via Mi Flash Tool

For firmware in EDL you will need:

  • πŸ–₯️ Mi Flash Tool (version 2016–2018).
  • πŸ“.tgz firmware for Mi 4 (e.g, MIUI 10 Global Stable).
  • πŸ”Œ Cable USB (preferably original).

Instructions:

  1. Unpack the firmware in a folder without Cyrillic symbols.
  2. Launch the Mi Flash Tool, press Select and specify the path to the firmware folder.
  3. Connect the phone in EDL mode.
  4. Select Clean All mode and press Flash.

πŸ’‘

Firmware through EDL It deletes all data, including the Mi Account link, and it's the only way to restore the phone if it doesn't respond to other methods.

Mistake.Reason.Decision
Sahara Communication FailedIncorrect drivers or damaged cableInstall the driver manually, try another one. USB-port
Firehose Match FailThe discrepancy between the firmware and phone versionDownload the firmware for the Cancro model
Device Not FoundPhone not detected in mode EDLCheck the connection, try another cable.

6. Installation of custom firmware after unlocking

Once the bootloader is unlocked on the Mi 4, you can install alternative firmware such as LineageOS, Pixel Experience or the likes of the newer ones. AOSP This will allow you to upgrade Android to a new version (for example, to Android 10) and improve performance.

Step 1: Installation of TWRP Recovery

Download the latest version TWRP For Mi 4 (cancro model) from twrp.me:

fastboot flash recovery twrp-3.6.0_cancro.img


fastboot boot twrp-3.6.0_cancro.img

Step 2: Firmware custom software

Instructions for LineageOS 17.1 (Android 10):

  1. Download firmware and GApps (such as OpenGApps pico).
  2. Reboot to TWRP (Loudness Up + Power).
  3. Run Wipe β†’ Advanced Wipe and mark Dalvik, Cache, System, Data.
  4. Sweep through the firmware, then GApps.
  5. Reboot (Reboot System)

πŸ’‘

If there is no network after firmware, check the settings APN or file separately (file) modem.img stock-stack).

FirmwareAndroid versionFeaturesReference
LineageOS 17.110Stable, minimalist interfaceforum.xda-developers.com
Pixel Experience10The interface is like Google Pixeldownload.pixelexperience.org
Havoc OS10Lots of customization, good performancehavoc-os.com
MIUI 12 (port)10Official interface with new functionsmiui.su

7. Frequent errors and their solutions

When unlocking the Xiaomi Mi 4, users face typical problems.

Error: This device is locked when running

That means the bootloader is not unlocked.

  • πŸ”“ Unlock the bootloader through the Mi Unlock Tool (see section 4).
  • πŸ“± If the utility does not work, try to sew TWRP Fastboot commands fastboot oem unlock (on some versions) MIUI).

Mistake: Invalid IMEI post-fix

If it's gone after the firmware. IMEI, restore it:

  1. Download the Chimera Tool or Maui utility META.
  2. Enter the original IMEI (It is under the battery or on a box).
  3. Fastboot: Fastboot Flash Modem NON-HLOS.bin

Error: The phone does not turn on after resetting

Possible causes and solutions:

  • πŸ”‹ Battery discharged – charge your phone for 30 to 60 minutes.
  • πŸ”„ Damaged firmware - sew stock MIUI through EDL.
  • πŸ› οΈ Hardware malfunction – check plumes or battery.

πŸ’‘

If the phone does not respond to buttons and does not charge, try to light up from another battery (3.7V) β€” Sometimes it helps to revive the device.

FAQ: Answers to Frequent Questions

Can I unlock the Mi 4 without losing data?
Yes, but only if you have debugging enabled. USB And you can connect through ADB. In this case, you can delete the lock files (gesture.key, password.key) without resetting. If debugging is disabled, the data will be lost when unlocked.
What to do if you forget your Mi Account login/password?
If the phone is linked to someone else's account, you can't officially restore access. EDL remove FRP. This will require a computer and a cable.
Does the Mi 4 support Android 11 or later?
No, the maximum supported version is Android 10 (via custom firmware like LineageOS 17.1).Newer versions of Android are not optimized for the Snapdragon 801 processor and will work with a heavy lag.
How to check if the bootloader is unlocked?
Turn off the phone and press the volume down. + Power. If you see Unlocked at the bottom of the screen, the bootloader is unlocked. If it's not written or it's written, Locked, you need to unlock.
Can I return the official firmware after the custom?
Yeah, for that, download the stock firmware. MIUI For the Mi 4 (cancro model) and run through the Mi Flash Tool in Clean All mode.