Skip to content

Commit

Permalink
New method to obtain tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
swiergot committed Jan 21, 2019
1 parent 7eee203 commit 88cc998
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions docs/discovery.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ encryption token must be known.
If the returned a token is with characters other than ``0``\ s or ``f``\ s,
it is likely a valid token which can be used directly for communication.
If not, the token needs to be extracted from the Mi Home Application,
see :ref:`creating_backup` for information how to do this.
see :ref:`logged_tokens` for information how to do this.

.. IMPORTANT::

Expand Down Expand Up @@ -87,12 +87,27 @@ Tokens full of ``0``\ s or ``f``\ s (as above) are either already paired
with the mobile app or will not yield a token through this method.
In those cases the procedure shown in :ref:`creating_backup` has to be used.

.. _logged_tokens:

Tokens from Mi Home logs
========================

The easiest way to obtain tokens is to browse through log files of the Mi Home
app version 5.4.49 for Android. It seems that version was released with debug
messages turned on by mistake. An APK file with the old version can be easily
found using one of the popular web search engines. After downgrading use a file
browser to navigate to directory ``SmartHome/logs/plug_DeviceManager``, then
open the most recent file and search for the token. When finished, use Google
Play to get the most recent version back.

.. _creating_backup:

Tokens from backups
===================

Extracting tokens from a Mi Home backup is the preferred way to obtain tokens.
Extracting tokens from a Mi Home backup is the preferred way to obtain tokens
if they cannot be looked up in the Mi Home app version 5.4.49 log files
(e.g. no Android device around).
For this to work the devices have to be added to the app beforehand
before the database (or backup) is extracted.

Expand Down

0 comments on commit 88cc998

Please sign in to comment.