feat: 配对信息二维码与主控端导入

- 被控端新增 zxing 二维码,展示 lancast://pair 链接(含设备 id、指纹、TLS 指纹位)
- 配对 URI 增加 id/name/tls 字段,端口与指纹仍由手机端生成
- 主控端设备列表新增「导入配对信息」,粘贴链接即可添加设备并写入 pin
- 导入设备落盘 ttstd_paired_devices.json,与发现结果按 id/ip+端口去重
This commit is contained in:
tongtong committed 2026-11-27 20:21:57 +08:00
1 parent 1548139051
commit 9a82766fa2
8 files changed
+338 -6

No files matched your search

+5
View File
@@ -51,6 +51,8 @@ class DeviceInfo {
final String model;
final String resolution;
final String? signalingUrl;
/// 被控端 TLS 自签证书的 SHA-256(为空表示对端不支持 TLS)。
final String tlsFingerprint;
const DeviceInfo({
required this.id,
@@ -63,6 +65,7 @@ class DeviceInfo {
this.model = '',
this.resolution = '1920x1080',
this.signalingUrl,
this.tlsFingerprint = '',
});
factory DeviceInfo.fromJson(Map<String, dynamic> json) {
@@ -79,6 +82,7 @@ class DeviceInfo {
model: (json['model'] ?? '').toString(),
resolution: (json['res'] ?? '1920x1080').toString(),
signalingUrl: json['sig']?.toString(),
tlsFingerprint: (json['tls'] ?? json['tlsFp'] ?? '').toString(),
);
}
@@ -93,6 +97,7 @@ class DeviceInfo {
'model': model,
'res': resolution,
if (signalingUrl != null) 'sig': signalingUrl,
if (tlsFingerprint.isNotEmpty) 'tls': tlsFingerprint,
};
bool supports(String capability) => capabilities.contains(capability);