How to Unlock the Bootloader and flash Xiaomi Phones using Fastboot Mode

We decided to come up with an Official Flashing Guide that can be helpful to anyone wondering on how to flash Xiaomi Phones using Fastboot Mode, and therefore a Fastboot Rom (.tgz).

First of all, let me share with you some useful information related to Bootloader and Fastboot.

BOOTLOADER

The bootloader is the component in the operating system of a smartphone (or a computer, for that matter) that is, in general terms, instructs the operating system (Android, iOS, Linux, Windows, etc) kernel to boot normally.

As you may know, all the latest Xiaomi smartphones now come with a locked bootloader.
But, what does it mean?

If you are able to modify the bootloader of your device, then you are able to load whatever (supported) operating system you want. That means “unlocked bootloader”.

A “locked bootloader”, which is intentionally LOCKED by the manufacturer or the cell phone operator, would not allow you to modify that bootloader. Android devices come with locked bootloaders for a reason. It’s not just that carriers and manufacturers want to own your hardware and prevent you from installing custom ROMS on it – although they do – there are good security reasons.

A device with a locked bootloader will only boot the operating system currently on it. You can’t install a custom operating system – the bootloader will refuse to load it.

FASTBOOT MODE

Fastboot is a tool/protocol for writing data directly to your phone’s flash memory. In practical use, it is used to flash images such as recoveries, bootloaders, and kernels to your Android device.
On Xiaomi devices, you can access to Fastboot mode following these steps:

  • Turn OFF your Xiaomi Phone.
  • Press and hold the Volume Down and Power button.
  • The phone will now boot into Fastboot mode.
  • Once you see your Fastboot screen, you can now connect your phone to your PC and access it via the Fastboot tool.

XiaoMiFlash

To unlock the bootloader on Xiaomi devices and flash Fastboot ROMS via Fastboot Mode, you will need to use Xiaomi Official flashing tool “XiaoMiFlash”. This tool works only on unlocked bootloader devices.

I have divided this thread into two guides, one is for unlocking the bootloader and flashing a Fastboot ROM, the other one is for flashing a Fastboot ROM on already unlocked devices.

GUIDE 1 – Flashing Guide for Locked Bootloader

Note: A Windows PC/laptop will be needed for the following steps. Make sure that your device is fully charged or has enough power (70% Battery) for this process. This guide will help you update your device to the latest MIUI ROM version. All user data will be purged in this process. Please back up your data and think twice before proceeding. Follow these procedures at your own risk.

1) BOOTLOADER UNLOCK PERMISSION

See also  Accessing StreamingAssets in Android or iOS

The first thing to do is to unlock the Fastboot of your device. In order to do that, you will need permissions. Click here to apply to unlock your device. Remember, after you unlock the device, it will become less secure. Your personal data might be leaked or lost.

Fill the application form with your forum nickname. You will get an SMS notification when you got the permission to unlock.
You will then be able to download the Mi Unlock app on your PC.
Please note, time to get permission to unlock may vary.

2) NECESSARY FILES:

Once you received the unlock permission you will need to download 3 files:

  • Xiaomi Flashing Tool Miflash v2018.5.28.0 –  Link
  • Mi Unlock to unlock your device Bootloader – Link
  • Fastboot ROM (.tgz) for your device – Link

3) ROM File:

Make sure to download the right Fastboot ROM (.tgz). Once you downloaded it, decompress it and move its content into C: folder on your computer.

4) DEVICE IN FASTBOOT MODE:

Now we need to boot your device in Fastboot Mode, as already explained above, follow these steps:

  • Turn OFF your Xiaomi Phone.
  • Press and hold the Volume Down and Power button.
  • The phone will now boot into Fastboot mode.
  • Once you see your Fastboot screen, you can now connect your phone to your PC and access it via the Fastboot tool.



5) Mi Unlock:

Now that we are in Fastboot Mode we can unlock the bootloader of the device. To do so we will need Mi Unlock, that you downloaded in Step 2. Remember?
Open and run it.

Agree to the disclaimer if you intend to proceed.

Log in with your Mi Account and Password

Let Mi Unlock check if you Mi Account has permissions.

