frida 16.7.13 → 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
|
@@ -0,0 +1,938 @@
|
|
|
1
|
+
export interface FridaBinding {
|
|
2
|
+
commitConstructors(): void;
|
|
3
|
+
DeviceManager: typeof DeviceManager;
|
|
4
|
+
Device: typeof Device;
|
|
5
|
+
_Device: typeof _Device;
|
|
6
|
+
RemoteDeviceOptions: RemoteDeviceOptions;
|
|
7
|
+
Application: typeof Application;
|
|
8
|
+
Process: typeof Process;
|
|
9
|
+
ProcessMatchOptions: ProcessMatchOptions;
|
|
10
|
+
RawSpawnOptions: RawSpawnOptions;
|
|
11
|
+
Spawn: typeof Spawn;
|
|
12
|
+
Child: typeof Child;
|
|
13
|
+
Crash: typeof Crash;
|
|
14
|
+
Bus: typeof Bus;
|
|
15
|
+
_Bus: typeof _Bus;
|
|
16
|
+
Service: typeof Service;
|
|
17
|
+
Session: typeof Session;
|
|
18
|
+
Script: typeof Script;
|
|
19
|
+
_Script: typeof _Script;
|
|
20
|
+
PortalMembership: typeof PortalMembership;
|
|
21
|
+
ControlService: typeof ControlService;
|
|
22
|
+
ControlServiceOptions: ControlServiceOptions;
|
|
23
|
+
PortalService: typeof PortalService;
|
|
24
|
+
_PortalService: typeof _PortalService;
|
|
25
|
+
FileMonitor: typeof FileMonitor;
|
|
26
|
+
Compiler: typeof Compiler;
|
|
27
|
+
CompilerOptions: CompilerOptions;
|
|
28
|
+
BuildOptions: BuildOptions;
|
|
29
|
+
WatchOptions: WatchOptions;
|
|
30
|
+
StaticAuthenticationService: typeof StaticAuthenticationService;
|
|
31
|
+
FrontmostQueryOptions: FrontmostQueryOptions;
|
|
32
|
+
ApplicationQueryOptions: ApplicationQueryOptions;
|
|
33
|
+
ProcessQueryOptions: ProcessQueryOptions;
|
|
34
|
+
SessionOptions: SessionOptions;
|
|
35
|
+
ScriptOptions: ScriptOptions;
|
|
36
|
+
SnapshotOptions: SnapshotOptions;
|
|
37
|
+
PortalOptions: PortalOptions;
|
|
38
|
+
PeerOptions: PeerOptions;
|
|
39
|
+
Relay: typeof Relay;
|
|
40
|
+
_Relay: typeof _Relay;
|
|
41
|
+
EndpointParameters: typeof EndpointParameters;
|
|
42
|
+
_EndpointParameters: typeof _EndpointParameters;
|
|
43
|
+
AbstractAuthenticationService: typeof AbstractAuthenticationService;
|
|
44
|
+
BaseObject: typeof BaseObject;
|
|
45
|
+
Cancellable: typeof Cancellable;
|
|
46
|
+
_Cancellable: typeof _Cancellable;
|
|
47
|
+
IOStream: typeof IOStream;
|
|
48
|
+
InputStream: typeof InputStream;
|
|
49
|
+
OutputStream: typeof OutputStream;
|
|
50
|
+
InetSocketAddress: typeof InetSocketAddress;
|
|
51
|
+
InetAddress: typeof InetAddress;
|
|
52
|
+
UnixSocketAddress: typeof UnixSocketAddress;
|
|
53
|
+
BaseSocketAddress: typeof BaseSocketAddress;
|
|
54
|
+
SocketAddressEnumerator: typeof SocketAddressEnumerator;
|
|
55
|
+
Runtime: typeof Runtime;
|
|
56
|
+
DeviceType: typeof DeviceType;
|
|
57
|
+
SourceMaps: typeof SourceMaps;
|
|
58
|
+
JsCompression: typeof JsCompression;
|
|
59
|
+
Realm: typeof Realm;
|
|
60
|
+
SessionDetachReason: typeof SessionDetachReason;
|
|
61
|
+
Scope: typeof Scope;
|
|
62
|
+
Stdio: typeof Stdio;
|
|
63
|
+
ChildOrigin: typeof ChildOrigin;
|
|
64
|
+
SnapshotTransport: typeof SnapshotTransport;
|
|
65
|
+
ScriptRuntime: typeof ScriptRuntime;
|
|
66
|
+
RelayKind: typeof RelayKind;
|
|
67
|
+
FileMonitorEvent: typeof FileMonitorEvent;
|
|
68
|
+
SocketFamily: typeof SocketFamily;
|
|
69
|
+
UnixSocketAddressType: typeof UnixSocketAddressType;
|
|
70
|
+
MessageType: typeof MessageType;
|
|
71
|
+
LogLevel: typeof LogLevel;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export class DeviceManager extends BaseObject {
|
|
75
|
+
constructor();
|
|
76
|
+
close(cancellable?: Cancellable | null): Promise<void>;
|
|
77
|
+
getDeviceById(id: string, timeout: number, cancellable?: Cancellable | null): Promise<Device>;
|
|
78
|
+
getDeviceByType(type: DeviceType, timeout: number, cancellable?: Cancellable | null): Promise<Device>;
|
|
79
|
+
findDeviceById(id: string, timeout: number, cancellable?: Cancellable | null): Promise<Device | null>;
|
|
80
|
+
findDeviceByType(type: DeviceType, timeout: number, cancellable?: Cancellable | null): Promise<Device | null>;
|
|
81
|
+
enumerateDevices(cancellable?: Cancellable | null): Promise<Device[]>;
|
|
82
|
+
addRemoteDevice(address: string, options?: RemoteDeviceOptions, cancellable?: Cancellable | null): Promise<Device>;
|
|
83
|
+
removeRemoteDevice(address: string, cancellable?: Cancellable | null): Promise<void>;
|
|
84
|
+
readonly added: Signal<DeviceAddedHandler>;
|
|
85
|
+
readonly removed: Signal<DeviceRemovedHandler>;
|
|
86
|
+
readonly changed: Signal<DeviceChangedHandler>;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export type DeviceAddedHandler = (device: Device) => void;
|
|
90
|
+
export type DeviceRemovedHandler = (device: Device) => void;
|
|
91
|
+
export type DeviceChangedHandler = () => void;
|
|
92
|
+
|
|
93
|
+
export class Device extends _Device {
|
|
94
|
+
getProcess(name: string, options?: ProcessMatchOptions, cancellable?: Cancellable | null): Promise<Process>;
|
|
95
|
+
querySystemParameters(cancellable?: Cancellable | null): Promise<SystemParameters>;
|
|
96
|
+
spawn(programOrArgv: string | string[], opts?: SpawnOptions, cancellable?: Cancellable | null): Promise<ProcessID>;
|
|
97
|
+
input(target: TargetProcess, data: Buffer, cancellable?: Cancellable | null): Promise<void>;
|
|
98
|
+
resume(target: TargetProcess, cancellable?: Cancellable | null): Promise<void>;
|
|
99
|
+
kill(target: TargetProcess, cancellable?: Cancellable | null): Promise<void>;
|
|
100
|
+
attach(target: TargetProcess, options?: SessionOptions, cancellable?: Cancellable | null): Promise<Session>;
|
|
101
|
+
injectLibraryFile(target: TargetProcess, path: string, entrypoint: string, data: string, cancellable?: Cancellable | null): Promise<InjecteeID>;
|
|
102
|
+
injectLibraryBlob(target: TargetProcess, blob: Buffer, entrypoint: string, data: string, cancellable?: Cancellable | null): Promise<InjecteeID>;
|
|
103
|
+
openChannel(address: string, cancellable?: Cancellable | null): Promise<NodeJS.ReadWriteStream>;
|
|
104
|
+
readonly output: Signal<OutputHandler>;
|
|
105
|
+
readonly uninjected: Signal<UninjectedHandler>;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export type OutputHandler = (pid: ProcessID, fd: FileDescriptor, data: Buffer) => void;
|
|
109
|
+
export type UninjectedHandler = (id: InjecteeID) => void;
|
|
110
|
+
|
|
111
|
+
export class _Device extends BaseObject {
|
|
112
|
+
isLost(): boolean;
|
|
113
|
+
protected _querySystemParameters(cancellable?: Cancellable | null): Promise<VariantDict>;
|
|
114
|
+
getFrontmostApplication(options?: FrontmostQueryOptions, cancellable?: Cancellable | null): Promise<Application | null>;
|
|
115
|
+
enumerateApplications(options?: ApplicationQueryOptions, cancellable?: Cancellable | null): Promise<Application[]>;
|
|
116
|
+
getProcessByPid(pid: number, options?: ProcessMatchOptions, cancellable?: Cancellable | null): Promise<Process>;
|
|
117
|
+
getProcessByName(name: string, options?: ProcessMatchOptions, cancellable?: Cancellable | null): Promise<Process>;
|
|
118
|
+
findProcessByPid(pid: number, options?: ProcessMatchOptions, cancellable?: Cancellable | null): Promise<Process | null>;
|
|
119
|
+
findProcessByName(name: string, options?: ProcessMatchOptions, cancellable?: Cancellable | null): Promise<Process | null>;
|
|
120
|
+
enumerateProcesses(options?: ProcessQueryOptions, cancellable?: Cancellable | null): Promise<Process[]>;
|
|
121
|
+
enableSpawnGating(cancellable?: Cancellable | null): Promise<void>;
|
|
122
|
+
disableSpawnGating(cancellable?: Cancellable | null): Promise<void>;
|
|
123
|
+
enumeratePendingSpawn(cancellable?: Cancellable | null): Promise<Spawn[]>;
|
|
124
|
+
enumeratePendingChildren(cancellable?: Cancellable | null): Promise<Child[]>;
|
|
125
|
+
protected _spawn(program: string, options?: RawSpawnOptions, cancellable?: Cancellable | null): Promise<number>;
|
|
126
|
+
protected _input(pid: number, data: Buffer, cancellable?: Cancellable | null): Promise<void>;
|
|
127
|
+
protected _resume(pid: number, cancellable?: Cancellable | null): Promise<void>;
|
|
128
|
+
protected _kill(pid: number, cancellable?: Cancellable | null): Promise<void>;
|
|
129
|
+
protected _attach(pid: number, options?: SessionOptions, cancellable?: Cancellable | null): Promise<Session>;
|
|
130
|
+
protected _injectLibraryFile(pid: number, path: string, entrypoint: string, data: string, cancellable?: Cancellable | null): Promise<number>;
|
|
131
|
+
protected _injectLibraryBlob(pid: number, blob: Buffer, entrypoint: string, data: string, cancellable?: Cancellable | null): Promise<number>;
|
|
132
|
+
protected _openChannel(address: string, cancellable?: Cancellable | null): Promise<IOStream>;
|
|
133
|
+
openService(address: string, cancellable?: Cancellable | null): Promise<Service>;
|
|
134
|
+
unpair(cancellable?: Cancellable | null): Promise<void>;
|
|
135
|
+
readonly id: string;
|
|
136
|
+
readonly name: string;
|
|
137
|
+
icon: any;
|
|
138
|
+
readonly type: DeviceType;
|
|
139
|
+
readonly bus: Bus;
|
|
140
|
+
readonly spawnAdded: Signal<SpawnAddedHandler>;
|
|
141
|
+
readonly spawnRemoved: Signal<SpawnRemovedHandler>;
|
|
142
|
+
readonly childAdded: Signal<ChildAddedHandler>;
|
|
143
|
+
readonly childRemoved: Signal<ChildRemovedHandler>;
|
|
144
|
+
readonly processCrashed: Signal<ProcessCrashedHandler>;
|
|
145
|
+
protected readonly _output: Signal<_OutputHandler>;
|
|
146
|
+
protected readonly _uninjected: Signal<_UninjectedHandler>;
|
|
147
|
+
readonly lost: Signal<DeviceLostHandler>;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export type SpawnAddedHandler = (spawn: Spawn) => void;
|
|
151
|
+
export type SpawnRemovedHandler = (spawn: Spawn) => void;
|
|
152
|
+
export type ChildAddedHandler = (child: Child) => void;
|
|
153
|
+
export type ChildRemovedHandler = (child: Child) => void;
|
|
154
|
+
export type ProcessCrashedHandler = (crash: Crash) => void;
|
|
155
|
+
export type _OutputHandler = (pid: number, fd: number, data: Buffer) => void;
|
|
156
|
+
export type _UninjectedHandler = (id: number) => void;
|
|
157
|
+
export type DeviceLostHandler = () => void;
|
|
158
|
+
|
|
159
|
+
export interface RemoteDeviceOptions {
|
|
160
|
+
certificate?: string;
|
|
161
|
+
origin?: string;
|
|
162
|
+
token?: string;
|
|
163
|
+
keepaliveInterval?: number;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export class Application extends BaseObject {
|
|
167
|
+
identifier: string;
|
|
168
|
+
name: string;
|
|
169
|
+
pid: number;
|
|
170
|
+
parameters: VariantDict;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export class Process extends BaseObject {
|
|
174
|
+
pid: number;
|
|
175
|
+
name: string;
|
|
176
|
+
parameters: VariantDict;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export interface ProcessMatchOptions {
|
|
180
|
+
timeout?: number;
|
|
181
|
+
scope?: Scope;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export interface RawSpawnOptions {
|
|
185
|
+
argv?: string[];
|
|
186
|
+
envp?: string[];
|
|
187
|
+
env?: string[];
|
|
188
|
+
cwd?: string;
|
|
189
|
+
stdio?: Stdio;
|
|
190
|
+
aux?: VariantDict;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
export class Spawn extends BaseObject {
|
|
194
|
+
pid: number;
|
|
195
|
+
identifier: string;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
export class Child extends BaseObject {
|
|
199
|
+
pid: number;
|
|
200
|
+
parentPid: number;
|
|
201
|
+
origin: ChildOrigin;
|
|
202
|
+
identifier: string;
|
|
203
|
+
path: string;
|
|
204
|
+
argv: string[];
|
|
205
|
+
envp: string[];
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
export class Crash extends BaseObject {
|
|
209
|
+
pid: number;
|
|
210
|
+
processName: string;
|
|
211
|
+
summary: string;
|
|
212
|
+
report: string;
|
|
213
|
+
parameters: VariantDict;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
export class Bus extends _Bus {
|
|
217
|
+
post(message: any, data?: Buffer | null): void;
|
|
218
|
+
readonly message: Signal<BusMessageHandler>;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
export type BusMessageHandler = (message: any, data: Buffer | null) => void;
|
|
222
|
+
|
|
223
|
+
export class _Bus extends BaseObject {
|
|
224
|
+
isDetached(): boolean;
|
|
225
|
+
attach(cancellable?: Cancellable | null): Promise<void>;
|
|
226
|
+
protected _post(json: string, data?: Buffer | null): void;
|
|
227
|
+
readonly detached: Signal<BusDetachedHandler>;
|
|
228
|
+
protected readonly _message: Signal<_BusMessageHandler>;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
export type BusDetachedHandler = () => void;
|
|
232
|
+
export type _BusMessageHandler = (json: string, data: Buffer | null) => void;
|
|
233
|
+
|
|
234
|
+
export class Service extends BaseObject {
|
|
235
|
+
isClosed(): boolean;
|
|
236
|
+
activate(cancellable?: Cancellable | null): Promise<void>;
|
|
237
|
+
cancel(cancellable?: Cancellable | null): Promise<void>;
|
|
238
|
+
request(parameters: any, cancellable?: Cancellable | null): Promise<any>;
|
|
239
|
+
readonly close: Signal<ServiceCloseHandler>;
|
|
240
|
+
readonly message: Signal<ServiceMessageHandler>;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
export type ServiceCloseHandler = () => void;
|
|
244
|
+
export type ServiceMessageHandler = (message: any) => void;
|
|
245
|
+
|
|
246
|
+
export class Session extends BaseObject {
|
|
247
|
+
isDetached(): boolean;
|
|
248
|
+
detach(cancellable?: Cancellable | null): Promise<void>;
|
|
249
|
+
resume(cancellable?: Cancellable | null): Promise<void>;
|
|
250
|
+
enableChildGating(cancellable?: Cancellable | null): Promise<void>;
|
|
251
|
+
disableChildGating(cancellable?: Cancellable | null): Promise<void>;
|
|
252
|
+
createScript(source: string, options?: ScriptOptions, cancellable?: Cancellable | null): Promise<Script>;
|
|
253
|
+
createScriptFromBytes(bytes: Buffer, options?: ScriptOptions, cancellable?: Cancellable | null): Promise<Script>;
|
|
254
|
+
compileScript(source: string, options?: ScriptOptions, cancellable?: Cancellable | null): Promise<Buffer>;
|
|
255
|
+
snapshotScript(embedScript: string, options?: SnapshotOptions, cancellable?: Cancellable | null): Promise<Buffer>;
|
|
256
|
+
setupPeerConnection(options?: PeerOptions, cancellable?: Cancellable | null): Promise<void>;
|
|
257
|
+
joinPortal(address: string, options?: PortalOptions, cancellable?: Cancellable | null): Promise<PortalMembership>;
|
|
258
|
+
pid: number;
|
|
259
|
+
persistTimeout: number;
|
|
260
|
+
readonly detached: Signal<SessionDetachedHandler>;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
export type SessionDetachedHandler = (reason: SessionDetachReason, crash: Crash | null) => void;
|
|
264
|
+
|
|
265
|
+
export class Script extends _Script {
|
|
266
|
+
logHandler: ScriptLogHandler;
|
|
267
|
+
readonly isDestroyed: boolean;
|
|
268
|
+
readonly exports: ScriptExports;
|
|
269
|
+
readonly defaultLogHandler: ScriptLogHandler;
|
|
270
|
+
post(message: any, data?: Buffer | null): void;
|
|
271
|
+
enableDebugger(options?: EnableDebuggerOptions, cancellable?: Cancellable | null): Promise<void>;
|
|
272
|
+
readonly message: Signal<ScriptMessageHandler>;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
export type ScriptMessageHandler = (message: Message, data: Buffer | null) => void;
|
|
276
|
+
|
|
277
|
+
export class _Script extends BaseObject {
|
|
278
|
+
protected _isDestroyed(): boolean;
|
|
279
|
+
load(cancellable?: Cancellable | null): Promise<void>;
|
|
280
|
+
unload(cancellable?: Cancellable | null): Promise<void>;
|
|
281
|
+
eternalize(cancellable?: Cancellable | null): Promise<void>;
|
|
282
|
+
protected _post(json: string, data?: Buffer | null): void;
|
|
283
|
+
protected _enableDebugger(port: number, cancellable?: Cancellable | null): Promise<void>;
|
|
284
|
+
disableDebugger(cancellable?: Cancellable | null): Promise<void>;
|
|
285
|
+
readonly destroyed: Signal<ScriptDestroyedHandler>;
|
|
286
|
+
protected readonly _message: Signal<_ScriptMessageHandler>;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
export type ScriptDestroyedHandler = () => void;
|
|
290
|
+
export type _ScriptMessageHandler = (json: string, data: Buffer | null) => void;
|
|
291
|
+
|
|
292
|
+
export class PortalMembership extends BaseObject {
|
|
293
|
+
terminate(cancellable?: Cancellable | null): Promise<void>;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
export class ControlService extends BaseObject {
|
|
297
|
+
constructor(endpointParams: EndpointParameters, options?: ControlServiceOptions);
|
|
298
|
+
start(cancellable?: Cancellable | null): Promise<void>;
|
|
299
|
+
stop(cancellable?: Cancellable | null): Promise<void>;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
export interface ControlServiceOptions {
|
|
303
|
+
sysroot?: string;
|
|
304
|
+
enablePreload?: boolean;
|
|
305
|
+
reportCrashes?: boolean;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
export class PortalService extends _PortalService {
|
|
309
|
+
constructor(options?: PortalServiceOptions);
|
|
310
|
+
post(connectionId: PortalConnectionId, message: any, data?: Buffer | null): void;
|
|
311
|
+
narrowcast(tag: string, message: any, data?: Buffer | null): void;
|
|
312
|
+
broadcast(message: any, data?: Buffer | null): void;
|
|
313
|
+
readonly nodeConnected: Signal<PortalNodeConnectedHandler>;
|
|
314
|
+
readonly nodeJoined: Signal<PortalNodeJoinedHandler>;
|
|
315
|
+
readonly nodeLeft: Signal<PortalNodeLeftHandler>;
|
|
316
|
+
readonly nodeDisconnected: Signal<PortalNodeDisconnectedHandler>;
|
|
317
|
+
readonly controllerConnected: Signal<PortalControllerConnectedHandler>;
|
|
318
|
+
readonly controllerDisconnected: Signal<PortalControllerDisconnectedHandler>;
|
|
319
|
+
readonly authenticated: Signal<PortalAuthenticatedHandler>;
|
|
320
|
+
readonly subscribe: Signal<PortalSubscribeHandler>;
|
|
321
|
+
readonly message: Signal<PortalMessageHandler>;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
export type PortalNodeConnectedHandler = (connectionId: PortalConnectionId, remoteAddress: SocketAddress) => void;
|
|
325
|
+
export type PortalNodeJoinedHandler = (connectionId: PortalConnectionId, application: Application) => void;
|
|
326
|
+
export type PortalNodeLeftHandler = (connectionId: PortalConnectionId, application: Application) => void;
|
|
327
|
+
export type PortalNodeDisconnectedHandler = (connectionId: PortalConnectionId, remoteAddress: SocketAddress) => void;
|
|
328
|
+
export type PortalControllerConnectedHandler = (connectionId: PortalConnectionId, remoteAddress: SocketAddress) => void;
|
|
329
|
+
export type PortalControllerDisconnectedHandler = (connectionId: PortalConnectionId, remoteAddress: SocketAddress) => void;
|
|
330
|
+
export type PortalAuthenticatedHandler = (connectionId: PortalConnectionId, sessionInfo: AuthenticatedSessionInfo) => void;
|
|
331
|
+
export type PortalSubscribeHandler = (connectionId: PortalConnectionId) => void;
|
|
332
|
+
export type PortalMessageHandler = (connectionId: PortalConnectionId, message: any, data: Buffer | null) => void;
|
|
333
|
+
|
|
334
|
+
export class _PortalService extends BaseObject {
|
|
335
|
+
constructor(clusterParams: EndpointParameters, controlParams?: EndpointParameters | null);
|
|
336
|
+
start(cancellable?: Cancellable | null): Promise<void>;
|
|
337
|
+
stop(cancellable?: Cancellable | null): Promise<void>;
|
|
338
|
+
kick(connectionId: number): void;
|
|
339
|
+
protected _post(connectionId: number, json: string, data?: Buffer | null): void;
|
|
340
|
+
protected _narrowcast(tag: string, json: string, data?: Buffer | null): void;
|
|
341
|
+
protected _broadcast(json: string, data?: Buffer | null): void;
|
|
342
|
+
enumerateTags(connectionId: number): string[] | null;
|
|
343
|
+
tag(connectionId: number, tag: string): void;
|
|
344
|
+
untag(connectionId: number, tag: string): void;
|
|
345
|
+
readonly device: Device;
|
|
346
|
+
clusterParams: EndpointParameters;
|
|
347
|
+
controlParams: EndpointParameters;
|
|
348
|
+
protected readonly _nodeConnected: Signal<_PortalNodeConnectedHandler>;
|
|
349
|
+
protected readonly _nodeJoined: Signal<_PortalNodeJoinedHandler>;
|
|
350
|
+
protected readonly _nodeLeft: Signal<_PortalNodeLeftHandler>;
|
|
351
|
+
protected readonly _nodeDisconnected: Signal<_PortalNodeDisconnectedHandler>;
|
|
352
|
+
protected readonly _controllerConnected: Signal<_PortalControllerConnectedHandler>;
|
|
353
|
+
protected readonly _controllerDisconnected: Signal<_PortalControllerDisconnectedHandler>;
|
|
354
|
+
protected readonly _authenticated: Signal<_PortalAuthenticatedHandler>;
|
|
355
|
+
protected readonly _subscribe: Signal<_PortalSubscribeHandler>;
|
|
356
|
+
protected readonly _message: Signal<_PortalMessageHandler>;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
export type _PortalNodeConnectedHandler = (connectionId: number, remoteAddress: BaseSocketAddress) => void;
|
|
360
|
+
export type _PortalNodeJoinedHandler = (connectionId: number, application: Application) => void;
|
|
361
|
+
export type _PortalNodeLeftHandler = (connectionId: number, application: Application) => void;
|
|
362
|
+
export type _PortalNodeDisconnectedHandler = (connectionId: number, remoteAddress: BaseSocketAddress) => void;
|
|
363
|
+
export type _PortalControllerConnectedHandler = (connectionId: number, remoteAddress: BaseSocketAddress) => void;
|
|
364
|
+
export type _PortalControllerDisconnectedHandler = (connectionId: number, remoteAddress: BaseSocketAddress) => void;
|
|
365
|
+
export type _PortalAuthenticatedHandler = (connectionId: number, sessionInfo: string) => void;
|
|
366
|
+
export type _PortalSubscribeHandler = (connectionId: number) => void;
|
|
367
|
+
export type _PortalMessageHandler = (connectionId: number, json: string, data: Buffer | null) => void;
|
|
368
|
+
|
|
369
|
+
export class FileMonitor extends BaseObject {
|
|
370
|
+
constructor(path: string);
|
|
371
|
+
enable(cancellable?: Cancellable | null): Promise<void>;
|
|
372
|
+
disable(cancellable?: Cancellable | null): Promise<void>;
|
|
373
|
+
path: string;
|
|
374
|
+
readonly change: Signal<FileMonitorChangeHandler>;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
export type FileMonitorChangeHandler = (filePath: string, otherFilePath: string | null, event: FileMonitorEvent) => void;
|
|
378
|
+
|
|
379
|
+
export class Compiler extends BaseObject {
|
|
380
|
+
constructor(manager: DeviceManager);
|
|
381
|
+
build(entrypoint: string, options?: BuildOptions, cancellable?: Cancellable | null): Promise<string>;
|
|
382
|
+
watch(entrypoint: string, options?: WatchOptions, cancellable?: Cancellable | null): Promise<void>;
|
|
383
|
+
manager: DeviceManager;
|
|
384
|
+
readonly starting: Signal<CompilerStartingHandler>;
|
|
385
|
+
readonly finished: Signal<CompilerFinishedHandler>;
|
|
386
|
+
readonly output: Signal<CompilerOutputHandler>;
|
|
387
|
+
readonly diagnostics: Signal<CompilerDiagnosticsHandler>;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
export type CompilerStartingHandler = () => void;
|
|
391
|
+
export type CompilerFinishedHandler = () => void;
|
|
392
|
+
export type CompilerOutputHandler = (bundle: string) => void;
|
|
393
|
+
export type CompilerDiagnosticsHandler = (diagnostics: any) => void;
|
|
394
|
+
|
|
395
|
+
export interface CompilerOptions {
|
|
396
|
+
projectRoot?: string;
|
|
397
|
+
sourceMaps?: SourceMaps;
|
|
398
|
+
compression?: JsCompression;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
export interface BuildOptions {
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
export interface WatchOptions {
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
export class StaticAuthenticationService extends BaseObject implements AuthenticationService {
|
|
408
|
+
constructor(token: string);
|
|
409
|
+
tokenHash: string;
|
|
410
|
+
authenticate(token: string, cancellable?: Cancellable | null): Promise<string>;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
export interface FrontmostQueryOptions {
|
|
414
|
+
scope?: Scope;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
export interface ApplicationQueryOptions {
|
|
418
|
+
identifiers?: string[];
|
|
419
|
+
scope?: Scope;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
export interface ProcessQueryOptions {
|
|
423
|
+
pids?: number[];
|
|
424
|
+
scope?: Scope;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
export interface SessionOptions {
|
|
428
|
+
realm?: Realm;
|
|
429
|
+
persistTimeout?: number;
|
|
430
|
+
emulatedAgentPath?: string;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
export interface ScriptOptions {
|
|
434
|
+
name?: string;
|
|
435
|
+
snapshot?: Buffer;
|
|
436
|
+
snapshotTransport?: SnapshotTransport;
|
|
437
|
+
runtime?: ScriptRuntime;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
export interface SnapshotOptions {
|
|
441
|
+
warmupScript?: string;
|
|
442
|
+
runtime?: ScriptRuntime;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
export interface PortalOptions {
|
|
446
|
+
certificate?: string;
|
|
447
|
+
token?: string;
|
|
448
|
+
acl?: string[];
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
export interface PeerOptions {
|
|
452
|
+
relays?: Relay[];
|
|
453
|
+
stunServer?: string;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
export class Relay extends _Relay {
|
|
457
|
+
constructor(properties: RelayProperties);
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
export class _Relay extends BaseObject {
|
|
461
|
+
constructor(address: string, username: string, password: string, kind: RelayKind);
|
|
462
|
+
address: string;
|
|
463
|
+
username: string;
|
|
464
|
+
password: string;
|
|
465
|
+
kind: RelayKind;
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
export class EndpointParameters extends _EndpointParameters {
|
|
469
|
+
constructor(params?: EndpointParametersSubset);
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
export class _EndpointParameters extends BaseObject {
|
|
473
|
+
constructor(address: string | null, port: number, certificate?: string | null, origin?: string | null, authService?: AuthenticationService | null, assetRoot?: string | null);
|
|
474
|
+
address: string;
|
|
475
|
+
port: number;
|
|
476
|
+
certificate: string;
|
|
477
|
+
origin: string;
|
|
478
|
+
authService: AuthenticationService;
|
|
479
|
+
assetRoot: string;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
export interface AuthenticationService extends BaseObject {
|
|
483
|
+
authenticate(token: string, cancellable?: Cancellable | null): Promise<string>;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
export abstract class AbstractAuthenticationService extends BaseObject implements AuthenticationService {
|
|
487
|
+
authenticate(token: string, cancellable: Cancellable | null): Promise<string>;
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
export class BaseObject {
|
|
491
|
+
notify(propertyName: string): void;
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
export class Cancellable extends _Cancellable {
|
|
495
|
+
readonly isCancelled: boolean;
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
export class _Cancellable extends BaseObject {
|
|
499
|
+
constructor();
|
|
500
|
+
cancel(): void;
|
|
501
|
+
disconnect(handlerId: number): void;
|
|
502
|
+
getFd(): number;
|
|
503
|
+
protected _isCancelled(): boolean;
|
|
504
|
+
popCurrent(): void;
|
|
505
|
+
pushCurrent(): void;
|
|
506
|
+
reset(): void;
|
|
507
|
+
throwIfCancelled(): boolean;
|
|
508
|
+
readonly cancelled: Signal<CancelledHandler>;
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
export type CancelledHandler = () => void;
|
|
512
|
+
|
|
513
|
+
export class IOStream extends BaseObject {
|
|
514
|
+
close(ioPriority: number, cancellable?: Cancellable | null): Promise<boolean>;
|
|
515
|
+
readonly closed: boolean;
|
|
516
|
+
readonly inputStream: InputStream;
|
|
517
|
+
readonly outputStream: OutputStream;
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
export class InputStream extends BaseObject {
|
|
521
|
+
close(ioPriority: number, cancellable?: Cancellable | null): Promise<boolean>;
|
|
522
|
+
read(count: number, ioPriority: number, cancellable?: Cancellable | null): Promise<Buffer>;
|
|
523
|
+
skip(count: number, ioPriority: number, cancellable?: Cancellable | null): Promise<number>;
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
export class OutputStream extends BaseObject {
|
|
527
|
+
close(ioPriority: number, cancellable?: Cancellable | null): Promise<boolean>;
|
|
528
|
+
flush(ioPriority: number, cancellable?: Cancellable | null): Promise<boolean>;
|
|
529
|
+
write(bytes: Buffer, ioPriority: number, cancellable?: Cancellable | null): Promise<number>;
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
export class InetSocketAddress extends BaseSocketAddress implements SocketConnectable {
|
|
533
|
+
constructor(address: InetAddress, port: number);
|
|
534
|
+
address: InetAddress;
|
|
535
|
+
flowinfo: number;
|
|
536
|
+
port: number;
|
|
537
|
+
scopeId: number;
|
|
538
|
+
enumerate(): SocketAddressEnumerator;
|
|
539
|
+
proxyEnumerate(): SocketAddressEnumerator;
|
|
540
|
+
toString(): string;
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
export class InetAddress extends BaseObject {
|
|
544
|
+
constructor(family: SocketFamily);
|
|
545
|
+
equal(otherAddress: InetAddress): boolean;
|
|
546
|
+
getNativeSize(): number;
|
|
547
|
+
toString(): string;
|
|
548
|
+
family: SocketFamily;
|
|
549
|
+
readonly isAny: boolean;
|
|
550
|
+
readonly isLinkLocal: boolean;
|
|
551
|
+
readonly isLoopback: boolean;
|
|
552
|
+
readonly isMcGlobal: boolean;
|
|
553
|
+
readonly isMcLinkLocal: boolean;
|
|
554
|
+
readonly isMcNodeLocal: boolean;
|
|
555
|
+
readonly isMcOrgLocal: boolean;
|
|
556
|
+
readonly isMcSiteLocal: boolean;
|
|
557
|
+
readonly isMulticast: boolean;
|
|
558
|
+
readonly isSiteLocal: boolean;
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
export class UnixSocketAddress extends BaseSocketAddress implements SocketConnectable {
|
|
562
|
+
constructor(path: string);
|
|
563
|
+
addressType: UnixSocketAddressType;
|
|
564
|
+
path: Buffer;
|
|
565
|
+
enumerate(): SocketAddressEnumerator;
|
|
566
|
+
proxyEnumerate(): SocketAddressEnumerator;
|
|
567
|
+
toString(): string;
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
export class BaseSocketAddress extends BaseObject implements SocketConnectable {
|
|
571
|
+
getNativeSize(): number;
|
|
572
|
+
readonly family: SocketFamily;
|
|
573
|
+
enumerate(): SocketAddressEnumerator;
|
|
574
|
+
proxyEnumerate(): SocketAddressEnumerator;
|
|
575
|
+
toString(): string;
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
export class SocketAddressEnumerator extends BaseObject {
|
|
579
|
+
next(cancellable?: Cancellable | null): BaseSocketAddress | null;
|
|
580
|
+
nextAsync(cancellable?: Cancellable | null): Promise<BaseSocketAddress | null>;
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
export interface SocketConnectable {
|
|
584
|
+
enumerate(): SocketAddressEnumerator;
|
|
585
|
+
proxyEnumerate(): SocketAddressEnumerator;
|
|
586
|
+
toString(): string;
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
export enum Runtime {
|
|
590
|
+
Glib = "glib",
|
|
591
|
+
Other = "other"
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
export enum DeviceType {
|
|
595
|
+
Local = "local",
|
|
596
|
+
Remote = "remote",
|
|
597
|
+
Usb = "usb"
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
export enum SourceMaps {
|
|
601
|
+
Included = "included",
|
|
602
|
+
Omitted = "omitted"
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
export enum JsCompression {
|
|
606
|
+
None = "none",
|
|
607
|
+
Terser = "terser"
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
export enum Realm {
|
|
611
|
+
Native = "native",
|
|
612
|
+
Emulated = "emulated"
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
export enum SessionDetachReason {
|
|
616
|
+
ApplicationRequested = "application-requested",
|
|
617
|
+
ProcessReplaced = "process-replaced",
|
|
618
|
+
ProcessTerminated = "process-terminated",
|
|
619
|
+
ConnectionTerminated = "connection-terminated",
|
|
620
|
+
DeviceLost = "device-lost"
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
export enum Scope {
|
|
624
|
+
Minimal = "minimal",
|
|
625
|
+
Metadata = "metadata",
|
|
626
|
+
Full = "full"
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
export enum Stdio {
|
|
630
|
+
Inherit = "inherit",
|
|
631
|
+
Pipe = "pipe"
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
export enum ChildOrigin {
|
|
635
|
+
Fork = "fork",
|
|
636
|
+
Exec = "exec",
|
|
637
|
+
Spawn = "spawn"
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
export enum SnapshotTransport {
|
|
641
|
+
Inline = "inline",
|
|
642
|
+
SharedMemory = "shared-memory"
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
export enum ScriptRuntime {
|
|
646
|
+
Default = "default",
|
|
647
|
+
QJS = "qjs",
|
|
648
|
+
V8 = "v8"
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
export enum RelayKind {
|
|
652
|
+
TurnUDP = "turn-udp",
|
|
653
|
+
TurnTCP = "turn-tcp",
|
|
654
|
+
TurnTLS = "turn-tls"
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
export enum FileMonitorEvent {
|
|
658
|
+
Changed = "changed",
|
|
659
|
+
ChangesDoneHint = "changes-done-hint",
|
|
660
|
+
Deleted = "deleted",
|
|
661
|
+
Created = "created",
|
|
662
|
+
AttributeChanged = "attribute-changed",
|
|
663
|
+
PreUnmount = "pre-unmount",
|
|
664
|
+
Unmounted = "unmounted",
|
|
665
|
+
Moved = "moved",
|
|
666
|
+
Renamed = "renamed",
|
|
667
|
+
MovedIn = "moved-in",
|
|
668
|
+
MovedOut = "moved-out"
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
export enum SocketFamily {
|
|
672
|
+
Invalid = "invalid",
|
|
673
|
+
Unix = "unix",
|
|
674
|
+
Ipv4 = "ipv4",
|
|
675
|
+
Ipv6 = "ipv6"
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
export enum UnixSocketAddressType {
|
|
679
|
+
Invalid = "invalid",
|
|
680
|
+
Anonymous = "anonymous",
|
|
681
|
+
Path = "path",
|
|
682
|
+
Abstract = "abstract",
|
|
683
|
+
AbstractPadded = "abstract-padded"
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
export type TargetProcess = ProcessID | ProcessName;
|
|
687
|
+
|
|
688
|
+
export type ProcessID = number;
|
|
689
|
+
|
|
690
|
+
export type InjecteeID = number;
|
|
691
|
+
|
|
692
|
+
export type FileDescriptor = number;
|
|
693
|
+
|
|
694
|
+
export type ProcessName = string;
|
|
695
|
+
|
|
696
|
+
export interface SystemParameters {
|
|
697
|
+
/**
|
|
698
|
+
* Operating System details.
|
|
699
|
+
*/
|
|
700
|
+
os: {
|
|
701
|
+
/**
|
|
702
|
+
* ID, e.g.: windows, macos, linux, ios, android, qnx, fedora, ubuntu, etc.
|
|
703
|
+
*/
|
|
704
|
+
id: string;
|
|
705
|
+
|
|
706
|
+
/**
|
|
707
|
+
* Human-readable name, e.g. `"macOS"`.
|
|
708
|
+
*/
|
|
709
|
+
name: string;
|
|
710
|
+
|
|
711
|
+
/**
|
|
712
|
+
* Human-readable version string, e.g. `"11.2.2"`.
|
|
713
|
+
*/
|
|
714
|
+
version?: string;
|
|
715
|
+
|
|
716
|
+
/**
|
|
717
|
+
* Build version, e.g. `"21B91"`.
|
|
718
|
+
*/
|
|
719
|
+
build?: string;
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
/**
|
|
723
|
+
* Platform, same as `Process.platform` in GumJS.
|
|
724
|
+
*/
|
|
725
|
+
platform: "windows" | "darwin" | "linux" | "freebsd" | "qnx";
|
|
726
|
+
|
|
727
|
+
/**
|
|
728
|
+
* Architecture, same as `Process.arch` in GumJS.
|
|
729
|
+
*/
|
|
730
|
+
arch: "ia32" | "x64" | "arm" | "arm64" | "mips";
|
|
731
|
+
|
|
732
|
+
/**
|
|
733
|
+
* Hardware details.
|
|
734
|
+
*/
|
|
735
|
+
hardware?: {
|
|
736
|
+
/**
|
|
737
|
+
* Product type, e.g. `"iPad6,3"`.
|
|
738
|
+
*/
|
|
739
|
+
product?: string;
|
|
740
|
+
|
|
741
|
+
/**
|
|
742
|
+
* Hardware platform, e.g. `"t8010"`.
|
|
743
|
+
*/
|
|
744
|
+
platform?: string;
|
|
745
|
+
|
|
746
|
+
/**
|
|
747
|
+
* Hardware model, e.g. `"J71bAP"`.
|
|
748
|
+
*/
|
|
749
|
+
model?: string;
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
/**
|
|
753
|
+
* Level of access.
|
|
754
|
+
*/
|
|
755
|
+
access: "full" | "jailed";
|
|
756
|
+
|
|
757
|
+
/**
|
|
758
|
+
* System name, e.g. `"Ole André’s iPhone"`.
|
|
759
|
+
*/
|
|
760
|
+
name?: string;
|
|
761
|
+
|
|
762
|
+
/**
|
|
763
|
+
* iOS UDID (Unique Device ID).
|
|
764
|
+
*/
|
|
765
|
+
udid?: string;
|
|
766
|
+
|
|
767
|
+
/**
|
|
768
|
+
* Details about cellular and networking interfaces.
|
|
769
|
+
*/
|
|
770
|
+
interfaces?: SystemInterface[];
|
|
771
|
+
|
|
772
|
+
/**
|
|
773
|
+
* Android API level, e.g.: `30`.
|
|
774
|
+
*/
|
|
775
|
+
apiLevel?: number;
|
|
776
|
+
|
|
777
|
+
[name: string]: any;
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
export type SystemInterface = NetworkInterface | CellularInterface;
|
|
781
|
+
|
|
782
|
+
export interface NetworkInterface {
|
|
783
|
+
type: "ethernet" | "wifi" | "bluetooth";
|
|
784
|
+
|
|
785
|
+
/**
|
|
786
|
+
* MAC address, e.g.: `"aa:bb:cc:dd:ee:ff"`.
|
|
787
|
+
*/
|
|
788
|
+
address: string;
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
export interface CellularInterface {
|
|
792
|
+
type: "cellular";
|
|
793
|
+
|
|
794
|
+
/**
|
|
795
|
+
* Phone number, e.g. `"+47 123 45 678"`.
|
|
796
|
+
*/
|
|
797
|
+
phoneNumber: string;
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
export interface SpawnOptions {
|
|
801
|
+
argv?: string[];
|
|
802
|
+
envp?: { [name: string]: string };
|
|
803
|
+
env?: { [name: string]: string };
|
|
804
|
+
cwd?: string;
|
|
805
|
+
stdio?: Stdio;
|
|
806
|
+
|
|
807
|
+
[name: string]: any;
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
export interface RelayProperties {
|
|
811
|
+
address: string;
|
|
812
|
+
username: string;
|
|
813
|
+
password: string;
|
|
814
|
+
kind: RelayKind;
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
export type Message = SendMessage | ErrorMessage;
|
|
818
|
+
|
|
819
|
+
export enum MessageType {
|
|
820
|
+
Send = "send",
|
|
821
|
+
Error = "error"
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
export interface SendMessage {
|
|
825
|
+
type: MessageType.Send;
|
|
826
|
+
payload: any;
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
export interface ErrorMessage {
|
|
830
|
+
type: MessageType.Error;
|
|
831
|
+
description: string;
|
|
832
|
+
stack?: string;
|
|
833
|
+
fileName?: string;
|
|
834
|
+
lineNumber?: number;
|
|
835
|
+
columnNumber?: number;
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
export type ScriptLogHandler = (level: LogLevel, text: string) => void;
|
|
839
|
+
|
|
840
|
+
export interface ScriptExports {
|
|
841
|
+
[name: string]: (...args: any[]) => Promise<any>;
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
export enum LogLevel {
|
|
845
|
+
Info = "info",
|
|
846
|
+
Warning = "warning",
|
|
847
|
+
Error = "error",
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
export interface EnableDebuggerOptions {
|
|
851
|
+
port?: number;
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
export interface PortalServiceOptions {
|
|
855
|
+
clusterParams?: EndpointParameters;
|
|
856
|
+
controlParams?: EndpointParameters;
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
export type PortalConnectionId = number;
|
|
860
|
+
|
|
861
|
+
export type PortalConnectionTag = string;
|
|
862
|
+
|
|
863
|
+
export interface EndpointParametersSubset {
|
|
864
|
+
address?: string;
|
|
865
|
+
port?: number;
|
|
866
|
+
certificate?: string;
|
|
867
|
+
origin?: string;
|
|
868
|
+
authentication?: AuthenticationScheme;
|
|
869
|
+
assetRoot?: string;
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
export type AuthenticationScheme = TokenAuthenticationScheme | CallbackAuthenticationScheme;
|
|
873
|
+
|
|
874
|
+
export interface TokenAuthenticationScheme {
|
|
875
|
+
scheme: "token";
|
|
876
|
+
token: string;
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
export interface CallbackAuthenticationScheme {
|
|
880
|
+
scheme: "callback";
|
|
881
|
+
callback: AuthenticationCallback;
|
|
882
|
+
}
|
|
883
|
+
|
|
884
|
+
export type AuthenticationCallback = (token: string) => Promise<AuthenticatedSessionInfo>;
|
|
885
|
+
|
|
886
|
+
export interface AuthenticatedSessionInfo {
|
|
887
|
+
[key: string]: any;
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
export type SocketAddress = IPV4SocketAddress | IPV6SocketAddress | AnonymousUnixSocketAddress | PathUnixSocketAddress | AbstractUnixSocketAddress;
|
|
891
|
+
|
|
892
|
+
export interface IPV4SocketAddress {
|
|
893
|
+
family: "ipv4";
|
|
894
|
+
address: string;
|
|
895
|
+
port: number;
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
export interface IPV6SocketAddress {
|
|
899
|
+
family: "ipv6";
|
|
900
|
+
address: string;
|
|
901
|
+
port: number;
|
|
902
|
+
flowlabel: number;
|
|
903
|
+
scopeid: number;
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
export interface AnonymousUnixSocketAddress {
|
|
907
|
+
family: "unix:anonymous";
|
|
908
|
+
}
|
|
909
|
+
|
|
910
|
+
export interface PathUnixSocketAddress {
|
|
911
|
+
family: "unix:path";
|
|
912
|
+
path: string;
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
export interface AbstractUnixSocketAddress {
|
|
916
|
+
family: "unix:abstract";
|
|
917
|
+
path: Buffer;
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
export type Variant = VariantValue | [type: symbol, value: VariantValue];
|
|
921
|
+
|
|
922
|
+
export type VariantValue = | boolean
|
|
923
|
+
| number
|
|
924
|
+
| string
|
|
925
|
+
| Buffer
|
|
926
|
+
| Variant[]
|
|
927
|
+
| VariantDict;
|
|
928
|
+
|
|
929
|
+
export interface VariantDict {
|
|
930
|
+
[key: string]: Variant;
|
|
931
|
+
}
|
|
932
|
+
|
|
933
|
+
export class Signal<H extends SignalHandler> {
|
|
934
|
+
connect(handler: H): void;
|
|
935
|
+
disconnect(handler: H): void;
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
export type SignalHandler = (...args: any[]) => void;
|