offici5l / MiUnlockTool

MiUnlockTool developed to retrieve encryptData(token) for Xiaomi devices for unlocking bootloader, It is compatible with all platforms.
Apache License 2.0
296 stars 21 forks source link

Successful unlocks #58

Open badrihippo opened 1 month ago

badrihippo commented 1 month ago

Since Xiaomi keeps updating the unlock procedure with small changes, I thought it would be useful to have a record of when the tool was last used successfully. If the maintainers are fine with it, we could use this issue for that? It would complement the bug reports, which only describe when the tool fails :slightly_smiling_face:

To set the ball rolling: I successfully used MiUnlockTool today, 2024-10-01, to unlock my Poco F1 (MIUI) from India using Linux. It was a secondhand one and I had already created my Mi account about three weeks ago (more than 7 days basically) so the unlock happened immediately. I had used mobile data for the "Mi Unlock Status" thing but when I actually ran the tool the mobile data was switched off (I don't get mobile data signal in the house; have to go out to use it).

offici5l commented 1 month ago

I can add a step in case of failure or success, send a message to the Telegram channel

In line code ex :

# ...

def sendunlockresult(product, unlockresult):
    try:
        requests.post('https://api.telegram.org/bot"bot-token-her"/sendMessage', data={'chat_id': 'chat-id_channel-her', 'text': f"product: {product}\nresult: {unlockresult}\ndatetime(UTC): {datetime.datetime.utcnow().strftime('%Y-%m-%d %H:%M:%S')}"})
    except:
        pass

# ...

    print(f"\nUnlock successful\n")
    sendunlockresult(product, "bootloader unlocked successfully")
except subprocess.CalledProcessError as e:
    print("Error message:", e.stderr)
    sendunlockresult(product, e.stderr)

ex telegram channel :

IMG_20241002_144621_719.jpg

This will also provide statistics on the number of devices that were unlocked each year, for example...

But I have to find a way to hide the bot token so that some people don't tamper with the statistics...

badrihippo commented 1 month ago

That's a good idea; it'd be automatic in that case and the user doesn't need to do anything! But exposing the token is a problem. One option could be to have an intermediate custom API that the bot calls, and let that API do the filtering (eg. sanity check like making sure the same account doesn't post again within 29 days, and make sure people don't send other kinds of random messages).

But that would require hosting the API somewhere; not sure what kind of resources you have. Depending on the implementation it could be done as a CGI script on a free webhost, since it's only a simple script.

Perhaps you can also extract the info from the channel and put it as a badge on the README? That would help casual users to get an idea even before joining the channel. (In my case, I don't have Telegram, so I'd have to install that and make an account before I can come and check the channel for updates)

CyberAustin commented 1 month ago

Worked for me just now. Redmi Note 12 4G (Model: 23021RAA2Y), Global version, MIUI 14.0.10 (TMGEUCM), Android version 13 TKQ1.221114.001, Kernel 5.15.78-android13-8-00009-DIVAR-1.30410.2.32398.4