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

+3 -1
View File
@@ -566,11 +566,12 @@ def handle_post(handler, u, runner, csrf_token: str) -> None:
except Exception:
return handler._send_json({"ok": False, "error": "invalid ports"}, status=400)
try:
from gui.gui_core_pkg import discover_adb_devices, get_local_subnet
from gui.gui_core_pkg import discover_adb_devices, get_local_subnet, get_local_subnets
devs = discover_adb_devices(
adb, subnet_spec=subnet, ports=port_list, probe_timeout=probe_timeout
)
tried_subnets = [subnet] if subnet else (get_local_subnets() or [])
payload = [
{
"target": d.target,
@@ -586,6 +587,7 @@ def handle_post(handler, u, runner, csrf_token: str) -> None:
{
"ok": True,
"subnet": subnet or get_local_subnet() or "",
"subnets": tried_subnets,
"ports": port_list,
"devices": payload,
}