Commit Graph
43 Commits
Author SHA1 Message Date
Your Name d81e00ddbc add pause resume controls to ui 2026-06-23 02:38:08 +08:00
Your Name 040ccd8161 feat: enforce online license verification 2026-06-19 11:49:57 +08:00
Your Name b74baef555 fix(packaging): keep distribution minimal 2026-06-18 11:14:04 +08:00
Your Name b61f766ea6 fix(updater): harden forced startup updates 2026-06-18 08:38:21 +08:00
Your Name d48fa4eec3 Add forced startup updater 2026-06-18 07:57:38 +08:00
Your Name b1c2128d72 Add local license verification and distribution checks 2026-06-17 22:22:04 +08:00
Your Name 87838daad4 add windows installer packaging workflow 2026-06-09 21:58:35 +08:00
Your Name 1d37d57c90 修复福袋详情OCR v2与调试日志 2026-06-03 01:22:13 +08:00
Your Name 36e374ef67 refactor: split large modules and harden live-room fudai flow 2026-06-01 18:39:44 +08:00
Your Name 1ef7325ead refactor(webgui): extract request and static helpers 2026-06-01 01:05:45 +08:00
CodexandClaude 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
CodexandClaude Opus 4.7 52b811d0cb feat(scan): WiFi-ADB 扫描支持自定义/多端口(覆盖 Android 11+ 随机端口)
之前只扫 5555。Android 11+ "无线调试" 用 37000-44999 随机端口,
固定的 adb tcpip 也可改端口。新接口让扫描适配任意端口规格。

新增 parse_port_spec:解析端口规格字符串
  - 5555            单端口
  - "5555,5556"     逗号分隔
  - "37000-37010"   范围(最大 1024 个)
  - 混合格式与序列输入
  - 非法/越界 → 退化为默认 5555
  - 单个范围 > 1024 端口直接忽略,避免误扫整个端口段

scan_open_ports 重构:
  - 接受 ports 参数(list[int]),传 ports 时优先于旧 port=int
  - 返回 list[(ip, port)] 而不是 list[ip],按 (IP 数值序, port 升序) 稳定排序

discover_adb_devices 支持 ports 参数,按 (ip, port) 逐个 verify_adb_target

接入 GUI 与 webui:
  - gui_app.py 扫描对话框新增"端口"输入框 + 提示
  - gui_app.py 启动重连:上次端口非 5555 时把它一并扫描
  - web_gui.py /api/wifi/scan 接受 ports;/api/wifi/auto-reconnect 同上次端口逻辑

新增 13 个 parse_port_spec 单测 + 4 个 scan_open_ports 多端口测试 +
2 个 discover_adb_devices 多端口集成测试。
真机验证:6 端口 (5555 + 37000-37005) × 254 IP,~8.5s 扫完,
正确发现 192.168.5.2:5555 (PEPM00)。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-23 01:02:48 +08:00
CodexandClaude Opus 4.7 cea3aced73 feat(web_gui): WebUI 启动时自动重连上次 WiFi 设备 + 智能匹配
新增 /api/wifi/auto-reconnect 端点,把桌面 GUI 的 _try_reconnect_last_wifi
逻辑搬到服务端:先 verify_adb_target 上次的 target → 失败则 discover_adb_devices
扫描 + pick_best_match 智能匹配。返回结构化 JSON 让前端渲染:

  action: noop | already_online | reconnected | matched | failed
  target / model / message / devices

webui/app.js DOMContentLoaded 末尾调用 tryAutoReconnectLastWifi(),
不阻塞页面加载。命中后自动刷新设备下拉并选中。

至此桌面 GUI 和 WebUI 在 WiFi 重连体验上完全对齐:换网段也能找回手机。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-22 20:53:23 +08:00
CodexandClaude Opus 4.7 8c3a162deb feat(web_gui): WebGUI 对齐桌面 GUI 的 WiFi 扫描和 last_wifi_target 能力
新增 4 个端点:
- POST /api/wifi/scan       扫描局域网 ADB 设备
- GET  /api/wifi/last       查询上次连接记录
- POST /api/wifi/last       同上(POST 方便 fetch)
- POST /api/wifi/last/clear 清除记录

