-
-
Notifications
You must be signed in to change notification settings - Fork 563
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
Column ZToken of the iOS app contains a 96 character token #75
Comments
I have not yet looked into how the extraction works on iOS, but I think we could provide a small external tool to do automatic extraction of usable tokens if that's not too much effort. For Android this would require extracting the backup file (the hard part to do in python?) and reading the sqlite db for values (easily solvable). |
This was my thought: Just implement the 10 lines above to support 32char and 96char tokens. Internally there is the 32char token used always. If the user supplies a 96char token it will be decrypted on the fly. |
…ses. This is to simplify the process for token and device type extraction, and will probably later merged to the CLI tool to generate config files based on known devices. Tested to work fine on .tar files extracted from Android backups, support for Apple databases is incomplete. Related to #75.
I used the code in that PR, but as I have no iDevices, I can't really test it, so any help would be appreciated :-) (currently it will dump also raw information from the DB, as it was not clear what kind of info we can get from the DB). edit: got an example DB from @syssi, the updated PR extracts Apple databases also just fine.
|
…ses (#77) * Add miio-extract-tokens tool for extracting tokens from sqlite databases. This is to simplify the process for token and device type extraction, and will probably later merged to the CLI tool to generate config files based on known devices. Tested to work fine on .tar files extracted from Android backups, support for Apple databases is incomplete. Related to #75. * Fix linting except for overlong lines * Fix Apple database support * Refactor the code into a class for further use * add --dump-raw and --dump-all (prints devs without IP addrs, such as linked BT devices)
This has been fixed with #77, so I think we can close this. |
The ZToken column of the iOS app is encrypted now. The token cannot be used anymore by copy&paste because it has 96 characters now. The encryption is AES-ECB with an empty key. It can be deciphered by:
The support for encrypted tokens could be implemented now.
https://community.home-assistant.io/t/beta-xiaomi-gateway-integration/8213/3052
https://community.home-assistant.io/t/issue-config-xiaomi-vacuum-by-v0-51-1/24304/12
https://community.home-assistant.io/t/xiaomi-philips-light-token-problem/26701
The text was updated successfully, but these errors were encountered: