If someone is interested in how to pull out a token using a smartphone and the installed MiHome program, into which a vacuum cleaner is added, without resetting it and not connecting directly to it from a computer (for those who do not have Wi-Fi on the computer), on Linux, without installing Java:
Instruction
Install adb and sqlite3:
sudo apt-get install android-tools-adb android-tools-fastboot sqlite3
We connect the smartphone to the computer, activate the developer mode and turn on USB debugging
Execute the command:
Now the phone should ask permission. If everything is successful, then on the screen you will see:
List of devices attached
cxxxxxxxxxxxxxx05 device
If you connect your smartphone to adb for the first time, the first time you enter the command, it may be offline or unauthorized instead of device. Just run the command again after you give permission on the smartphone.
Further:
mkdir ~ / mi_backup
cd ~ / mi_backup
Now we select the spoiler according to your device: is it rutted or not.
For rooted devices
During the execution of commands, the smartphone will ask for root rights.
adb shell
su
cp /data/data/com.xiaomi.smarthome/databases/miio2.db / sdcard /
exit
adb pull /sdcard/miio2.db ./
adb -d shell "rm /sdcard/miio2.db"
sqlite3 ./miio2.db
select * from devicerecord;
For non-rooted devices
We start creating a backup copy of the application data:
adb backup "-noapk com.xiaomi.smarthome"
A backup window will appear on the smartphone.
NOT enter any passwords, just click create a backup. We wait. When the program finishes, go further:
dd if = backup.ab bs = 1 skip = 24 | (printf "\ x1f \ x8b \ x08 \ x00 \ x00 \ x00 \ x00 \ x00" && cat -) | gunzip -c | tar -x
The process may have the following errors, do not pay attention to them:
gzip: stdin: unexpected end of file
The apps folder should appear in the directory, if there is one, everything is fine, go ahead:
sqlite3 ./apps/com.xiaomi.smarthome/db/miio2.db
select * from devicerecord;
Here we are waiting for our ill-fated token. There will be a lot of text on the screen, and at the very end of it you will find the same token (in my case 5a764d38467a6e736e4a476146666a4c):
| rockrobo.vacuum.v1 | Dust ||||| 16 | 0 || 0 | -68 | 1 | HomeRouter | 5a764d38467a6e736e4a476146666a4c | 1619574839 |
Exit sqlite (a dot at the beginning is required):
The bunch of commands above replaces us with just one single line in
of this instructionnamely mirobo discover --handshake true. But this is the price of not having Wi-Fi on the computer. I don’t add this method to the header, since there is still a much simpler one
Xiaomi Mi Robot Vacuum - Firmware and language packs (Buzzzzer Post # 68828230)thank
Buzzzzer Post has been edited.//Hack - 05.01.18, 22:25