MaaFw 2.0.3__py3-none-win_arm64.whl → 2.1.0__py3-none-win_arm64.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.
Potentially problematic release.
This version of MaaFw might be problematic. Click here for more details.
- {MaaFw-2.0.3.dist-info → MaaFw-2.1.0.dist-info}/METADATA +1 -1
- MaaFw-2.1.0.dist-info/RECORD +28 -0
- maa/bin/MaaAdbControlUnit.dll +0 -0
- maa/bin/MaaDbgControlUnit.dll +0 -0
- maa/bin/MaaFramework.dll +0 -0
- maa/bin/MaaToolkit.dll +0 -0
- maa/bin/MaaUtils.dll +0 -0
- maa/bin/MaaWin32ControlUnit.dll +0 -0
- maa/controller.py +3 -3
- maa/define.py +22 -0
- maa/notification_handler.py +15 -13
- maa/resource.py +32 -0
- MaaFw-2.0.3.dist-info/RECORD +0 -28
- {MaaFw-2.0.3.dist-info → MaaFw-2.1.0.dist-info}/LICENSE.md +0 -0
- {MaaFw-2.0.3.dist-info → MaaFw-2.1.0.dist-info}/WHEEL +0 -0
- {MaaFw-2.0.3.dist-info → MaaFw-2.1.0.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
maa/__init__.py,sha256=rBIC5X_VsfFXOMJRdKjgDyO428XHgeWAT3t6ZYmqO1M,207
|
|
2
|
+
maa/buffer.py,sha256=E0tuasXPm6A_4r22PGSwObgGXb2qCMJrT5yrAvcgk6I,17424
|
|
3
|
+
maa/context.py,sha256=Y71T92tIAGq6x8bJfYX8emUPEmPUA7nhnWgqOHh390E,5722
|
|
4
|
+
maa/controller.py,sha256=BpAotY8qlxLSKU0ZO249YDhJWU35B5avnwCTE5PxItQ,22160
|
|
5
|
+
maa/custom_action.py,sha256=pqPjDK7nVkGL8fceJadwb7IkeGjYc2X8RaXZOnVZXQs,2527
|
|
6
|
+
maa/custom_recognition.py,sha256=Y3Asdgb19YZioOVZZVs_hLSW6uBg7WDZDQPR2XfZpFU,3087
|
|
7
|
+
maa/define.py,sha256=nFPEOa7asyf4UG9kkeQrQaarXWbN0w-tSHoQWdZi_4s,11032
|
|
8
|
+
maa/job.py,sha256=Vj6q3sFPlmo260mxJWBnPuO2oT2LdZ-92vdDvrqBZYU,1777
|
|
9
|
+
maa/library.py,sha256=nDTBUFC6_91gmyy8SfkTTccMZET9XGU8IxvuVUEwQ6E,2099
|
|
10
|
+
maa/notification_handler.py,sha256=KjQlu66fNVwGGli8kuhNdSZPj2vO_oXjaNt_B1i_5wA,5251
|
|
11
|
+
maa/resource.py,sha256=bvS02sCCS9DRw_zJZeyCk8_DrZry6KBlUIvcfpKoUIg,8243
|
|
12
|
+
maa/tasker.py,sha256=6FOzU-PxWSA0dK8vEmiPVaJThvUMwNDi6EC6V-TcQmM,14758
|
|
13
|
+
maa/toolkit.py,sha256=TlF8MoaGcWLklpISIlQNvc_rpTFBFrpDbLgctfQ_zqo,11325
|
|
14
|
+
maa/bin/DirectML.dll,sha256=OZzXLdjebjwHxY63t7obvESKdwuE0E_D8DHGZC2wPp4,27307440
|
|
15
|
+
maa/bin/MaaAdbControlUnit.dll,sha256=xO33lSxoEYw51MJ92PNxh9h7KG0ctSYbT1yUlQBmEFg,873472
|
|
16
|
+
maa/bin/MaaDbgControlUnit.dll,sha256=7Z2XA7wi8hgvbNjJkueUWgE-5J_fClYMEWne6lZ8s3Q,444416
|
|
17
|
+
maa/bin/MaaFramework.dll,sha256=1xc0q4bPZZvSudmoFqx61DVuwUasbR6IBRqwQWZaWfk,1626624
|
|
18
|
+
maa/bin/MaaToolkit.dll,sha256=UIV_EfedrEdGI6v29IPCVV_I2giez8UUQ-LYdDLtqnE,732672
|
|
19
|
+
maa/bin/MaaUtils.dll,sha256=2RyXi6ad1FdJVrrIpBc72mQd-qOpzfdE3nlK3UFdz0s,555008
|
|
20
|
+
maa/bin/MaaWin32ControlUnit.dll,sha256=Dm--BAa1Vb0PbPMgpnCofES4Cp0cHXK2Y8tPfnnUOwE,399872
|
|
21
|
+
maa/bin/fastdeploy_ppocr_maa.dll,sha256=-noAb-Sf_YeQW9P9X-oWvD7FeySSCiEJi98X3uqkR3E,554496
|
|
22
|
+
maa/bin/onnxruntime_maa.dll,sha256=z1h6QyRTL5EtFS1Rc4TGBJGXUW_6LaVQ3yVhpz2B4mg,14457856
|
|
23
|
+
maa/bin/opencv_world4_maa.dll,sha256=n56ncTibRBFGMSZMXyEKXZ_aAkMiTAhGl8wjQnU4CJY,14959104
|
|
24
|
+
MaaFw-2.1.0.dist-info/LICENSE.md,sha256=RG51X65V_wNLuyG-RGcLXxFsKyZnlH5wNvK_5mMlOag,7560
|
|
25
|
+
MaaFw-2.1.0.dist-info/METADATA,sha256=LETsrB0lTcx-0T05Zj0FnWC51QbSIRJm-_VWQ4kTTL8,9428
|
|
26
|
+
MaaFw-2.1.0.dist-info/WHEEL,sha256=Duyuyl5UQT6_Wtko3k3gVoeKjXVfTFS3DpEnxomAcIY,95
|
|
27
|
+
MaaFw-2.1.0.dist-info/top_level.txt,sha256=G8r2L__aYaMq4S3R70G6NsfEROiVp08kUcWvATzk2J8,4
|
|
28
|
+
MaaFw-2.1.0.dist-info/RECORD,,
|
maa/bin/MaaAdbControlUnit.dll
CHANGED
|
Binary file
|
maa/bin/MaaDbgControlUnit.dll
CHANGED
|
Binary file
|
maa/bin/MaaFramework.dll
CHANGED
|
Binary file
|
maa/bin/MaaToolkit.dll
CHANGED
|
Binary file
|
maa/bin/MaaUtils.dll
CHANGED
|
Binary file
|
maa/bin/MaaWin32ControlUnit.dll
CHANGED
|
Binary file
|
maa/controller.py
CHANGED
|
@@ -76,9 +76,9 @@ class Controller:
|
|
|
76
76
|
)
|
|
77
77
|
return self._gen_ctrl_job(ctrl_id)
|
|
78
78
|
|
|
79
|
-
def post_stop_app(self,
|
|
79
|
+
def post_stop_app(self, intent: str) -> Job:
|
|
80
80
|
ctrl_id = Library.framework.MaaControllerPostStopApp(
|
|
81
|
-
self._handle,
|
|
81
|
+
self._handle, intent.encode()
|
|
82
82
|
)
|
|
83
83
|
return self._gen_ctrl_job(ctrl_id)
|
|
84
84
|
|
|
@@ -98,7 +98,7 @@ class Controller:
|
|
|
98
98
|
)
|
|
99
99
|
return self._gen_ctrl_job(ctrl_id)
|
|
100
100
|
|
|
101
|
-
def post_touch_up(self,
|
|
101
|
+
def post_touch_up(self, contact: int = 0) -> Job:
|
|
102
102
|
ctrl_id = Library.framework.MaaControllerPostTouchUp(self._handle, contact)
|
|
103
103
|
return self._gen_ctrl_job(ctrl_id)
|
|
104
104
|
|
maa/define.py
CHANGED
|
@@ -49,6 +49,7 @@ MaaOptionValue = ctypes.c_void_p
|
|
|
49
49
|
MaaOption = ctypes.c_int32
|
|
50
50
|
MaaGlobalOption = MaaOption
|
|
51
51
|
MaaCtrlOption = MaaOption
|
|
52
|
+
MaaResOption = MaaOption
|
|
52
53
|
|
|
53
54
|
|
|
54
55
|
class MaaGlobalOptionEnum:
|
|
@@ -104,6 +105,27 @@ class MaaCtrlOptionEnum:
|
|
|
104
105
|
Recording = 5
|
|
105
106
|
|
|
106
107
|
|
|
108
|
+
# enum MaaInferenceDeviceEnum
|
|
109
|
+
# {
|
|
110
|
+
# MaaInferenceDevice_CPU = -2,
|
|
111
|
+
# MaaInferenceDevice_Auto = -1,
|
|
112
|
+
# MaaInferenceDevice_GPU0 = 0,
|
|
113
|
+
# MaaInferenceDevice_GPU1 = 1,
|
|
114
|
+
# // and more gpu id...
|
|
115
|
+
# };
|
|
116
|
+
MaaInferenceDevice = ctypes.c_int32
|
|
117
|
+
|
|
118
|
+
class MaaResOptionEnum:
|
|
119
|
+
Invalid = 0
|
|
120
|
+
|
|
121
|
+
# Use the specified inference device.
|
|
122
|
+
# Please set this option before loading the model.
|
|
123
|
+
#
|
|
124
|
+
# value: MaaInferenceDevice, eg: 0; val_size: sizeof(MaaInferenceDevice)
|
|
125
|
+
# default value is MaaInferenceDevice_Auto
|
|
126
|
+
InferenceDevice = 1
|
|
127
|
+
|
|
128
|
+
|
|
107
129
|
MaaAdbScreencapMethod = ctypes.c_uint64
|
|
108
130
|
|
|
109
131
|
|
maa/notification_handler.py
CHANGED
|
@@ -33,7 +33,7 @@ class NotificationHandler(ABC):
|
|
|
33
33
|
path: str
|
|
34
34
|
|
|
35
35
|
def on_resource_loading(
|
|
36
|
-
self,
|
|
36
|
+
self, noti_type: NotificationType, detail: ResourceLoadingDetail
|
|
37
37
|
):
|
|
38
38
|
pass
|
|
39
39
|
|
|
@@ -44,7 +44,7 @@ class NotificationHandler(ABC):
|
|
|
44
44
|
action: str
|
|
45
45
|
|
|
46
46
|
def on_controller_action(
|
|
47
|
-
self,
|
|
47
|
+
self, noti_type: NotificationType, detail: ControllerActionDetail
|
|
48
48
|
):
|
|
49
49
|
pass
|
|
50
50
|
|
|
@@ -55,7 +55,7 @@ class NotificationHandler(ABC):
|
|
|
55
55
|
uuid: str
|
|
56
56
|
hash: str
|
|
57
57
|
|
|
58
|
-
def on_tasker_task(self,
|
|
58
|
+
def on_tasker_task(self, noti_type: NotificationType, detail: TaskerTaskDetail):
|
|
59
59
|
pass
|
|
60
60
|
|
|
61
61
|
@dataclass
|
|
@@ -64,7 +64,9 @@ class NotificationHandler(ABC):
|
|
|
64
64
|
name: str
|
|
65
65
|
next_list: list[str]
|
|
66
66
|
|
|
67
|
-
def on_task_next_list(
|
|
67
|
+
def on_task_next_list(
|
|
68
|
+
self, noti_type: NotificationType, detail: TaskNextListDetail
|
|
69
|
+
):
|
|
68
70
|
pass
|
|
69
71
|
|
|
70
72
|
@dataclass
|
|
@@ -74,7 +76,7 @@ class NotificationHandler(ABC):
|
|
|
74
76
|
name: str
|
|
75
77
|
|
|
76
78
|
def on_task_recognition(
|
|
77
|
-
self,
|
|
79
|
+
self, noti_type: NotificationType, detail: TaskRecognitionDetail
|
|
78
80
|
):
|
|
79
81
|
pass
|
|
80
82
|
|
|
@@ -84,7 +86,7 @@ class NotificationHandler(ABC):
|
|
|
84
86
|
node_id: int
|
|
85
87
|
name: str
|
|
86
88
|
|
|
87
|
-
def on_task_action(self,
|
|
89
|
+
def on_task_action(self, noti_type: NotificationType, detail: TaskActionDetail):
|
|
88
90
|
pass
|
|
89
91
|
|
|
90
92
|
def on_unknown_notification(self, msg: str, details: dict):
|
|
@@ -92,7 +94,7 @@ class NotificationHandler(ABC):
|
|
|
92
94
|
|
|
93
95
|
def on_raw_notification(self, msg: str, details: dict):
|
|
94
96
|
|
|
95
|
-
|
|
97
|
+
noti_type = NotificationHandler._notification_type(msg)
|
|
96
98
|
|
|
97
99
|
if msg.startswith("Resource.Loading"):
|
|
98
100
|
detail = self.ResourceLoadingDetail(
|
|
@@ -100,7 +102,7 @@ class NotificationHandler(ABC):
|
|
|
100
102
|
hash=details["hash"],
|
|
101
103
|
path=details["path"],
|
|
102
104
|
)
|
|
103
|
-
self.on_resource_loading(
|
|
105
|
+
self.on_resource_loading(noti_type, detail)
|
|
104
106
|
|
|
105
107
|
elif msg.startswith("Controller.Action"):
|
|
106
108
|
detail = self.ControllerActionDetail(
|
|
@@ -108,7 +110,7 @@ class NotificationHandler(ABC):
|
|
|
108
110
|
uuid=details["uuid"],
|
|
109
111
|
action=details["action"],
|
|
110
112
|
)
|
|
111
|
-
self.on_controller_action(
|
|
113
|
+
self.on_controller_action(noti_type, detail)
|
|
112
114
|
|
|
113
115
|
elif msg.startswith("Tasker.Task"):
|
|
114
116
|
detail = self.TaskerTaskDetail(
|
|
@@ -117,7 +119,7 @@ class NotificationHandler(ABC):
|
|
|
117
119
|
uuid=details["uuid"],
|
|
118
120
|
hash=details["hash"],
|
|
119
121
|
)
|
|
120
|
-
self.on_tasker_task(
|
|
122
|
+
self.on_tasker_task(noti_type, detail)
|
|
121
123
|
|
|
122
124
|
elif msg.startswith("Task.NextList"):
|
|
123
125
|
detail = self.TaskNextListDetail(
|
|
@@ -125,7 +127,7 @@ class NotificationHandler(ABC):
|
|
|
125
127
|
name=details["name"],
|
|
126
128
|
next_list=details["list"],
|
|
127
129
|
)
|
|
128
|
-
self.on_task_next_list(
|
|
130
|
+
self.on_task_next_list(noti_type, detail)
|
|
129
131
|
|
|
130
132
|
elif msg.startswith("Task.Recognition"):
|
|
131
133
|
detail = self.TaskRecognitionDetail(
|
|
@@ -133,7 +135,7 @@ class NotificationHandler(ABC):
|
|
|
133
135
|
reco_id=details["reco_id"],
|
|
134
136
|
name=details["name"],
|
|
135
137
|
)
|
|
136
|
-
self.on_task_recognition(
|
|
138
|
+
self.on_task_recognition(noti_type, detail)
|
|
137
139
|
|
|
138
140
|
elif msg.startswith("Task.Action"):
|
|
139
141
|
detail = self.TaskActionDetail(
|
|
@@ -141,7 +143,7 @@ class NotificationHandler(ABC):
|
|
|
141
143
|
node_id=details["node_id"],
|
|
142
144
|
name=details["name"],
|
|
143
145
|
)
|
|
144
|
-
self.on_task_action(
|
|
146
|
+
self.on_task_action(noti_type, detail)
|
|
145
147
|
|
|
146
148
|
else:
|
|
147
149
|
self.on_unknown_notification(msg, details)
|
maa/resource.py
CHANGED
|
@@ -60,6 +60,19 @@ class Resource:
|
|
|
60
60
|
def clear(self) -> bool:
|
|
61
61
|
return bool(Library.framework.MaaResourceClear(self._handle))
|
|
62
62
|
|
|
63
|
+
def set_gpu(self, gpu_id: int) -> bool:
|
|
64
|
+
if gpu_id < 0:
|
|
65
|
+
return False
|
|
66
|
+
return self.set_inference_device(gpu_id)
|
|
67
|
+
|
|
68
|
+
def set_cpu(self) -> bool:
|
|
69
|
+
MaaInferenceDevice_CPU = -2
|
|
70
|
+
return self.set_inference_device(MaaInferenceDevice_CPU)
|
|
71
|
+
|
|
72
|
+
def set_auto_device(self) -> bool:
|
|
73
|
+
MaaInferenceDevice_Auto = -1
|
|
74
|
+
return self.set_inference_device(MaaInferenceDevice_Auto)
|
|
75
|
+
|
|
63
76
|
def register_custom_recognition(
|
|
64
77
|
self, name: str, recognition: "CustomRecognition" # type: ignore
|
|
65
78
|
) -> bool:
|
|
@@ -136,6 +149,17 @@ class Resource:
|
|
|
136
149
|
|
|
137
150
|
### private ###
|
|
138
151
|
|
|
152
|
+
def set_inference_device(self, device_id: int) -> bool:
|
|
153
|
+
cint = ctypes.c_int32(device_id)
|
|
154
|
+
return bool(
|
|
155
|
+
Library.framework.MaaResourceSetOption(
|
|
156
|
+
self._handle,
|
|
157
|
+
MaaResOptionEnum.InferenceDevice,
|
|
158
|
+
ctypes.pointer(cint),
|
|
159
|
+
ctypes.sizeof(ctypes.c_int32),
|
|
160
|
+
)
|
|
161
|
+
)
|
|
162
|
+
|
|
139
163
|
def _status(self, id: int) -> ctypes.c_int32:
|
|
140
164
|
return Library.framework.MaaResourceStatus(self._handle, id)
|
|
141
165
|
|
|
@@ -189,6 +213,14 @@ class Resource:
|
|
|
189
213
|
MaaStringBufferHandle,
|
|
190
214
|
]
|
|
191
215
|
|
|
216
|
+
Library.framework.MaaResourceSetOption.restype = MaaBool
|
|
217
|
+
Library.framework.MaaResourceSetOption.argtypes = [
|
|
218
|
+
MaaResourceHandle,
|
|
219
|
+
MaaResOption,
|
|
220
|
+
MaaOptionValue,
|
|
221
|
+
MaaOptionValueSize,
|
|
222
|
+
]
|
|
223
|
+
|
|
192
224
|
Library.framework.MaaResourceRegisterCustomRecognition.restype = MaaBool
|
|
193
225
|
Library.framework.MaaResourceRegisterCustomRecognition.argtypes = [
|
|
194
226
|
MaaResourceHandle,
|
MaaFw-2.0.3.dist-info/RECORD
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
maa/__init__.py,sha256=rBIC5X_VsfFXOMJRdKjgDyO428XHgeWAT3t6ZYmqO1M,207
|
|
2
|
-
maa/buffer.py,sha256=E0tuasXPm6A_4r22PGSwObgGXb2qCMJrT5yrAvcgk6I,17424
|
|
3
|
-
maa/context.py,sha256=Y71T92tIAGq6x8bJfYX8emUPEmPUA7nhnWgqOHh390E,5722
|
|
4
|
-
maa/controller.py,sha256=F7BV221e0lPCElRD89mBJGJvXhNFe_QhvhV3yWSnKoY,22167
|
|
5
|
-
maa/custom_action.py,sha256=pqPjDK7nVkGL8fceJadwb7IkeGjYc2X8RaXZOnVZXQs,2527
|
|
6
|
-
maa/custom_recognition.py,sha256=Y3Asdgb19YZioOVZZVs_hLSW6uBg7WDZDQPR2XfZpFU,3087
|
|
7
|
-
maa/define.py,sha256=cCqrFo4I4Ije1Ebs2ylz_esa2BQVPXz3mkKnzX6Ou0A,10468
|
|
8
|
-
maa/job.py,sha256=Vj6q3sFPlmo260mxJWBnPuO2oT2LdZ-92vdDvrqBZYU,1777
|
|
9
|
-
maa/library.py,sha256=nDTBUFC6_91gmyy8SfkTTccMZET9XGU8IxvuVUEwQ6E,2099
|
|
10
|
-
maa/notification_handler.py,sha256=HtGmTFgTj7ibTdAIVNr5-LBn38trv_j6beHvYXUVFeg,5172
|
|
11
|
-
maa/resource.py,sha256=SL0P0A4mmV8IbTMH36tP_AwjzGlCG8-SwLI4NOe30Ao,7204
|
|
12
|
-
maa/tasker.py,sha256=6FOzU-PxWSA0dK8vEmiPVaJThvUMwNDi6EC6V-TcQmM,14758
|
|
13
|
-
maa/toolkit.py,sha256=TlF8MoaGcWLklpISIlQNvc_rpTFBFrpDbLgctfQ_zqo,11325
|
|
14
|
-
maa/bin/DirectML.dll,sha256=OZzXLdjebjwHxY63t7obvESKdwuE0E_D8DHGZC2wPp4,27307440
|
|
15
|
-
maa/bin/MaaAdbControlUnit.dll,sha256=rrWqJzzW_PIMM-s6-_p_Knr4SPyrAXsGGM_7veQH5c8,861184
|
|
16
|
-
maa/bin/MaaDbgControlUnit.dll,sha256=hJii-1SMH6mggM80CkEH_LNKEnbdptpl70Lp-wwtHB0,444416
|
|
17
|
-
maa/bin/MaaFramework.dll,sha256=uK1YPOBMSixg1lbo_-M7bID2WFVXR7hHgSEm5OIQyUM,1594880
|
|
18
|
-
maa/bin/MaaToolkit.dll,sha256=1-eoi26a9eRJNg3RJ7V5eJEl-MqPVBeuyMYhdt-tAaI,728576
|
|
19
|
-
maa/bin/MaaUtils.dll,sha256=2S3B5wIA0Rtoj-vwU8Pe5e7pWYACZSAKBQM47AIABJg,555008
|
|
20
|
-
maa/bin/MaaWin32ControlUnit.dll,sha256=CgNMSApI1fSJ2I_QDdLaJ2PdaEokEr1jR8w8-jH8rb8,399872
|
|
21
|
-
maa/bin/fastdeploy_ppocr_maa.dll,sha256=-noAb-Sf_YeQW9P9X-oWvD7FeySSCiEJi98X3uqkR3E,554496
|
|
22
|
-
maa/bin/onnxruntime_maa.dll,sha256=z1h6QyRTL5EtFS1Rc4TGBJGXUW_6LaVQ3yVhpz2B4mg,14457856
|
|
23
|
-
maa/bin/opencv_world4_maa.dll,sha256=n56ncTibRBFGMSZMXyEKXZ_aAkMiTAhGl8wjQnU4CJY,14959104
|
|
24
|
-
MaaFw-2.0.3.dist-info/LICENSE.md,sha256=RG51X65V_wNLuyG-RGcLXxFsKyZnlH5wNvK_5mMlOag,7560
|
|
25
|
-
MaaFw-2.0.3.dist-info/METADATA,sha256=y81HFpAvDLTZT0u0cVph_Eow21A84EMgVOmHNc6PdfE,9428
|
|
26
|
-
MaaFw-2.0.3.dist-info/WHEEL,sha256=Duyuyl5UQT6_Wtko3k3gVoeKjXVfTFS3DpEnxomAcIY,95
|
|
27
|
-
MaaFw-2.0.3.dist-info/top_level.txt,sha256=G8r2L__aYaMq4S3R70G6NsfEROiVp08kUcWvATzk2J8,4
|
|
28
|
-
MaaFw-2.0.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|