[Redmi Note 12 4G] Ahmad_Karimi:
Hi everyone

It's been about 2 weeks, I bought a Redmi note 12 4G phone.

I created a Xiaomi account and added the phone to the account and left it for more than 168 hours.

I don't have a computer and one of my friends was supposed to lend me his computer but he didn't.

I searched github for a few days until I came across a fork named "termux-miunlock".

I have an old Samsung S5 phone and USB2 otg interface.

I installed the Thermux program on my old phone.

I couldn't believe it would work, but it did.

Now the bootloader is unlocked and I don't need a computer to root anymore.

View attachment 5976345

I have 2 Android phones.

Redmi Note 12 phone with stock ROM that can be unlocked (I call it stock phone in the tutorial)

Another phone that has a command line interface for ADB (I call it ADB phone)

When the stock phone is turned on in normal mode, a software must be installed and run:

1-- Go to

GitHub - RohitVerma882/termux-miunlock: A program that can be used to retrieve the bootloader unlock token for Xiaomi devices. (and unlock the bootloader) using Termux

A program that can be used to retrieve the bootloader unlock token for Xiaomi devices. (and unlock the bootloader) using Termux - RohitVerma882/termux-miunlock

github.com

and click view code.

Click on the account.apk file and on the new page that opens, click on ... and click download.

2- Install and run the software. As soon as it runs, the Xiaomi account site will open.

As soon as the login is successful, a code in Base64 format will be displayed. Copy it and transfer it to the second phone (ADB phone) which is supposed to be the Adb/fastboot platform and replace the computer. (via a text file or ... )

We have nothing to do with stock phone anymore.

We connect the two phones with the otg interface and the main charger cable (the otg interface must be connected to the ADB phone)

3- We install termux and termux-api software in ADB phone.

We go to fastboot mode with the following commands

adb devices

The output of the above command should confirm the connection (the list of connected devices should not be empty).

adb reboot bootloader

4- After starting the stock phone in fastboot mode, enter the following commands in the Thermox environment (internet must be connected)

A:

git clone https://github.com/RohitVerma882/termux-miunlock.git && cd termux-miunlock

B:

chmod +x setup.sh && ./setup.sh

C:

mi-fastboot getvar product

(The above command output for my phone was "tapas")

D:

mi-fastboot getvar token

(The output of the above command is a text string that is different every time it is restarted)

E:

chmod +x get_token.sh && ./get_token.sh --region=global --product=PRODUCT --token=TOKEN DATA

(instead of "PRODUCT" the output of the C section command and instead of "TOKEN" the output of the D section command and instead of "DATA" the same BASE64 text string that we prepared from Stock phone and transferred to ADB phone is used

If the above command is executed successfully, its output is a long string called "unlock device token". In the above command, the option

--region=global

It is necessary and is not currently in the main instructions.

)

F:

echo "unlock_device_token" | xxd -r -p > token.bin

G:

mi-fastboot stage token.bin && mi-fastboot oem unlock

.....

and over

stock phone will be restarted. As soon as you see the miui logo, you will see the open lock sign under the selfie camera.

It takes several minutes for the userdata format and factory reset and the MIUI interface to come up, which is normal.

View attachment 5976509View attachment 5976511View attachment 5976513

I used Google Translate.

I'm sorry if it's incomprehensible and of course busy