一名独立开发者为了将AirRobo智能猫砂盆接入Home Assistant智能家居系统,对配套手机应用及通信协议进行了逆向工程 1。通过Wireshark和HTTP Toolkit捕获流量,并利用JADX反编译Android APK获取源代码,该开发者复现了基于MD5的HTTP请求签名逻辑 1。这一过程涉及将时间戳、App Key、随机数(Nonce)和设备ID拼接后计算摘要,从而生成X-UBT-Sign头部以访问设备数据API 1。
研究发现,控制指令如清理功能并不通过HTTP发送,而是经由MQTT协议传输 1。开发者从登录响应中提取出MQTT凭证(包括用户名、密码和Client ID),并进一步解析出消息为多层Protobuf结构 1。尽管外层包裹了带有CRC-8校验的RISP帧以及IM消息、BytesValue和Any等复杂结构,但核心操作载荷仅为4字节(08 01 10 01) 1。为了验证各层字节数据的构造方式,开发者还使用了Frida脚本动态Hook序列化过程 1。
最终,该开发者构建了一个本地Python API服务器作为桥梁,将Home Assistant的请求转换为上述复杂的MQTT消息发送给设备 1。目前,虽然认证和数据同步仍依赖厂商云端API,但控制权已部分实现本地化 1。作者计划下一步集成存在传感器以完善自动化控制 1。
An independent developer successfully reverse-engineered the communication protocols of an AirRobo smart litter box to enable local control and integration with the Home Assistant automation platform. 1 The project aimed to bypass reliance on vendor cloud services by reconstructing the underlying HTTP authentication logic and decoding proprietary message formats used for device commands. 1
To uncover how the system operates, the developer captured network traffic using Wireshark and HTTP Toolkit while decompiling the companion Android application with JADX to analyze its source code. 1 This process revealed that HTTP requests are secured via an X-UBT-Sign header, generated by calculating an MD5 hash from a combination of the timestamp, App Key, random nonce, and device ID. 1 Furthermore, analysis showed that control instructions, such as triggering the cleaning cycle, are not sent over HTTP but transmitted via the MQTT protocol, requiring credentials extracted from the login response. 1
The most complex part of the engineering effort involved parsing the binary MQTT messages, which consist of nested Protobuf structures wrapped in RISP frames with CRC-8 checksums. 1 By employing Frida scripts to dynamically hook the serialization process, the developer verified that the core operational payload is merely four bytes (08 01 10 01) despite the intricate outer layers. 1 To bridge the gap between Home Assistant and the device, the author built a local Python API server that translates standard requests into these specific MQTT messages. 1 Although authentication and data synchronization still depend on the vendor’s cloud APIs, this solution has effectively localized the device's primary control functions. 1
评论
还没有评论,欢迎留下第一条。