Comments (12)
printf $(cat /mnt/data/miio/device.token) | xxd -p
works fine, dgiese. thanks again! :}
from dustcloud.
iptables -A OUTPUT -d 192.168.0.0/24 -j ACCEPT
iptables -A OUTPUT -d 127.0.0.0/8 -j ACCEPT
iptables -A OUTPUT -j DROP
This will block everything except for 192.168.0.0/24 and local connections. Use with caution, you can't install voice packs or firmware from remote servers anymore. Also apt update won't work anymore.
from dustcloud.
Will mirobo discover --handshake true
work for token
or for obtaining token network is needed anyway?
I want to disable any communication with the cloud on my Vacuum
echo "0.0.0.0 awsbj0-files.fds.api.xiaomi.com" >> ./etc/hosts
echo "0.0.0.0 awsbj0.fds.api.xiaomi.com" >> ./etc/hosts
echo "0.0.0.0 ott.io.mi.com" >> ./etc/hosts
echo "0.0.0.0 ot.io.mi.com" >> ./etc/hosts
from dustcloud.
Should still work, however the token will change often because it resets it after some time if it's not connected to the cloud. Or at least if it hasn't been registered there before as part of the setup process.
from dustcloud.
Hi,
@bademux: Token is issued by miio_client, so blocking the cloud have no effect.
@frostworx: convert the token to hex, e.g. Jm5RKQ05IABCDEFG -> 4a6d35524b5130354941424344454647 (lowercase!)
Dennis
(Sorry for late reply, had to get some sleep at the 34C3)
from dustcloud.
yay, thank you very much @dgiese!
for blocking the cloud I'd also add "sg.ott.io.mi.com" to the list.
until yesterday I left open port 8053 for two xiaomi servers open on my firewall, which allowed me to keep my token and close evertything else. I guess I don't need that anymore now :)
from dustcloud.
/mnt/data/miio/device.token is storing it, but it's not stored in plaintext. Maybe md5 of that file or something. That would also generate a random token if it doesn't exist.
from dustcloud.
thank you! I've seen that file, but I thought the "Device Token" description in Interesting-files.md means, that this is the unique device id, which doesn't change.
I took the "old classic way" to receive a new valid token (nice description here: https://github.com/jghaanstra/com.xiaomi-miio/blob/master/docs/obtain_token_mirobot_new.md).
It was some extra work to open all firewall and dns blocks for the (damn!) android tablet and the robot, so it would be nice if the token could be extracted otherwise.
In case I find out something useful I'll report back.
from dustcloud.
Sorry for stupid question, but maybe we can allow only local network on the Vacuum itself?
upd,
I think we can just disable dns lookup (as for now) to cut vacuum from external world.
Google tells me to add "order hosts" to /etc/host.conf
from dustcloud.
The servers depend on which server your mi home app works. I always use mainland china to get all the devices. For different settings the servers will be different.
from dustcloud.
For me the key in /mnt/data/miio/device.token
does not seem to be the correct token.
But sending the magic package to the miio_client reveals the correct token.
Here is another method to get it:
- start wireshark or tcpdump (on your pc or on the robot)
echo -ne '\x21\x31\x00\x20\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff' | nc -u 192.168.8.1 54321
- extract the last 16 bytes/characters and convert them to a (32 characters) hexadecimal string (using
xxd -p
)
update: After a reboot of the robot the token from /mnt/data/miio/device.token
was the correct token.
from dustcloud.
This seems to work for latest version (presuming you have a rooted android device):
-
Delete the app -> reinstall -> log in (in order to make sure that cache is up to date)
-
Once logged in, use adb to access the rooted device through USB cable. In:
/data/data/com.xiaomi.smarthome/cache/smrc4-cache
-
print the content of each file in this folder (cat *)
this will give you the cached decrypted 'RC4 encrypted' settings which are fetched through the various APIs. This will print various JSON objects, whereas you'll find the Token of your device.
// Pat
from dustcloud.
Related Issues (20)
- Discussion: S6 MaxV UART pins HOT 1
- Replace soundpack on roborock s6 pure HOT 1
- Dreame Vacuum D9 is dead
- Which Xiaomi robot vacs ared supported?
- Roborock S5 Max firmware ver 1566 11/2021 confirmed rootable HOT 5
- SFTP support for Roborock HOT 4
- Rooting Xioami MJSTG1 HOT 28
- Support for Neato D8/D9/D10 HOT 2
- Support for Xiaomi Mi Robot Vacuum-Mop 2 Lite HOT 1
- Support for Dreame W10 rooting HOT 2
- Error while rooting xiaomi vacuum
- How to flash v8 to viomi v8 version? HOT 1
- Problem with voice generator
- docker-compose up -d --build fails with "SyntaxError: invalid syntax"
- Experience with STYTJ02YM robots HOT 14
- Vacuum mop 2 pro support?
- Roborock S5max update failed
- Region lock
- Roborock S5 Max soft-briked, then recovered
- Any language with this PHP script
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dustcloud.