fix(wifi-adb): improve scan with multi-subnet fallback and mdns discovery

This commit is contained in:
Your Name committed 2026-06-01 09:40:44 +08:00
1 parent de21921d03
commit f76232f2fc
6 files changed
+235 -32

No files matched your search

+5 -3
View File
@@ -161,13 +161,15 @@ async function wifiScan() {
}
const devs = Array.isArray(resp.devices) ? resp.devices : [];
const subnet = resp.subnet || "";
const subnets = Array.isArray(resp.subnets) ? resp.subnets.filter(Boolean) : [];
const subnetLabel = subnets.length > 0 ? subnets.join(", ") : subnet;
if (!devs.length) {
appendLog([`[WiFi ADB] 扫描完成 (${subnet}),未发现开放 5555 端口的设备`]);
if (status) status.textContent = `扫描完成 (${subnet}),未发现设备`;
appendLog([`[WiFi ADB] 扫描完成 (${subnetLabel}),未发现开放端口设备`]);
if (status) status.textContent = `扫描完成 (${subnetLabel}),未发现设备`;
return;
}
appendLog([
`[WiFi ADB] 扫描完成 (${subnet}),发现 ${devs.length} 台候选: ` +
`[WiFi ADB] 扫描完成 (${subnetLabel}),发现 ${devs.length} 台候选: ` +
devs.map((d) => `${d.target}(${d.state})`).join(", "),
]);