[codex] fix MuMu Pro detection for generic ADB serials#254
Conversation
审查者指南将显式 MuMuPro 配置视为 MuMu 家族(不再依赖 ADB serial),增加 boss 撤退处理,并调整若干与岛屿相关的 UI 素材、任务优先级以及辅助工具,以提升岛屿与地图交互的稳定性。 更新后的 is_mumu_family 检测流程图flowchart TD
A[is_mumu_family called] --> B{serial == 127.0.0.1:7555}
B -->|Yes| Z[return True]
B -->|No| C{is_mumu12_family}
C -->|Yes| Z
C -->|No| D{config.EmulatorInfo_Emulator == MuMuPro}
D -->|Yes| Z
D -->|No| Y[return False]
auto_search_combat_status 中 boss 撤退处理的流程图flowchart TD
A[auto_search_combat_status loop] --> B[device.screenshot]
B --> C{appear_then_click FLEET_WITHDRAW}
C -->|Yes| D[break]
C -->|No| E{appear FLEET_WITHDRAW_BOSS}
E -->|Yes| F[withdraw]
F --> D
E -->|No| G{appear_then_click SWITCH_OVER}
G -->|Yes| A
G -->|No| H[fleet_alive_multiple = False<br>exit loop]
文件级更改
提示与命令与 Sourcery 交互
自定义使用体验访问你的 控制面板 来:
获取帮助Original review guide in EnglishReviewer's GuideTreat explicit MuMuPro configuration as MuMu-family regardless of ADB serial, add boss-withdraw handling, and adjust several island-related UI assets, task priorities, and helper tooling for more robust island and map interactions. Flow diagram for updated is_mumu_family detectionflowchart TD
A[is_mumu_family called] --> B{serial == 127.0.0.1:7555}
B -->|Yes| Z[return True]
B -->|No| C{is_mumu12_family}
C -->|Yes| Z
C -->|No| D{config.EmulatorInfo_Emulator == MuMuPro}
D -->|Yes| Z
D -->|No| Y[return False]
Flow diagram for boss withdraw handling in auto_search_combat_statusflowchart TD
A[auto_search_combat_status loop] --> B[device.screenshot]
B --> C{appear_then_click FLEET_WITHDRAW}
C -->|Yes| D[break]
C -->|No| E{appear FLEET_WITHDRAW_BOSS}
E -->|Yes| F[withdraw]
F --> D
E -->|No| G{appear_then_click SWITCH_OVER}
G -->|Yes| A
G -->|No| H[fleet_alive_multiple = False<br>exit loop]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Code Review
This pull request introduces several updates to the Island module, including splitting the general Island task into specific sub-tasks in the task priority configurations, adding a button region editor tool, documenting an island feature expansion plan, and updating UI assets and page mappings. Additionally, it handles boss fleet withdrawals in combat search and adds macOS MuMu Pro support in device connection attributes. A review comment suggests adding a safe guard in module/device/connection_attr.py to prevent a potential AttributeError when self.config is None.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| return ( | ||
| self.serial == '127.0.0.1:7555' | ||
| or self.is_mumu12_family | ||
| or self.config.EmulatorInfo_Emulator == 'MuMuPro' | ||
| ) |
There was a problem hiding this comment.
If self.config is None (which can happen when instantiating ConnectionAttr in standalone scripts or tests without a full configuration), accessing self.config.EmulatorInfo_Emulator will raise an AttributeError. We should safely guard this check.
| return ( | |
| self.serial == '127.0.0.1:7555' | |
| or self.is_mumu12_family | |
| or self.config.EmulatorInfo_Emulator == 'MuMuPro' | |
| ) | |
| return ( | |
| self.serial == '127.0.0.1:7555' | |
| or self.is_mumu12_family | |
| or (self.config and self.config.EmulatorInfo_Emulator == 'MuMuPro') | |
| ) |
What changed
Treat devices explicitly configured as
MuMuProas part of the MuMu family, even when they expose a genericemulator-*ADB serial.Root cause
MuMu Pro on macOS can expose
emulator-5554instead of its usual127.0.0.1:16xxxserial.is_mumu_familypreviously identified MuMu only by serial and port, so this connection was classified as a generic emulator.As a result, DroidCast_raw skipped the MuMu-specific physical resolution and orientation handling. Its
720x1280RGB565 buffer was interpreted without the required rotation, producing a sideways1280x720screenshot and causing repeatedUnknown ui pageerrors.Impact
DroidCast and DroidCast_raw now apply their existing MuMu orientation handling when MuMu Pro is explicitly selected, while other emulators using
emulator-*serials remain unaffected.Validation
MuMuProemulator-5554720x12801is_mumu_familyandis_mumu_over_version_356were both false.1280x720.git diff --checkand compiledmodule/device/connection_attr.py.Summary by Sourcery
扩展岛屿自动化功能,并改进模拟器与战斗处理。
Bug Fixes(错误修复):
emulator-*ADB 序列号时,也将显式配置的 MuMu Pro 实例视为 MuMu 家族。Enhancements(功能增强):
IslandPlan。Documentation(文档):
Original summary in English
Summary by Sourcery
Extend island automation features and improve emulator and combat handling.
Bug Fixes:
Enhancements:
Documentation:
Original summary in English
Summary by Sourcery
扩展岛屿自动化功能,并改进模拟器与战斗处理。
Bug Fixes(错误修复):
emulator-*ADB 序列号时,也将显式配置的 MuMu Pro 实例视为 MuMu 家族。Enhancements(功能增强):
IslandPlan。Documentation(文档):
Original summary in English
Summary by Sourcery
Extend island automation features and improve emulator and combat handling.
Bug Fixes:
Enhancements:
Documentation: