RohitVerma882 / termux-miunlock

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Odd number of characters

Guybrush3pw00d opened this issue · comments

My best regards and thanks for your efforts with developing this tool. I'm getting two issues, maybe linked together.
If I use mi-fastboot to issue any command (even the simplest mi-fastboot devices) it just gets stuck forever and I need to terminate it by CTRL-C while if I use fastboot from Termux android-tools it works like a charm. I get the token by it then (being a Qualcomm and not a Mediatek, I've used fastboot getvar token) but when I execute get_token.sh I get the error:

Failed to decode response: Odd number of characters.

I don't know if it relates to TOKEN or DATA. Maybe TOKEN taken from fastboot (and not mi-fastboot as explained) is wrong, I don't know.
I'd like to add that I've run both mi-fastboot and fastboot as root by tsu given the advices that fastboot is working under Termux only in that way. mi-fastboot has the same behaviour no matter the level of privilege anyway.
Thanks in advance for your help and have a nice day! :)

I think you have made some mistake while pasting the account data token from the app

First of all, thanks for your follow-up. Unlikely to have happened (though I'm not perfect and it could well be the reason; I would try again ASAP) given that I've just generated DATA by the provided apk, copied/pasted it inside a text file which I've then transferred by Mi Share from target to host, exactly to avoid issues.
I've read later on that HyperOS isn't supported (quite a pity given that issues with unlocking the bootloader actually arise there while with MIUI everything is fine, with the official tools too). May the error be related to that? I'm trying to unlock a Ziyi on HyperOS 1.0.4.0. My scenario is that I've been forced to look for alternative ways to unlock because the official tool keeps refusing to unlock complaining about the device not being activated (I don't even know the meaning) in spite of the usual procedure being successfully completed. Thanks again! :)

I can confirm that, in spite of the fact I still don't understand how it could happen given that I've double checked everything, the error was on my side as you were suggesting. Done everything again and now it 'works'. The quotation marks are because it gives me this error:

"SEVERE: Xiaomi server returned error 20031:
Error description: This device is not bound to your account
Turn on your device and bind your account to the device by going in MIUI's Settings > Developer options > Mi Unlock status
Server description: Please add your account in Settings > Developer options > Mi Unlock status."

which is UNTRUE and is exactly the same error I've got with an outdated official version (miflash_unlock-en-5.5.224.24) while with the latest miflash_unlock_en_7.6.727.43 I get the aforementioned error about device activation. I don't know what else to say.

I can confirm that, in spite of the fact I still don't understand how it could happen given that I've double checked everything, the error was on my side as you were suggesting. Done everything again and now it 'works'. The quotation marks are because it gives me this error:

"SEVERE: Xiaomi server returned error 20031: Error description: This device is not bound to your account Turn on your device and bind your account to the device by going in MIUI's Settings > Developer options > Mi Unlock status Server description: Please add your account in Settings > Developer options > Mi Unlock status."

which is UNTRUE and is exactly the same error I've got with an outdated official version (miflash_unlock-en-5.5.224.24) while with the latest miflash_unlock_en_7.6.727.43 I get the aforementioned error about device activation. I don't know what else to say.

Maybe it will be fixed by changing region.

available regions: india, global, china, russia, europe

Hello again. Previously, as adviced around, I had set my region to United States. Now I've set it to my actual country and setting the region to europe for get_token.sh (it makes sense, even because the rom currently installed is an eu one) I get the same error than the newest official version:

SEVERE: Xiaomi server returned error 10013:
Error description: Unknown error: 10013
Server description: This device is not activated, please activate it and try to unlock it again.

while with the older official versions I still get the wrong error that I need to bind my account. We're getting somewhere but I don't understand what's that activation thing.

If you have not received an SMS about mi activation from the sim card in your mobile, then that sim card will not be active in that mobile

How to check?
Settings > mi account > devices > select current device

Here shows your device active
IMG_20240420_160551_111

Whenever a sim card is inserted in the mobile, a notification of Xiaomi activation service framework comes. This SMS is sent to activate the sim card for the mobile.

Thanks for your advices. This hadn't ever been a compulsory step for unlocking Xiaomis indeed I haven't ever needed to do it to successfully unlock. Just binding the account from developer options has always been enough and this was the case this time too. I can confirm your tool works just fine on HyperOS too.
I've discovered that when you get the error about activation you just need to request for unlock again, immediately after the unsuccessful attempt without doing anything else: the error goes away by magic and the waiting time is displayed (or the mobile unlocked, it clearly depends on the stage you're on). If I knew it before, I hadn't wasted so much time.
It stays that your very well laid down advice about how to activate is very useful and a good thing to do anyway, just to be on the safe side in spite of the fact that it wasn't necessary in my case.
Thanks for your work, help and advices and have a nice day! :)