同步 connect / disconnect 路径行为:
- /api/wifi/connect 成功后写入 last_wifi_target(取设备型号)
- /api/wifi/disconnect 如果断的就是上次记住的设备 → 自动清除记录

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-22 20:33:22 +08:00
CodexandClaude Opus 4.7 a6bbdcc400 拆分 web_gui (2251 → 5 子模块 + 2148 行原文件保留 ProcRunner/Handler/main)
把 gui/web_gui.py 中 11 个独立 helper 拆出到 gui/web_gui_pkg/ 子包,
ProcRunner 巨型类(1514 行 / 25 实例方法 / 390 处 self)+ Handler 类
(588 行)+ main 留在原文件。

新建子包:
- logger (29)         _wg_log + module logger
- ansi (17)           strip_ansi_escape_codes + _ANSI_ESCAPE_RE
- adb_compat (44)     5 个 thin wrapper(forward 到 gui.gui_core_pkg)
- nested (18)         get_nested_value(点号路径配置读取)
- stats_helpers (71)  _parse_countdown_seconds / _bucket / _inc_map(ProcRunner 3 个 @staticmethod)

策略:8 个顶层 helper 直接搬子包;ProcRunner 内 3 个 @staticmethod 也搬,
类内改成 1 行 @staticmethod forwarding 保持 ProcRunner._parse_countdown_seconds
等调用兼容。原文件 import gui.web_gui_pkg 暴露 11 个公共符号。

外部 import 路径全部不变:
- find_adb_executable / read_config / list_adb_devices 等共 70+ 处外部引用
  全部不需修改(CONFIG_PATH 17 处 / read_config 17 处 / find_adb_executable
  18 处 / list_adb_devices 21 处 / write_config 10 处 / 其他 1-7 处)

回归:
- 6 个新文件 + 改写后 web_gui.py compileall 通过
- pytest 353 passed / 1 skipped
- _wg_log / strip_ansi_escape_codes / get_nested_value 调用结果正确
- ProcRunner._parse_countdown_seconds('1:30') = 90 (薄壳 forwarding OK)
- ProcRunner._bucket(15, [0,10,50,100]) = '10-50'
- ProcRunner._inc_map(m, 'k', 5) -> {'k': 5}
- ProcRunner() 实例化 OK

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 18:57:52 +08:00
zzz 6ef04c1f37 Merge branch 'main' into claude/wonderful-brattain-d1cfe0 2026-05-21 10:24:10 +08:00
CodexandClaude Opus 4.7 71f3653354 补回上次合并丢失的关键路径修复 + .gitignore 补强 + 依赖版本对齐
上次冲突解决时跳过了 982f57e (P0 清理) 和 b6ae970 (路径修复) 两个 commit,
本提交补回其中影响运行时正确性和文档一致性的 7 处。

E. 路径错位修复
  - douyin/core/douyin_fudai.py: _reservations_state_path 与 room_pos_map
    状态目录改为优先调用 path_config.get_reservations_path()
  - douyin/core/path_config.py: get_reservations_path 注释明确"实际位置 + 写入方"
  - gui/components/mapping_utils.py: 删除错误兜底 douyin/state/reservations.json
  - gui/components/mapping_table.py: 同步删除 douyin/state/room_pos_map.json 错误兜底
  - gui/web_gui.py: get_reservations() 内的兜底由 douyin/state/ 修正为 douyin/core/state/
  - bin/run_cli.py: 移除对已删空文件 douyin_reservation_ops.py 的 shim 加载
  - douyin/reservation/douyin_reservation_ops.py: 删除 0 字节空文件

F. .gitignore 补强
  - 新增 *.bak_* 拦截带日期后缀的备份命名(修复 *.bak 命中失败的场景)

G. 依赖版本对齐
  - requirements-minimal.txt: paddleocr/paddlepaddle 改为 >=3.0.0,与 requirements.txt 一致
  - README.md: 安装指引中 paddlepaddle==2.5.2 改为 >=3.0.0

回归:全量 .py compileall 通过;7 项断言(path_config 路径、douyin_fudai 切换、
3 处兜底已清、shim 已移除、空文件已删、.gitignore 补强、版本对齐)全部 PASS;
test_filter_logging / check_web_gui_config_sync 通过。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 10:18:17 +08:00
CodexandClaude Opus 4.5 b96a67b6b8 refactor: web_gui 中 5 个 ADB/config 函数改为薄包装
find_adb_executable / list_adb_devices / resolve_adb_device /
read_config / write_config 在 gui_core.py 中已有完全相同的实现。
web_gui.py 中改为薄包装,所有外部使用保持兼容。

注:get_nested_value 是 web_gui 独有,保留。

