In this guide, we will show you the steps to unlock the bootloader on your Xiaomi device without using a PC or Mi Unlock Tool. Xiaomi devices have always been known to be quite an active player in custom development. From flashing custom ROMs to recoveries or gaining administrative privileges by rooting your device via Magisk, the possibilities stand endless.
However, before you can carry out any of these tweaks, there’s an important prerequisite that you need to checkmark off the list- the bootloader on your device needs to be unlocked. In this regard, Xiaomi, out of all the OEMs, has probably the most cumbersome method of getting this job done, all thanks to the tons of complications involved in the Mi Unlock Tool.
Fortunately, there now exists a nifty method using which you can unlock the bootloader on your Xiaomi device without even using a PC. And in this guide, we will show you how to do just that. So without further ado, let’s get started.
How to Unlock Xiaomi Bootloader without PC or Mi Unlock Tool!
Do note that the below process will wipe off all the data from your device [and it might nullify the device’s warranty as well], so please take a complete device backup beforehand. Moreover, this process will “not” allow you to bypass the 168-hour waiting time. Droidwin and its members wouldn’t be held responsible in case of a thermonuclear war, your alarm doesn’t wake you up, or if anything happens to your device and data by performing the below steps.
STEP 1: The Prerequisites
- Head over to Settings > Xiaomi Account and add your Xiaomi account, if you haven’t already done so.
- Then tap on MIUI version 7 times to enable Developer Options. Now go to Additional Settings and enable OEM Unlocking and USB Debugging.
- After that, go to Mi Unlock Status and tap on Add Account and Device. While doing so, make sure SIM is inserted, WiFi is off and data is enabled.
STEP 2: Get the DATA Code
- Now, you’ll need another smartphone and a USB OTG. Let’s call the phone whose bootloader is being unlocked as A and the secondary device as B.
- So on your B phone, head over to this GitHub page. Then tap on the overflow icon at the top right and check View Desktop Site.
- Now click on the Code button and select Download ZIP. Once downloaded, extract it.
- You’ll get a couple of files, out of which you’ll have to install MiUnlockAccount.apk.
- Now launch the app and it will take you to the Xiaomi sign-in page. Log in via the same account that is used on your Xiaomi device.
- It will now ask you to send a verification code on your Xiaomi device, so hit Send. Meanwhile, also verify the Captcha and hit Submit.
- Once the captcha is verified, it will now ask you to enter the verification code. Do so and hit Submit.
- You’ll now get an alphanumeric string of characters, click Copy [let’s name it DATA].
STEP 3: Install Packages
- First off, download and install Termux and Termux API apps.
- Then launch Termux and type in the below command:
- It might ask you to continue many times throughout the process, type in Y, and hit Enter every time.
- Once done, execute the below command:
pkg install git
- Now type in the below command and hit Enter
pkg install vim
- After that, type in the below command and hit Enter
git clone https://github.com/RohitVerma882/termux-miunlock.git && cd termux-miunlock
- Now, execute the below command
chmod +x setup.sh && ./setup.sh
- While the files are being downloaded, you may proceed ahead with the next step.
STEP 4: Generate Unlock Device Token
- First off, power off your Xiaomi device. Then press and hold the Power and Volume Down keys to boot it to Fastboot Mode.
- Now plug in the OTG on your phone B and connect it with your Xiaomi device [device A] via USB cable.
- Now type in the below command in the Termux window to verify the Fastboot Connection:
- You should now get a prompt: Allow Termux API to access Android. Tap on OK.
- Next up, you’ll have to find your Xiaomi’s device codename, so use the below command:
mi-fastboot getvar product
- We will now have to generate a token [let’s name it TOKEN]. If you have a Snapdragon chipset device, then use the below command:
mi-fastboot getvar token
- On the other hand, if you have a MediaTek chipset, then use the following command:
mi-fastboot oem get_token
- Now type in the below command
chmod +x get_token.sh
- After that, type in the below command [replace PRODUCT with your device codename that you got above. On the other hand, replace TOKEN with the one that you have got just above. Likewise, replace DATA with the code that you had got in STEP 2 via the MiUnlockAccount app]
./get_token.sh --product=PRODUCT --token=TOKEN DATA
- If this is the first time you are unlocking this device’s bootloader, you’ll get a prompt to wait for 168 hours. Once you have bypassed this time limit, you’ll then get an Unlock Device Token from Xiaomi.
STEP 5: Unlock Xiaomi Bootloader without PC
- Finally, execute the below command [replace UNLOCK_TOKEN with the one that you have just got from Xiaomi].
mi-fastboot oem-unlock "UNLOCK_TOKEN"
- Your device will now undergo a reset and the bootloader will be subsequently unlocked. That’s it.
So these were the steps to unlock the bootloader on your Xiaomi device without using the PC or Mi Unlock Tool. If you have any queries concerning the aforementioned steps, do let us know in the comments. We will get back to you with a solution at the earliest.
- Your Device is not Certified error on Xiaomi EU ROM: How to Fix
- Fix This Phone is Destroyed on Xiaomi Locked Bootloader!
- How to Add App Vault MIUI Widgets on Xiaomi Home Screen
- Wrong Caller ID on Custom ROMs on Xiaomi: How to Fix
- Some devices, such as the Pixel 7 series, might give you a tough time in carrying out this process. So in such cases, try using another device as the secondary device.
- If you don’t get that “DATA” code in STEP 2, then simply go back and again try. You will get it in a couple of attempts.