Skip to content

Automated PR 2026.08.28 - #1758

Merged
runhey merged 13 commits into
masterfrom
dev
Aug 31, 2026
Merged

Automated PR 2026.08.28#1758
runhey merged 13 commits into
masterfrom
dev

Conversation

@github-actions

@github-actions github-actions Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Automated PR created by GitHub Actions. Merge dev into master

Sourcery 摘要

提升自动化操作的真实性和调度安全性,同时扩展诊断、战斗处理和游戏内容支持。

新功能:

  • 添加可配置的防封号调度功能,支持睡眠时间段、每日活动时长限制和休息时间。
  • 添加注重隐私的诊断导出接口,用于打包经过脱敏的配置摘要和近期日志。
  • 扩展式神皮肤支持,新增一套式神皮肤及相关资源。
  • 引入可复用、由策略驱动的战斗完成和奖励处理流程。
  • 为结界利用任务添加可配置的最小执行间隔,并支持新的 Duel 和游戏 UI 资源。

错误修复:

  • 更新受影响的图像和 OCR 区域,以适配当前游戏布局。
  • 成功点击区域后增加延迟,提升交互可靠性。

改进:

  • 在点击、滑动、拖动和长按操作中模拟更真实的设备交互,使坐标、压力和时序更加多样化。
  • 重构通用战斗等待逻辑,改用基于共享策略的战斗流程。

杂项:

  • 更新中文本地化内容及相关任务图像元数据。
Original summary in English

Summary by Sourcery

Improve automation realism and scheduling safeguards while expanding diagnostics, battle handling, and game-content support.

New Features:

  • Add configurable anti-ban scheduling with sleep windows, daily activity limits, and rest periods.
  • Add a privacy-conscious diagnostic export endpoint that packages sanitized configuration summaries and recent logs.
  • Extend costume support with a new Shikigami costume set and associated assets.
  • Introduce a reusable, strategy-driven battle completion and reward-handling flow.
  • Add configurable minimum intervals for Kekkai utilization runs and support new Duel and game UI assets.

Bug Fixes:

  • Update affected image and OCR regions to reflect current game layouts.
  • Add a delay after successful area clicks to improve interaction reliability.

Enhancements:

  • Humanize device interactions across click, swipe, drag, and long-press operations with varied coordinates, pressure, and timing.
  • Refactor general battle waiting to use the shared strategy-based battle flow.

Chores:

  • Update Chinese localization and related task image metadata.

smallwin-jq and others added 13 commits August 21, 2026 17:24
feat(Component):增加幕间“花札幕台”
…s-roi-dev

修复契光水境式神录识别区域
fix(Duel_Try): 添加队伍试用图像资源及相关规则
- define hook-based battle plans with configurable execution sequences
- support decorator and context manager overrides for battle wait strategies
- add default handlers for battle completion, settlement, failure, and idle actions
- 点击/滑动拟人化: 坐标均匀分布改为高斯(向按钮中心聚集); minitouch/scrcpy/
  nemu_ipc 点击加真实按压时长+抬起前微动+压力抖动(压力钳制到设备范围),
  滑动改为变节奏。修掉每次点击 dwell≈0、压力恒定这类可识别特征。
- 新增全局作息约束(默认关): 睡眠时间窗/累计活跃上限/强制休息。在调度器取任务处
  加 gate 抬高唤醒时间, 复用现有空闲策略关游戏/模拟器, 支持跨午夜与配置热重载。
- 结界蹭卡新增可选的最小再运行间隔(默认0=不改现状), 压制过高的蹭卡频率。
- 新增一键诊断导出: /home/export_diagnostic 打包脱敏后的关键配置与最近日志成 zip,
  便于反馈排查风控问题(脱敏账号/token/密码/手机号)。
- add hook signals and dynamic battle wait plan overrides
- integrate strategy-based battle waiting into GeneralBattle
- migrate ActivityShikigami battle handling to the new strategy framework
feat: 防风控加固与一键诊断导出

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

嘿——我发现了 2 个问题

面向 AI Agent 的提示
请处理这次代码审查中的评论:

## 单独评论

### 评论 1
<location path="tasks/Component/GeneralBattle/battle_wait.py" line_range="247-261" />
<code_context>
+            if kwargs:
</code_context>
<issue_to_address>
**issue (bug_risk):** 装饰器在调用被包装的战斗等待方法时丢弃了位置参数。`GeneralBattle.run_general_battle` 以位置参数方式调用 `self.battle_wait(config.random_click_swipt_enable)`,但 `inner` 忽略了 `args`,仅使用 `battle_wait_plan` 调用被包装函数,因此针对 `random_click_swipt_enable` 的 ActivityShikigami 兼容性处理永远不会被激活,请求的随机点击行为也会丢失。

