Home > Unlock Bootloader

How to Unlock Xiaomi Bootloader without PC or Mi Unlock Tool!

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

  1. Head over to Settings > Xiaomi Account and add your Xiaomi account, if you haven’t already done so.
    Unlock Xiaomi Bootloader without PC
  2. Then tap on MIUI version 7 times to enable Developer Options. Now go to Additional Settings and enable OEM Unlocking and USB Debugging.
    Unlock Xiaomi Bootloader without PC
  3. 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.
    Unlock Xiaomi Bootloader without PC

STEP 2: Get the DATA Code

  1. 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.
  2. 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.
  3. Now click on the Code button and select Download ZIP. Once downloaded, extract it.
  4. You’ll get a couple of files, out of which you’ll have to install MiUnlockAccount.apk.
  5. 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.
  6. 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.
  7. Once the captcha is verified, it will now ask you to enter the verification code. Do so and hit Submit.
  8. You’ll now get an alphanumeric string of characters, click Copy [let’s name it DATA].

STEP 3: Install Packages

  1. First off, download and install Termux and Termux API apps.
  2. Then launch Termux and type in the below command:
    pkg update
  3. It might ask you to continue many times throughout the process, type in Y, and hit Enter every time.
  4. Once done, execute the below command:
    pkg install git
  5. Now type in the below command and hit Enter
    pkg install vim
  6. After that, type in the below command and hit Enter
    git clone https://github.com/RohitVerma882/termux-miunlock.git && cd termux-miunlock
  7. Now, execute the below command
    chmod +x setup.sh && ./setup.sh
  8. While the files are being downloaded, you may proceed ahead with the next step.

STEP 4: Generate Unlock Device Token

  1. First off, power off your Xiaomi device. Then press and hold the Power and Volume Down keys to boot it to Fastboot Mode.
  2. Now plug in the OTG on your phone B and connect it with your Xiaomi device [device A] via USB cable.
  3. Now type in the below command in the Termux window to verify the Fastboot Connection:
    mi-fastboot devices
  4. You should now get a prompt: Allow Termux API to access Android. Tap on OK.
  5. Next up, you’ll have to find your Xiaomi’s device codename, so use the below command:
    mi-fastboot getvar product
  6. 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
  7. On the other hand, if you have a MediaTek chipset, then use the following command:
    mi-fastboot oem get_token
  8. Now type in the below command
    chmod +x get_token.sh
  9. 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
  10. 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

  1. Finally, execute the below command [replace UNLOCK_TOKEN with the one that you have just got from Xiaomi].
    mi-fastboot oem-unlock "UNLOCK_TOKEN"
  2. 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.



Troubleshooting

  • 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.
Share:
  • Hi! Please help. How to unlock bootloader on Redmi A1 ? I have Redmi A1 what’s running on Android 12 Go. This device code name is ICE. I don’t have a PC. What Can I do ?