Xiaomi Bootloaders: How to Unlock and Lock

Not a long moment ago, Xiaomi decided to lock their bootloader.
Anda berbicara bahasa Indonesia? Baca artikel terjemahannya di sini.

During their early years, Xiaomi was a developer-friendly manufacturer. It was terribly easy to flash a new ROM. Just boot into fastboot and use MiFlash to flash a new ROM. Rooting wasn't difficult too, even though I rarely root my device. Recently, however, starting from the days of their 3rd generation Redmi phone (Redmi Note 3, Redmi 3), Xiaomi decided to lock their bootloader, making it one step more difficult to flash a new ROM. Xiaomi stated that the decision was to comply with Google's Android guideline. I personally think that it is probably to prevent sleazy importers from flashing unofficial ROMs to their devices.

Unsurprisingly, this decision, of course, enraged most of the community. Some threatened to never buy Xiaomi devices again (good luck finding another great value-for-money brand), some just grumbled like usual. However, my opinion is clear: Xiaomi's main market is, of course, the mainstream users who probably don't even know what a bootloader is. Heck, they even may not know if the ROM running in their phone is fake, and whenever something goes wrong, they would blame Xiaomi. This is obviously harmful for the Chinese manufacturer.

So, what I'm asking is let's be rational. Obviously there's a reason why Xiaomi took this route and I believe that they are doing the best for their customers, and it's not like they completely lock it with no way to unlock, right? So yeah, in this article I'm going to explain how to unlock your Xiaomi device's bootloader (the official way), how to relock, and how flashing a new ROM is essentially the same as it had been before the decision was made.

Of course, the usual disclaimers apply: The author is not responsible for any damage caused to the device. While the steps are relatively safe and the author has been doing it for quite a while now, there is always a risk. You have been warned.

Now that it's settled, let's get to it.

What Is A Bootloader?

How Bootloader works... Sort of...
The picture above is taken from Blackberry's help site. Although may not be accurate, it tells us in an easy way how bootloader works. In short, a bootloader is a piece of software that runs before the device is booted. It generally checks whether the software you're running is genuine or not. This, while ensures that you're running a genuine software, will prevent you from installing custom software (or will be dubbed ROMs afterwards, since we're talking about them). Even if you managed to install one, the device would refuse to boot, leading to a state we call "brick" or "bootloop". The reason for this is that although custom ROMs are legitimate, it doesn't have the signature from the original manufacturer. That's why, the bootloader can't find it, and refuses to boot.

Now let me tell you that there are actually ways to bypass this bootloader. However, there's a risk of turning your device into nothing but a paperweight, so I'm not courageous enough to travel down that path.

Some manufacturers choose to unlock their bootloader, though most lock it due to the fact that unlocking it poses security risks. Xiaomi is a prime example. Their older devices used to have unlocked bootloaders. Now, for complying to Google's security standards, they decide to lock it, effectively preventing users from easily installing custom ROMs and other mods.

TL;DR Bootloaders are a small program executed before boot to make sure you are running a genuine software. Unlocking bootloader deactivates this check, allowing you to freely tamper with its software.

Applying for Bootloader Unlock