**触发条件:** 当使用现有的位置参数 `random_click_swipt_enable` 调用 `battle_wait` 时。

**建议修复:** 保留并传递位置参数,或者在应用兼容性覆盖逻辑之前,明确将第一个位置参数映射到 `random_click_swipt_enable`。
</issue_to_address>

### 评论 2
<location path="tasks/Component/GeneralBattle/battle_wait.py" line_range="357-361" />
<code_context>
+    def _bw_success_soul(self, bw_ctx: BattleWaitContext) -> HookSignal:
+        if self.appear_then_click(self.I_WIN, interval=0.8):
+            return HookSignal.CONTINUE
+        appear_ghost, appear_reward, appear_gold, appear_skin = (
+            self.appear(self.I_GREED_GHOST),
+            self.appear(self.I_REWARD),
+            self.appear(self.I_REWARD_GOLD),
+            self.appear(self.I_REWARD_GOLD_SNAKE_SKIN)
+        )
+        if not any([appear_ghost, appear_reward, appear_gold, appear_skin]):
</code_context>
<issue_to_address>
**issue (broader_impact):** 魂战成功处理器不再识别 `I_REWARD_PURPLE_SNAKE_SKIN`,尽管被替换的 ActivityShikigami 实现会处理该奖励。当显示紫色蛇皮奖励时,`_bw_success_soul` 会使 `bw_ctx.completion` 保持为 false,外层战斗循环会无限继续,而不是领取奖励并结束。

**触发条件:** 当战斗产生紫色蛇皮奖励时。

**建议修复:** 在两个奖励检测元组中都加入 `I_REWARD_PURPLE_SNAKE_SKIN`,或者提供等效的自定义奖励钩子。
</issue_to_address>

Sourcery 评估

需要人工审查。 需要先处理 2 个发现;此外,新的未认证诊断端点会创建包含配置和近期日志的持久 ZIP 压缩包,而正则清理器可能会遗漏凭据或其他敏感值;即使回滚代码,也不会删除已经创建的压缩包或已经下载的副本。战斗等待重构以及调度器/输入变更也会广泛改变运行时行为,但这些故障通常可以通过回滚代码来恢复。

阻塞性发现:tasks/Component/GeneralBattle/battle_wait.py:261tasks/Component/GeneralBattle/battle_wait.py:361


Sourcery 对开源项目免费——如果您喜欢我们的审查,请考虑分享 ✨
帮我变得更有用!请在每条评论上点击 👍 或 👎,我会利用反馈来改进审查结果。
Original comment in English

Hey - I've found 2 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="tasks/Component/GeneralBattle/battle_wait.py" line_range="247-261" />
<code_context>
+            if kwargs:
</code_context>
<issue_to_address>
**issue (bug_risk):** The decorator drops positional arguments when invoking the wrapped battle-wait method. `GeneralBattle.run_general_battle` calls `self.battle_wait(config.random_click_swipt_enable)` positionally, but `inner` ignores `args` and calls the wrapped function only with `battle_wait_plan`, so the ActivityShikigami compatibility handling for `random_click_swipt_enable` is never activated and the requested random-click behavior is lost.

**Triggers:** When `battle_wait` is called with the existing positional `random_click_swipt_enable` argument.

**Suggested fix:** Preserve and forward positional arguments, or explicitly map the first positional argument to `random_click_swipt_enable` before applying the compatibility override.
</issue_to_address>

### Comment 2
<location path="tasks/Component/GeneralBattle/battle_wait.py" line_range="357-361" />
<code_context>
+    def _bw_success_soul(self, bw_ctx: BattleWaitContext) -> HookSignal:
+        if self.appear_then_click(self.I_WIN, interval=0.8):
+            return HookSignal.CONTINUE
+        appear_ghost, appear_reward, appear_gold, appear_skin = (
+            self.appear(self.I_GREED_GHOST),
+            self.appear(self.I_REWARD),
+            self.appear(self.I_REWARD_GOLD),
+            self.appear(self.I_REWARD_GOLD_SNAKE_SKIN)
+        )
+        if not any([appear_ghost, appear_reward, appear_gold, appear_skin]):
</code_context>
<issue_to_address>
**issue (broader_impact):** The soul battle success handler no longer recognizes `I_REWARD_PURPLE_SNAKE_SKIN`, although the replaced ActivityShikigami implementation handled that reward. When the purple snake-skin reward is displayed, `_bw_success_soul` leaves `bw_ctx.completion` false and the outer battle loop continues indefinitely instead of collecting the reward and finishing.

