From 8a934c8813aefc42b4e68e39784f657265ab2a9f Mon Sep 17 00:00:00 2001 From: yuming Date: Fri, 18 Sep 2026 22:55:12 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=AF=8F=E8=BD=AE=E7=82=B93=E4=B8=AA+?= =?UTF-8?q?=E7=AD=89=E5=BE=85180=E7=A7=92=EF=BC=8C=E9=81=BF=E5=85=8D?= =?UTF-8?q?=E9=98=9F=E5=88=97=E5=A0=86=E7=A7=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 红点检测不准(失败任务红点持续存在),改为: - 每轮只点3个(而不是6个),给队列留余量 - 等待时间从120秒增加到180秒 - 超时后直接滚动,靠下游MD5去重兜底 --- automate.py | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/automate.py b/automate.py index cca4751..316870c 100644 --- a/automate.py +++ b/automate.py @@ -575,7 +575,7 @@ def get_remote_new_file_count(baseline_files): return len(all_files - baseline_files) -def tap_all_thumbnails(baseline, max_rounds=300, poll_interval=4, max_wait_per_round=120): +def tap_all_thumbnails(baseline, max_rounds=300, poll_interval=4, max_wait_per_round=180): """循环:点击固定网格 9 个卡片(点击即下载)→ 轮询确认下载数量稳定 → 滚动 2 行。 新版 UI(7.8.1)自绘,dump 拿不到缩略图 bounds,改用固定网格坐标 THUMB_X x THUMB_Y。 首次点击卡片会弹"使用手机网络下载将消耗流量"确认框,点确定后补点一次该卡片。 @@ -720,17 +720,6 @@ def tap_all_thumbnails(baseline, max_rounds=300, poll_interval=4, max_wait_per_r # 每屏动态实测卡片行中心 y(消除整点分组标签平移造成的错位,这是"重复下载" # 的总根源),再对每行 × 固定 3 列逐格判打勾,只点还没下载完的。 grid_shot = screenshot("/tmp/_gridchk.png") - # 队列忙等待:右上角有红点说明下载队列已满,新点击会被拒绝。 - # 先等队列消化(最多5分钟),红点消失后再继续,避免空等6分钟后滚动走。 - queue_wait = 0 - while is_queue_busy(grid_shot) and queue_wait < 300: - if queue_wait % 30 == 0: - print(f" 轮 {r+1}: 下载队列忙(右上角红点),等待队列消化... {queue_wait}s") - time.sleep(10) - queue_wait += 10 - grid_shot = screenshot("/tmp/_gridchk.png") - if is_queue_busy(grid_shot): - print(f" 轮 {r+1}: 等待 {queue_wait}s 后队列仍忙,照常滚动(靠下游去重兜底)") full_rows = detect_card_rows(grid_shot) # 检测不到行时重试最多3次:缩略图加载慢、ANR刚恢复、画面切换中都会导致 # 临时检测不到行。之前只重试1次就放弃,会误判"全部已打勾"直接滚动, @@ -758,7 +747,7 @@ def tap_all_thumbnails(baseline, max_rounds=300, poll_interval=4, max_wait_per_r badge_skipped = sum(1 for cy in row_centers for gx in THUMB_X if checked.get((gx, cy))) # 收集所有未打勾格子(从上到下),最多9个避免超并发 todo_cells = [(gx, cy) for cy in row_centers for gx in THUMB_X if not checked.get((gx, cy))] - tapped_cells = todo_cells[:6] # 萤石并发上限10,留余量点6个 + tapped_cells = todo_cells[:3] # 每轮只点3个,避免队列堆积 for (gx, cy) in tapped_cells: adb("shell", "input", "tap", str(gx), str(cy)) time.sleep(0.5)