As previously mentioned, the community was mad over this decision. However, Xiaomi still gives us a way to unlock our bootloaders. Of course, there's a procedure you have to go through:
  1. Go to Mi Unlock to apply for bootloader unlock.
  2. Log into your Mi account (the site might be in Chinese, but it's your usual login form, with email/phone number on top and password on the bottom).
  3. Once logged in, fill the form and provide the necessary information.
  4. Wait for a notification that your application has been approved (usually by SMS).
Xiaomi claims that you will hear back from them in a week. However, if you're registered in their MIUI Forum and you've reached the Diamond Member status, your application will be immediately approved. Maybe that's why I didn't receive any SMS notification... Anyway, should your application be approved, you'll get this when you revisit Mi Unlock and re-login:

Once you get this, that means your application has been approved. Yay!

Using Mi Unlock to Unlock Xiaomi Bootloader

Before You Begin...

Make sure you have the following:
  1. A good Internet connection, as the unlocking process seems to need Internet connection.
  2. A well-charged battery. Above 50% should do. You don't want your phone to run out of battery at the most critical moment, do you?
  3. Phone backup. Make sure to backup and upload your phone's data to the cloud should anything go wrong.

Download Mi Unlock

Now that your application is approved, you can start downloading Mi Unlock, a special tool used specifically to unlock your device's bootloader. There may be some other download links for this tool out there, but you won't be able to use it if your account is not approved, since the tool is tied to Mi accounts.

This is why you need to have your application approved.

Boot to Fastboot, Connect to PC, and Unlock

The next thing to do is to login. Afterwards, get your phone to fastboot mode by turning it off, and hold Volume Down + Power buttons until the screen is on. Connect it to your PC, and Mi Unlock should detect it automatically.

Mi Unlock will automatically detect your fastboot device.
You know what to do. Click "Unlock" to begin the unlocking process. It will take a few minutes until the process is complete. Should anything go wrong, don't panic and try to read what the tool has to say. It's the key to resolving your problem. Go ask them in the comments section below or look it up in MIUI's official forum. You'll get the following if the process is successful.

Congratulations. Your bootloader is now unlocked.
Click "Reboot Phone" and everything will get back to normal.

Go Ahead. Install that Custom ROM.

Now that your bootloader is unlocked, you can easily install a new custom ROM or recovery. I've used this chance to shift from Global Beta to Global Stable ROM as somehow the ROM breaks the ability to make phone calls. There are numerous guides on the Internet on how to install custom ROMs. Just remember a few things before going nuts:
  1. Make sure you have exactly the same model of the ROM before you proceed. Some devices have the same name with different specs (for example, there are two Redmi Note 3: Mediatek and Snapdragon). Going with a ROM for a different device is downright suicide.
  2. Risk is always there. Remember to always do this on your own risk. This includes breaking some features, battery drain, etc.

Bonus: Using Command Prompt to Check Xiaomi Bootloader and Relock

Is My Bootloader Locked or Unlocked?

By default, all new devices have their bootloader locked. However, if you want to confirm this, there's a way using adb and Windows' Command Prompt. Adb (or Android Bridge) is a little program used to connect your PC with your device. You can download adb from here (XDA Developer). I suggest you do a system-wide install for convenience. Here's how to check:
  1. Boot your Xiaomi device to fastboot (hold down Volume Down + Power buttons when the device is off) and connect it to the PC.
  2. Type fastboot devices in Command Prompt to show a list of connected devices. Your device's serial number should be there.
  3. Run fastboot oem device-info. This will show you a list of information for your device. Look for "Device unlocked" section. If it says true, that means your device's bootloader is unlocked. Otherwise, it's locked.

Okay, I've Unlocked and Finished My Thing. How Can I Re-lock?

If you simply want to downgrade your firmware's version or shift to another build type (for example from Global Beta to Stable China, etc.) and you want to re-lock the bootloader, it's much easier than unlocking. Please mind that in order to re-lock your bootloader, you should have the stock firmware and recovery. Otherwise, things might get ugly. From the Command Prompt, with your device still connected in Fastboot mode, type fastboot oem lock. This will effectively re-lock your phone's bootloader.

Here's a screenshot of how you do all of those above.

1. View Connected Devices. 2. View your device's information. 3. Re-lock bootloader. 4. Retrieving updated device information.
Well, I guess that's all for now, Folks. I hope this little information can be useful to you. As I said before, this is the official way to unlock your bootloaders. There may be unofficial ways out there, but if you don't know what you're doing, I suggest stick with the official one. As usual, if you have any problem, don't hesitate to ask in the comments section below and I'll do my best to answer. Finally, thanks for reading and I'm looking forward to your next visit. Until next time! :D


Popular posts from this blog

Logitech mk240 Mouse Combo Review

Flashing Evercoss Winner Tab V (AT8B)... and Possibly Other Spreadtrum Devices

Check Your PC Fan using HWiNFO and smcFanControl