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.
Files changed (172) hide show
  1. package/README.md +1 -10
  2. package/build/BSDmakefile +6 -0
  3. package/build/Makefile +10 -0
  4. package/build/src/frida.d.ts +364 -0
  5. package/build/src/frida.js +962 -0
  6. package/build/src/frida_binding.d.ts +938 -0
  7. package/meson.build +34 -67
  8. package/package.json +30 -20
  9. package/scripts/fetch-abi-bits.py +15 -65
  10. package/scripts/install.js +5 -4
  11. package/src/addon.def +3 -0
  12. package/src/addon.symbols +2 -1
  13. package/src/addon.version +4 -0
  14. package/src/frida_bindgen/__init__.py +0 -0
  15. package/src/frida_bindgen/__main__.py +4 -0
  16. package/src/frida_bindgen/__pycache__/__init__.cpython-312.pyc +0 -0
  17. package/src/frida_bindgen/__pycache__/__main__.cpython-312.pyc +0 -0
  18. package/src/frida_bindgen/__pycache__/cli.cpython-312.pyc +0 -0
  19. package/src/frida_bindgen/__pycache__/codegen.cpython-312.pyc +0 -0
  20. package/src/frida_bindgen/__pycache__/customization.cpython-312.pyc +0 -0
  21. package/src/frida_bindgen/__pycache__/loader.cpython-312.pyc +0 -0
  22. package/src/frida_bindgen/__pycache__/model.cpython-312.pyc +0 -0
  23. package/src/frida_bindgen/assets/codegen_helpers.c +1970 -0
  24. package/src/frida_bindgen/assets/codegen_helpers.ts +100 -0
  25. package/src/frida_bindgen/assets/codegen_prototypes.h +78 -0
  26. package/src/frida_bindgen/assets/codegen_types.h +57 -0
  27. package/src/frida_bindgen/assets/customization_facade.exports +13 -0
  28. package/src/frida_bindgen/assets/customization_facade.ts +157 -0
  29. package/src/frida_bindgen/assets/customization_helpers.imports +2 -0
  30. package/src/frida_bindgen/assets/customization_helpers.ts +396 -0
  31. package/src/frida_bindgen/cli.py +96 -0
  32. package/src/frida_bindgen/codegen.py +2233 -0
  33. package/src/frida_bindgen/customization.py +924 -0
  34. package/src/frida_bindgen/loader.py +60 -0
  35. package/src/frida_bindgen/model.py +1357 -0
  36. package/src/meson.build +92 -27
  37. package/{lib/build.py → src/tsc.py} +12 -12
  38. package/src/win_delay_load_hook.c +56 -0
  39. package/subprojects/frida-core.wrap +1 -1
  40. package/test/data/index.ts +2 -2
  41. package/test/device.ts +1 -2
  42. package/test/device_manager.ts +1 -2
  43. package/test/labrat.ts +2 -2
  44. package/test/script.ts +12 -12
  45. package/test/session.ts +3 -3
  46. package/tsconfig.json +6 -11
  47. package/dist/application.d.ts +0 -81
  48. package/dist/application.js +0 -2
  49. package/dist/authentication.d.ts +0 -3
  50. package/dist/authentication.js +0 -2
  51. package/dist/bus.d.ts +0 -16
  52. package/dist/bus.js +0 -23
  53. package/dist/cancellable.d.ts +0 -15
  54. package/dist/cancellable.js +0 -41
  55. package/dist/child.d.ts +0 -16
  56. package/dist/child.js +0 -9
  57. package/dist/crash.d.ts +0 -10
  58. package/dist/crash.js +0 -2
  59. package/dist/device.d.ts +0 -156
  60. package/dist/device.js +0 -188
  61. package/dist/device_manager.d.ts +0 -25
  62. package/dist/device_manager.js +0 -42
  63. package/dist/endpoint_parameters.d.ts +0 -26
  64. package/dist/endpoint_parameters.js +0 -24
  65. package/dist/icon.d.ts +0 -14
  66. package/dist/icon.js +0 -2
  67. package/dist/index.d.ts +0 -161
  68. package/dist/index.js +0 -170
  69. package/dist/iostream.d.ts +0 -13
  70. package/dist/iostream.js +0 -73
  71. package/dist/native.d.ts +0 -1
  72. package/dist/native.js +0 -11
  73. package/dist/portal_membership.d.ts +0 -6
  74. package/dist/portal_membership.js +0 -12
  75. package/dist/portal_service.d.ts +0 -48
  76. package/dist/portal_service.js +0 -52
  77. package/dist/process.d.ts +0 -47
  78. package/dist/process.js +0 -2
  79. package/dist/relay.d.ts +0 -22
  80. package/dist/relay.js +0 -32
  81. package/dist/script.d.ts +0 -70
  82. package/dist/script.js +0 -266
  83. package/dist/service.d.ts +0 -16
  84. package/dist/service.js +0 -26
  85. package/dist/session.d.ts +0 -45
  86. package/dist/session.js +0 -73
  87. package/dist/signals.d.ts +0 -20
  88. package/dist/signals.js +0 -40
  89. package/dist/socket_address.d.ts +0 -25
  90. package/dist/socket_address.js +0 -2
  91. package/dist/spawn.d.ts +0 -4
  92. package/dist/spawn.js +0 -2
  93. package/dist/system_parameters.d.ts +0 -84
  94. package/dist/system_parameters.js +0 -2
  95. package/lib/application.ts +0 -98
  96. package/lib/authentication.ts +0 -3
  97. package/lib/bus.ts +0 -30
  98. package/lib/cancellable.ts +0 -48
  99. package/lib/child.ts +0 -15
  100. package/lib/crash.ts +0 -11
  101. package/lib/device.ts +0 -331
  102. package/lib/device_manager.ts +0 -69
  103. package/lib/endpoint_parameters.ts +0 -56
  104. package/lib/icon.ts +0 -15
  105. package/lib/index.ts +0 -316
  106. package/lib/iostream.ts +0 -78
  107. package/lib/meson.build +0 -53
  108. package/lib/native.ts +0 -9
  109. package/lib/portal_membership.ts +0 -10
  110. package/lib/portal_service.ts +0 -105
  111. package/lib/process.ts +0 -57
  112. package/lib/relay.ts +0 -44
  113. package/lib/script.ts +0 -361
  114. package/lib/service.ts +0 -34
  115. package/lib/session.ts +0 -113
  116. package/lib/signals.ts +0 -45
  117. package/lib/socket_address.ts +0 -35
  118. package/lib/spawn.ts +0 -4
  119. package/lib/system_parameters.ts +0 -103
  120. package/meson.options +0 -11
  121. package/src/addon.cc +0 -78
  122. package/src/application.cc +0 -148
  123. package/src/application.h +0 -31
  124. package/src/authentication.cc +0 -174
  125. package/src/authentication.h +0 -24
  126. package/src/bus.cc +0 -167
  127. package/src/bus.h +0 -33
  128. package/src/cancellable.cc +0 -117
  129. package/src/cancellable.h +0 -31
  130. package/src/child.cc +0 -150
  131. package/src/child.h +0 -32
  132. package/src/crash.cc +0 -122
  133. package/src/crash.h +0 -30
  134. package/src/device.cc +0 -1350
  135. package/src/device.h +0 -56
  136. package/src/device_manager.cc +0 -362
  137. package/src/device_manager.h +0 -35
  138. package/src/endpoint_parameters.cc +0 -171
  139. package/src/endpoint_parameters.h +0 -28
  140. package/src/glib_context.cc +0 -62
  141. package/src/glib_context.h +0 -29
  142. package/src/glib_object.cc +0 -25
  143. package/src/glib_object.h +0 -37
  144. package/src/iostream.cc +0 -243
  145. package/src/iostream.h +0 -30
  146. package/src/operation.h +0 -94
  147. package/src/portal_membership.cc +0 -100
  148. package/src/portal_membership.h +0 -26
  149. package/src/portal_service.cc +0 -401
  150. package/src/portal_service.h +0 -40
  151. package/src/process.cc +0 -135
  152. package/src/process.h +0 -30
  153. package/src/relay.cc +0 -139
  154. package/src/relay.h +0 -31
  155. package/src/runtime.cc +0 -568
  156. package/src/runtime.h +0 -69
  157. package/src/script.cc +0 -301
  158. package/src/script.h +0 -36
  159. package/src/service.cc +0 -224
  160. package/src/service.h +0 -36
  161. package/src/session.cc +0 -860
  162. package/src/session.h +0 -42
  163. package/src/signals.cc +0 -334
  164. package/src/signals.h +0 -47
  165. package/src/spawn.cc +0 -95
  166. package/src/spawn.h +0 -27
  167. package/src/usage_monitor.h +0 -117
  168. package/src/uv_context.cc +0 -118
  169. package/src/uv_context.h +0 -40
  170. package/src/win_delay_load_hook.cc +0 -63
  171. package/subprojects/nan.wrap +0 -9
  172. package/subprojects/packagefiles/nan.patch +0 -13
