Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Successful unlocks #58

Open
badrihippo opened this issue Oct 1, 2024 · 3 comments
Open

Successful unlocks #58

badrihippo opened this issue Oct 1, 2024 · 3 comments

Comments

@badrihippo
Copy link

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 🙂

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
Copy link
Owner

offici5l commented Oct 2, 2024

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
Copy link
Author

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants