This guide provides a clean, safe path to restore your Xiaomi device to factory settings and re-lock the bootloader.
Only select the "Lock" option if the ROM Region matches your Device Hardware. Locking a Global ROM on a Chinese device (or vice versa) will result in a permanent brick.
- How to verify your region:
- IMEI Method: Find your IMEI (
*#06#or on the box) and use the Official Xiaomi Product Authentication. "International Version" means Global. - Note: There are other ways to check (like hardware codes or box markings); if in doubt, research your specific model variant before locking.
- IMEI Method: Find your IMEI (
To avoid being locked out of your phone after the flash:
- Google Account: Go to your Google Security settings on a PC or another device and remove this phone from your account. Alternatively, remove the Google account within the phone settings before flashing.
- Xiaomi (Mi) Account: Ensure you know your Mi Account password. After flashing, the phone may ask for it to activate. If you are unsure, log out of the Mi Account on the device before starting.
- Mi Flash Tool: Download Version 20220507
- Stock ROM: Xiaomi Firmware Updater (ginkgo)
- IMPORTANT: You must download the FASTBOOT type (tgz/tar).
- DO NOT use the "Recovery" type; it is incompatible with Mi Flash.
The Mi Flash Tool is sensitive to long file paths and special characters.
- Extraction: Extract the
.tgzfile until you have the final folder containing the/imagesfolder. - Rename & Move: - Rename the extracted folder to something short (e.g.,
ginkgo_stock).- Move this folder to the root of your drive (e.g.,
C:\ginkgo_stock). - Ensure the path contains ONLY Latin characters. No spaces, symbols, or Cyrillic characters.
- Move this folder to the root of your drive (e.g.,
- Enter Fastboot Mode:
- Power off the phone.
- Hold Volume Down + Power until the "FASTBOOT" logo appears.
- Connect the phone to your PC.
- Setup Mi Flash Tool:
- Launch
XiaoMiFlash.exe. - Click Select and choose your shortened ROM folder (e.g.,
C:\ginkgo_stock). - Click Refresh. Your device serial should appear.
- Launch
- Select Flash Option:
- At the bottom right, select "clean all and lock".
- This wipes all data and re-locks the bootloader to factory state.
- Flash:
- Click Flash. Wait for the green "Success" status.
- The phone will reboot automatically.
- "Could not find part of the path": Your folder path is too long or contains invalid characters. Move the folder to
C:\and ensure the name is simple. - Mi Flash not detecting phone: Ensure you are using a USB 2.0 port if possible, and check that Xiaomi ADB drivers are installed correctly.
Disclaimer: This guide is for educational purposes. Flashing firmware carries inherent risks. Proceed at your own risk.