feat: 真实连接链路、移除虚拟数据、全量打包脚本

This commit is contained in:
tongtong committed 2026-11-26 21:39:10 +08:00
1 parent 31b9a52eb4
commit 34340f4126
16 files changed
+601 -204

No files matched your search

+29
View File
@@ -36,6 +36,35 @@ cargo test --offline --test demo_e2e
运行前确保 `ttstdconnect_core.dll`(Windows)/ `.so`(Linux)位于可执行文件同目录;`installer/windows/package.ps1` 已自动构建并内置该动态库。
## 非同一局域网的模拟器测试
当被控端与主控端不在同一局域网时,可用 Android 模拟器 + `adb reverse` 把电脑端口映射到模拟器:
```powershell
# 1. 启动模拟器(已有 Pixel_8 AVD)
& "F:\AndroidSDK\emulator\emulator.exe" -avd Pixel_8 -no-snapshot-load
# 2. 端口反向映射:模拟器访问 127.0.0.1:41001 即电脑的 41001
$adb = "F:\AndroidSDK\platform-tools\adb.exe"
& $adb -s emulator-5554 reverse tcp:41001 tcp:41001
& $adb -s emulator-5554 reverse tcp:41000 tcp:41000
& $adb -s emulator-5554 reverse tcp:41002 tcp:41002
# 3. 电脑上运行 demo 服务
cd rust_core
cargo run --example demo_server
# 4. 在模拟器启动被控端(host 用 127.0.0.1)
& $adb -s emulator-5554 shell am start -n com.ttstd.lancast.receiver/.MainActivity `
--es com.ttstd.lancast.receiver.HOST 127.0.0.1
# 5. 点击「测试连接(无需授权)」按钮,跳过 MediaProjection 授权只验证连接
```
成功标志:demo 服务日志出现 `peer:127.0.0.1:xxxxx` 与 `key-established`,模拟器界面显示「状态:ECDH 已建立(测试模式)」。
注意:crosshatch 系统签名 APK 可安装在 userdebug/eng 构建的模拟器上;普通零售系统镜像请改用 neutral 变体。
## Android 被控端
```powershell