package/dist/device.d.ts DELETED
@@ -1,156 +0,0 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
- import { Application } from "./application";
4
- import { Bus } from "./bus";
5
- import { Cancellable } from "./cancellable";
6
- import { Child } from "./child";
7
- import { Crash } from "./crash";
8
- import { Icon } from "./icon";
9
- import { IOStream } from "./iostream";
10
- import { Process } from "./process";
11
- import { Service } from "./service";
12
- import { Session } from "./session";
13
- import { Signal } from "./signals";
14
- import { Spawn } from "./spawn";
15
- import { SystemParameters } from "./system_parameters";
16
- import { inspect } from "util";
17
- export declare class Device {
18
- private impl;
19
- spawnAdded: Signal<SpawnAddedHandler>;
20
- spawnRemoved: Signal<SpawnRemovedHandler>;
21
- childAdded: Signal<ChildAddedHandler>;
22
- childRemoved: Signal<ChildRemovedHandler>;
23
- processCrashed: Signal<ProcessCrashedHandler>;
24
- output: Signal<OutputHandler>;
25
- uninjected: Signal<UninjectedHandler>;
26
- lost: Signal<DeviceLostHandler>;
27
- bus: Bus;
28
- constructor(impl: any);
29
- get id(): string;
30
- get name(): string;
31
- get icon(): Icon | null;
32
- get type(): DeviceType;
33
- get isLost(): boolean;
34
- querySystemParameters(cancellable?: Cancellable): Promise<SystemParameters>;
35
- getFrontmostApplication(options?: FrontmostQueryOptions, cancellable?: Cancellable): Promise<Application | null>;
36
- enumerateApplications(options?: ApplicationQueryOptions, cancellable?: Cancellable): Promise<Application[]>;
37
- enumerateProcesses(options?: ProcessQueryOptions, cancellable?: Cancellable): Promise<Process[]>;
38
- getProcess(name: string, options?: ProcessMatchOptions, cancellable?: Cancellable): Promise<Process>;
39
- enableSpawnGating(cancellable?: Cancellable): Promise<void>;
40
- disableSpawnGating(cancellable?: Cancellable): Promise<void>;
41
- enumeratePendingSpawn(cancellable?: Cancellable): Promise<Spawn[]>;
42
- enumeratePendingChildren(cancellable?: Cancellable): Promise<Child[]>;
43
- spawn(program: string | string[], options?: SpawnOptions, cancellable?: Cancellable): Promise<ProcessID>;
44
- input(target: TargetProcess, data: Buffer, cancellable?: Cancellable): Promise<void>;
45
- resume(target: TargetProcess, cancellable?: Cancellable): Promise<void>;
46
- kill(target: TargetProcess, cancellable?: Cancellable): Promise<void>;
47
- attach(target: TargetProcess, options?: SessionOptions, cancellable?: Cancellable): Promise<Session>;
48
- injectLibraryFile(target: TargetProcess, path: string, entrypoint: string, data: string, cancellable?: Cancellable): Promise<InjecteeID>;
49
- injectLibraryBlob(target: TargetProcess, blob: Buffer, entrypoint: string, data: string, cancellable?: Cancellable): Promise<InjecteeID>;
50
- openChannel(address: string, cancellable?: Cancellable): Promise<IOStream>;
51
- openService(address: string, cancellable?: Cancellable): Promise<Service>;
52
- unpair(cancellable?: Cancellable): Promise<void>;
53
- private getPid;
54
- [inspect.custom](depth: any, options: any): string;
55
- }
56
- export type ProcessID = number;
57
- export type ProcessName = string;
58
- export type InjecteeID = number;
59
- export type FileDescriptor = number;
60
- export type SpawnAddedHandler = (spawn: Spawn) => void;
61
- export type SpawnRemovedHandler = (spawn: Spawn) => void;
62
- export type ChildAddedHandler = (child: Child) => void;
63
- export type ChildRemovedHandler = (child: Child) => void;
64
- export type ProcessCrashedHandler = (crash: Crash) => void;
65
- export type OutputHandler = (pid: ProcessID, fd: FileDescriptor, data: Buffer) => void;
66
- export type UninjectedHandler = (id: InjecteeID) => void;
67
- export type DeviceLostHandler = () => void;
68
- export declare enum DeviceType {
69
- Local = "local",
70
- Remote = "remote",
71
- Usb = "usb"
72
- }
73
- export interface FrontmostQueryOptions {
74
- /**
75
- * How much data to collect about the frontmost application. The default is `Scope.Minimal`,
76
- * which means no parameters will be collected. Specify `Scope.Metadata` to collect all
77
- * parameters except icons, which can be included by specifying `Scope.Full`.
78
- */
79
- scope?: Scope;
80
- }
81
- export interface ApplicationQueryOptions {
82
- /**
83
- * Limit enumeration to one or more application IDs only. Typically used to fetch additional
84
- * details about a subset, e.g. based on user interaction.
85
- */
86
- identifiers?: string[];
87
- /**
88
- * How much data to collect about each application. The default is `Scope.Minimal`, which
89
- * means no parameters will be collected. Specify `Scope.Metadata` to collect all parameters
90
- * except icons, which can be included by specifying `Scope.Full`.
91
- */
92
- scope?: Scope;
93
- }
94
- export interface ProcessQueryOptions {
95
- /**
96
- * Limit enumeration to one or more process IDs only. Typically used to fetch additional
97
- * details about a subset, e.g. based on user interaction.
98
- */
99
- pids?: number[];
100
- /**
101
- * How much data to collect about each process. The default is `Scope.Minimal`, which
102
- * means no parameters will be collected. Specify `Scope.Metadata` to collect all
103
- * parameters except icons, which can be included by specifying `Scope.Full`.
104
- */
105
- scope?: Scope;
106
- }
107
- export interface ProcessMatchOptions {
108
- /**
109
- * How much data to collect about the matching process. The default is `Scope.Minimal`,
110
- * which means no parameters will be collected. Specify `Scope.Metadata` to collect all
111
- * parameters except icons, which can be included by specifying `Scope.Full`.
112
- */
113
- scope?: Scope;
114
- }
115
- /**
116
- * How much data to collect about a given application or process.
117
- */
118
- export declare enum Scope {
119
- /**
120
- * Don't collect any parameters. This is the default.
121
- */
122
- Minimal = "minimal",
123
- /**
124
- * Collect all parameters except icons.
125
- */
126
- Metadata = "metadata",
127
- /**
128
- * Collect all parameters, including icons.
129
- */
130
- Full = "full"
131
- }
132
- export interface SpawnOptions {
133
- argv?: string[];
134
- envp?: {
135
- [name: string]: string;
136
- };
137
- env?: {
138
- [name: string]: string;
139
- };
140
- cwd?: string;
141
- stdio?: Stdio;
142
- [name: string]: any;
143
- }
144
- export declare enum Stdio {
145
- Inherit = "inherit",
146
- Pipe = "pipe"
147
- }
148
- export type TargetProcess = ProcessID | ProcessName;
149
- export interface SessionOptions {
150
- realm?: Realm;
151
- persistTimeout?: number;
152
- }
153
- export declare enum Realm {
154
- Native = "native",
155
- Emulated = "emulated"
156
- }
package/dist/device.js DELETED
@@ -1,188 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Realm = exports.Stdio = exports.Scope = exports.DeviceType = exports.Device = void 0;
4
- const bus_1 = require("./bus");
5
- const iostream_1 = require("./iostream");
6
- const service_1 = require("./service");
7
- const session_1 = require("./session");
8
- const signals_1 = require("./signals");
9
- const minimatch_1 = require("minimatch");
10
- const util_1 = require("util");
11
- class Device {
12
- constructor(impl) {
13
- this.impl = impl;
14
- this.bus = new bus_1.Bus(impl.bus);
15
- const { signals } = impl;
16
- this.spawnAdded = new signals_1.Signal(signals, "spawn-added");
17
- this.spawnRemoved = new signals_1.Signal(signals, "spawn-removed");
18
- this.childAdded = new signals_1.Signal(signals, "child-added");
19
- this.childRemoved = new signals_1.Signal(signals, "child-removed");
20
- this.processCrashed = new signals_1.Signal(signals, "process-crashed");
21
- this.output = new signals_1.Signal(signals, "output");
22
- this.uninjected = new signals_1.Signal(signals, "uninjected");
23
- this.lost = new signals_1.Signal(signals, "lost");
24
- }
25
- get id() {
26
- return this.impl.id;
27
- }
28
- get name() {
29
- return this.impl.name;
30
- }
31
- get icon() {
32
- return this.impl.icon;
33
- }
34
- get type() {
35
- return this.impl.type;
36
- }
37
- get isLost() {
38
- return this.impl.isLost;
39
- }
40
- querySystemParameters(cancellable) {
41
- return this.impl.querySystemParameters(cancellable);
42
- }
43
- getFrontmostApplication(options = {}, cancellable) {
44
- const { scope = null, } = options;
45
- return this.impl.getFrontmostApplication(scope, cancellable);
46
- }
47
- enumerateApplications(options = {}, cancellable) {
48
- const { identifiers = [], scope = null, } = options;
49
- return this.impl.enumerateApplications(identifiers, scope, cancellable);
50
- }
51
- enumerateProcesses(options = {}, cancellable) {
52
- const { pids = [], scope = null, } = options;
53
- return this.impl.enumerateProcesses(pids, scope, cancellable);
54
- }
55
- async getProcess(name, options = {}, cancellable) {
56
- const { scope = Scope.Minimal, } = options;
57
- const processes = await this.enumerateProcesses({ scope }, cancellable);
58
- const mm = new minimatch_1.Minimatch(name.toLowerCase());
59
- const matching = processes.filter(process => mm.match(process.name.toLowerCase()));
60
- if (matching.length === 1) {
61
- return matching[0];
62
- }
63
- else if (matching.length > 1) {
64
- throw new Error("Ambiguous name; it matches: " + matching.map(process => `${process.name} (pid: ${process.pid})`).join(", "));
65
- }
66
- else {
67
- throw new Error("Process not found");
68
- }
69
- }
70
- enableSpawnGating(cancellable) {
71
- return this.impl.enableSpawnGating(cancellable);
72
- }
73
- disableSpawnGating(cancellable) {
74
- return this.impl.disableSpawnGating(cancellable);
75
- }
76
- enumeratePendingSpawn(cancellable) {
77
- return this.impl.enumeratePendingSpawn(cancellable);
78
- }
79
- enumeratePendingChildren(cancellable) {
80
- return this.impl.enumeratePendingChildren(cancellable);
81
- }
82
- spawn(program, options = {}, cancellable) {
83
- const pendingOptions = Object.assign({}, options);
84
- let argv = consumeOption("argv");
85
- if (typeof program !== "string") {
86
- argv = program;
87
- program = argv[0];
88
- if (argv.length === 1) {
89
- argv = null;
90
- }
91
- }
92
- const envp = consumeOption("envp");
93
- const env = consumeOption("env");
94
- const cwd = consumeOption("cwd");
95
- const stdio = consumeOption("stdio");
96
- const aux = pendingOptions;
97
- return this.impl.spawn(program, argv, envp, env, cwd, stdio, aux, cancellable);
98
- function consumeOption(name) {
99
- const value = pendingOptions[name];
100
- delete pendingOptions[name];
101
- return value !== null && value !== void 0 ? value : null;
102
- }
103
- }
104
- async input(target, data, cancellable) {
105
- const pid = await this.getPid(target, cancellable);
106
- return this.impl.input(pid, data, cancellable);
107
- }
108
- async resume(target, cancellable) {
109
- const pid = await this.getPid(target, cancellable);
110
- return this.impl.resume(pid, cancellable);
111
- }
112
- async kill(target, cancellable) {
113
- const pid = await this.getPid(target, cancellable);
114
- return this.impl.kill(pid, cancellable);
115
- }
116
- async attach(target, options = {}, cancellable) {
117
- const { realm = null, persistTimeout = null, } = options;
118
- const pid = await this.getPid(target, cancellable);
119
- return new session_1.Session(await this.impl.attach(pid, realm, persistTimeout, cancellable));
120
- }
121
- async injectLibraryFile(target, path, entrypoint, data, cancellable) {
122
- const pid = await this.getPid(target, cancellable);
123
- return this.impl.injectLibraryFile(pid, path, entrypoint, data, cancellable);
124
- }
125
- async injectLibraryBlob(target, blob, entrypoint, data, cancellable) {
126
- const pid = await this.getPid(target, cancellable);
127
- return this.impl.injectLibraryBlob(pid, blob, entrypoint, data, cancellable);
128
- }
129
- async openChannel(address, cancellable) {
130
- return new iostream_1.IOStream(await this.impl.openChannel(address, cancellable));
131
- }
132
- async openService(address, cancellable) {
133
- return new service_1.Service(await this.impl.openService(address, cancellable));
134
- }
135
- async unpair(cancellable) {
136
- await this.impl.unpair(cancellable);
137
- }
138
- async getPid(target, cancellable) {
139
- if (typeof target === "number") {
140
- return target;
141
- }
142
- const process = await this.getProcess(target, {}, cancellable);
143
- return process.pid;
144
- }
145
- [util_1.inspect.custom](depth, options) {
146
- return "Device " + (0, util_1.inspect)({
147
- id: this.id,
148
- name: this.name,
149
- icon: this.icon,
150
- type: this.type
151
- }, options);
152
- }
153
- }
154
- exports.Device = Device;
155
- var DeviceType;
156
- (function (DeviceType) {
157
- DeviceType["Local"] = "local";
158
- DeviceType["Remote"] = "remote";
159
- DeviceType["Usb"] = "usb";
160
- })(DeviceType || (exports.DeviceType = DeviceType = {}));
161
- /**
162
- * How much data to collect about a given application or process.
163
- */
164
- var Scope;
165
- (function (Scope) {
166
- /**
167
- * Don't collect any parameters. This is the default.
168
- */
169
- Scope["Minimal"] = "minimal";
170
- /**
171
- * Collect all parameters except icons.
172
- */
173
- Scope["Metadata"] = "metadata";
174
- /**
175
- * Collect all parameters, including icons.
176
- */
177
- Scope["Full"] = "full";
178
- })(Scope || (exports.Scope = Scope = {}));
179
- var Stdio;
180
- (function (Stdio) {
181
- Stdio["Inherit"] = "inherit";
182
- Stdio["Pipe"] = "pipe";
183
- })(Stdio || (exports.Stdio = Stdio = {}));
184
- var Realm;
185
- (function (Realm) {
186
- Realm["Native"] = "native";
187
- Realm["Emulated"] = "emulated";
188
- })(Realm || (exports.Realm = Realm = {}));
@@ -1,25 +0,0 @@
1
- /// <reference types="node" />
2
- import { Cancellable } from "./cancellable";
3
- import { Device } from "./device";
4
- import { Signal } from "./signals";
5
- import { inspect } from "util";
6
- export declare class DeviceManager {
7
- private impl;
8
- added: Signal<DeviceAddedHandler>;
9
- removed: Signal<DeviceRemovedHandler>;
10
- changed: Signal<DevicesChangedHandler>;
11
- constructor();
12
- enumerateDevices(cancellable?: Cancellable): Promise<Device[]>;
13
- addRemoteDevice(address: string, options?: RemoteDeviceOptions, cancellable?: Cancellable): Promise<Device>;
14
- removeRemoteDevice(address: string, cancellable?: Cancellable): Promise<void>;
15
- [inspect.custom](): string;
16
- }
17
- export interface RemoteDeviceOptions {
18
- certificate?: string;
19
- origin?: string;
20
- token?: string;
21
- keepaliveInterval?: number;
22
- }
23
- export type DeviceAddedHandler = (device: Device) => void;
24
- export type DeviceRemovedHandler = (device: Device) => void;
25
- export type DevicesChangedHandler = () => void;
@@ -1,42 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DeviceManager = void 0;
4
- const device_1 = require("./device");
5
- const native_1 = require("./native");
6
- const signals_1 = require("./signals");
7
- const util_1 = require("util");
8
- class DeviceManager {
9
- constructor() {
10
- this.impl = new native_1.binding.DeviceManager();
11
- const signals = new DeviceManagerSignals(this.impl.signals);
12
- this.added = new signals_1.Signal(signals, "added");
13
- this.removed = new signals_1.Signal(signals, "removed");
14
- this.changed = new signals_1.Signal(signals, "changed");
15
- }
16
- async enumerateDevices(cancellable) {
17
- const devices = await this.impl.enumerateDevices(cancellable);
18
- return devices.map(impl => new device_1.Device(impl));
19
- }
20
- async addRemoteDevice(address, options = {}, cancellable) {
21
- const { certificate = null, origin = null, token = null, keepaliveInterval = null, } = options;
22
- return new device_1.Device(await this.impl.addRemoteDevice(address, certificate, origin, token, keepaliveInterval, cancellable));
23
- }
24
- removeRemoteDevice(address, cancellable) {
25
- return this.impl.removeRemoteDevice(address, cancellable);
26
- }
27
- [util_1.inspect.custom]() {
28
- return "DeviceManager {}";
29
- }
30
- }
31
- exports.DeviceManager = DeviceManager;
32
- class DeviceManagerSignals extends signals_1.SignalAdapter {
33
- constructor(signals) {
34
- super(signals);
35
- }
36
- getProxy(name, userHandler) {
37
- if (name === "added" || name === "removed") {
38
- return impl => userHandler(new device_1.Device(impl));
39
- }
40
- return null;
41
- }
42
- }
@@ -1,26 +0,0 @@
1
- /// <reference types="node" />
2
- import { AuthenticatedSessionInfo } from "./authentication";
3
- import { inspect } from "util";
4
- export declare class EndpointParameters {
5
- private impl;
6
- constructor({ address, port, certificate, origin, authentication, assetRoot, }?: EndpointParametersSubset);
7
- [inspect.custom](): string;
8
- }
9
- export interface EndpointParametersSubset {
10
- address?: string;
11
- port?: number;
12
- certificate?: string;
13
- origin?: string;
14
- authentication?: AuthenticationScheme;
15
- assetRoot?: string;
16
- }
17
- export type AuthenticationScheme = TokenAuthenticationScheme | CallbackAuthenticationScheme;
18
- export interface TokenAuthenticationScheme {
19
- scheme: "token";
20
- token: string;
21
- }
22
- export interface CallbackAuthenticationScheme {
23
- scheme: "callback";
24
- callback: AuthenticationCallback;
25
- }
26
- export type AuthenticationCallback = (token: string) => Promise<AuthenticatedSessionInfo>;
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EndpointParameters = void 0;
4
- const native_1 = require("./native");
5
- const util_1 = require("util");
6
- class EndpointParameters {
7
- constructor({ address = null, port = null, certificate = null, origin = null, authentication = null, assetRoot = null, } = {}) {
8
- let authToken = null;
9
- let authCallback = null;
10
- if (authentication !== null) {
11
- if (authentication.scheme === "token") {
12
- authToken = authentication.token;
13
- }
14
- else {
15
- authCallback = authentication.callback;
16
- }
17
- }
18
- this.impl = new native_1.binding.EndpointParameters(address, port, certificate, origin, authToken, authCallback, assetRoot);
19
- }
20
- [util_1.inspect.custom]() {
21
- return "EndpointParameters {}";
22
- }
23
- }
24
- exports.EndpointParameters = EndpointParameters;
package/dist/icon.d.ts DELETED
@@ -1,14 +0,0 @@
1
- /// <reference types="node" />
2
- export type Icon = RGBAIcon | PNGIcon;
3
- export interface RGBAIcon {
4
- format: "rgba";
5
- width: number;
6
- height: number;
7
- image: Buffer;
8
- }
9
- export interface PNGIcon {
10
- format: "png";
11
- width?: number;
12
- height?: number;
13
- image: Buffer;
14
- }
package/dist/icon.js DELETED
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
package/dist/index.d.ts DELETED
@@ -1,161 +0,0 @@
1
- /// <reference types="node" />
2
- import * as applicationModule from "./application";
3
- import * as authenticationModule from "./authentication";
4
- import * as busModule from "./bus";
5
- import * as cancellableModule from "./cancellable";
6
- import * as childModule from "./child";
7
- import * as crashModule from "./crash";
8
- import * as deviceManagerModule from "./device_manager";
9
- import * as deviceModule from "./device";
10
- import * as endpointParametersModule from "./endpoint_parameters";
11
- import * as iconModule from "./icon";
12
- import * as iostreamModule from "./iostream";
13
- import * as portalMembershipModule from "./portal_membership";
14
- import * as portalServiceModule from "./portal_service";
15
- import * as processModule from "./process";
16
- import * as relayModule from "./relay";
17
- import * as scriptModule from "./script";
18
- import * as serviceModule from "./service";
19
- import * as sessionModule from "./session";
20
- import * as socketAddressModule from "./socket_address";
21
- import * as spawnModule from "./spawn";
22
- import * as systemParametersModule from "./system_parameters";
23
- export type DeviceManager = deviceManagerModule.DeviceManager;
24
- export declare const DeviceManager: typeof deviceManagerModule.DeviceManager;
25
- export type RemoteDeviceOptions = deviceManagerModule.RemoteDeviceOptions;
26
- export type DeviceAddedHandler = deviceManagerModule.DeviceAddedHandler;
27
- export type DeviceRemovedHandler = deviceManagerModule.DeviceRemovedHandler;
28
- export type DevicesChangedHandler = deviceManagerModule.DevicesChangedHandler;
29
- export type Device = deviceModule.Device;
30
- export declare const Device: typeof deviceModule.Device;
31
- export type ProcessID = deviceModule.ProcessID;
32
- export type ProcessName = deviceModule.ProcessName;
33
- export type InjecteeID = deviceModule.InjecteeID;
34
- export type FileDescriptor = deviceModule.FileDescriptor;
35
- export type SpawnAddedHandler = deviceModule.SpawnAddedHandler;
36
- export type SpawnRemovedHandler = deviceModule.SpawnRemovedHandler;
37
- export type ChildAddedHandler = deviceModule.ChildAddedHandler;
38
- export type ChildRemovedHandler = deviceModule.ChildRemovedHandler;
39
- export type OutputHandler = deviceModule.OutputHandler;
40
- export type UninjectedHandler = deviceModule.UninjectedHandler;
41
- export type DeviceLostHandler = deviceModule.DeviceLostHandler;
42
- export type DeviceType = deviceModule.DeviceType;
43
- export declare const DeviceType: typeof deviceModule.DeviceType;
44
- export type FrontmostQueryOptions = deviceModule.FrontmostQueryOptions;
45
- export type ApplicationQueryOptions = deviceModule.ApplicationQueryOptions;
46
- export type ProcessQueryOptions = deviceModule.ProcessQueryOptions;
47
- export type ProcessMatchOptions = deviceModule.ProcessMatchOptions;
48
- export type Scope = deviceModule.Scope;
49
- export declare const Scope: typeof deviceModule.Scope;
50
- export type SpawnOptions = deviceModule.SpawnOptions;
51
- export type Stdio = deviceModule.Stdio;
52
- export declare const Stdio: typeof deviceModule.Stdio;
53
- export type TargetProcess = deviceModule.TargetProcess;
54
- export type SessionOptions = deviceModule.SessionOptions;
55
- export type Realm = deviceModule.Realm;
56
- export declare const Realm: typeof deviceModule.Realm;
57
- export type SystemParameters = systemParametersModule.SystemParameters;
58
- export type SystemInterface = systemParametersModule.SystemInterface;
59
- export type NetworkInterface = systemParametersModule.NetworkInterface;
60
- export type CellularInterface = systemParametersModule.CellularInterface;
61
- export type Session = sessionModule.Session;
62
- export declare const Session: typeof sessionModule.Session;
63
- export type SessionDetachedHandler = sessionModule.SessionDetachedHandler;
64
- export type SessionDetachReason = sessionModule.SessionDetachReason;
65
- export declare const SessionDetachReason: typeof sessionModule.SessionDetachReason;
66
- export type PeerOptions = sessionModule.PeerOptions;
67
- export type PortalOptions = sessionModule.PortalOptions;
68
- export type Script = scriptModule.Script;
69
- export declare const Script: typeof scriptModule.Script;
70
- export type ScriptOptions = scriptModule.ScriptOptions;
71
- export type SnapshotOptions = scriptModule.SnapshotOptions;
72
- export type ScriptRuntime = scriptModule.ScriptRuntime;
73
- export declare const ScriptRuntime: typeof scriptModule.ScriptRuntime;
74
- export type ScriptDestroyedHandler = scriptModule.ScriptDestroyedHandler;
75
- export type ScriptMessageHandler = scriptModule.ScriptMessageHandler;
76
- export type ScriptLogHandler = scriptModule.ScriptLogHandler;
77
- export type Message = scriptModule.Message;
78
- export type MessageType = scriptModule.MessageType;
79
- export declare const MessageType: typeof scriptModule.MessageType;
80
- export type SendMessage = scriptModule.SendMessage;
81
- export type ErrorMessage = scriptModule.ErrorMessage;
82
- export type ScriptExports = scriptModule.ScriptExports;
83
- export type LogLevel = scriptModule.LogLevel;
84
- export declare const LogLevel: typeof scriptModule.LogLevel;
85
- export type EnableDebuggerOptions = scriptModule.EnableDebuggerOptions;
86
- export type Relay = relayModule.Relay;
87
- export declare const Relay: typeof relayModule.Relay;
88
- export type RelayProperties = relayModule.RelayProperties;
89
- export type RelayKind = relayModule.RelayKind;
90
- export declare const RelayKind: typeof relayModule.RelayKind;
91
- export type PortalMembership = portalMembershipModule.PortalMembership;
92
- export declare const PortalMembership: typeof portalMembershipModule.PortalMembership;
93
- export type PortalService = portalServiceModule.PortalService;
94
- export declare const PortalService: typeof portalServiceModule.PortalService;
95
- export type PortalServiceOptions = portalServiceModule.PortalServiceOptions;
96
- export type PortalConnectionId = portalServiceModule.PortalConnectionId;
97
- export type PortalConnectionTag = portalServiceModule.PortalConnectionTag;
98
- export type PortalNodeConnectedHandler = portalServiceModule.PortalNodeConnectedHandler;
99
- export type PortalNodeJoinedHandler = portalServiceModule.PortalNodeJoinedHandler;
100
- export type PortalNodeLeftHandler = portalServiceModule.PortalNodeLeftHandler;
101
- export type PortalNodeDisconnectedHandler = portalServiceModule.PortalNodeDisconnectedHandler;
102
- export type PortalControllerConnectedHandler = portalServiceModule.PortalControllerConnectedHandler;
103
- export type PortalControllerDisconnectedHandler = portalServiceModule.PortalControllerDisconnectedHandler;
104
- export type PortalAuthenticatedHandler = portalServiceModule.PortalAuthenticatedHandler;
105
- export type PortalSubscribeHandler = portalServiceModule.PortalSubscribeHandler;
106
- export type PortalMessageHandler = portalServiceModule.PortalMessageHandler;
107
- export type EndpointParameters = endpointParametersModule.EndpointParameters;
108
- export declare const EndpointParameters: typeof endpointParametersModule.EndpointParameters;
109
- export type EndpointParametersSubset = endpointParametersModule.EndpointParametersSubset;
110
- export type AuthenticationScheme = endpointParametersModule.AuthenticationScheme;
111
- export type TokenAuthenticationScheme = endpointParametersModule.TokenAuthenticationScheme;
112
- export type CallbackAuthenticationScheme = endpointParametersModule.CallbackAuthenticationScheme;
113
- export type AuthenticationCallback = endpointParametersModule.AuthenticationCallback;
114
- export type AuthenticatedSessionInfo = authenticationModule.AuthenticatedSessionInfo;
115
- export type IOStream = iostreamModule.IOStream;
116
- export declare const IOStream: typeof iostreamModule.IOStream;
117
- export type Cancellable = cancellableModule.Cancellable;
118
- export declare const Cancellable: typeof cancellableModule.Cancellable;
119
- export type Application = applicationModule.Application;
120
- export type ApplicationParameters = applicationModule.ApplicationParameters;
121
- export type Process = processModule.Process;
122
- export type ProcessParameters = processModule.ProcessParameters;
123
- export type Spawn = spawnModule.Spawn;
124
- export type Child = childModule.Child;
125
- export type ChildOrigin = childModule.ChildOrigin;
126
- export declare const ChildOrigin: typeof childModule.ChildOrigin;
127
- export type Crash = crashModule.Crash;
128
- export type CrashParameters = crashModule.CrashParameters;
129
- export type Icon = iconModule.Icon;
130
- export type RGBAIcon = iconModule.RGBAIcon;
131
- export type PNGIcon = iconModule.PNGIcon;
132
- export type Bus = busModule.Bus;
133
- export declare const Bus: typeof busModule.Bus;
134
- export type BusDetachedHandler = busModule.BusDetachedHandler;
135
- export type BusMessageHandler = busModule.BusMessageHandler;
136
- export type Service = serviceModule.Service;
137
- export declare const Service: typeof serviceModule.Service;
138
- export type ServiceCloseHandler = serviceModule.ServiceCloseHandler;
139
- export type ServiceMessageHandler = serviceModule.ServiceMessageHandler;
140
- export type SocketAddress = socketAddressModule.SocketAddress;
141
- export type IPV4SocketAddress = socketAddressModule.IPV4SocketAddress;
142
- export type IPV6SocketAddress = socketAddressModule.IPV6SocketAddress;
143
- export type AnonymousUnixSocketAddress = socketAddressModule.AnonymousUnixSocketAddress;
144
- export type PathUnixSocketAddress = socketAddressModule.PathUnixSocketAddress;
145
- export type AbstractUnixSocketAddress = socketAddressModule.AbstractUnixSocketAddress;
146
- export declare function querySystemParameters(cancellable?: Cancellable): Promise<SystemParameters>;
147
- export declare function spawn(program: string | string[], options?: SpawnOptions, cancellable?: Cancellable): Promise<number>;
148
- export declare function resume(target: number | string, cancellable?: Cancellable): Promise<void>;
149
- export declare function kill(target: number | string, cancellable?: Cancellable): Promise<void>;
150
- export declare function attach(target: TargetProcess, options?: SessionOptions, cancellable?: Cancellable): Promise<Session>;
151
- export declare function injectLibraryFile(target: number | string, path: string, entrypoint: string, data: string, cancellable?: Cancellable): Promise<number>;
152
- export declare function injectLibraryBlob(target: number | string, blob: Buffer, entrypoint: string, data: string, cancellable?: Cancellable): Promise<number>;
153
- export declare function enumerateDevices(cancellable?: Cancellable): Promise<Device[]>;
154
- export declare function getDeviceManager(): DeviceManager;
155
- export declare function getLocalDevice(cancellable?: Cancellable): Promise<Device>;
156
- export declare function getRemoteDevice(cancellable?: Cancellable): Promise<Device>;
157
- export declare function getUsbDevice(options?: GetDeviceOptions, cancellable?: Cancellable): Promise<Device>;
158
- export declare function getDevice(id: string, options?: GetDeviceOptions, cancellable?: Cancellable): Promise<Device>;
159
- export interface GetDeviceOptions {
160
- timeout?: number | null;
161
- }