Files
glass/glass-mouse/scripts/_strings.py
T
admin 2840e82685 Initial commit: Android GlassMouse + iOS GlassRemote 智能眼镜遥控项目
包含本次会话修复:
- iOS clickReady 警告 bug(默认 false 永远显示)
- BLE 'handle is invalid' 排查(stale handle auto-retry 实验 + 回退)

项目结构:
- glass-mouse/: 眼镜端原生 Kotlin App,前台服务 MouseService + 自定义 BLE GATT 桥接 ProxyBleServer + 无障碍 GestureDescription 注入
- ios/GlassRemote/: iPhone 端 SwiftUI + CoreBluetooth,通过 BLE 直连眼镜
- HTTP 投屏服务(:8000) 接 PPT/WPS 备注宏 POST 推送

技术栈: Android Kotlin (gradle 8.14.4, compileSdk 34), iOS Swift 5.10 (Xcode 26.5)
2026-08-26 10:34:23 +08:00

43 lines
1.1 KiB
Python

# -*- coding: utf-8 -*-
# 从 classes4.dex 中 BLE 常量附近抽取可读字符串,定位相关类名与命令常量
import re
path = "/tmp/inmo_apk_scan/classes4.dex"
with open(path, "rb") as f:
data = f.read()
def printables(b):
return b.decode("latin1")
# 关键偏移
targets = {
"BLE_UUID_SERVICE": data.find(b"BLE_UUID_SERVICE\x00"),
"00002020": data.find(b"00002020"),
"BLE_SCROLL_DOWN": data.find(b"BLE_SCROLL_DOWN"),
}
print("target offsets:", targets)
# 在 BLE_UUID 附近抽长字符串(>=4 可打印)
region = data[4_900_000:4_922_000]
runs = re.findall(rb'[\x20-\x7e\x80-\xff]{4,}', region)
print(f"\n=== BLE 区域可读串 ({len(runs)} 条,前 120 条) ===")
seen = set()
for r in runs:
try:
s = r.decode("utf-8")
except:
s = r.decode("latin1")
if s in seen:
continue
seen.add(s)
print(s)
if len(seen) >= 120:
break
# 提取类名线索:Lxxx/xxx; 形式
classes = set(re.findall(rb'L[/\w\$]+;', region))
print(f"\n=== 该区域出现的类名 ({len(classes)} 个) ===")
for c in sorted(classes):
try: print(c.decode("utf-8"))
except: pass