文件行数:gui/web_gui.py 原 2253 行减至 2210 行(约减 43 行)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-05-21 10:12:38 +08:00
CodexandClaude Opus 4.7 a876d9ebb0 gui/web_gui: 内部错误 print → _wg_log,保留启动横幅
- 新增模块级 _wg_log(msg, level):与 yanghao/screenshot 同模式
- 内部错误(日志写权限/失败、静态文件、logs search/get_logs_since)
  6 处 print → _wg_log,分级 WARNING/ERROR
- main() 内的 7 处 print 保留为 stdout:启动端口/URL/中断退出/帮助提示
  属于交互/CLI 输出而非日志事件,走 stdout 更直观

回归:149 .py 编译通过;test_filter_logging / check_web_gui_config_sync 通过。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 09:38:47 +08:00
Codex f16eadbd75 精修 WebUI 第十八轮:后端 /api/version + 预约卡 hover accent
- 后端 gui/web_gui.py 新增 GET /api/version:返回 {name, version, build},前端 footer 自动从 cache-bust fallback 切换为真实版本号
- 预约卡 .reservationItem hover 时左侧浮现 2px primary accent 条;isImminent / isDue 状态下不显示(避免与 warning/danger 边框冲突)
- 高价值直播间共用 reservationItem 视觉,自动获得相同 hover accent
- cache-bust v20 → v21
2026-05-21 09:29:38 +08:00
CodexandClaude Opus 4.5 8fe7ff0585 refactor: 根目录核心模块迁移到 douyin/core/ 和 douyin/logging/
将 4 个根目录核心模块迁移到合理位置:
- path_config.py    -> douyin/core/path_config.py
- version.py        -> douyin/core/version.py
- Underlying_Operations.py -> douyin/core/underlying_operations.py
- unified_logger.py -> douyin/logging/unified_logger.py

配套更新所有 import:
- path_config: 41 处 import 改为 douyin.core.path_config
- version: 4 处改为 douyin.core.version
- unified_logger: 5 处改为 douyin.logging.unified_logger
- Underlying_Operations: 14 处改为 douyin.core.underlying_operations

修复 path_config.PROJECT_ROOT 计算(向上 2 级而非当前目录)。