**Triggers:** When a battle produces the purple snake-skin reward.

**Suggested fix:** Include `I_REWARD_PURPLE_SNAKE_SKIN` in both reward-detection tuples, or provide an equivalent custom reward hook.
</issue_to_address>

Sourcery assessment

Needs a human reviewer. 2 findings to address first, and the new unauthenticated diagnostic endpoint creates persistent ZIP archives containing configuration and recent logs, and the regex scrubber can miss credentials or other sensitive values; reverting the code would not remove archives already created or copies already downloaded. The battle-wait refactor and scheduler/input changes also alter runtime behavior broadly, but those failures are normally reversible with a code rollback.

Blocking findings: tasks/Component/GeneralBattle/battle_wait.py:261, tasks/Component/GeneralBattle/battle_wait.py:361


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment on lines +247 to +261
if kwargs:
override_kwargs = {}
override_args = list()
for key, value in kwargs.items():
if key == 'random_click_swipt_enable' and value:
override_kwargs['randomclick'] = 'default'
override_args.append('randomclick_default')
battle_wait_strategy.battle_wait_plan =\
battle_wait_strategy.battle_wait_plan.override(*override_args)
# -----------------------------------------------------------------------
# kwargs.setdefault(
# 'battle_wait_plan',
# self.battle_wait_plan,
# )
return func(owner, battle_wait_plan=battle_wait_strategy.battle_wait_plan)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): 装饰器在调用被包装的战斗等待方法时丢弃了位置参数。GeneralBattle.run_general_battle 以位置参数方式调用 self.battle_wait(config.random_click_swipt_enable),但 inner 忽略了 args,仅使用 battle_wait_plan 调用被包装函数,因此针对 random_click_swipt_enable 的 ActivityShikigami 兼容性处理永远不会被激活,请求的随机点击行为也会丢失。

触发条件: 当使用现有的位置参数 random_click_swipt_enable 调用 battle_wait 时。

建议修复: 保留并传递位置参数,或者在应用兼容性覆盖逻辑之前,明确将第一个位置参数映射到 random_click_swipt_enable

Original comment in English

issue (bug_risk): The decorator drops positional arguments when invoking the wrapped battle-wait method. GeneralBattle.run_general_battle calls self.battle_wait(config.random_click_swipt_enable) positionally, but inner ignores args and calls the wrapped function only with battle_wait_plan, so the ActivityShikigami compatibility handling for random_click_swipt_enable is never activated and the requested random-click behavior is lost.

Triggers: When battle_wait is called with the existing positional random_click_swipt_enable argument.

Suggested fix: Preserve and forward positional arguments, or explicitly map the first positional argument to random_click_swipt_enable before applying the compatibility override.

Comment on lines +357 to +361
appear_ghost, appear_reward, appear_gold, appear_skin = (
self.appear(self.I_GREED_GHOST),
self.appear(self.I_REWARD),
self.appear(self.I_REWARD_GOLD),
self.appear(self.I_REWARD_GOLD_SNAKE_SKIN)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (broader_impact): 魂战成功处理器不再识别 I_REWARD_PURPLE_SNAKE_SKIN,尽管被替换的 ActivityShikigami 实现会处理该奖励。当显示紫色蛇皮奖励时,_bw_success_soul 会使 bw_ctx.completion 保持为 false,外层战斗循环会无限继续,而不是领取奖励并结束。

触发条件: 当战斗产生紫色蛇皮奖励时。

建议修复: 在两个奖励检测元组中都加入 I_REWARD_PURPLE_SNAKE_SKIN,或者提供等效的自定义奖励钩子。

Original comment in English

issue (broader_impact): The soul battle success handler no longer recognizes I_REWARD_PURPLE_SNAKE_SKIN, although the replaced ActivityShikigami implementation handled that reward. When the purple snake-skin reward is displayed, _bw_success_soul leaves bw_ctx.completion false and the outer battle loop continues indefinitely instead of collecting the reward and finishing.

Triggers: When a battle produces the purple snake-skin reward.

Suggested fix: Include I_REWARD_PURPLE_SNAKE_SKIN in both reward-detection tuples, or provide an equivalent custom reward hook.

@runhey
runhey merged commit 4e51560 into master Aug 31, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants