Your Name
97935d9c48
refactor(gui): 抽 _generic_search_widget 到 components/text_search (3669 → 3590)
2026-05-30 15:16:42 +08:00
Your Name
64c210dd5a
refactor(gui): 抽 refresh_run_log 到 components/run_log_view (3715 → 3669)
2026-05-30 15:12:38 +08:00
Your Name
68d1224b53
refactor(gui): 抽 _on_scan_one_click + _handle_scan_result 到 components/wifi_adb_one_click_scan (3775 → 3715)
2026-05-30 15:08:35 +08:00
Your Name
92d524297b
refactor(gui): 抽预览 Tab 全部 8 个动作到 components/preview_view (3891 → 3775)
2026-05-30 15:03:45 +08:00
Your Name
59ebe8c1e7
refactor(gui): 抽 win_record Tab 全部 7 个动作到 components/win_record_view (4044 → 3891)
2026-05-30 14:53:11 +08:00
Your Name
a7ef92fc7c
refactor(gui): 抽 pump_logs 到 components/log_pump (4117 → 4044)
2026-05-30 14:37:03 +08:00
Your Name
c5df7a05d2
refactor(gui): 抽 update_ocr_results 到 components/ocr_results_view (4148 → 4117)
2026-05-30 14:30:42 +08:00
Your Name
b3380042b8
refactor(gui): 抽 _try_reconnect_last_wifi 到 components/wifi_adb_reconnect (4268 → 4148)
2026-05-30 14:24:19 +08:00
Your Name
4993fad004
refactor(gui): 抽 _open_scan_pick_dialog 到 components/wifi_adb_pick_dialog (4337 → 4268)
2026-05-30 14:18:19 +08:00
Your Name
44b091466d
refactor(gui): 抽 actions_log 视图相关到 components/actions_log_view (4463 → 4337)
2026-05-30 14:10:30 +08:00
Your Name
8ea676562c
refactor(gui): 抽 do_screenshot + OCR_REGIONS 到 components/screenshot_action (4635 → 4463)
2026-05-30 14:03:31 +08:00
Your Name
a07ef00b5e
refactor(gui): 抽 refresh_high_value_rooms 到 components/high_value_view (4656 → 4635)
2026-05-30 13:56:36 +08:00
Your Name
5329561b3a
refactor(gui): 抽 refresh_reservations 到 components/reservations_view (4913 → 4656)
2026-05-30 13:52:39 +08:00
Your Name
6bffcae2de
refactor(gui): 抽 open_wifi_adb_dialog 到 components/wifi_adb_dialog (5274 → 4913)
2026-05-30 13:48:22 +08:00
Your Name
ac464788e1
refactor(gui): 抽 open_scan_dialog 到 components/wifi_adb_scan_dialog (5476 → 5274)
2026-05-30 13:43:17 +08:00
Your Name
8dace383ec
docs(plans): 添加 gui/gui_app.py 拆分实施计划
2026-05-30 13:26:42 +08:00
Your Name
26f9e5a553
docs(specs): 添加 gui/gui_app.py 拆分设计文档
2026-05-30 13:24:07 +08:00
Codex and Claude Sonnet 4.5
bb90e2983f
fix(pil): 补充修复剩余 PIL Image 资源泄漏
...
覆盖 14 个文件中的 Image.open() 未正确关闭问题:
- fansclub_handler: 5 处(pic/pic_rgb/img 未 close)
- image_ops: 2 处(crop 后 pic 未 close)
- douyin_popups: 2 处(pic.convert 重赋值泄漏原始句柄)
- douyin_fudai: 1 处(open().convert() 链式调用泄漏)
- douyin_robot: 2 处(同上)
- save_files/direct_attend/finder/stage/find_open/detail/_common/ocr_preprocess: 各 1-2 处
统一修复模式:分离 open 与 convert,try/finally 确保原始句柄关闭。
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com >
2026-05-23 22:49:50 +08:00
Codex and Claude Sonnet 4.5
c3746b0207
fix(pil): 修复 PIL Image 资源泄漏
...
Image.open() 后未 close() 导致文件句柄泄漏,用 _raw + try/finally 模式修复。
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com >
2026-05-23 22:42:22 +08:00
Codex and Claude Sonnet 4.5
b1fa6af9ce
fix(gui): 修复启动后 GUI 卡死约 1.2 秒
...
delayed_refresh_preview 在 mainloop 启动 300ms 后同步加载大图(PIL
Image.open + load + convert),阻塞主线程。改为:
1. 延迟到 3 秒后再触发预览(GUI 已完全初始化)
2. 图片加载放到后台线程,完成后通过 root.after 回主线程更新
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com >
2026-05-23 21:58:50 +08:00
Codex and Claude Sonnet 4.5
96fdc96f24
refactor(cleanup): 移除剩余死代码模块
...
- 删除 douyin/utils/douyin_text_utils.py 及其测试
- 移除 performance_tracker.py 中未使用的 track_function 方法
- 移除 param_usage_tracer.py 中未使用的 stop_tracing / is_enabled
- 清理 bin/run_cli.py 和 tests/test_imports.py 中的残留引用
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com >
2026-05-23 21:58:41 +08:00
Codex and Claude Sonnet 4.5
c4544489ac
refactor(coords): 提取点击坐标常量,消除硬编码
...
在 coords.py 添加 DETAIL_OUTSIDE_CLICK、PARTICIPATE_BTN_CLICK、
FANSCLUB_JOIN_CLICK、FANSCLUB_JOIN_FALLBACK_CLICK 常量,
替换 fudai_attend/fansclub_handler/join_decision 中的硬编码坐标。
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com >
2026-05-23 21:20:17 +08:00
Codex and Claude Sonnet 4.5
d19d5bfc56
refactor(cleanup): 移除 logging 模块死代码
...
- unified_logger.py: 删除 5 个从未使用的装饰器/函数
- internal_loggers.py: 删除 3 个未使用方法和工厂函数
- action_logger.py: 删除 3 个未使用方法
- log_formatter.py: 删除 6 个未使用格式化函数(保留 GUI 依赖的 4 个)
- 同步更新 __init__.py 和测试文件
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com >
2026-05-23 21:04:35 +08:00
Codex and Claude Sonnet 4.5
703da834fb
fix(security): 修复 shell 注入风险和类型转换未捕获问题
...
- path_config.py: find_executable Unix 回退路径使用 shlex.quote 防注入
- underlying_operations.py: try_set_ime IME ID 使用 shlex.quote 防注入
- screenshot_direct.py: 环境变量 float/int 转换添加 try/except 容错
- device_select.py: 用户输入 int() 转换添加 try/except 容错
- read_once.py / image_acquirer.py / detail_verifier.py: PIL Image 添加 close()
- detector.py: 移除 return 后不可达死代码
- optimized_entry.py: 统一返回值类型 int,失败时返回 0
- read_once.py: 移除 try/except 中重复的相同代码
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com >
2026-05-23 20:50:26 +08:00
Codex and Claude Sonnet 4.5
4908df19d4
refactor(cleanup): 移除死代码和冗余导入
...
- douyin_fudai_core.py: 移除未使用的 ThreadPoolExecutor/check_contain 导入
和被覆盖的 fudai_result_checker 导入
- ocr_executor.py: 移除重复的 _fudai_ocr_executor_state 初始化
- flow_control_pkg: 移除 stage_handler/no_fudai/find_open 中未使用的导入
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com >
2026-05-23 20:27:41 +08:00
Codex and Claude Sonnet 4.5
ca00258bf3
fix(code-quality): 修复 NameError 风险和死代码清理
...
- detect_by_template.py: 添加缺失的 os 和 path_config 导入
- join_decision.py: 添加缺失的 is_watch_task_fudai 导入
- read_once.py: 添加缺失的 Optional 类型导入
- fudai_detail_validator.py: 使用 extract_2digits 做更健壮的数字解析
- screenshot_manager: 移除未使用的导入和死代码
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com >
2026-05-23 20:22:52 +08:00
Codex and Claude Sonnet 4.5
e62314fa25
fix(import): 修复 fudai_attend 相对导入路径错误
...
join_decision.py 在 fudai_filter_pkg 子包内,用 .fudai_attend 会查找
fudai_filter_pkg.fudai_attend(不存在),实际模块在上层 core 包。
改为 ..fudai_attend。
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com >
2026-05-23 19:26:58 +08:00
Codex and Claude Sonnet 4.5
df69c6ab67
fix(countdown): 修复长倒计时被截断到15分钟的bug
...
check_countdown 中 >900s 的上限过于激进,将实际的58分钟福袋截断到14:50。
改为 >3600s(1小时)上限,兼容抖音的60分钟福袋。
同时修复 _extract_digits 取后N位的问题,改为取前N位,
避免当子图意外捕获额外数字时(如 "1458")被误提取为 "58"。
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com >
2026-05-23 19:22:20 +08:00
Codex and Claude Sonnet 4.5
a50f08de5a
fix(fudai): 验证失败时按钮可操作则继续参与
...
验证失败(如内容识别被禁用导致内容为空)时,若按钮状态为
"可以参与"/"需要加入粉丝团"等可操作状态,继续走参与流程而非
直接返回,避免漏参与有效福袋。同时修正 basic_join_decision 调用签名。
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com >
2026-05-23 19:03:51 +08:00
Codex and Claude Sonnet 4.5
8fd38dd30b
fix(fudai): validator 内容检查正确尊重 disable 配置
...
当 config.json 中 fudai_disable_content_recognition=true 时,
跳过内容为空的检查。原实现在 except 块中丢失 disable_content
状态,导致配置生效时仍误判内容为空为验证失败。
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com >
2026-05-23 19:00:32 +08:00
Codex and Claude Sonnet 4.5
d850af2c44
fix(fudai): 验证器不再因内容为空而拒绝有效福袋
...
当奖品价值>0且倒计时合理时,内容为空是正常的(部分福袋无文字
内容),不应判定验证失败导致跳过参与。
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com >
2026-05-23 18:39:13 +08:00
Codex
2fab3f238e
fix: entry-point scripts douyin.* import 失败 — sys.path 在 import 之后才设置
...
bin/run_cli.py 的 _BASE_DIR+sys.path.insert 原在 logging import 之后,
导致 No module named 'douyin' 警告。tools/ 下 5 个脚本完全缺失 sys.path
设置,auto_connect_wifi_adb.py 层级算错只跳到 tools/ 而非项目根。
2026-05-23 18:11:18 +08:00
Codex
f750969df3
fix(deps): pin protobuf==3.20.3 修复 PaddleOCR 初始化失败回退到慢速 EasyOCR
2026-05-23 17:43:01 +08:00
Codex
842dd254e3
fix: correct import path for check_detail_height in detect_fudai_detail_page
...
The relative import from .douyin_detection was looking in the
douyin/detection/pixel/ package, but douyin_detection.py lives
at douyin/detection/douyin_detection.py. This caused every fudai
detail page detection to fail with detection_exception, making the
system always treat successful detail page opens as misclicks.
2026-05-23 17:05:43 +08:00
Codex and Claude Sonnet 4.5
6f38907119
fix(fudai/reservation): 修 3 处拆模块遗留 NameError
...
- douyin_fudai_core.py: get_fudai_contain 引用 TASK_LIST / PARTICIPATE_BUTTON
但只导入了 LIVE_ROOM_TITLE,运行时必触发 NameError
- douyin_reservation_verify.py: match_reservation 末尾日志引用
current_title,但该变量仅在 if expected_title 块内赋值,
expected_title 为空时 NameError(被 try/except 吞掉但丢失日志)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com >
2026-05-23 13:28:54 +08:00
Codex and Claude Sonnet 4.5
470c68a252
fix(fudai/stage): 修 reservation_check_start NameError + ocr_detection 缩进 + stage 默认值
...
- douyin_fudai.py: 补回 reservation_check_start 初始化(ffd048f 拆 helper 时丢失)
- ocr_detection.py: 修 _confirm_live_list 中 OCR 变量在 if 块外赋值的缩进 bug
- ocr_detection.py: shopping_redpacket_ocr_confidence_threshold 改 getattr 兜底 0.35
- douyin_stage.py: enable_ocr_mode1 默认值 False→True;像素检测未命中补 return
- config.json: 同步 enable_ocr_mode1 默认值
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com >
2026-05-23 11:22:03 +08:00
Codex and Claude Opus 4.7
fe97e82104
fix(gui): 实时查看器/状态 Tab 的耗时解析支持 ms 单位
...
问题:实际 actions.log 写的是 `耗时=10.00ms`(毫秒),但 _parse_minimal
和 parse_action_duration 的正则只匹配 `s`,导致:
- 实时查看弹窗永远显示"暂无动作"
- 实时状态 Tab 同样空白
同时存在的副 bug:兜底正则在整行匹配,前缀里的 `192.168.5.2:5555` /
日志时间戳 `2026-05-21` 都可能被误识别成耗时。
修复:
- 解析窗口限定到 line.find("耗时") 之后的子串 (tail)
- 优先匹配 ms(顺序很重要:\s*s 会先吃掉 "10ms" 的 m)
- s 单位加 (?![a-zA-Z]) 负向后顾,避免匹配 "ms" / "second" 之类
- 同步修复 gui_app.py:3685 的 parse_action_duration(实时状态 Tab)
测试:
- _parse_minimal 加 4 个新测试覆盖 ms / 整数 ms / 优先级 / 前缀干扰
- 全量 1426 passed (+5)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-23 09:08:58 +08:00
Codex and Claude Opus 4.7
9f330572cc
test(gui): 加 gui_app.main() 启动冒烟测试
...
背景:d759921 抽 _open_realtime_viewer_impl 时误删 16 行搜索工具栏定义,
gui_app 启动时报 NameError,但 pytest 1421 passed 没抓住——def main()
里的 NameError 只有真正调用 main() 才触发,单纯 import 不会执行函数体。
新测试通过 patch tk.Misc.mainloop 让 GUI 创建完所有控件后立刻 quit,
覆盖 def main() 内部所有顶层语句,能抓住 NameError / AttributeError /
ImportError 这类启动期失败。
已验证:临时 revert ca6c2e4 后该测试 FAIL(精确指向 L3994 NameError),
恢复 ca6c2e4 后 PASS。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-23 08:59:30 +08:00
Codex and Claude Opus 4.7
4277bf7fa4
fix(gui): WiFi 扫描显示 adb 真实返回,state=failed 不再误导为"请授权"
...
问题:扫描提示 "192.168.5.2:5555 当前状态=failed,请先在手机上授权后重试",
但 failed 表示 adb connect 既不成功也不是 unauthorized(通常是 adb 服务异常 /
设备短暂不可达),不是授权问题。手机不会弹窗,用户照提示去手机上找授权窗
口,永远不会成功。
修复:
- _handle_scan_result: 区分 failed 分支,逐项打印 adb 真实返回(去掉换行
方便单行显示),并提示用户排查 adb 服务而非"请授权"。
- _open_scan_pick_dialog: 表格新增 "adb 返回" 列(截断 200 字符);
Toplevel 拓宽到 680x320 容纳新列。
- use_selected: 根据 state 给出针对性提示——unauthorized 让用户授权,
failed 显示对应 message,其他状态保持通用提示。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-23 08:55:15 +08:00
Codex and Claude Opus 4.7
ca6c2e4d20
fix(gui): 恢复运行日志 Tab 搜索工具栏定义
...
d759921 抽 _open_realtime_viewer_impl 时误删了紧随其后的 16 行
"搜索工具栏"块(log_search_frame / log_filter_var / log_search_var /
log_search_entry),导致 gui_app 启动时在 L3964 报
NameError: name 'log_search_entry' is not defined。
恢复这 16 行到原位置,gui_app 可正常启动。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-23 08:37:30 +08:00
Codex and Claude Opus 4.7
7884132743
test(pkg): 补充 _pkg 子模块单元测试
...
覆盖 screenshot_manager.save_files / reservation_logic._common /
logging_wrapper_pkg._common 共 14 个测试。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-23 07:05:23 +08:00
Codex and Claude Opus 4.7
9fbfcb5ed2
chore(gitignore): 忽略 output/ 测试与诊断产物
...
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-23 07:05:11 +08:00
Codex and Claude Opus 4.7
87bac9e548
chore(config): 补充新增功能默认配置
...
新增 GUI realtime_status / swipe_down_back / log_unified 默认值,
与代码中 cfg.get(..., default) 兜底保持一致。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-23 07:04:59 +08:00
Codex and Claude Opus 4.7
d759921442
refactor(gui): 抽 _open_realtime_viewer_impl 到 components/realtime_viewer (5539 → 5370)
...
gui_app.py 嵌套函数 _open_realtime_viewer_impl 是 170 行的"实时查看"对话框:
弹 Toplevel 显示当前 pic/screenshot.png + 列表展示 actions.log 中含"耗时"的
最近 80 行,每秒刷新。
抽到 gui/components/realtime_viewer.py:
- open_realtime_viewer(root) 主入口
- _tail_read(path, max_bytes) 末尾字节读取
- _parse_minimal(line) 提取 (动作名, 耗时) 二元组
- 全局单例 _active_win 替代原嵌套 def 的属性式 _win
gui_app.py 中嵌套 def 缩成 4 行委托。
新增 13 个单元测试覆盖 _tail_read 4 种情况 + _parse_minimal 8 种格式。
1421 passed (+13)。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-23 03:47:58 +08:00
Codex and Claude Opus 4.7
be1eb6eda7
refactor(web_gui): 抽 ProcRunner._update_stats_from_line 解析逻辑到 stats_log_parser (2429 → 1806)
...
ProcRunner._update_stats_from_line 是 624 行的"日志行 → 计数器更新"方法,与
gui_core.Runner 同名方法行为接近但有差异:
- web_gui 解析 traceId / MDC 信息(gui_core 没有)
- web_gui 没有 _lock / _last_log_ts 字段(不需要锁保护)
- web_gui 没有 unique_keys_* / *_room_pos 这些去重数据结构
- web_gui 有"进入直播间到识别福袋耗时"事件解析
抽到独立的 gui/web_gui_pkg/stats_log_parser.py(不与 gui_core_pkg 版本共享,
避免在两边各加缺失字段,行为差异显式保留在两个文件中):
- update_stats_from_line(runner, line) 主入口
- 16 个 _parse_* 子函数(含 traceId/MDC、enter_to_fudai_seen 等 web_gui 专属段)
ProcRunner._update_stats_from_line 从 624 行变成 4 行委托。
1408 passed.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-23 03:41:52 +08:00
Codex and Claude Opus 4.7
3b8f85b9cb
refactor(gui_core): 抽 _update_stats_from_line 解析逻辑到 stats_log_parser (1207 → 541)
...
Runner._update_stats_from_line 是 666 行的"日志行 → 计数器更新"巨型方法。
按业务事件分类 14 个独立段(福袋字段 / 打开-参与计数器 / 跳过原因 /
错误统计 / 粉丝团 / 预约 / 开奖结果 / 直播间切换 / 阶段诊断 / OCR / 性能 /
详情识别 / 福袋查找 / 回退操作)。
抽到 gui/gui_core_pkg/stats_log_parser.py:
- update_stats_from_line(runner, line) 主入口
- 14 个 _parse_* 子函数按事件分组
- 通过 runner.* 调用保持与原 Runner 方法/状态一致
Runner._update_stats_from_line 从 666 行变成 4 行委托。模块级测试更易于
单独覆盖各分类的解析逻辑。
1408 passed.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-23 03:35:04 +08:00
Codex and Claude Opus 4.7
fb35670032
refactor(gui): 抽 ThreadSafeLogWriter 到 components/log_writer (5649 → 5537)
...
gui_app.py 的 ThreadSafeLogWriter 类(109 行)是自包含的日志文件写入器:
threading.Lock 保护、按日期分割、配置开关、PermissionError/Exception 兜底。
抽到 gui/components/log_writer.py,原 gui_app 中的 109 行类定义 + 1 行实例化
替换为 3 行导入 + 实例化。read_config 通过 staticmethod _read_config 延迟导入,
避免循环依赖。
新增 15 个单元测试覆盖:
- __init__:默认 log_dir / 配置开关 / dated_logs / 相对路径解析 / 配置异常兜底
- write:正常写 / 禁用跳过 / 空行跳过 / 时间戳前缀 / 已格式化行原样写
- 100 线程 × 10 行的并发安全测试(确认 1000 行无丢失)
- PermissionError / 通用异常下不抛 + warn 一次
1408 passed (+15)。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-23 03:29:25 +08:00
Codex and Claude Opus 4.7
230c0d4049
refactor(gui): 抽 refresh_stats 字符串格式化到 stats_formatter (6339 → 5634)
...
gui_app.py 的 refresh_stats 闭包是 705 行纯字符串构建:把 runner.get_stats()
的字典格式化成多个分段(基本信息/快速汇总/核心统计/跳过/OCR/详情/福袋查找/
性能/粉丝团/切换/预约/错误/价值/最近福袋/中奖记录)。
抽到 gui/components/stats_formatter.py:
- format_stats(stats: Dict) -> List[str] 主入口
- 14 个 _append_* 子段构建器(每段一个,按需追加)
- _section_lines(title, body) 标题包装
闭包改为 16 行委托:调 format_stats + 写入 ScrolledText。
新增 32 个单元测试覆盖:
- 空 dict / 缺字段时的兜底
- 基本运行状态(uptime / pid / exit_code 各种格式)
- 各分段的"有数据 / 无数据"条件
- 关键率计算(打开成功率/点击率/参与成功率/中奖率/跳过率/错误频率)
- 边界情况(attend_ok > clicks 检测到已参与,结果未开奖警告,wins 截断到 10 条)
1393 passed (+32)。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-23 03:23:53 +08:00
Codex and Claude Opus 4.7
a864f6e23a
refactor(fudai): 抽 __init__ 配置默认值到 init_helpers (1559 → 1323)
...
fudai_analyse.__init__ L119-354 是 236 行配置字段默认值 + 运行时状态初始化:
- ~80 个 self.X = <default_value> 配置字段
- 30+ 个运行时状态字段
- _reservations_state_path 解析 + room_pos_map 旧文件清理
抽到 douyin/core/fudai_modules/init_helpers.py:
- apply_fudai_defaults(self): 主入口
- _apply_yanghao_defaults(self): 推荐页养号子段
- _resolve_reservations_state_path(self): 解析路径,path_config 失败时
兜底用 ".." 回退(不再用 dirname(__file__) + "state")
- _cleanup_old_room_pos_map_files(self): 清理上次运行的 JSON/CSV/MD 导出
__init__ 中保留:
- L57-117 设备/分辨率/operation/日志系统初始化(依赖较深,难抽)
- L356-357 self.load_config()
行为完全保留:所有字段值、解析顺序、异常兜底全部不变。
test_runtime_path_anchors.test_reservations_state_path_uses_path_config 已更新
为同时检查 douyin_fudai.py 和 init_helpers.py。
1361 passed.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-23 03:13:46 +08:00
Codex and Claude Opus 4.7
3a9f01ad74
refactor(fudai_modules): 抽 swipe 兜底重复逻辑到 fudai_device_control (1238 → 1147)
...
handle_detail_helpers.py 中 _handle_error_status 内联段(L266-318,53 行)
和 _fallback_swipe_up 顶层函数(L1187-1239,53 行)做的是完全一样的事:
没有 swipe_up_to_next_live 时直接 ADB shell input swipe,失败再回退到
operation.swipe。重复 1:1。
新增 douyin/core/fudai_modules/fudai_device_control.py:
- fallback_swipe_up_via_adb(self): 纯 ADB 兜底 swipe
- swipe_up_or_fallback(self): 优先 swipe_up_to_next_live,否则 fallback
handle_detail_helpers 两处都改成 4 行委托。原文件去掉 os/subprocess
import,仅保留 time。
行为完全保留:分辨率换算公式、ADB 路径解析、subprocess 超时 5s、operation.swipe
最终兜底全部不变。
1361 passed.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-23 03:07:41 +08:00