mobile-mcp-ai 2.7.4__tar.gz → 2.7.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {mobile_mcp_ai-2.7.4/mobile_mcp_ai.egg-info → mobile_mcp_ai-2.7.5}/PKG-INFO +1 -1
- {mobile_mcp_ai-2.7.4 → mobile_mcp_ai-2.7.5}/core/basic_tools_lite.py +32 -1
- {mobile_mcp_ai-2.7.4 → mobile_mcp_ai-2.7.5/mobile_mcp_ai.egg-info}/PKG-INFO +1 -1
- {mobile_mcp_ai-2.7.4 → mobile_mcp_ai-2.7.5}/setup.py +1 -1
- {mobile_mcp_ai-2.7.4 → mobile_mcp_ai-2.7.5}/LICENSE +0 -0
- {mobile_mcp_ai-2.7.4 → mobile_mcp_ai-2.7.5}/MANIFEST.in +0 -0
- {mobile_mcp_ai-2.7.4 → mobile_mcp_ai-2.7.5}/README.md +0 -0
- {mobile_mcp_ai-2.7.4 → mobile_mcp_ai-2.7.5}/__init__.py +0 -0
- {mobile_mcp_ai-2.7.4 → mobile_mcp_ai-2.7.5}/config.py +0 -0
- {mobile_mcp_ai-2.7.4 → mobile_mcp_ai-2.7.5}/core/__init__.py +0 -0
- {mobile_mcp_ai-2.7.4 → mobile_mcp_ai-2.7.5}/core/device_manager.py +0 -0
- {mobile_mcp_ai-2.7.4 → mobile_mcp_ai-2.7.5}/core/dynamic_config.py +0 -0
- {mobile_mcp_ai-2.7.4 → mobile_mcp_ai-2.7.5}/core/ios_client_wda.py +0 -0
- {mobile_mcp_ai-2.7.4 → mobile_mcp_ai-2.7.5}/core/ios_device_manager_wda.py +0 -0
- {mobile_mcp_ai-2.7.4 → mobile_mcp_ai-2.7.5}/core/mobile_client.py +0 -0
- {mobile_mcp_ai-2.7.4 → mobile_mcp_ai-2.7.5}/core/template_matcher.py +0 -0
- {mobile_mcp_ai-2.7.4 → mobile_mcp_ai-2.7.5}/core/templates/close_buttons/auto_x_0112_151217.png +0 -0
- {mobile_mcp_ai-2.7.4 → mobile_mcp_ai-2.7.5}/core/templates/close_buttons/auto_x_0112_152037.png +0 -0
- {mobile_mcp_ai-2.7.4 → mobile_mcp_ai-2.7.5}/core/templates/close_buttons/auto_x_0112_152840.png +0 -0
- {mobile_mcp_ai-2.7.4 → mobile_mcp_ai-2.7.5}/core/templates/close_buttons/auto_x_0112_153256.png +0 -0
- {mobile_mcp_ai-2.7.4 → mobile_mcp_ai-2.7.5}/core/templates/close_buttons/auto_x_0112_154847.png +0 -0
- {mobile_mcp_ai-2.7.4 → mobile_mcp_ai-2.7.5}/core/templates/close_buttons/gray_x_stock_ad.png +0 -0
- {mobile_mcp_ai-2.7.4 → mobile_mcp_ai-2.7.5}/core/utils/__init__.py +0 -0
- {mobile_mcp_ai-2.7.4 → mobile_mcp_ai-2.7.5}/core/utils/logger.py +0 -0
- {mobile_mcp_ai-2.7.4 → mobile_mcp_ai-2.7.5}/core/utils/operation_history_manager.py +0 -0
- {mobile_mcp_ai-2.7.4 → mobile_mcp_ai-2.7.5}/core/utils/smart_wait.py +0 -0
- {mobile_mcp_ai-2.7.4 → mobile_mcp_ai-2.7.5}/docs/iOS_SETUP_GUIDE.md +0 -0
- {mobile_mcp_ai-2.7.4 → mobile_mcp_ai-2.7.5}/mcp_tools/__init__.py +0 -0
- {mobile_mcp_ai-2.7.4 → mobile_mcp_ai-2.7.5}/mcp_tools/mcp_server.py +0 -0
- {mobile_mcp_ai-2.7.4 → mobile_mcp_ai-2.7.5}/mobile_mcp_ai.egg-info/SOURCES.txt +0 -0
- {mobile_mcp_ai-2.7.4 → mobile_mcp_ai-2.7.5}/mobile_mcp_ai.egg-info/dependency_links.txt +0 -0
- {mobile_mcp_ai-2.7.4 → mobile_mcp_ai-2.7.5}/mobile_mcp_ai.egg-info/entry_points.txt +0 -0
- {mobile_mcp_ai-2.7.4 → mobile_mcp_ai-2.7.5}/mobile_mcp_ai.egg-info/not-zip-safe +0 -0
- {mobile_mcp_ai-2.7.4 → mobile_mcp_ai-2.7.5}/mobile_mcp_ai.egg-info/requires.txt +0 -0
- {mobile_mcp_ai-2.7.4 → mobile_mcp_ai-2.7.5}/mobile_mcp_ai.egg-info/top_level.txt +0 -0
- {mobile_mcp_ai-2.7.4 → mobile_mcp_ai-2.7.5}/requirements.txt +0 -0
- {mobile_mcp_ai-2.7.4 → mobile_mcp_ai-2.7.5}/setup.cfg +0 -0
- {mobile_mcp_ai-2.7.4 → mobile_mcp_ai-2.7.5}/templates/close_buttons/auto_x_0112_151217.png +0 -0
- {mobile_mcp_ai-2.7.4 → mobile_mcp_ai-2.7.5}/templates/close_buttons/auto_x_0112_152037.png +0 -0
- {mobile_mcp_ai-2.7.4 → mobile_mcp_ai-2.7.5}/templates/close_buttons/auto_x_0112_152840.png +0 -0
- {mobile_mcp_ai-2.7.4 → mobile_mcp_ai-2.7.5}/templates/close_buttons/auto_x_0112_153256.png +0 -0
- {mobile_mcp_ai-2.7.4 → mobile_mcp_ai-2.7.5}/templates/close_buttons/auto_x_0112_154847.png +0 -0
- {mobile_mcp_ai-2.7.4 → mobile_mcp_ai-2.7.5}/templates/close_buttons/gray_x_stock_ad.png +0 -0
- {mobile_mcp_ai-2.7.4 → mobile_mcp_ai-2.7.5}/utils/__init__.py +0 -0
- {mobile_mcp_ai-2.7.4 → mobile_mcp_ai-2.7.5}/utils/logger.py +0 -0
- {mobile_mcp_ai-2.7.4 → mobile_mcp_ai-2.7.5}/utils/xml_formatter.py +0 -0
- {mobile_mcp_ai-2.7.4 → mobile_mcp_ai-2.7.5}/utils/xml_parser.py +0 -0
|
@@ -3328,7 +3328,7 @@ class BasicMobileToolsLite:
|
|
|
3328
3328
|
pass
|
|
3329
3329
|
|
|
3330
3330
|
if not close_candidates:
|
|
3331
|
-
#
|
|
3331
|
+
# 兜底策略1:如果检测到弹窗但未找到关闭按钮,且页面元素很少(只有1个可点击元素),直接点击它
|
|
3332
3332
|
if popup_detected and popup_bounds and len(all_clickable_elements) == 1:
|
|
3333
3333
|
single_element = all_clickable_elements[0]
|
|
3334
3334
|
self.client.u2.click(single_element['center_x'], single_element['center_y'])
|
|
@@ -3354,6 +3354,37 @@ class BasicMobileToolsLite:
|
|
|
3354
3354
|
result["returned"] = return_result['success']
|
|
3355
3355
|
return result
|
|
3356
3356
|
|
|
3357
|
+
# 兜底策略2:即使未检测到弹窗,如果页面只有一个可点击元素,也尝试点击它(可能是特殊类型的弹窗)
|
|
3358
|
+
# 这种情况通常出现在:下载浮层、特殊弹窗等,它们的 resource-id 可能不包含 dialog/popup 等关键词
|
|
3359
|
+
if len(all_clickable_elements) == 1:
|
|
3360
|
+
single_element = all_clickable_elements[0]
|
|
3361
|
+
# 检查元素是否占据较大屏幕区域(可能是弹窗)
|
|
3362
|
+
element_area_ratio = (single_element['width'] * single_element['height']) / (screen_width * screen_height)
|
|
3363
|
+
# 如果元素占据屏幕 20% 以上,认为是可能的弹窗
|
|
3364
|
+
if element_area_ratio > 0.2:
|
|
3365
|
+
self.client.u2.click(single_element['center_x'], single_element['center_y'])
|
|
3366
|
+
time.sleep(0.5)
|
|
3367
|
+
|
|
3368
|
+
# 检查应用是否跳转
|
|
3369
|
+
app_check = self._check_app_switched()
|
|
3370
|
+
return_result = None
|
|
3371
|
+
if app_check['switched']:
|
|
3372
|
+
return_result = self._return_to_target_app()
|
|
3373
|
+
|
|
3374
|
+
# 记录操作
|
|
3375
|
+
rel_x = single_element['center_x'] / screen_width
|
|
3376
|
+
rel_y = single_element['center_y'] / screen_height
|
|
3377
|
+
self._record_click('percent', f"{round(rel_x * 100, 1)}%,{round(rel_y * 100, 1)}%",
|
|
3378
|
+
round(rel_x * 100, 1), round(rel_y * 100, 1),
|
|
3379
|
+
element_desc="唯一可点击元素(特殊弹窗兜底)")
|
|
3380
|
+
|
|
3381
|
+
result = {"success": True, "clicked": True, "method": "single_clickable_special_popup_fallback"}
|
|
3382
|
+
if app_check['switched']:
|
|
3383
|
+
result["switched"] = True
|
|
3384
|
+
if return_result:
|
|
3385
|
+
result["returned"] = return_result['success']
|
|
3386
|
+
return result
|
|
3387
|
+
|
|
3357
3388
|
# 如果没有找到关闭按钮,且不满足兜底条件,返回fallback
|
|
3358
3389
|
if popup_detected and popup_bounds:
|
|
3359
3390
|
return {"success": False, "fallback": "vision", "popup": True}
|
|
@@ -25,7 +25,7 @@ if requirements_file.exists():
|
|
|
25
25
|
|
|
26
26
|
setup(
|
|
27
27
|
name="mobile-mcp-ai",
|
|
28
|
-
version="2.7.
|
|
28
|
+
version="2.7.5", # 优化弹窗关闭逻辑:添加特殊弹窗兜底策略
|
|
29
29
|
author="douzi",
|
|
30
30
|
author_email="1492994674@qq.com",
|
|
31
31
|
description="移动端自动化 MCP Server - 支持 Android/iOS,AI 功能可选(基础工具不需要 AI)",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mobile_mcp_ai-2.7.4 → mobile_mcp_ai-2.7.5}/core/templates/close_buttons/auto_x_0112_151217.png
RENAMED
|
File without changes
|
{mobile_mcp_ai-2.7.4 → mobile_mcp_ai-2.7.5}/core/templates/close_buttons/auto_x_0112_152037.png
RENAMED
|
File without changes
|
{mobile_mcp_ai-2.7.4 → mobile_mcp_ai-2.7.5}/core/templates/close_buttons/auto_x_0112_152840.png
RENAMED
|
File without changes
|
{mobile_mcp_ai-2.7.4 → mobile_mcp_ai-2.7.5}/core/templates/close_buttons/auto_x_0112_153256.png
RENAMED
|
File without changes
|
{mobile_mcp_ai-2.7.4 → mobile_mcp_ai-2.7.5}/core/templates/close_buttons/auto_x_0112_154847.png
RENAMED
|
File without changes
|
{mobile_mcp_ai-2.7.4 → mobile_mcp_ai-2.7.5}/core/templates/close_buttons/gray_x_stock_ad.png
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|