lamda 7.76__tar.gz → 7.80__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {lamda-7.76 → lamda-7.80}/PKG-INFO +1 -1
- {lamda-7.76 → lamda-7.80}/lamda/__init__.py +1 -1
- {lamda-7.76 → lamda-7.80}/lamda/client.py +68 -0
- {lamda-7.76 → lamda-7.80}/lamda/rpc/application.proto +29 -0
- {lamda-7.76 → lamda-7.80}/lamda/rpc/services.proto +6 -0
- {lamda-7.76 → lamda-7.80}/lamda.egg-info/PKG-INFO +1 -1
- {lamda-7.76 → lamda-7.80}/README.md +0 -0
- {lamda-7.76 → lamda-7.80}/lamda/bcast.proto +0 -0
- {lamda-7.76 → lamda-7.80}/lamda/const.py +0 -0
- {lamda-7.76 → lamda-7.80}/lamda/exceptions.py +0 -0
- {lamda-7.76 → lamda-7.80}/lamda/google/protobuf/any.proto +0 -0
- {lamda-7.76 → lamda-7.80}/lamda/google/protobuf/api.proto +0 -0
- {lamda-7.76 → lamda-7.80}/lamda/google/protobuf/compiler/plugin.proto +0 -0
- {lamda-7.76 → lamda-7.80}/lamda/google/protobuf/descriptor.proto +0 -0
- {lamda-7.76 → lamda-7.80}/lamda/google/protobuf/duration.proto +0 -0
- {lamda-7.76 → lamda-7.80}/lamda/google/protobuf/empty.proto +0 -0
- {lamda-7.76 → lamda-7.80}/lamda/google/protobuf/field_mask.proto +0 -0
- {lamda-7.76 → lamda-7.80}/lamda/google/protobuf/source_context.proto +0 -0
- {lamda-7.76 → lamda-7.80}/lamda/google/protobuf/struct.proto +0 -0
- {lamda-7.76 → lamda-7.80}/lamda/google/protobuf/timestamp.proto +0 -0
- {lamda-7.76 → lamda-7.80}/lamda/google/protobuf/type.proto +0 -0
- {lamda-7.76 → lamda-7.80}/lamda/google/protobuf/wrappers.proto +0 -0
- {lamda-7.76 → lamda-7.80}/lamda/rpc/debug.proto +0 -0
- {lamda-7.76 → lamda-7.80}/lamda/rpc/file.proto +0 -0
- {lamda-7.76 → lamda-7.80}/lamda/rpc/policy.proto +0 -0
- {lamda-7.76 → lamda-7.80}/lamda/rpc/proxy.proto +0 -0
- {lamda-7.76 → lamda-7.80}/lamda/rpc/settings.proto +0 -0
- {lamda-7.76 → lamda-7.80}/lamda/rpc/shell.proto +0 -0
- {lamda-7.76 → lamda-7.80}/lamda/rpc/status.proto +0 -0
- {lamda-7.76 → lamda-7.80}/lamda/rpc/storage.proto +0 -0
- {lamda-7.76 → lamda-7.80}/lamda/rpc/types.proto +0 -0
- {lamda-7.76 → lamda-7.80}/lamda/rpc/uiautomator.proto +0 -0
- {lamda-7.76 → lamda-7.80}/lamda/rpc/util.proto +0 -0
- {lamda-7.76 → lamda-7.80}/lamda/rpc/wifi.proto +0 -0
- {lamda-7.76 → lamda-7.80}/lamda/types.py +0 -0
- {lamda-7.76 → lamda-7.80}/lamda.egg-info/SOURCES.txt +0 -0
- {lamda-7.76 → lamda-7.80}/lamda.egg-info/dependency_links.txt +0 -0
- {lamda-7.76 → lamda-7.80}/lamda.egg-info/not-zip-safe +0 -0
- {lamda-7.76 → lamda-7.80}/lamda.egg-info/requires.txt +0 -0
- {lamda-7.76 → lamda-7.80}/lamda.egg-info/top_level.txt +0 -0
- {lamda-7.76 → lamda-7.80}/setup.cfg +0 -0
- {lamda-7.76 → lamda-7.80}/setup.py +0 -0
@@ -256,6 +256,11 @@ TouchSequence.appendUp = touchSequenceAppendUp
|
|
256
256
|
TouchSequence.__getitem__ = touchSequenceIndexer
|
257
257
|
TouchSequence.__iter__ = touchSequenceIter
|
258
258
|
|
259
|
+
DataEncode = protos.DataEncode
|
260
|
+
ScriptRuntime = protos.ScriptRuntime
|
261
|
+
HookRpcRequest = protos.HookRpcRequest
|
262
|
+
HookRpcResponse = protos.HookRpcResponse
|
263
|
+
|
259
264
|
Bound.width = property(width)
|
260
265
|
Bound.height = property(height)
|
261
266
|
|
@@ -960,6 +965,24 @@ class UiAutomatorStub(BaseServiceStub):
|
|
960
965
|
return ObjectUiAutomatorOpStub(self.stub, kwargs)
|
961
966
|
|
962
967
|
|
968
|
+
class AppScriptRpcInterface(object):
|
969
|
+
def __init__(self, stub, application,
|
970
|
+
name):
|
971
|
+
self.application = application
|
972
|
+
self.stub = stub
|
973
|
+
self.name = name
|
974
|
+
def __call__(self, *args):
|
975
|
+
call_args = dict()
|
976
|
+
call_args["method"] = self.name
|
977
|
+
call_args["args"] = args
|
978
|
+
req = HookRpcRequest()
|
979
|
+
req.package = self.application.applicationId
|
980
|
+
req.callinfo = json.dumps(call_args)
|
981
|
+
result = self.stub.callScript(req)
|
982
|
+
r = json.loads(result.callresult)
|
983
|
+
return r
|
984
|
+
|
985
|
+
|
963
986
|
class ApplicationOpStub:
|
964
987
|
def __init__(self, stub, applicationId, user=0):
|
965
988
|
"""
|
@@ -1114,6 +1137,51 @@ class ApplicationOpStub:
|
|
1114
1137
|
req.user = self.user
|
1115
1138
|
r = self.stub.isInstalled(req)
|
1116
1139
|
return r.value
|
1140
|
+
def attach_script(self, script, runtime=ScriptRuntime.RUNTIME_QJS,
|
1141
|
+
emit="",
|
1142
|
+
encode=DataEncode.DATA_ENCODE_NONE,
|
1143
|
+
standup=5):
|
1144
|
+
"""
|
1145
|
+
向应用注入持久化 Hook 脚本
|
1146
|
+
"""
|
1147
|
+
s = isinstance(script, str)
|
1148
|
+
script = script.encode() if s else script
|
1149
|
+
req = protos.HookRequest()
|
1150
|
+
req.package = self.applicationId
|
1151
|
+
req.script = script
|
1152
|
+
req.runtime = runtime
|
1153
|
+
req.standup = standup
|
1154
|
+
req.destination = emit
|
1155
|
+
req.encode = encode
|
1156
|
+
r = self.stub.attachScript(req)
|
1157
|
+
return r.value
|
1158
|
+
def detach_script(self):
|
1159
|
+
"""
|
1160
|
+
移除注入应用的 Hook 脚本
|
1161
|
+
"""
|
1162
|
+
req = protos.String(value=self.applicationId)
|
1163
|
+
r = self.stub.detachScript(req)
|
1164
|
+
return r.value
|
1165
|
+
def is_attached_script(self):
|
1166
|
+
"""
|
1167
|
+
检查使用在此应用注入了 Hook 脚本
|
1168
|
+
"""
|
1169
|
+
req = protos.String(value=self.applicationId)
|
1170
|
+
r = self.stub.isScriptAttached(req)
|
1171
|
+
return r.value
|
1172
|
+
def is_script_alive(self):
|
1173
|
+
"""
|
1174
|
+
检查应用中的 Hook 脚本是否正常
|
1175
|
+
"""
|
1176
|
+
req = protos.String(value=self.applicationId)
|
1177
|
+
r = self.stub.isScriptAlive(req)
|
1178
|
+
return r.value
|
1179
|
+
def __getattr__(self, name):
|
1180
|
+
"""
|
1181
|
+
调用注入应用 Hook 脚本的导出方法
|
1182
|
+
"""
|
1183
|
+
return AppScriptRpcInterface(self.stub, self,
|
1184
|
+
name)
|
1117
1185
|
|
1118
1186
|
|
1119
1187
|
class ApplicationStub(BaseServiceStub):
|
@@ -13,6 +13,16 @@ enum GrantType {
|
|
13
13
|
GRANT_IGNORE = 2;
|
14
14
|
}
|
15
15
|
|
16
|
+
enum DataEncode {
|
17
|
+
DATA_ENCODE_NONE = 0;
|
18
|
+
DATA_ENCODE_ZLIB = 1;
|
19
|
+
}
|
20
|
+
|
21
|
+
enum ScriptRuntime {
|
22
|
+
RUNTIME_QJS = 0;
|
23
|
+
RUNTIME_V8 = 1;
|
24
|
+
}
|
25
|
+
|
16
26
|
message ApplicationRequest {
|
17
27
|
string name = 1;
|
18
28
|
string permission = 2;
|
@@ -83,3 +93,22 @@ message ApplicationProcesses {
|
|
83
93
|
message ApplicationPkgNames {
|
84
94
|
repeated string names = 1;
|
85
95
|
}
|
96
|
+
|
97
|
+
message HookRequest {
|
98
|
+
string package = 1;
|
99
|
+
bytes script = 2;
|
100
|
+
ScriptRuntime runtime = 3;
|
101
|
+
string destination = 4;
|
102
|
+
DataEncode encode = 5;
|
103
|
+
uint32 standup = 6;
|
104
|
+
}
|
105
|
+
|
106
|
+
message HookRpcRequest {
|
107
|
+
string package = 1;
|
108
|
+
string callinfo = 2;
|
109
|
+
}
|
110
|
+
|
111
|
+
message HookRpcResponse {
|
112
|
+
string package = 1;
|
113
|
+
string callresult = 2;
|
114
|
+
}
|
@@ -50,6 +50,12 @@ service Application {
|
|
50
50
|
rpc addToDozeModeWhiteList(ApplicationRequest) returns (Boolean) {}
|
51
51
|
rpc removeFromDozeModeWhiteList(ApplicationRequest) returns (Boolean) {}
|
52
52
|
rpc getIdentifierByLabel(String) returns (String) {}
|
53
|
+
|
54
|
+
rpc callScript(HookRpcRequest) returns (HookRpcResponse) {}
|
55
|
+
rpc isScriptAlive(String) returns (Boolean) {}
|
56
|
+
rpc isScriptAttached(String) returns (Boolean) {}
|
57
|
+
rpc attachScript(HookRequest) returns (Boolean) {}
|
58
|
+
rpc detachScript(String) returns (Boolean) {}
|
53
59
|
}
|
54
60
|
|
55
61
|
service Debug {
|
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
|
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
|