Canny1913 / miunlock

A program that can be used to retrieve the bootloader unlock token for Xiaomi devices. (and unlock the bootloader)
https://unlock.update.miui.com
133 stars 33 forks source link

PATCHED: 'Please use the common user tool on the official website.' #14

Open unfairDude opened 2 years ago

unfairDude commented 2 years ago

i get this error after confirming to proceed with unlock

ERROR:root:invalid code != 0: {'code': 20045, 'description': '请使用官网普通用户解锁工具进行操作', 'descCN': '请使用官网普通用户解锁工具进行操作', 'descEN': 'Please use the common user tool on the official website.', 'uid': '8150708967'} Traceback (most recent call last): File "/home/anon/Desktop/miunlock/main.py", line 111, in data = r.run() File "/home/anon/Desktop/miunlock/request.py", line 117, in run raise XiaomiError(STRINGS["en"].get(data.get("code", -1), STRINGS["en"][-1]).format(**data), data.get("code", 6)) request.XiaomiError: [ERROR]: Unknown error 20045

unfairDude commented 2 years ago

2 days ago it was working but i had to wait 77 hours remaining... now it just gives this error after typing the getvar token

unfairDude commented 2 years ago

just found out someone had same issue using miunlock tool and fixed using miflash unlock-en 6.5.314.7 version and someone else using miflash_unlock-en-5.5.224.24 maybe you can fix using that specific version @Canny1913

Edit: version 5.5 is not working

Practicalbutterfly5 commented 2 years ago

I have same issue

unfairDude commented 2 years ago

3/4 days ago it was working but i had to wait 77 hours remaining... now it just gives this error after typing the getvar token

zeGolem commented 2 years ago

Can confirm, I just tried unlocking my phone for the first time and got this message:

ERROR:root:invalid code != 0: {'code': 20045, 'description': '请使用官网普通用户解锁工具进行操作', 'descCN': '请使用官网普通用户解锁工具进行操作', 'descEN': 'Please use the common user tool on the official website.', 'uid': '***'}
Canny1913 commented 2 years ago

just found out someone had same issue using miunlock tool and fixed using miflash unlock-en 6.5.314.7 version and someone else using miflash_unlock-en-5.5.224.24 maybe you can fix using that specific version @Canny1913

Edit: version 5.5 is not working

try editing this line and all other version strings https://github.com/Canny1913/miunlock/blob/master/main.py#L30

thing is i cant reproduce this at all

zeGolem commented 2 years ago

try editing this line and all other version strings

Just did that, didn't help :/

thing is i cant reproduce this at all

I can reproduce the issue on my Mi Mix 3, though I haven't waited 7 days since creating my Xiaomi account, so maybe that's the issue, and it's just a cryptic message?

stamgit commented 2 years ago

Issue applies for me, old account, already unlocked same phone before. Tried various version strings including 4.5.813.51, 5.5.224.24, 6.5.224.28, 6.5.406.31 (which seems to be the latest?). Replaced in both three clientVersion strings. 20045 while calling https://github.com/Canny1913/miunlock/blob/59129dacd05192c1a5c88177acf338d36cab2b96/main.py#L92 (mtk device)

tfuxu commented 2 years ago

I think I found a solution for this issue. Looks like the only thing that changed is pcId being now a constant, so that value ?d in screenshots below is what we need.

Response location from JS injection: loc-old

Response location from MiFlash: loc-new

In MiFlash it looks like they are using MD5 hash instead of UUID, but both of them are valid when putted in UnlockRequests.

After I replaced random uuid (here) with a MD5 value from miflash link, I've finally got a different error! Screenshot from 2022-08-29 02-27-15

Andre8900 commented 2 years ago

Same issue, even when applying your PR #17 Please help

Andre8900 commented 2 years ago

I am sorry to spam you @tfuxu but can you help me with this? I really need my phone unlocked

tfuxu commented 2 years ago

I am sorry to spam you @tfuxu but can you help me with this? I really need my phone unlocked

I have no idea what I would need to change here to get this to work, honestly. Maybe I'll try to use a Wireshark to check if requests has been changed in a official tool, but I can't promise that I'll be able to get this program working again.

Andre8900 commented 2 years ago

I have no idea what I still need to change here to get this to work, honestly. Maybe I'll try to use a Wireshark to check if requests has been changed in a official tool, but I can't promise that I'll be able to get this program working again.

Alright, I have unlocked my phone now using a friend's Windows computer. Thanks a lot anyways for your effort and for having created that tool. And f*ck Xiaomi for bothering Linux/Mac users.

mozkomor05 commented 1 year ago

Getting the same issue with qcom device. I tried changing applying the patch and changing the clientVersion to latest version of MiFlash, but without any success. I am still getting unknow error 20045.

jerinphilip commented 1 year ago

requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://in-unlock.update.intl.miui.com/api/v2/nonce

@RohitVerma882? Any help is much appreciated.