Phone Connected and ready to unlock. Click “Unlock”.

Click “Unlock anyway”

You just successfully unlocked your device.

See also  How to Change Package Name in Android Studio

6) FLASHING:

You don’t need to reboot your device after the unlock. However, if you reboot your device, make sure you then follow Step 4 again to go into Fastboot Mode.

Decompress Xiaomi Flashing Tool Miflash v2018.5.28.0 downloaded in Step 2, and double click on it to install it (if there is security warning, select ‘Run’).
After the installation is completed, open MiFlash.exe

This is how the app looks like:

Now you need to copy the directory of the Fastboot ROM from Step 3 and paste it in the top address bar as in the picture below. Alternatively, you can click select and browse the Fastboot ROM, make sure you select all images.

As your device should be in Fastboot Mode and connected to the computer already, click Refresh to refresh the app and detect the device.
If your device is correctly set in Fastboot Mode, with bootloader unlocked and connected to the computer, MiFlash should automatically recognise the device as in the image below.
If this doesn’t happen, go back and make sure you followed all the steps correctly.

At the bottom of the window, select the type of flash option that you prefer.

Clean all will erase all the data present in your phone leaving your bootloader unlocked.

Save user data will erase all the data present in your phone without wiping the data partition, leaving your bootloader unlocked.

Clean all and lock will erase all the data present in your phone and lock your bootloader.


Now click “Flash” to Flash the ROM file into the device.

Your device will now automatically reboot running the new ROM.

GUIDE 2 – Flashing Guide for Unlocked Bootloader

Note: A Windows PC/laptop will be needed for the following steps. Make sure that your device is fully charged or has enough power (70% Battery) for this process. This guide will help you update your device to the latest MIUI ROM version. All user data will be purged in this process. Please back up your data and think twice before proceeding. Follow these procedures at your own risk.

1) NECESSARY FILES

You will need to download 2 files only:

  • Xiaomi Flashing Tool Miflash v2018.5.28.0 –  Link
  • Fastboot ROM (.tgz) for your device – Link

2) ROM File

Make sure to download the right Fastboot ROM (.tgz). Once you downloaded it, decompress it and move its content into C: folder on your computer.

See also  Cannot Launch Android Emulator

3) DEVICE IN FASTBOOT MODE

Now we need to boot your device in Fastboot Mode, as already explained above, follow these steps:

  • Turn OFF your Xiaomi Phone.
  • Press and hold the Volume Down and Power button.
  • The phone will now boot into Fastboot mode.
  • Once you see your Fastboot screen, you can now connect your phone to your PC and access to it via the Fastboot tool.

4) FLASHING

Decompress Xiaomi Flashing Tool Miflash v2018.5.28.0 downloaded in Step1, and double click on it to install it (if there is security warning, select ‘Run’).
After the installation is completed, open MiFlash.exe

This is how the app looks like:

Now you need to copy the directory of the Fastboot ROM from Step 2 and paste it in the top address bar as in the picture below. Alternatively, you can click select and browse the Fastboot ROM, make sure you select all images.

As your device should be in Fastboot Mode and connected to the computer already, click Refresh to refresh the app and detect the device.
If your device is correctly set in Fastboot Mode, with bootloader unlocked and connected to the computer, MiFlash should automatically recognise the device as in the image below.
If this doesn’t happen, go back and make sure you followed all the steps correctly.

At the bottom of the window, select the type of flash option that you prefer.

Clean all will erase all the data present in your phone leaving your bootloader unlocked.

Save user data will erase all the data present in your phone without wiping the data partition, leaving your bootloader unlocked.

Clean all and lock will erase all the data present in your phone and lock your bootloader.

Now click “Flash” to Flash the ROM file into the device.

Your device will now automatically reboot running the new ROM.

I hope you will find this guide useful.

Source:
All credits go to msalauddins, en.miui BD Community Moderator who wrote this fantastic guide.

https://c.mi.com/thread-1815303-1-0.html

Originally posted 2020-11-24 07:46:07.

Trending:

  • how to flash mi in locked bootloader
  • how to fix erase not allowed in lock state error on mi flash tool