-
-
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
Docs for token extraction for Apple users #460
Conversation
@@ -217,6 +237,29 @@ to the tool with ``--password <password>``. | |||
Token: 476e6b70343055483XXX | |||
MAC: 28:6C:07:XX:XX:XX | |||
|
|||
Extracting tokens manually |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the automatic way using miio-extract-tokens
not working in some cases, or is this just for completeness?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It didn't work for my sqlite database and therefor I've added this part. There was a TypeError
exception:
(homeassistant) root@rpi:/opt/homeassistant# miio-extract-tokens /tmp/1672094281_mihome.sqlite
INFO:miio.extract_tokens:Reading database from /tmp/1672094281_mihome.sqlite
INFO:miio.extract_tokens:Reading tokens from Apple DB
Traceback (most recent call last):
File "/opt/homeassistant/homeassistant/bin/miio-extract-tokens", line 11, in <module>
sys.exit(main())
File "/opt/homeassistant/homeassistant/lib/python3.5/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/opt/homeassistant/homeassistant/lib/python3.5/site-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/opt/homeassistant/homeassistant/lib/python3.5/site-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/opt/homeassistant/homeassistant/lib/python3.5/site-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/opt/homeassistant/homeassistant/lib/python3.5/site-packages/miio/extract_tokens.py", line 155, in main
devices = list(reader.read_tokens(backup))
File "/opt/homeassistant/homeassistant/lib/python3.5/site-packages/miio/extract_tokens.py", line 113, in read_tokens
yield from self.read_apple()
File "/opt/homeassistant/homeassistant/lib/python3.5/site-packages/miio/extract_tokens.py", line 74, in read_apple
token = BackupDatabaseReader.decrypt_ztoken(dev['ZTOKEN'])
File "/opt/homeassistant/homeassistant/lib/python3.5/site-packages/miio/extract_tokens.py", line 50, in decrypt_ztoken
if len(ztoken) <= 32:
TypeError: object of type 'NoneType' has no len()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should obviously be fixed. Could you try with --dump-raw
to see what it outputs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should obviously be fixed. Could you try with
--dump-raw
to see what it outputs?
Sorry busy again :) I can test it tonight… let me open an issue for that!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Let's merge this now, it's a good idea still have the manual way documented, too :-)
Added description how to extract SQLite database from iOS backup & manually extract/decrypt tokens from SQLite database.