mobile-mcp-ai 2.4.2__py3-none-any.whl → 2.4.3__py3-none-any.whl
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/core/basic_tools_lite.py +46 -14
- mobile_mcp/core/ios_client_wda.py +8 -0
- {mobile_mcp_ai-2.4.2.dist-info → mobile_mcp_ai-2.4.3.dist-info}/METADATA +1 -1
- {mobile_mcp_ai-2.4.2.dist-info → mobile_mcp_ai-2.4.3.dist-info}/RECORD +8 -8
- {mobile_mcp_ai-2.4.2.dist-info → mobile_mcp_ai-2.4.3.dist-info}/WHEEL +0 -0
- {mobile_mcp_ai-2.4.2.dist-info → mobile_mcp_ai-2.4.3.dist-info}/entry_points.txt +0 -0
- {mobile_mcp_ai-2.4.2.dist-info → mobile_mcp_ai-2.4.3.dist-info}/licenses/LICENSE +0 -0
- {mobile_mcp_ai-2.4.2.dist-info → mobile_mcp_ai-2.4.3.dist-info}/top_level.txt +0 -0
|
@@ -387,17 +387,23 @@ class BasicMobileToolsLite:
|
|
|
387
387
|
|
|
388
388
|
if popup_bounds:
|
|
389
389
|
px1, py1, px2, py2 = popup_bounds
|
|
390
|
+
popup_width = px2 - px1
|
|
391
|
+
popup_height = py2 - py1
|
|
390
392
|
|
|
391
393
|
# 绘制弹窗边框(蓝色)
|
|
392
394
|
draw.rectangle([px1, py1, px2, py2], outline=(0, 100, 255, 200), width=3)
|
|
393
395
|
draw.text((px1 + 5, py1 + 5), f"弹窗区域", fill=(0, 100, 255), font=font)
|
|
394
396
|
|
|
395
|
-
# 计算可能的 X
|
|
397
|
+
# 计算可能的 X 按钮位置(基于弹窗尺寸动态计算,适配不同分辨率)
|
|
398
|
+
offset_x = max(25, int(popup_width * 0.05)) # 宽度的5%,最小25px
|
|
399
|
+
offset_y = max(25, int(popup_height * 0.04)) # 高度的4%,最小25px
|
|
400
|
+
outer_offset = max(15, int(popup_width * 0.025)) # 外部偏移
|
|
401
|
+
|
|
396
402
|
close_positions = [
|
|
397
|
-
{"name": "
|
|
398
|
-
{"name": "
|
|
399
|
-
{"name": "正上方", "x": (px1 + px2) // 2, "y": py1 -
|
|
400
|
-
{"name": "底部下方", "x": (px1 + px2) // 2, "y": py2 +
|
|
403
|
+
{"name": "右上角内", "x": px2 - offset_x, "y": py1 + offset_y, "priority": 1},
|
|
404
|
+
{"name": "右上角外", "x": px2 + outer_offset, "y": py1 - outer_offset, "priority": 2},
|
|
405
|
+
{"name": "正上方", "x": (px1 + px2) // 2, "y": py1 - offset_y, "priority": 3},
|
|
406
|
+
{"name": "底部下方", "x": (px1 + px2) // 2, "y": py2 + offset_y, "priority": 4},
|
|
401
407
|
]
|
|
402
408
|
|
|
403
409
|
# 绘制可能的 X 按钮位置(绿色圆圈 + 数字)
|
|
@@ -647,12 +653,25 @@ class BasicMobileToolsLite:
|
|
|
647
653
|
# 如果检测到弹窗,始终添加 X 按钮位置提示
|
|
648
654
|
if popup_bounds:
|
|
649
655
|
px1, py1, px2, py2 = popup_bounds
|
|
656
|
+
popup_width = px2 - px1
|
|
657
|
+
popup_height = py2 - py1
|
|
658
|
+
|
|
659
|
+
# 计算多个可能的 X 按钮位置(基于弹窗尺寸动态计算)
|
|
660
|
+
# 【优化】X按钮有三种常见位置:
|
|
661
|
+
# 1. 弹窗边界上方(浮动X按钮)
|
|
662
|
+
# 2. 弹窗内靠近顶部边界(内嵌X按钮)
|
|
663
|
+
# 3. 弹窗正下方(底部关闭按钮)
|
|
664
|
+
offset_x = max(60, int(popup_width * 0.07)) # 宽度7%,距右边界
|
|
665
|
+
offset_y_above = max(35, int(popup_height * 0.025)) # 高度2.5%,在顶边界之上
|
|
666
|
+
offset_y_near = max(45, int(popup_height * 0.03)) # 高度3%,紧贴顶边界内侧
|
|
650
667
|
|
|
651
|
-
# 计算多个可能的 X 按钮位置(基于弹窗边界)
|
|
652
668
|
close_positions = [
|
|
653
|
-
|
|
654
|
-
{"name": "
|
|
655
|
-
|
|
669
|
+
# 【最高优先级】弹窗内紧贴顶部边界(大多数X按钮在这里)
|
|
670
|
+
{"name": "右上角", "x": px2 - offset_x, "y": py1 + offset_y_near},
|
|
671
|
+
# 弹窗边界上方(浮动X按钮)
|
|
672
|
+
{"name": "右上浮", "x": px2 - offset_x, "y": py1 - offset_y_above},
|
|
673
|
+
# 弹窗正下方中间(底部关闭按钮)
|
|
674
|
+
{"name": "正下方", "x": (px1 + px2) // 2, "y": py2 + max(50, int(popup_height * 0.04))},
|
|
656
675
|
]
|
|
657
676
|
|
|
658
677
|
# 用黄色/金色标注这些可能位置(始终显示)
|
|
@@ -2200,13 +2219,26 @@ class BasicMobileToolsLite:
|
|
|
2200
2219
|
# 如果检测到弹窗区域,先尝试点击常见的关闭按钮位置
|
|
2201
2220
|
if popup_bounds:
|
|
2202
2221
|
px1, py1, px2, py2 = popup_bounds
|
|
2222
|
+
popup_width = px2 - px1
|
|
2223
|
+
popup_height = py2 - py1
|
|
2224
|
+
|
|
2225
|
+
# 【优化】X按钮有三种常见位置:
|
|
2226
|
+
# 1. 弹窗内靠近顶部边界(内嵌X按钮)- 最常见
|
|
2227
|
+
# 2. 弹窗边界上方(浮动X按钮)
|
|
2228
|
+
# 3. 弹窗正下方(底部关闭按钮)
|
|
2229
|
+
offset_x = max(60, int(popup_width * 0.07)) # 宽度7%
|
|
2230
|
+
offset_y_above = max(35, int(popup_height * 0.025)) # 高度2.5%,在边界之上
|
|
2231
|
+
offset_y_near = max(45, int(popup_height * 0.03)) # 高度3%,紧贴顶边界内侧
|
|
2203
2232
|
|
|
2204
|
-
# 常见的关闭按钮位置
|
|
2205
2233
|
try_positions = [
|
|
2206
|
-
|
|
2207
|
-
(px2 -
|
|
2208
|
-
|
|
2209
|
-
(
|
|
2234
|
+
# 【最高优先级】弹窗内紧贴顶部边界
|
|
2235
|
+
(px2 - offset_x, py1 + offset_y_near, "弹窗右上角"),
|
|
2236
|
+
# 弹窗边界上方(浮动X按钮)
|
|
2237
|
+
(px2 - offset_x, py1 - offset_y_above, "弹窗右上浮"),
|
|
2238
|
+
# 弹窗正下方中间(底部关闭按钮)
|
|
2239
|
+
((px1 + px2) // 2, py2 + max(50, int(popup_height * 0.04)), "弹窗下方中间"),
|
|
2240
|
+
# 弹窗正上方中间
|
|
2241
|
+
((px1 + px2) // 2, py1 - 40, "弹窗正上方"),
|
|
2210
2242
|
]
|
|
2211
2243
|
|
|
2212
2244
|
for try_x, try_y, position_name in try_positions:
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
mobile_mcp/__init__.py,sha256=sQJZTL_sxQFzmcS7jOtS2AHCfUySz40vhX96N6u1qy4,816
|
|
2
2
|
mobile_mcp/config.py,sha256=yaFLAV4bc2wX0GQPtZDo7OYF9E88tXV-av41fQsJwK4,4480
|
|
3
3
|
mobile_mcp/core/__init__.py,sha256=ndMy-cLAIsQDG5op7gM_AIplycqZSZPWEkec1pEhvEY,170
|
|
4
|
-
mobile_mcp/core/basic_tools_lite.py,sha256=
|
|
4
|
+
mobile_mcp/core/basic_tools_lite.py,sha256=WNtNUFy7MOPaD7rl7fZFE01wj7ruDpnNHBTsJKx7n60,130899
|
|
5
5
|
mobile_mcp/core/device_manager.py,sha256=PX3-B5bJFnKNt6C8fT7FSY8JwD-ngZ3toF88bcOV9qA,8766
|
|
6
6
|
mobile_mcp/core/dynamic_config.py,sha256=Ja1n1pfb0HspGByqk2_A472mYVniKmGtNEWyjUjmgK8,9811
|
|
7
|
-
mobile_mcp/core/ios_client_wda.py,sha256=
|
|
7
|
+
mobile_mcp/core/ios_client_wda.py,sha256=dXs6KDUZrQxT_4t8-VBGN5EnmpVCRsPHOmD5NmDCwWA,18769
|
|
8
8
|
mobile_mcp/core/ios_device_manager_wda.py,sha256=A44glqI-24un7qST-E3w6BQD8mV92YVUbxy4rLlTScY,11264
|
|
9
9
|
mobile_mcp/core/mobile_client.py,sha256=bno3HvU-QSAC3G4TnoFngTxqXeu-ZP5rGlEWdWh8jOo,62570
|
|
10
10
|
mobile_mcp/core/utils/__init__.py,sha256=RhMMsPszmEn8Q8GoNufypVSHJxyM9lio9U6jjpnuoPI,378
|
|
@@ -17,9 +17,9 @@ mobile_mcp/utils/__init__.py,sha256=8EH0i7UGtx1y_j_GEgdN-cZdWn2sRtZSEOLlNF9HRnY,
|
|
|
17
17
|
mobile_mcp/utils/logger.py,sha256=Sqq2Nr0Y4p03erqcrbYKVPCGiFaNGHMcE_JwCkeOfU4,3626
|
|
18
18
|
mobile_mcp/utils/xml_formatter.py,sha256=uwTRb3vLbqhT8O-udzWT7s7LsV-DyDUz2DkofD3hXOE,4556
|
|
19
19
|
mobile_mcp/utils/xml_parser.py,sha256=QhL8CWbdmNDzmBLjtx6mEnjHgMFZzJeHpCL15qfXSpI,3926
|
|
20
|
-
mobile_mcp_ai-2.4.
|
|
21
|
-
mobile_mcp_ai-2.4.
|
|
22
|
-
mobile_mcp_ai-2.4.
|
|
23
|
-
mobile_mcp_ai-2.4.
|
|
24
|
-
mobile_mcp_ai-2.4.
|
|
25
|
-
mobile_mcp_ai-2.4.
|
|
20
|
+
mobile_mcp_ai-2.4.3.dist-info/licenses/LICENSE,sha256=HrhfyXIkWY2tGFK11kg7vPCqhgh5DcxleloqdhrpyMY,11558
|
|
21
|
+
mobile_mcp_ai-2.4.3.dist-info/METADATA,sha256=Rtv9Nly-13_zoASQ_nX5ML3R4bZo21OFOsms6bNLC1g,9745
|
|
22
|
+
mobile_mcp_ai-2.4.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
23
|
+
mobile_mcp_ai-2.4.3.dist-info/entry_points.txt,sha256=KB_FglozgPHBprSM1vFbIzGyheFuHFmGanscRdMJ_8A,68
|
|
24
|
+
mobile_mcp_ai-2.4.3.dist-info/top_level.txt,sha256=lLm6YpbTv855Lbh8BIA0rPxhybIrvYUzMEk9OErHT94,11
|
|
25
|
+
mobile_mcp_ai-2.4.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|