But when I type the ADB-command to make the backup (.\adb backup -noapk com.xiaomi.smarthome -f backup.ab), my Huawei P9 (Android 7) phone says (translated from Norwegian):
“A full backup of all the data is requested”
and
"Since your unit is encrypted, the backup also needs to be encrypted. Supply a password: "
If I don’t supply a password, I am not able to continue.
If i supply a password, an AES256 encrypted backup.ad file is created.
So my questions, I am probably doing something wrong:
My unit is encrypted? Might de default so in Android 7?
“A full backup”? I really just requested the Xiaomi Mi App?
If you are adventurous you can install the current git master (which supports token extraction) of python-miio for testing with the following command: pip install -e git+https://github.com/rytilahti/python-miio.git#egg=python-mirobo (still using python-mirobo as a name here to avoid potential problems with future installations. The package will be renamed to python-miio soon.) In the best case you would only install this inside a virtualenv.
A tool called miio-extract-tokens will be installed which can be used to extract even encrypted backup files. It will simply extract the backup and print out all the tokens from the database, e.g.
miio-extract-tokens --password 1 backup.ab
Saving database to /tmp/tmp2vh74gof
INFO:mirobo.extract_tokens:Reading database from /tmp/tmp2vh74gof
INFO:mirobo.extract_tokens:Reading tokens from Android DB
Gateway
Model: lumi.gateway.v3
IP address: 192.168.XX.XX
Token: 91c52a27eff00b9548f2XXXX
MAC: 28:6C:07:XX:XX:XX
room1
Model: yeelink.light.color1
IP address: 192.168.XX:XX
Token: 5f77fdab0e6bc64a31a9c96XXXX
MAC: F0:B4:29:XX:XX:XX