优化WiFi ADB快速扫描

This commit is contained in:
Your Name committed 2026-06-03 08:50:43 +08:00
1 parent e51d37890a
commit 24b58a8c6d
6 files changed
+155 -141

No files matched your search

+1 -1
View File
@@ -25,7 +25,7 @@ def _handle_scan_result(
open_pick_dialog: Callable[[Sequence], None],
) -> None:
if not devs:
on_line("[扫描] 未发现开放 5555 端口的设备(同 WiFi 下设备需先启用 ADB 调试)")
on_line("[扫描] 未发现 WiFi ADB 设备(同 WiFi 下设备需先启用 ADB 调试/无线调试)")
return
connected = [d for d in devs if d.adb_state == "connected"]
+4 -4
View File
@@ -61,7 +61,7 @@ def open_scan_dialog(
# 第二行:端口规格
ttk.Label(top_frame, text="端口:").grid(row=1, column=0, sticky=W, pady=(6, 0))
scan_port_var = tk.StringVar(value="5555")
scan_port_var = tk.StringVar(value="")
ttk.Entry(top_frame, textvariable=scan_port_var, width=32).grid(
row=1, column=1, columnspan=3, padx=(6, 0), pady=(6, 0), sticky="we"
)
@@ -74,7 +74,7 @@ def open_scan_dialog(
).grid(row=2, column=0, columnspan=4, sticky=W, pady=(4, 0))
ttk.Label(
top_frame,
text="端口示例: 5555 | 5555,5556 | 37000-40000 (Android 11+ 无线调试随机端口在 37000-44999)",
text="端口留空=快速自动;手动示例: 5555 | 5555,5556 | 37000-44000 (Android 无线调试随机端口)",
font=("Arial", 8),
foreground="gray",
).grid(row=3, column=0, columnspan=4, sticky=W, pady=(2, 0))
@@ -192,7 +192,7 @@ def open_scan_dialog(
devs = discover_adb_devices(
adb_exe_local,
subnet_spec=spec,
ports=port_list,
ports=None if not scan_port_var.get().strip() else port_list,
on_progress=on_progress,
on_phase=on_phase,
)
@@ -216,7 +216,7 @@ def open_scan_dialog(
)
else:
status_var.set("扫描完成,未发现设备")
on_line_local("[扫描] 未发现开放 5555 的设备")
on_line_local("[扫描] 未发现 WiFi ADB 设备")
progress_var.set(100)
scan_btn.config(state="normal")
scanning["flag"] = False