Skip to content
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

get device token is 000000000000000000 #366

Closed
tustman opened this issue Aug 16, 2018 · 1 comment
Closed

get device token is 000000000000000000 #366

tustman opened this issue Aug 16, 2018 · 1 comment

Comments

@tustman
Copy link

tustman commented Aug 16, 2018

device : Xiaomi Chuangmi Plug V3 (1 Socket, 2 USB Ports)
device ip : 172.28.1.15

code:

#-*-coding:utf8-*-
import codecs
import socket
from protocol import Message
helobytes=bytes.fromhex('21310020ffffffffffffffffffffffffffffffffffffffffffffffffffffffff')
s=socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
s.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
s.sendto(helobytes,('172.28.1.15',54321)) #插座ip,端口54321
data,addr=s.recvfrom(1024)
m=Message.parse(data)
tok=codecs.encode(m.checksum,'hex')
print(m)
print(tok)

result:

Container: 
    data = Container: 
        length = 0
        value = b'' (total 0)
        offset2 = 32
        offset1 = 32
        data = b'' (total 0)
    header = Container: 
        length = 16
        value = Container: 
            length = 32
            unknown = 0
            device_id = b'\x04H~\xe4' (total 4)
            ts = 1970-01-01 00:34:04
        offset2 = 16
        offset1 = 0
        data = b'!1\x00 \x00\x00\x00\x00\x04H~\xe4\x00\x00\x07\xfc' (total 16)
    checksum = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' (total 16)
b'00000000000000000000000000000000'
@rytilahti
Copy link
Owner

This means that the device has already been bound to the app and/or does not reveal the token. You will have to find the token through other means, e.g., by extracting it from the backups.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants