Flashing a Xiaomi smartphone through a computer is a task that scares many users, but it is one of the most reliable ways to upgrade or restore a device, especially if standard methods are used through Settings. β Software updates don't work. OTA-Updates (over the air), firmware via PC gives full control over the process: you can choose any version MIUI (including global or Chinese), roll back on previous builds or even install custom firmware like Pixel Experience.
However, the process requires care: error at any stage, from unlocking the bootloader to choosing the wrong firmware version, can turn the phone into a brick. In this article, we will examine all the steps of flashing through the computer, from preparing tools to finalizing the smartphone, focusing on unlocking the bootloader without waiting 168 hours (relevant to new models 2023-2026) and bypassing typical errors like anti-rollback or invalid image.
Preparation for firmware: what to do before the start
Before you connect your smartphone to your PC, make sure that all the preliminary steps are taken. skipping them can lead to the inability to restore data or even break the device.
First, back up. The firmware erases all data from internal memory, including photos, contacts and messages. Use Mi Cloud (if available) or third-party utilities like Titanium Backup (requires root).
- π± IMEI (You can find it in *#06# or on the box - useful if the network disappears after firmware.
- π Authorization keys for banking applications (Sberbank, Tinkoff, etc.) β they are tied to the current firmware.
- π folder MIUI on the internal drive - there are stored the settings of the themes and system applications.
Second, check the smartphone model and the current version of MIUI, which is critical for choosing the right firmware.
- π B Settings β The phone. β Model (e.g. Redmi Note 12 Pro)+ 5G).
- π Quickboot Getvar Product (if your phone is already in fastboot mode).
π‘
If your Xiaomi doesn't turn on, you can tell by the sticker under the lid or box. For the Chinese version (with the C suffix), the firmware must be appropriate - the global one won't work!
Finally, prepare the computer:
- π₯οΈ Install Mi drivers USB Driver (download from the official Xiaomi website).
- π Use the original. USB-cables β cheap cables can not transfer data in fastboot mode.
- π The battery charge should be at least 50% - at low charge, the process can be interrupted.
Unlocking the bootloader: how to bypass the 168-hour timer
The bootloader on all Xiaomi smartphones is locked by default, and unlocking it is a must before fastboot is installed. The official method involves linking your Mi Account account and waiting 168 hours (7 days), but there are legal workarounds for new devices.
Standard procedure:
- Link Mi Account to your phone in Settings β Xiaomi Account.
- Activate Developer Options (7 times click on the MIUI version in About Phone).
- Enable OEM Unlock and USB Debugging in the developer menu.
- Download Mi Unlock Tool from the official website and log in.
- Connect your phone in fastboot mode (clip Power + Volume down) and follow the program instructions.
To get around the 168-hour wait:
- π Use alternative versions of the Mi Unlock Tool (e.g., the Mi Unlock Tool Bypass from the community). XDA).
- π On some models (for example, Redmi Note 11) the timer is reset after resetting to factory settings and re-binding the account.
- π οΈ For older devices (until 2021) the method with EDL-The system requires an authorized Xiaomi account with developer rights.
What happens if you flash a phone with a locked bootloader?
β οΈ Warning: Unlocking the bootloader resets all data on the phone, including tied Google accounts and banking apps. If you used Mi Account to unlock the screen, you will need to enter a password from it after the procedure.
Selection of firmware: official MIUI vs custom
The type of firmware depends not only on the functionality, but also on the stability of the smartphone. Official MIUI firmware is divided into:
- π Globally stable (miui_GLOBAL JAVERSION.ZIP β recommended for most users, supports Google services, Russian language and monthly security updates.
- π¨π³ China's stable (miui_China.zip β without Google, but with more recent features, suitable for enthusiasts who are ready to install GApps separately.
- π§ͺ Weekly bat version β updated weekly but may contain bugs.
Custom firmware (e.g. LineageOS, Pixel Experience) gives more freedom, but requires:
- π Unlocked loader.
- π‘οΈ Established custom recaveri (TWRP Or OrangeFox).
- π₯ Compatibility with a specific model (check on the forums) XDA or 4PDA).
| Type of firmware | Pluses | Cons | Recommendation |
|---|---|---|---|
| Global MIUI | Stability, Google Support, OTA-update | Fewer features than in the Chinese version | For everyday use |
| Chinese MIUI | More recent features, less bloatware | No Google, there may be problems with the certification of banking applications | For experienced users |
| Castomic (AOSP) | Pure Android, no MIUI ads | The camera, NFC or sensors may not work | For enthusiasts and testing |
Where to download the firmware:
- π Official versions: miui.com (select by model and region).
- π Custom firmware: XDA Developers or 4PDA.
π‘
Never flash firmware from another model, even if the names are similar (for example, the Redmi Note 12 Pro and Redmi Note 12 Pro+), which will lead to a βhard brickβ β irreparable breakdown.
Firmware through MiFlash: step-by-step instructions
MiFlash is Xiaomiβs official firmware utility for fastboot, and is suitable for installing full firmware packages (with the.tgz or.zip extension) and recovering the device after crashes.
Instructions:
βοΈ Preparing for firmware through MiFlash
- Unpack the downloaded firmware into a short-path folder (e.g., C:\MIUI\).
- Run MiFlash on behalf of the administrator.
- Connect your phone in fastboot mode (clip Power + Volume down when the phone is off).
- In MiFlash, click Select and specify the firmware folder.
- Select the firmware method: clean all β complete cleaning (recommended when changing the version of MIUI). clean all and lock β cleaning + lock bootloader (dangerous!). save user data β saving user data (not always stable).
Flash
If the process is suspended on waiting for the device:
- π Check the cable connection and port USB (better USB 2.0).
- π Reinstall drivers manually through Device Manager.
- π οΈ Try a different version of MiFlash (e.g. MiFlash 2020 instead of 2023).
β οΈ Note: If the phone doesnβt turn on after firmware, and an anti-rollback error appears in MiFlash, then you tried to install an older version. MIUI, It's not the same as before, but it's only fixed by firmware to the new version or by EDL (requires authorization).
Fastboot Firmware: An Alternative to MiFlash
If MiFlash doesnβt work or needs more flexible setup, you can flash the device through the command line in fastboot mode, which is suitable for advanced users and allows you to control each step.
Tools required:
- π₯οΈ ADB Fastboot (downloaded as part of Android) SDK separately).
- π Firmware in.tgz format or unpacked.img files.
Step-by-step:
- Unpack the firmware in a folder (for example, C:\fastboot_rom\).
- Open the command prompt in this folder (Shift + PCM β Open the PowerShell window here).
- Connect your phone in fastboot mode and check the connection with the command: fastboot devices should appear serial number of the device.
- Run the firmware in turn for each section: fastboot flash boot.img fastboot flash recovery.img fastboot flash recovery system.img fastboot flash vendor.img fastboot flash vendor.img fastboot flash dtbo dtbo.img
- Clear the cache: fastboot erase cache fastboot erase userdata
- Reboot the device: fastboot reboot
You can use a batch script to simplify (create a file). flash_all.bat contents):
@echo off
fastboot flash boot boot.img
fastboot flash recovery recovery.img
fastboot flash system system.img
fastboot flash vendor vendor.img
fastboot flash dtbo dtbo.img
fastboot erase cache
fastboot erase userdata
fastboot rebootIf you see a FAILED error (remote: 'Partition not found'), you don't have a firmware image for that partition. Check the archive contents and skip the missing files.
Frequent mistakes and their solutions
Even if you follow the instructions accurately, you can get errors, and let's look at the most common ones and how to fix them.
| Mistake. | Reason. | Decision |
|---|---|---|
| anti-rollback | Trying to revert to the old version of MIUI | Switch a newer version or through EDL (requires authorization) |
| invalid sparse file format at header | A damaged firmware file | Download the firmware again, check the checksum (MD5) |
| device not found | The device is not recognized in fastboot | Check drivers, cable, USB port. Try another PC. |
| The phone is stuck on the Mi logo | Incompatible firmware or interrupted process | Repeat the firmware with full cleaning (clean all) |
Additional advice:
- π If there is no network after the firmware, check it out. IMEI (Type *#06#. If it is missing, restore it through SN Writer Tool (requires) EDL).
- π If there's no sound, the vendor section may not have been clicked.
- π΅ If the sensor is not working, please swipe separately touch.fw (relevant for some Redmi models).
How to restore IMEI after firmware?
First setup after firmware
Once the firmware is successful, the phone will turn on as new.
- Select language and region. For global firmware, it is recommended to specify Russia or Europe (for Chinese, it is China, but then you will need to install the Google Services Framework separately).
- Connect to Wi-Fi. If there is no network, check the operator's APN settings.
- Log in to the Mi Account that was used to unlock the bootloader.
- Restore data from a backup (if you did it through Mi Cloud or Titanium Backup).
Recommendations for optimization:
- π Turn off auto-update MIUI In Settings β The phone. β Update the software if you do not want to make unexpected changes.
- π Set Protection Against Accidental Unlocking in Settings β Lock screen β Additionally.
- π΅ Check the fingerprint scanner and NFC β Sometimes they require additional adjustment after firmware.
If you have a custom firmware stitched (e.g., Pixel Experience), additionally:
- Install GApps (Google Apps) via TWRP if they are not in the build.
- Check the camera performance β some models require separate modes (like the ANX Camera).
- Set up root access through Magisk if required (for example, for ViPER4Android).