frida 16.7.14 → 16.7.15
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.
- package/README.md +1 -10
- package/build/BSDmakefile +6 -0
- package/build/Makefile +10 -0
- package/build/src/frida.d.ts +364 -0
- package/build/src/frida.js +962 -0
- package/build/src/frida_binding.d.ts +938 -0
- package/meson.build +34 -67
- package/package.json +30 -20
- package/scripts/fetch-abi-bits.py +15 -65
- package/scripts/install.js +5 -4
- package/src/addon.def +3 -0
- package/src/addon.symbols +2 -1
- package/src/addon.version +4 -0
- package/src/frida_bindgen/__init__.py +0 -0
- package/src/frida_bindgen/__main__.py +4 -0
- package/src/frida_bindgen/__pycache__/__init__.cpython-312.pyc +0 -0
- package/src/frida_bindgen/__pycache__/__main__.cpython-312.pyc +0 -0
- package/src/frida_bindgen/__pycache__/cli.cpython-312.pyc +0 -0
- package/src/frida_bindgen/__pycache__/codegen.cpython-312.pyc +0 -0
- package/src/frida_bindgen/__pycache__/customization.cpython-312.pyc +0 -0
- package/src/frida_bindgen/__pycache__/loader.cpython-312.pyc +0 -0
- package/src/frida_bindgen/__pycache__/model.cpython-312.pyc +0 -0
- package/src/frida_bindgen/assets/codegen_helpers.c +1970 -0
- package/src/frida_bindgen/assets/codegen_helpers.ts +100 -0
- package/src/frida_bindgen/assets/codegen_prototypes.h +78 -0
- package/src/frida_bindgen/assets/codegen_types.h +57 -0
- package/src/frida_bindgen/assets/customization_facade.exports +13 -0
- package/src/frida_bindgen/assets/customization_facade.ts +157 -0
- package/src/frida_bindgen/assets/customization_helpers.imports +2 -0
- package/src/frida_bindgen/assets/customization_helpers.ts +396 -0
- package/src/frida_bindgen/cli.py +96 -0
- package/src/frida_bindgen/codegen.py +2233 -0
- package/src/frida_bindgen/customization.py +924 -0
- package/src/frida_bindgen/loader.py +60 -0
- package/src/frida_bindgen/model.py +1357 -0
- package/src/meson.build +92 -27
- package/{lib/build.py → src/tsc.py} +12 -12
- package/src/win_delay_load_hook.c +56 -0
- package/subprojects/frida-core.wrap +1 -1
- package/test/data/index.ts +2 -2
- package/test/device.ts +1 -2
- package/test/device_manager.ts +1 -2
- package/test/labrat.ts +2 -2
- package/test/script.ts +12 -12
- package/test/session.ts +3 -3
- package/tsconfig.json +6 -11
- package/dist/application.d.ts +0 -81
- package/dist/application.js +0 -2
- package/dist/authentication.d.ts +0 -3
- package/dist/authentication.js +0 -2
- package/dist/bus.d.ts +0 -16
- package/dist/bus.js +0 -23
- package/dist/cancellable.d.ts +0 -15
- package/dist/cancellable.js +0 -41
- package/dist/child.d.ts +0 -16
- package/dist/child.js +0 -9
- package/dist/crash.d.ts +0 -10
- package/dist/crash.js +0 -2
- package/dist/device.d.ts +0 -156
- package/dist/device.js +0 -188
- package/dist/device_manager.d.ts +0 -25
- package/dist/device_manager.js +0 -42
- package/dist/endpoint_parameters.d.ts +0 -26
- package/dist/endpoint_parameters.js +0 -24
- package/dist/icon.d.ts +0 -14
- package/dist/icon.js +0 -2
- package/dist/index.d.ts +0 -161
- package/dist/index.js +0 -170
- package/dist/iostream.d.ts +0 -13
- package/dist/iostream.js +0 -73
- package/dist/native.d.ts +0 -1
- package/dist/native.js +0 -11
- package/dist/portal_membership.d.ts +0 -6
- package/dist/portal_membership.js +0 -12
- package/dist/portal_service.d.ts +0 -48
- package/dist/portal_service.js +0 -52
- package/dist/process.d.ts +0 -47
- package/dist/process.js +0 -2
- package/dist/relay.d.ts +0 -22
- package/dist/relay.js +0 -32
- package/dist/script.d.ts +0 -70
- package/dist/script.js +0 -266
- package/dist/service.d.ts +0 -16
- package/dist/service.js +0 -26
- package/dist/session.d.ts +0 -45
- package/dist/session.js +0 -73
- package/dist/signals.d.ts +0 -20
- package/dist/signals.js +0 -40
- package/dist/socket_address.d.ts +0 -25
- package/dist/socket_address.js +0 -2
- package/dist/spawn.d.ts +0 -4
- package/dist/spawn.js +0 -2
- package/dist/system_parameters.d.ts +0 -84
- package/dist/system_parameters.js +0 -2
- package/lib/application.ts +0 -98
- package/lib/authentication.ts +0 -3
- package/lib/bus.ts +0 -30
- package/lib/cancellable.ts +0 -48
- package/lib/child.ts +0 -15
- package/lib/crash.ts +0 -11
- package/lib/device.ts +0 -331
- package/lib/device_manager.ts +0 -69
- package/lib/endpoint_parameters.ts +0 -56
- package/lib/icon.ts +0 -15
- package/lib/index.ts +0 -316
- package/lib/iostream.ts +0 -78
- package/lib/meson.build +0 -53
- package/lib/native.ts +0 -9
- package/lib/portal_membership.ts +0 -10
- package/lib/portal_service.ts +0 -105
- package/lib/process.ts +0 -57
- package/lib/relay.ts +0 -44
- package/lib/script.ts +0 -361
- package/lib/service.ts +0 -34
- package/lib/session.ts +0 -113
- package/lib/signals.ts +0 -45
- package/lib/socket_address.ts +0 -35
- package/lib/spawn.ts +0 -4
- package/lib/system_parameters.ts +0 -103
- package/meson.options +0 -11
- package/src/addon.cc +0 -78
- package/src/application.cc +0 -148
- package/src/application.h +0 -31
- package/src/authentication.cc +0 -174
- package/src/authentication.h +0 -24
- package/src/bus.cc +0 -167
- package/src/bus.h +0 -33
- package/src/cancellable.cc +0 -117
- package/src/cancellable.h +0 -31
- package/src/child.cc +0 -150
- package/src/child.h +0 -32
- package/src/crash.cc +0 -122
- package/src/crash.h +0 -30
- package/src/device.cc +0 -1350
- package/src/device.h +0 -56
- package/src/device_manager.cc +0 -362
- package/src/device_manager.h +0 -35
- package/src/endpoint_parameters.cc +0 -171
- package/src/endpoint_parameters.h +0 -28
- package/src/glib_context.cc +0 -62
- package/src/glib_context.h +0 -29
- package/src/glib_object.cc +0 -25
- package/src/glib_object.h +0 -37
- package/src/iostream.cc +0 -243
- package/src/iostream.h +0 -30
- package/src/operation.h +0 -94
- package/src/portal_membership.cc +0 -100
- package/src/portal_membership.h +0 -26
- package/src/portal_service.cc +0 -401
- package/src/portal_service.h +0 -40
- package/src/process.cc +0 -135
- package/src/process.h +0 -30
- package/src/relay.cc +0 -139
- package/src/relay.h +0 -31
- package/src/runtime.cc +0 -568
- package/src/runtime.h +0 -69
- package/src/script.cc +0 -301
- package/src/script.h +0 -36
- package/src/service.cc +0 -224
- package/src/service.h +0 -36
- package/src/session.cc +0 -860
- package/src/session.h +0 -42
- package/src/signals.cc +0 -334
- package/src/signals.h +0 -47
- package/src/spawn.cc +0 -95
- package/src/spawn.h +0 -27
- package/src/usage_monitor.h +0 -117
- package/src/uv_context.cc +0 -118
- package/src/uv_context.h +0 -40
- package/src/win_delay_load_hook.cc +0 -63
- package/subprojects/nan.wrap +0 -9
- package/subprojects/packagefiles/nan.patch +0 -13
package/dist/script.js
DELETED
|
@@ -1,266 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LogLevel = exports.MessageType = exports.ScriptRuntime = exports.Script = void 0;
|
|
4
|
-
const cancellable_1 = require("./cancellable");
|
|
5
|
-
const signals_1 = require("./signals");
|
|
6
|
-
const util_1 = require("util");
|
|
7
|
-
class Script {
|
|
8
|
-
constructor(impl) {
|
|
9
|
-
this.impl = impl;
|
|
10
|
-
this.logHandlerImpl = log;
|
|
11
|
-
const services = new ScriptServices(this, impl.signals);
|
|
12
|
-
const rpcController = services;
|
|
13
|
-
this.exportsProxy = new ScriptExportsProxy(rpcController);
|
|
14
|
-
const signals = services;
|
|
15
|
-
this.destroyed = new signals_1.Signal(signals, "destroyed");
|
|
16
|
-
this.message = new signals_1.Signal(signals, "message");
|
|
17
|
-
}
|
|
18
|
-
get isDestroyed() {
|
|
19
|
-
return this.impl.isDestroyed;
|
|
20
|
-
}
|
|
21
|
-
get exports() {
|
|
22
|
-
return this.exportsProxy;
|
|
23
|
-
}
|
|
24
|
-
get logHandler() {
|
|
25
|
-
return this.logHandlerImpl;
|
|
26
|
-
}
|
|
27
|
-
set logHandler(handler) {
|
|
28
|
-
this.logHandlerImpl = handler;
|
|
29
|
-
}
|
|
30
|
-
get defaultLogHandler() {
|
|
31
|
-
return log;
|
|
32
|
-
}
|
|
33
|
-
load(cancellable) {
|
|
34
|
-
return this.impl.load(cancellable);
|
|
35
|
-
}
|
|
36
|
-
unload(cancellable) {
|
|
37
|
-
return this.impl.unload(cancellable);
|
|
38
|
-
}
|
|
39
|
-
eternalize(cancellable) {
|
|
40
|
-
return this.impl.eternalize(cancellable);
|
|
41
|
-
}
|
|
42
|
-
post(message, data = null) {
|
|
43
|
-
this.impl.post(message, data);
|
|
44
|
-
}
|
|
45
|
-
enableDebugger(options = {}, cancellable) {
|
|
46
|
-
const { port = 0 } = options;
|
|
47
|
-
return this.impl.enableDebugger(port, cancellable);
|
|
48
|
-
}
|
|
49
|
-
disableDebugger(cancellable) {
|
|
50
|
-
return this.impl.disableDebugger(cancellable);
|
|
51
|
-
}
|
|
52
|
-
[util_1.inspect.custom](depth, options) {
|
|
53
|
-
return "Script {}";
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
exports.Script = Script;
|
|
57
|
-
var ScriptRuntime;
|
|
58
|
-
(function (ScriptRuntime) {
|
|
59
|
-
ScriptRuntime["Default"] = "default";
|
|
60
|
-
ScriptRuntime["QJS"] = "qjs";
|
|
61
|
-
ScriptRuntime["V8"] = "v8";
|
|
62
|
-
})(ScriptRuntime || (exports.ScriptRuntime = ScriptRuntime = {}));
|
|
63
|
-
var MessageType;
|
|
64
|
-
(function (MessageType) {
|
|
65
|
-
MessageType["Send"] = "send";
|
|
66
|
-
MessageType["Error"] = "error";
|
|
67
|
-
})(MessageType || (exports.MessageType = MessageType = {}));
|
|
68
|
-
var LogLevel;
|
|
69
|
-
(function (LogLevel) {
|
|
70
|
-
LogLevel["Info"] = "info";
|
|
71
|
-
LogLevel["Warning"] = "warning";
|
|
72
|
-
LogLevel["Error"] = "error";
|
|
73
|
-
})(LogLevel || (exports.LogLevel = LogLevel = {}));
|
|
74
|
-
class ScriptServices extends signals_1.SignalAdapter {
|
|
75
|
-
constructor(script, signals) {
|
|
76
|
-
super(signals);
|
|
77
|
-
this.script = script;
|
|
78
|
-
this.pendingRequests = {};
|
|
79
|
-
this.nextRequestId = 1;
|
|
80
|
-
this.onDestroyed = () => {
|
|
81
|
-
this.signals.disconnect("destroyed", this.onDestroyed);
|
|
82
|
-
this.signals.disconnect("message", this.onMessage);
|
|
83
|
-
};
|
|
84
|
-
this.onMessage = (message, data) => {
|
|
85
|
-
if (message.type === MessageType.Send && isRpcSendMessage(message)) {
|
|
86
|
-
const [, id, operation, ...params] = message.payload;
|
|
87
|
-
this.onRpcMessage(id, operation, params, data);
|
|
88
|
-
}
|
|
89
|
-
else if (isLogMessage(message)) {
|
|
90
|
-
const opaqueMessage = message;
|
|
91
|
-
const logMessage = opaqueMessage;
|
|
92
|
-
this.script.logHandler(logMessage.level, logMessage.payload);
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
this.signals.connect("destroyed", this.onDestroyed);
|
|
96
|
-
this.signals.connect("message", this.onMessage);
|
|
97
|
-
}
|
|
98
|
-
getProxy(name, userHandler) {
|
|
99
|
-
if (name === "message") {
|
|
100
|
-
return (message, data) => {
|
|
101
|
-
if (!isInternalMessage(message)) {
|
|
102
|
-
userHandler(message, data);
|
|
103
|
-
}
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
return null;
|
|
107
|
-
}
|
|
108
|
-
request(operation, params, data, cancellable) {
|
|
109
|
-
return new Promise((resolve, reject) => {
|
|
110
|
-
const id = this.nextRequestId++;
|
|
111
|
-
const complete = (error, result) => {
|
|
112
|
-
if (cancellable !== undefined) {
|
|
113
|
-
cancellable.cancelled.disconnect(onOperationCancelled);
|
|
114
|
-
}
|
|
115
|
-
this.signals.disconnect("destroyed", onScriptDestroyed);
|
|
116
|
-
delete this.pendingRequests[id];
|
|
117
|
-
if (error === null) {
|
|
118
|
-
resolve(result);
|
|
119
|
-
}
|
|
120
|
-
else {
|
|
121
|
-
reject(error);
|
|
122
|
-
}
|
|
123
|
-
};
|
|
124
|
-
function onScriptDestroyed() {
|
|
125
|
-
complete(new Error("Script is destroyed"));
|
|
126
|
-
}
|
|
127
|
-
function onOperationCancelled() {
|
|
128
|
-
complete(new Error("Operation was cancelled"));
|
|
129
|
-
}
|
|
130
|
-
this.pendingRequests[id] = complete;
|
|
131
|
-
this.script.post(["frida:rpc", id, operation, ...params], data);
|
|
132
|
-
this.signals.connect("destroyed", onScriptDestroyed);
|
|
133
|
-
if (cancellable !== undefined) {
|
|
134
|
-
cancellable.cancelled.connect(onOperationCancelled);
|
|
135
|
-
if (cancellable.isCancelled) {
|
|
136
|
-
onOperationCancelled();
|
|
137
|
-
return;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
if (this.script.isDestroyed) {
|
|
141
|
-
onScriptDestroyed();
|
|
142
|
-
}
|
|
143
|
-
});
|
|
144
|
-
}
|
|
145
|
-
onRpcMessage(id, operation, params, data) {
|
|
146
|
-
if (operation === RpcOperation.Ok || operation === RpcOperation.Error) {
|
|
147
|
-
const callback = this.pendingRequests[id];
|
|
148
|
-
if (callback === undefined) {
|
|
149
|
-
return;
|
|
150
|
-
}
|
|
151
|
-
let value = null;
|
|
152
|
-
let error = null;
|
|
153
|
-
if (operation === RpcOperation.Ok) {
|
|
154
|
-
if (data !== null) {
|
|
155
|
-
value = (params.length > 1) ? [params[1], data] : data;
|
|
156
|
-
}
|
|
157
|
-
else {
|
|
158
|
-
value = params[0];
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
else {
|
|
162
|
-
const [message, name, stack, rawErr] = params;
|
|
163
|
-
error = new Error(message);
|
|
164
|
-
error.name = name;
|
|
165
|
-
error.stack = stack;
|
|
166
|
-
Object.assign(error, rawErr);
|
|
167
|
-
}
|
|
168
|
-
callback(error, value);
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
function ScriptExportsProxy(rpcController) {
|
|
173
|
-
return new Proxy(this, {
|
|
174
|
-
has(target, property) {
|
|
175
|
-
return !isReservedMethodName(property);
|
|
176
|
-
;
|
|
177
|
-
},
|
|
178
|
-
get(target, property, receiver) {
|
|
179
|
-
if (property in target) {
|
|
180
|
-
return target[property];
|
|
181
|
-
}
|
|
182
|
-
if (property === util_1.inspect.custom) {
|
|
183
|
-
return inspectProxy;
|
|
184
|
-
}
|
|
185
|
-
if (isReservedMethodName(property)) {
|
|
186
|
-
return undefined;
|
|
187
|
-
}
|
|
188
|
-
return (...args) => {
|
|
189
|
-
let cancellable;
|
|
190
|
-
if (args[args.length - 1] instanceof cancellable_1.Cancellable) {
|
|
191
|
-
cancellable = args.pop();
|
|
192
|
-
}
|
|
193
|
-
let data = null;
|
|
194
|
-
if (Buffer.isBuffer(args[args.length - 1])) {
|
|
195
|
-
data = args.pop();
|
|
196
|
-
}
|
|
197
|
-
return rpcController.request("call", [property, args], data, cancellable);
|
|
198
|
-
};
|
|
199
|
-
},
|
|
200
|
-
set(target, property, value, receiver) {
|
|
201
|
-
target[property] = value;
|
|
202
|
-
return true;
|
|
203
|
-
},
|
|
204
|
-
ownKeys(target) {
|
|
205
|
-
return Object.getOwnPropertyNames(target);
|
|
206
|
-
},
|
|
207
|
-
getOwnPropertyDescriptor(target, property) {
|
|
208
|
-
if (property in target) {
|
|
209
|
-
return Object.getOwnPropertyDescriptor(target, property);
|
|
210
|
-
}
|
|
211
|
-
if (isReservedMethodName(property)) {
|
|
212
|
-
return undefined;
|
|
213
|
-
}
|
|
214
|
-
return {
|
|
215
|
-
writable: true,
|
|
216
|
-
configurable: true,
|
|
217
|
-
enumerable: true
|
|
218
|
-
};
|
|
219
|
-
},
|
|
220
|
-
});
|
|
221
|
-
}
|
|
222
|
-
function inspectProxy() {
|
|
223
|
-
return "ScriptExportsProxy {}";
|
|
224
|
-
}
|
|
225
|
-
var RpcOperation;
|
|
226
|
-
(function (RpcOperation) {
|
|
227
|
-
RpcOperation["Ok"] = "ok";
|
|
228
|
-
RpcOperation["Error"] = "error";
|
|
229
|
-
})(RpcOperation || (RpcOperation = {}));
|
|
230
|
-
function isInternalMessage(message) {
|
|
231
|
-
return isRpcMessage(message) || isLogMessage(message);
|
|
232
|
-
}
|
|
233
|
-
function isRpcMessage(message) {
|
|
234
|
-
return message.type === MessageType.Send && isRpcSendMessage(message);
|
|
235
|
-
}
|
|
236
|
-
function isRpcSendMessage(message) {
|
|
237
|
-
const payload = message.payload;
|
|
238
|
-
if (!Array.isArray(payload)) {
|
|
239
|
-
return false;
|
|
240
|
-
}
|
|
241
|
-
return payload[0] === "frida:rpc";
|
|
242
|
-
}
|
|
243
|
-
function isLogMessage(message) {
|
|
244
|
-
return message.type === "log";
|
|
245
|
-
}
|
|
246
|
-
function log(level, text) {
|
|
247
|
-
switch (level) {
|
|
248
|
-
case LogLevel.Info:
|
|
249
|
-
console.log(text);
|
|
250
|
-
break;
|
|
251
|
-
case LogLevel.Warning:
|
|
252
|
-
console.warn(text);
|
|
253
|
-
break;
|
|
254
|
-
case LogLevel.Error:
|
|
255
|
-
console.error(text);
|
|
256
|
-
break;
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
const reservedMethodNames = new Set([
|
|
260
|
-
"then",
|
|
261
|
-
"catch",
|
|
262
|
-
"finally",
|
|
263
|
-
]);
|
|
264
|
-
function isReservedMethodName(name) {
|
|
265
|
-
return reservedMethodNames.has(name.toString());
|
|
266
|
-
}
|
package/dist/service.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { Cancellable } from "./cancellable";
|
|
3
|
-
import { Signal } from "./signals";
|
|
4
|
-
import { inspect } from "util";
|
|
5
|
-
export declare class Service {
|
|
6
|
-
private impl;
|
|
7
|
-
close: Signal<ServiceCloseHandler>;
|
|
8
|
-
message: Signal<ServiceMessageHandler>;
|
|
9
|
-
constructor(impl: any);
|
|
10
|
-
activate(cancellable?: Cancellable): Promise<void>;
|
|
11
|
-
cancel(cancellable?: Cancellable): Promise<void>;
|
|
12
|
-
request(parameters: any, cancellable?: Cancellable): Promise<any>;
|
|
13
|
-
[inspect.custom](depth: any, options: any): string;
|
|
14
|
-
}
|
|
15
|
-
export type ServiceCloseHandler = () => void;
|
|
16
|
-
export type ServiceMessageHandler = (message: any) => void;
|
package/dist/service.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Service = void 0;
|
|
4
|
-
const signals_1 = require("./signals");
|
|
5
|
-
const util_1 = require("util");
|
|
6
|
-
class Service {
|
|
7
|
-
constructor(impl) {
|
|
8
|
-
this.impl = impl;
|
|
9
|
-
const signals = impl.signals;
|
|
10
|
-
this.close = new signals_1.Signal(signals, "close");
|
|
11
|
-
this.message = new signals_1.Signal(signals, "message");
|
|
12
|
-
}
|
|
13
|
-
activate(cancellable) {
|
|
14
|
-
return this.impl.activate(cancellable);
|
|
15
|
-
}
|
|
16
|
-
cancel(cancellable) {
|
|
17
|
-
return this.impl.cancel(cancellable);
|
|
18
|
-
}
|
|
19
|
-
request(parameters, cancellable) {
|
|
20
|
-
return this.impl.request(parameters, cancellable);
|
|
21
|
-
}
|
|
22
|
-
[util_1.inspect.custom](depth, options) {
|
|
23
|
-
return "Service {}";
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
exports.Service = Service;
|
package/dist/session.d.ts
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
/// <reference types="node" />
|
|
3
|
-
import { Cancellable } from "./cancellable";
|
|
4
|
-
import { Crash } from "./crash";
|
|
5
|
-
import { PortalMembership } from "./portal_membership";
|
|
6
|
-
import { Relay } from "./relay";
|
|
7
|
-
import { Script, ScriptOptions, SnapshotOptions } from "./script";
|
|
8
|
-
import { Signal } from "./signals";
|
|
9
|
-
import { inspect } from "util";
|
|
10
|
-
export declare class Session {
|
|
11
|
-
private impl;
|
|
12
|
-
detached: Signal<SessionDetachedHandler>;
|
|
13
|
-
constructor(impl: any);
|
|
14
|
-
get pid(): number;
|
|
15
|
-
get persistTimeout(): number;
|
|
16
|
-
get isDetached(): boolean;
|
|
17
|
-
detach(cancellable?: Cancellable): Promise<void>;
|
|
18
|
-
resume(cancellable?: Cancellable): Promise<void>;
|
|
19
|
-
enableChildGating(cancellable?: Cancellable): Promise<void>;
|
|
20
|
-
disableChildGating(cancellable?: Cancellable): Promise<void>;
|
|
21
|
-
createScript(source: string, options?: ScriptOptions, cancellable?: Cancellable): Promise<Script>;
|
|
22
|
-
createScriptFromBytes(bytes: Buffer, options?: ScriptOptions, cancellable?: Cancellable): Promise<Script>;
|
|
23
|
-
compileScript(source: string, options?: ScriptOptions, cancellable?: Cancellable): Promise<Buffer>;
|
|
24
|
-
snapshotScript(embedScript: string, options?: SnapshotOptions, cancellable?: Cancellable): Promise<Buffer>;
|
|
25
|
-
setupPeerConnection(options?: PeerOptions, cancellable?: Cancellable): Promise<void>;
|
|
26
|
-
joinPortal(address: string, options?: PortalOptions, cancellable?: Cancellable): Promise<PortalMembership>;
|
|
27
|
-
[inspect.custom](depth: any, options: any): string;
|
|
28
|
-
}
|
|
29
|
-
export type SessionDetachedHandler = (reason: SessionDetachReason, crash: Crash | null) => void;
|
|
30
|
-
export declare enum SessionDetachReason {
|
|
31
|
-
ApplicationRequested = "application-requested",
|
|
32
|
-
ProcessReplaced = "process-replaced",
|
|
33
|
-
ProcessTerminated = "process-terminated",
|
|
34
|
-
ConnectionTerminated = "connection-terminated",
|
|
35
|
-
DeviceLost = "device-lost"
|
|
36
|
-
}
|
|
37
|
-
export interface PeerOptions {
|
|
38
|
-
stunServer?: string;
|
|
39
|
-
relays?: Relay[];
|
|
40
|
-
}
|
|
41
|
-
export interface PortalOptions {
|
|
42
|
-
certificate?: string;
|
|
43
|
-
token?: string;
|
|
44
|
-
acl?: string[];
|
|
45
|
-
}
|
package/dist/session.js
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SessionDetachReason = exports.Session = void 0;
|
|
4
|
-
const portal_membership_1 = require("./portal_membership");
|
|
5
|
-
const script_1 = require("./script");
|
|
6
|
-
const signals_1 = require("./signals");
|
|
7
|
-
const util_1 = require("util");
|
|
8
|
-
class Session {
|
|
9
|
-
constructor(impl) {
|
|
10
|
-
this.impl = impl;
|
|
11
|
-
const { signals } = impl;
|
|
12
|
-
this.detached = new signals_1.Signal(signals, "detached");
|
|
13
|
-
}
|
|
14
|
-
get pid() {
|
|
15
|
-
return this.impl.pid;
|
|
16
|
-
}
|
|
17
|
-
get persistTimeout() {
|
|
18
|
-
return this.impl.persistTimeout;
|
|
19
|
-
}
|
|
20
|
-
get isDetached() {
|
|
21
|
-
return this.impl.isDetached;
|
|
22
|
-
}
|
|
23
|
-
detach(cancellable) {
|
|
24
|
-
return this.impl.detach(cancellable);
|
|
25
|
-
}
|
|
26
|
-
resume(cancellable) {
|
|
27
|
-
return this.impl.resume(cancellable);
|
|
28
|
-
}
|
|
29
|
-
enableChildGating(cancellable) {
|
|
30
|
-
return this.impl.enableChildGating(cancellable);
|
|
31
|
-
}
|
|
32
|
-
disableChildGating(cancellable) {
|
|
33
|
-
return this.impl.disableChildGating(cancellable);
|
|
34
|
-
}
|
|
35
|
-
async createScript(source, options = {}, cancellable) {
|
|
36
|
-
const { name = null, snapshot = null, runtime = null } = options;
|
|
37
|
-
return new script_1.Script(await this.impl.createScript(source, name, snapshot, runtime, cancellable));
|
|
38
|
-
}
|
|
39
|
-
async createScriptFromBytes(bytes, options = {}, cancellable) {
|
|
40
|
-
const { name = null, snapshot = null, runtime = null } = options;
|
|
41
|
-
return new script_1.Script(await this.impl.createScriptFromBytes(bytes, name, snapshot, runtime, cancellable));
|
|
42
|
-
}
|
|
43
|
-
compileScript(source, options = {}, cancellable) {
|
|
44
|
-
const { name = null, runtime = null } = options;
|
|
45
|
-
return this.impl.compileScript(source, name, runtime, cancellable);
|
|
46
|
-
}
|
|
47
|
-
snapshotScript(embedScript, options = {}, cancellable) {
|
|
48
|
-
const { warmupScript = null, runtime = null } = options;
|
|
49
|
-
return this.impl.snapshotScript(embedScript, warmupScript, runtime, cancellable);
|
|
50
|
-
}
|
|
51
|
-
setupPeerConnection(options = {}, cancellable) {
|
|
52
|
-
const { stunServer = null, relays = [], } = options;
|
|
53
|
-
return this.impl.setupPeerConnection(stunServer, relays, cancellable);
|
|
54
|
-
}
|
|
55
|
-
async joinPortal(address, options = {}, cancellable) {
|
|
56
|
-
const { certificate = null, token = null, acl = null, } = options;
|
|
57
|
-
return new portal_membership_1.PortalMembership(await this.impl.joinPortal(address, certificate, token, acl, cancellable));
|
|
58
|
-
}
|
|
59
|
-
[util_1.inspect.custom](depth, options) {
|
|
60
|
-
return "Session " + (0, util_1.inspect)({
|
|
61
|
-
pid: this.pid
|
|
62
|
-
}, options);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
exports.Session = Session;
|
|
66
|
-
var SessionDetachReason;
|
|
67
|
-
(function (SessionDetachReason) {
|
|
68
|
-
SessionDetachReason["ApplicationRequested"] = "application-requested";
|
|
69
|
-
SessionDetachReason["ProcessReplaced"] = "process-replaced";
|
|
70
|
-
SessionDetachReason["ProcessTerminated"] = "process-terminated";
|
|
71
|
-
SessionDetachReason["ConnectionTerminated"] = "connection-terminated";
|
|
72
|
-
SessionDetachReason["DeviceLost"] = "device-lost";
|
|
73
|
-
})(SessionDetachReason || (exports.SessionDetachReason = SessionDetachReason = {}));
|
package/dist/signals.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export interface Signals {
|
|
2
|
-
connect(name: string, handler: SignalHandler): void;
|
|
3
|
-
disconnect(name: string, handler: SignalHandler): void;
|
|
4
|
-
}
|
|
5
|
-
export declare class Signal<T extends SignalHandler> {
|
|
6
|
-
private signals;
|
|
7
|
-
private name;
|
|
8
|
-
constructor(signals: Signals, name: string);
|
|
9
|
-
connect(handler: T): void;
|
|
10
|
-
disconnect(handler: T): void;
|
|
11
|
-
}
|
|
12
|
-
export type SignalHandler = (...args: any[]) => void;
|
|
13
|
-
export declare class SignalAdapter implements Signals {
|
|
14
|
-
protected signals: Signals;
|
|
15
|
-
private proxyHandlers;
|
|
16
|
-
constructor(signals: Signals);
|
|
17
|
-
connect(name: string, handler: SignalHandler): void;
|
|
18
|
-
disconnect(name: string, handler: SignalHandler): void;
|
|
19
|
-
protected getProxy(name: string, userHandler: SignalHandler): SignalHandler | null;
|
|
20
|
-
}
|
package/dist/signals.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SignalAdapter = exports.Signal = void 0;
|
|
4
|
-
class Signal {
|
|
5
|
-
constructor(signals, name) {
|
|
6
|
-
this.signals = signals;
|
|
7
|
-
this.name = name;
|
|
8
|
-
}
|
|
9
|
-
connect(handler) {
|
|
10
|
-
this.signals.connect(this.name, handler);
|
|
11
|
-
}
|
|
12
|
-
disconnect(handler) {
|
|
13
|
-
this.signals.disconnect(this.name, handler);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
exports.Signal = Signal;
|
|
17
|
-
class SignalAdapter {
|
|
18
|
-
constructor(signals) {
|
|
19
|
-
this.signals = signals;
|
|
20
|
-
this.proxyHandlers = new Map();
|
|
21
|
-
}
|
|
22
|
-
connect(name, handler) {
|
|
23
|
-
const proxyHandler = this.getProxy(name, handler);
|
|
24
|
-
if (proxyHandler !== null) {
|
|
25
|
-
this.proxyHandlers.set(handler, proxyHandler);
|
|
26
|
-
this.signals.connect(name, proxyHandler);
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
this.signals.connect(name, handler);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
disconnect(name, handler) {
|
|
33
|
-
const proxyHandler = this.proxyHandlers.get(handler);
|
|
34
|
-
this.signals.disconnect(name, (proxyHandler !== undefined) ? proxyHandler : handler);
|
|
35
|
-
}
|
|
36
|
-
getProxy(name, userHandler) {
|
|
37
|
-
return null;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
exports.SignalAdapter = SignalAdapter;
|
package/dist/socket_address.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
export type SocketAddress = IPV4SocketAddress | IPV6SocketAddress | AnonymousUnixSocketAddress | PathUnixSocketAddress | AbstractUnixSocketAddress;
|
|
3
|
-
export interface IPV4SocketAddress {
|
|
4
|
-
family: "ipv4";
|
|
5
|
-
address: string;
|
|
6
|
-
port: number;
|
|
7
|
-
}
|
|
8
|
-
export interface IPV6SocketAddress {
|
|
9
|
-
family: "ipv6";
|
|
10
|
-
address: string;
|
|
11
|
-
port: number;
|
|
12
|
-
flowlabel: number;
|
|
13
|
-
scopeid: number;
|
|
14
|
-
}
|
|
15
|
-
export interface AnonymousUnixSocketAddress {
|
|
16
|
-
family: "unix:anonymous";
|
|
17
|
-
}
|
|
18
|
-
export interface PathUnixSocketAddress {
|
|
19
|
-
family: "unix:path";
|
|
20
|
-
path: string;
|
|
21
|
-
}
|
|
22
|
-
export interface AbstractUnixSocketAddress {
|
|
23
|
-
family: "unix:abstract";
|
|
24
|
-
path: Buffer;
|
|
25
|
-
}
|
package/dist/socket_address.js
DELETED
package/dist/spawn.d.ts
DELETED
package/dist/spawn.js
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
export interface SystemParameters {
|
|
2
|
-
/**
|
|
3
|
-
* Operating System details.
|
|
4
|
-
*/
|
|
5
|
-
os: {
|
|
6
|
-
/**
|
|
7
|
-
* ID, e.g.: windows, macos, linux, ios, android, qnx, fedora, ubuntu, etc.
|
|
8
|
-
*/
|
|
9
|
-
id: string;
|
|
10
|
-
/**
|
|
11
|
-
* Human-readable name, e.g. `"macOS"`.
|
|
12
|
-
*/
|
|
13
|
-
name: string;
|
|
14
|
-
/**
|
|
15
|
-
* Human-readable version string, e.g. `"11.2.2"`.
|
|
16
|
-
*/
|
|
17
|
-
version?: string;
|
|
18
|
-
/**
|
|
19
|
-
* Build version, e.g. `"21B91"`.
|
|
20
|
-
*/
|
|
21
|
-
build?: string;
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* Platform, same as `Process.platform` in GumJS.
|
|
25
|
-
*/
|
|
26
|
-
platform: "windows" | "darwin" | "linux" | "qnx";
|
|
27
|
-
/**
|
|
28
|
-
* Architecture, same as `Process.arch` in GumJS.
|
|
29
|
-
*/
|
|
30
|
-
arch: "ia32" | "x64" | "arm" | "arm64" | "mips";
|
|
31
|
-
/**
|
|
32
|
-
* Hardware details.
|
|
33
|
-
*/
|
|
34
|
-
hardware?: {
|
|
35
|
-
/**
|
|
36
|
-
* Product type, e.g. `"iPad6,3"`.
|
|
37
|
-
*/
|
|
38
|
-
product?: string;
|
|
39
|
-
/**
|
|
40
|
-
* Hardware platform, e.g. `"t8010"`.
|
|
41
|
-
*/
|
|
42
|
-
platform?: string;
|
|
43
|
-
/**
|
|
44
|
-
* Hardware model, e.g. `"J71bAP"`.
|
|
45
|
-
*/
|
|
46
|
-
model?: string;
|
|
47
|
-
};
|
|
48
|
-
/**
|
|
49
|
-
* Level of access.
|
|
50
|
-
*/
|
|
51
|
-
access: "full" | "jailed";
|
|
52
|
-
/**
|
|
53
|
-
* System name, e.g. `"Ole André’s iPhone"`.
|
|
54
|
-
*/
|
|
55
|
-
name?: string;
|
|
56
|
-
/**
|
|
57
|
-
* iOS UDID (Unique Device ID).
|
|
58
|
-
*/
|
|
59
|
-
udid?: string;
|
|
60
|
-
/**
|
|
61
|
-
* Details about cellular and networking interfaces.
|
|
62
|
-
*/
|
|
63
|
-
interfaces?: SystemInterface[];
|
|
64
|
-
/**
|
|
65
|
-
* Android API level, e.g.: `30`.
|
|
66
|
-
*/
|
|
67
|
-
apiLevel?: number;
|
|
68
|
-
[name: string]: any;
|
|
69
|
-
}
|
|
70
|
-
export type SystemInterface = NetworkInterface | CellularInterface;
|
|
71
|
-
export interface NetworkInterface {
|
|
72
|
-
type: "ethernet" | "wifi" | "bluetooth";
|
|
73
|
-
/**
|
|
74
|
-
* MAC address, e.g.: `"aa:bb:cc:dd:ee:ff"`.
|
|
75
|
-
*/
|
|
76
|
-
address: string;
|
|
77
|
-
}
|
|
78
|
-
export interface CellularInterface {
|
|
79
|
-
type: "cellular";
|
|
80
|
-
/**
|
|
81
|
-
* Phone number, e.g. `"+47 123 45 678"`.
|
|
82
|
-
*/
|
|
83
|
-
phoneNumber: string;
|
|
84
|
-
}
|