feat(sender): 设备指纹固定、/watch 实时刷新、中继连接与文件子协议上传

- 新增 PinStore:首次连接记录被控端签名指纹,变化时弹窗确认
- 新增 SignalingWatch:订阅 /watch,300ms 去抖后重拉设备列表
- 设置页新增"连接走信令中继",主控端按该开关走 ttstd_relay_start
- 中继模式禁用投屏并提示原因,状态卡区分直连/中继
- 新增 ControlFileClient:通过 msgType=7 分片上传/列目录,文件页加入口
- NativeCore/Bridge 暴露 relayStart/relayStop/sendFileRequest
This commit is contained in:
tongtong committed 2026-11-27 18:44:49 +08:00
1 parent 22bac28914
commit a9ba4bb7bc
9 files changed
+752 -8

No files matched your search

@@ -30,6 +30,7 @@ class _SettingsPageState extends State<SettingsPage> {
late bool _audioEnabled;
late bool _clipboardSync;
late bool _fileTransfer;
late bool _relayEnabled;
late int _bitrateMbps;
DeviceInfo? _localListener;
ServiceCheckResult? _serviceResult;
@@ -50,6 +51,7 @@ class _SettingsPageState extends State<SettingsPage> {
_audioEnabled = widget.settings.audioEnabled;
_clipboardSync = widget.settings.clipboardSync;
_fileTransfer = widget.settings.fileTransfer;
_relayEnabled = widget.settings.relayEnabled;
_bitrateMbps = widget.settings.bitrateMbps;
_loadLocalListener();
_refreshListenerState();
@@ -180,6 +182,10 @@ class _SettingsPageState extends State<SettingsPage> {
_snack('请填写外部信令服务器地址');
return;
}
if (_relayEnabled && _useLocalSignaling) {
_snack('中继需要被控端也能访问的信令地址,请改用外部信令');
return;
}
if (int.tryParse(_localPort.text.trim()) == null) {
_snack('本机端口必须是数字');
return;
@@ -209,6 +215,7 @@ class _SettingsPageState extends State<SettingsPage> {
audioEnabled: _audioEnabled,
clipboardSync: _clipboardSync,
fileTransfer: _fileTransfer,
relayEnabled: _relayEnabled,
bitrateMbps: _bitrateMbps,
filePort: int.tryParse(_filePort.text.trim()) ?? widget.settings.filePort,
fileToken: _fileToken.text.trim(),
@@ -410,6 +417,12 @@ class _SettingsPageState extends State<SettingsPage> {
value: _fileTransfer,
onChanged: (value) => setState(() => _fileTransfer = value),
),
SwitchListTile(
title: const Text('连接走信令中继'),
subtitle: const Text('跨网段时使用;中继只承载控制通道,不能投屏/传音频'),
value: _relayEnabled,
onChanged: (value) => setState(() => _relayEnabled = value),
),
Padding(
padding: const EdgeInsets.fromLTRB(16, 4, 16, 8),
child: Row(