优化WiFi ADB快速扫描
This commit is contained in:
1 parent
e51d37890a
commit
24b58a8c6d
6 files changed
+155
-141
No files matched your search
@@ -614,7 +614,7 @@ def handle_post(handler, u, runner, csrf_token: str) -> None:
|
||||
return handler._send_json({"ok": False, "error": "adb not found"}, status=422)
|
||||
subnet = str(body.get("subnet") or "").strip() or None
|
||||
try:
|
||||
probe_timeout = float(body.get("probe_timeout") or 0.3)
|
||||
probe_timeout = float(body.get("probe_timeout") or 0.12)
|
||||
except Exception:
|
||||
return handler._send_json({"ok": False, "error": "invalid probe_timeout"}, status=400)
|
||||
if probe_timeout <= 0:
|
||||
@@ -626,13 +626,14 @@ def handle_post(handler, u, runner, csrf_token: str) -> None:
|
||||
from gui.gui_core_pkg import parse_port_spec
|
||||
|
||||
port_list = parse_port_spec(ports_raw)
|
||||
ports_for_scan = None if ports_raw is None or str(ports_raw).strip() == "" else port_list
|
||||
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, get_local_subnets
|
||||
|
||||
devs = discover_adb_devices(
|
||||
adb, subnet_spec=subnet, ports=port_list, probe_timeout=probe_timeout
|
||||
adb, subnet_spec=subnet, ports=ports_for_scan, probe_timeout=probe_timeout
|
||||
)
|
||||
tried_subnets = [subnet] if subnet else (get_local_subnets() or [])
|
||||
payload = [
|
||||
|
||||
Reference in new issue
Block a user