验证:python -m compileall 全项目通过。

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-05-21 00:23:14 +08:00
CodexandClaude Opus 4.5 84e8d0c46d fix: Web GUI 安全加固
1. PID 操作添加专用锁保护,防止 force_stop 并发问题
2. POST 接口添加 CSRF token 验证
3. 新增 /api/csrf-token 接口供前端获取 token

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-05-20 22:39:47 +08:00
Codex e7a7d3f888 Fix device selection and adb command safety 2026-05-20 18:43:58 +08:00
Your Name 89128deb0f Complete missing Web GUI controls 2026-05-20 17:54:40 +08:00
Your Name 7eb72bd00e Update config, web GUI, and add debug features 2026-05-20 08:12:06 +08:00
Your Name fb0c07c91a Add shopping red packet detection tests and sample image
- Implemented a test script for shopping red packet detection using pixel analysis and OCR.
- Created a sample image to simulate a shopping red packet for testing purposes.
- Added functions to test pixel detection, coordinate definitions, and OCR keyword matching.
- Included detailed print statements for test results and summaries.
2026-01-08 20:37:49 +08:00
Your Name b3011dd9ce feat: Implement high-value room revisit feature and enhance fudai tracking
- Added tracking for previously seen fudai in Runner and ProcRunner classes to avoid duplicate recognition.
- Extracted room title during fudai recognition for better tracking.
- Updated high_value_rooms.json with new room entries and adjusted total count.
- Introduced new GUI elements for configuring icon coordinates in webui.
- Created comprehensive documentation for the high-value room revisit functionality.
- Added tests for delay settings and icon detection logic to ensure functionality.
- Implemented a tool for analyzing step times in logs to identify performance bottlenecks.
2026-01-08 14:27:38 +08:00
Your Name 5738d29bd6 feat: 添加预约回退功能完整测试脚本和错误场景测试脚本 2026-01-08 00:15:00 +08:00
Your Name 93d47a16d6 Refactor reservation preemption handling and logging
- Removed the reservation preempt minimum value from the Runner and GUI components.
- Updated logging mechanism to streamline log message handling and improve readability.
- Introduced a new method for appending log lines in the Runner class.
- Cleaned up related GUI elements and configuration options in web interface.
- Deleted obsolete simulation scripts related to reservation preemption checks.
2026-01-07 21:24:10 +08:00
Your Name c6b6745e3e feat: 优化日志记录格式,增强循环次数和运行时间限制的可读性 2026-01-07 19:06:10 +08:00
Your Name c6eb76845f feat: 优化代码格式,提升可读性和一致性 2026-01-06 22:39:58 +08:00
Your Name 68295e564e feat: 优化配置和日志提取逻辑,增强用户体验和数据准确性 2026-01-06 22:39:27 +08:00
Your Name 43e39f4db6 feat: 添加工具以查找重复的异常处理,增强代码质量检查;新增验证 GUI 回退方式的自检脚本 2026-01-05 21:32:50 +08:00
Your Name 6121154370 feat: 更新配置文件路径,重构配置管理逻辑,增强配置文件的兼容性和可读性 2026-01-04 16:27:19 +08:00
Your Name 6b9b02bd58 feat: 增强福袋参与和预约管理功能,添加统计记录和优化配置参数 2026-01-04 11:31:54 +08:00
Your Name c0df59ac26 feat: 优化安全数据处理逻辑,确保 detail 数据的稳定性和类型安全 2026-01-04 10:18:51 +08:00
Your Name 9e08ed3bd0 chore: remove OCR archive, delete collect_ocr_failures, update docs 2026-01-03 03:50:45 +08:00
Your Name 0b5f150691 Refactor and clean up code across multiple scripts
- Removed trailing whitespace and ensured files end with a single newline in cleanup_unused_files.py.
- Added fix_trailing_whitespace.py to batch remove trailing whitespace from Python files.
- Updated install_dependencies.py to improve dependency installation prompts.
- Cleaned up pick_coords.py by removing unnecessary whitespace and improving code readability.
- Enhanced region_selector.py by disabling specific pylint checks for better compatibility with third-party libraries.
- Improved WPS流程图生成工具.py by cleaning up whitespace and enhancing readability.
- Updated __init__.py in typings to remove unnecessary lines.
- Modified app.js to adjust default configuration values and clean up unused code.
2026-01-02 23:57:03 +08:00
Your Name a0aad21835 feat: Optimize ADB exec-out and OCR performance
- Introduced performance enhancements for ADB exec-out, reducing execution time by 10-20% through the use of Popen with streaming reads, increased buffer sizes, and removal of unnecessary fsync calls.
- Implemented optimizations in OCR processing, cutting recognition time by 50% by refining button recognition logic and improving image loading and preprocessing methods.
- Added detailed performance diagnostics and configuration options to facilitate further optimizations.
- Created new documentation files outlining the performance improvements and recommendations for future enhancements.
2026-01-02 02:06:01 +08:00
Your Name 223c127e11 chore: Clean up and refactor codebase for improved maintainability
- Removed obsolete command-line test parameters from `run_cli.py` to streamline functionality.
- Introduced a new `ocr_preprocess.py` module for unified OCR image preprocessing, enhancing recognition stability.
- Updated various components to utilize the new preprocessing function, improving code organization and readability.
- Adjusted configuration values in `config.json` for better performance and consistency.
- Added comprehensive technical documentation for the Douyin project, detailing code modification standards and operational guidelines.
- Cleaned up excessive blank lines across multiple files to enhance overall readability.
2025-12-30 23:11:34 +08:00
Your Name bdf9312bc9 chore: Remove obsolete scripts and enhance path configuration
- Deleted `check_md_files.py` and `fix_cursor_md_issue.py` as they are no longer needed.
- Added new functions in `path_config.py` for better path management, including actions log and run_cli paths.
- Updated various modules to utilize the new path configuration, ensuring consistency and maintainability across the project.
2025-12-28 20:55:34 +08:00
Your Name b9849b9f5a chore: Remove obsolete scripts and enhance path configuration
- Deleted `check_md_files.py` and `fix_cursor_md_issue.py` as they are no longer needed.
- Added new functions in `path_config.py` for better path management, including actions log and run_cli paths.
- Updated various modules to utilize the unified path configuration, ensuring backward compatibility and improved maintainability.
- Enhanced documentation in `README.md` to reflect changes in path management and project structure.
2025-12-28 20:47:30 +08:00
Your Name c67f22f76f feat: Refactor and reorganize project structure with new modules and files
- Deleted obsolete files including test scripts and configuration files to streamline the project.
- Introduced new modules for handling Douyin functionalities, including core operations, logging, and GUI components.
- Updated import paths to reflect the new module structure, enhancing code organization and maintainability.
- Added configuration files and documentation to support the new structure and improve user guidance.
2025-12-28 14:16:40 +08:00