frida 16.7.14 → 16.7.16

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 (174) 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 +22 -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/assets/meson.build +13 -0
  15. package/src/frida_bindgen/__init__.py +0 -0
  16. package/src/frida_bindgen/__main__.py +4 -0
  17. package/src/frida_bindgen/__pycache__/__init__.cpython-312.pyc +0 -0
  18. package/src/frida_bindgen/__pycache__/__main__.cpython-312.pyc +0 -0
  19. package/src/frida_bindgen/__pycache__/cli.cpython-312.pyc +0 -0
  20. package/src/frida_bindgen/__pycache__/codegen.cpython-312.pyc +0 -0
  21. package/src/frida_bindgen/__pycache__/customization.cpython-312.pyc +0 -0
  22. package/src/frida_bindgen/__pycache__/loader.cpython-312.pyc +0 -0
  23. package/src/frida_bindgen/__pycache__/model.cpython-312.pyc +0 -0
  24. package/src/frida_bindgen/assets/codegen_helpers.c +1970 -0
  25. package/src/frida_bindgen/assets/codegen_helpers.ts +100 -0
  26. package/src/frida_bindgen/assets/codegen_prototypes.h +78 -0
  27. package/src/frida_bindgen/assets/codegen_types.h +57 -0
  28. package/src/frida_bindgen/assets/customization_facade.exports +13 -0
  29. package/src/frida_bindgen/assets/customization_facade.ts +157 -0
  30. package/src/frida_bindgen/assets/customization_helpers.imports +2 -0
  31. package/src/frida_bindgen/assets/customization_helpers.ts +396 -0
  32. package/src/frida_bindgen/cli.py +96 -0
  33. package/src/frida_bindgen/codegen.py +2233 -0
  34. package/src/frida_bindgen/customization.py +924 -0
  35. package/src/frida_bindgen/loader.py +60 -0
  36. package/src/frida_bindgen/model.py +1357 -0
  37. package/src/meson.build +94 -27
  38. package/{lib/build.py → src/tsc.py} +12 -12
  39. package/src/win_delay_load_hook.c +56 -0
  40. package/subprojects/frida-core.wrap +1 -1
  41. package/test/data/index.ts +2 -2
  42. package/test/device.ts +1 -2
  43. package/test/device_manager.ts +1 -2
  44. package/test/labrat.ts +2 -2
  45. package/test/script.ts +12 -12
  46. package/test/session.ts +3 -3
  47. package/tsconfig.json +6 -11
  48. package/dist/application.d.ts +0 -81
  49. package/dist/application.js +0 -2
  50. package/dist/authentication.d.ts +0 -3
  51. package/dist/authentication.js +0 -2
  52. package/dist/bus.d.ts +0 -16
  53. package/dist/bus.js +0 -23
  54. package/dist/cancellable.d.ts +0 -15
  55. package/dist/cancellable.js +0 -41
  56. package/dist/child.d.ts +0 -16
  57. package/dist/child.js +0 -9
  58. package/dist/crash.d.ts +0 -10
  59. package/dist/crash.js +0 -2
  60. package/dist/device.d.ts +0 -156
  61. package/dist/device.js +0 -188
  62. package/dist/device_manager.d.ts +0 -25
  63. package/dist/device_manager.js +0 -42
  64. package/dist/endpoint_parameters.d.ts +0 -26
  65. package/dist/endpoint_parameters.js +0 -24
  66. package/dist/icon.d.ts +0 -14
  67. package/dist/icon.js +0 -2
  68. package/dist/index.d.ts +0 -161
  69. package/dist/index.js +0 -170
  70. package/dist/iostream.d.ts +0 -13
  71. package/dist/iostream.js +0 -73
  72. package/dist/native.d.ts +0 -1
  73. package/dist/native.js +0 -11
  74. package/dist/portal_membership.d.ts +0 -6
  75. package/dist/portal_membership.js +0 -12
  76. package/dist/portal_service.d.ts +0 -48
  77. package/dist/portal_service.js +0 -52
  78. package/dist/process.d.ts +0 -47
  79. package/dist/process.js +0 -2
  80. package/dist/relay.d.ts +0 -22
  81. package/dist/relay.js +0 -32
  82. package/dist/script.d.ts +0 -70
  83. package/dist/script.js +0 -266
  84. package/dist/service.d.ts +0 -16
  85. package/dist/service.js +0 -26
  86. package/dist/session.d.ts +0 -45
  87. package/dist/session.js +0 -73
  88. package/dist/signals.d.ts +0 -20
  89. package/dist/signals.js +0 -40
  90. package/dist/socket_address.d.ts +0 -25
  91. package/dist/socket_address.js +0 -2
  92. package/dist/spawn.d.ts +0 -4
  93. package/dist/spawn.js +0 -2
  94. package/dist/system_parameters.d.ts +0 -84
  95. package/dist/system_parameters.js +0 -2
  96. package/lib/application.ts +0 -98
  97. package/lib/authentication.ts +0 -3
  98. package/lib/bus.ts +0 -30
  99. package/lib/cancellable.ts +0 -48
  100. package/lib/child.ts +0 -15
  101. package/lib/crash.ts +0 -11
  102. package/lib/device.ts +0 -331
  103. package/lib/device_manager.ts +0 -69
  104. package/lib/endpoint_parameters.ts +0 -56
  105. package/lib/icon.ts +0 -15
  106. package/lib/index.ts +0 -316
  107. package/lib/iostream.ts +0 -78
  108. package/lib/meson.build +0 -53
  109. package/lib/native.ts +0 -9
  110. package/lib/portal_membership.ts +0 -10
  111. package/lib/portal_service.ts +0 -105
  112. package/lib/process.ts +0 -57
  113. package/lib/relay.ts +0 -44
  114. package/lib/script.ts +0 -361
  115. package/lib/service.ts +0 -34
  116. package/lib/session.ts +0 -113
  117. package/lib/signals.ts +0 -45
  118. package/lib/socket_address.ts +0 -35
  119. package/lib/spawn.ts +0 -4
  120. package/lib/system_parameters.ts +0 -103
  121. package/meson.options +0 -11
  122. package/src/addon.cc +0 -78
  123. package/src/application.cc +0 -148
  124. package/src/application.h +0 -31
  125. package/src/authentication.cc +0 -174
  126. package/src/authentication.h +0 -24
  127. package/src/bus.cc +0 -167
  128. package/src/bus.h +0 -33
  129. package/src/cancellable.cc +0 -117
  130. package/src/cancellable.h +0 -31
  131. package/src/child.cc +0 -150
  132. package/src/child.h +0 -32
  133. package/src/crash.cc +0 -122
  134. package/src/crash.h +0 -30
  135. package/src/device.cc +0 -1350
  136. package/src/device.h +0 -56
  137. package/src/device_manager.cc +0 -362
  138. package/src/device_manager.h +0 -35
  139. package/src/endpoint_parameters.cc +0 -171
  140. package/src/endpoint_parameters.h +0 -28
  141. package/src/glib_context.cc +0 -62
  142. package/src/glib_context.h +0 -29
  143. package/src/glib_object.cc +0 -25
  144. package/src/glib_object.h +0 -37
  145. package/src/iostream.cc +0 -243
  146. package/src/iostream.h +0 -30
  147. package/src/operation.h +0 -94
  148. package/src/portal_membership.cc +0 -100
  149. package/src/portal_membership.h +0 -26
  150. package/src/portal_service.cc +0 -401
  151. package/src/portal_service.h +0 -40
  152. package/src/process.cc +0 -135
  153. package/src/process.h +0 -30
  154. package/src/relay.cc +0 -139
  155. package/src/relay.h +0 -31
  156. package/src/runtime.cc +0 -568
  157. package/src/runtime.h +0 -69
  158. package/src/script.cc +0 -301
  159. package/src/script.h +0 -36
  160. package/src/service.cc +0 -224
  161. package/src/service.h +0 -36
  162. package/src/session.cc +0 -860
  163. package/src/session.h +0 -42
  164. package/src/signals.cc +0 -334
  165. package/src/signals.h +0 -47
  166. package/src/spawn.cc +0 -95
  167. package/src/spawn.h +0 -27
  168. package/src/usage_monitor.h +0 -117
  169. package/src/uv_context.cc +0 -118
  170. package/src/uv_context.h +0 -40
  171. package/src/win_delay_load_hook.cc +0 -63
  172. package/subprojects/nan.wrap +0 -9
  173. package/subprojects/packagefiles/nan.patch +0 -13
  174. /package/{scripts → src/assets}/adjust-version.py +0 -0
package/src/meson.build CHANGED
@@ -1,33 +1,100 @@
1
- frida_binding_sources = files(
2
- 'addon.cc',
3
- 'device_manager.cc',
4
- 'device.cc',
5
- 'application.cc',
6
- 'process.cc',
7
- 'spawn.cc',
8
- 'child.cc',
9
- 'crash.cc',
10
- 'bus.cc',
11
- 'service.cc',
12
- 'session.cc',
13
- 'script.cc',
14
- 'relay.cc',
15
- 'portal_membership.cc',
16
- 'portal_service.cc',
17
- 'endpoint_parameters.cc',
18
- 'authentication.cc',
19
- 'iostream.cc',
20
- 'cancellable.cc',
21
- 'signals.cc',
22
- 'glib_object.cc',
23
- 'runtime.cc',
24
- 'uv_context.cc',
25
- 'glib_context.cc',
26
- 'win_delay_load_hook.cc',
1
+ subdir('assets')
2
+
3
+ if frida_core_dep.type_name() == 'internal'
4
+ frida_core_subprj = subproject('frida-core')
5
+ frida_gir = frida_core_subprj.get_variable('core_public_gir')
6
+ glib_gir = frida_core_subprj.get_variable('glib_gir')
7
+ gobject_gir = frida_core_subprj.get_variable('gobject_gir')
8
+ gio_gir = frida_core_subprj.get_variable('gio_gir')
9
+ else
10
+ girdir = frida_core_dep.get_variable('frida_girdir')
11
+ frida_gir = girdir / 'Frida-1.0.gir'
12
+ glib_gir = girdir / 'GLib-2.0.gir'
13
+ gobject_gir = girdir / 'GObject-2.0.gir'
14
+ gio_gir = girdir / 'Gio-2.0.gir'
15
+ endif
16
+
17
+ env = environment()
18
+ env.set('PYTHONPATH', meson.current_source_dir())
19
+
20
+ code = custom_target('binding-code',
21
+ output: [
22
+ 'frida.ts',
23
+ 'frida_binding.d.ts',
24
+ 'frida_binding.c',
25
+ ],
26
+ input: [
27
+ frida_gir,
28
+ glib_gir,
29
+ gobject_gir,
30
+ gio_gir,
31
+ files(
32
+ 'frida_bindgen' / '__init__.py',
33
+ 'frida_bindgen' / '__main__.py',
34
+ 'frida_bindgen' / 'cli.py',
35
+ 'frida_bindgen' / 'codegen.py',
36
+ 'frida_bindgen' / 'customization.py',
37
+ 'frida_bindgen' / 'loader.py',
38
+ 'frida_bindgen' / 'model.py',
39
+ 'frida_bindgen' / 'assets' / 'codegen_helpers.c',
40
+ 'frida_bindgen' / 'assets' / 'codegen_helpers.ts',
41
+ 'frida_bindgen' / 'assets' / 'codegen_prototypes.h',
42
+ 'frida_bindgen' / 'assets' / 'codegen_types.h',
43
+ 'frida_bindgen' / 'assets' / 'customization_facade.exports',
44
+ 'frida_bindgen' / 'assets' / 'customization_facade.ts',
45
+ 'frida_bindgen' / 'assets' / 'customization_helpers.imports',
46
+ 'frida_bindgen' / 'assets' / 'customization_helpers.ts',
47
+ )
48
+ ],
49
+ command: [
50
+ python, '-m', 'frida_bindgen',
51
+ '--frida-gir=@INPUT0@',
52
+ '--glib-gir=@INPUT1@',
53
+ '--gobject-gir=@INPUT2@',
54
+ '--gio-gir=@INPUT3@',
55
+ '--output-ts=@OUTPUT0@',
56
+ '--output-dts=@OUTPUT1@',
57
+ '--output-c=@OUTPUT2@',
58
+ ],
59
+ env: env,
60
+ install: true,
61
+ install_dir: [
62
+ false,
63
+ pkg_install_dir / 'build' / 'src',
64
+ false,
65
+ ],
66
+ )
67
+
68
+ custom_target('js',
69
+ input: [
70
+ code[0],
71
+ code[1],
72
+ ],
73
+ output: [
74
+ 'frida.js',
75
+ 'frida.d.ts',
76
+ ],
77
+ command: [
78
+ python,
79
+ files('tsc.py'),
80
+ '@OUTDIR@',
81
+ '@PRIVATE_DIR@',
82
+ npm,
83
+ adjusted_package_json,
84
+ tsconfig_json,
85
+ '@INPUT@',
86
+ ],
87
+ install: true,
88
+ install_dir: pkg_install_dir / 'build' / 'src',
27
89
  )
28
90
 
91
+ frida_binding_sources = [
92
+ code[2],
93
+ files('win_delay_load_hook.c'),
94
+ ]
95
+
29
96
  if system == 'windows'
30
- if cpp.get_argument_syntax() != 'msvc'
97
+ if cc.get_argument_syntax() != 'msvc'
31
98
  symfile = 'addon.symbols'
32
99
  extra_link_args += '-Wl,--retain-symbols-file,' + meson.current_source_dir() / symfile
33
100
  extra_link_depends += files(symfile)
@@ -12,16 +12,16 @@ def main(argv: list[str]):
12
12
  for asset in [package_json, tsconfig]:
13
13
  shutil.copy(asset, privdir)
14
14
 
15
- libdir = privdir / "lib"
16
- if libdir.exists():
17
- shutil.rmtree(libdir)
18
- libdir.mkdir()
15
+ srcdir = privdir / "src"
16
+ if srcdir.exists():
17
+ shutil.rmtree(srcdir)
18
+ srcdir.mkdir()
19
19
  for asset in sources:
20
- shutil.copy(asset, libdir)
20
+ shutil.copy(asset, srcdir)
21
21
 
22
- distdir = privdir / "dist"
23
- if distdir.exists():
24
- shutil.rmtree(distdir)
22
+ srcoutdir = privdir / "build" / "src"
23
+ if srcoutdir.exists():
24
+ shutil.rmtree(srcoutdir)
25
25
 
26
26
  run_kwargs = {
27
27
  "stdout": subprocess.PIPE,
@@ -32,13 +32,13 @@ def main(argv: list[str]):
32
32
  subprocess.run([npm, "install", "--ignore-scripts"],
33
33
  cwd=privdir,
34
34
  **run_kwargs)
35
- subprocess.run([npm, "run", "build"],
35
+ subprocess.run([npm, "exec", "tsc"],
36
36
  cwd=privdir,
37
37
  **run_kwargs)
38
38
 
39
- for asset in sources:
40
- for ext in [".js", ".d.ts"]:
41
- shutil.copy(distdir / (asset.stem + ext), outdir)
39
+ for asset in (s for s in sources if not s.name.endswith(".d.ts")):
40
+ shutil.copy(srcoutdir / (asset.stem + ".js"), outdir)
41
+ shutil.copy(srcoutdir / (asset.stem + ".d.ts"), outdir)
42
42
  except subprocess.CalledProcessError as e:
43
43
  print(e, file=sys.stderr)
44
44
  print("Output:\n\t| " + "\n\t| ".join(e.output.strip().split("\n")), file=sys.stderr)
@@ -0,0 +1,56 @@
1
+ /*
2
+ * When this file is linked to a DLL, it sets up a delay-load hook that
3
+ * intervenes when the DLL is trying to load the host executable
4
+ * dynamically. Instead of trying to locate the .exe file it'll just
5
+ * return a handle to the process image.
6
+ *
7
+ * This allows compiled addons to work when the host executable is renamed.
8
+ */
9
+
10
+ #ifdef _MSC_VER
11
+
12
+ #pragma managed(push, off)
13
+
14
+ #ifndef WIN32_LEAN_AND_MEAN
15
+ #define WIN32_LEAN_AND_MEAN
16
+ #endif
17
+
18
+ #include <windows.h>
19
+
20
+ #include <delayimp.h>
21
+ #include <string.h>
22
+
23
+ static FARPROC WINAPI
24
+ load_exe_hook (unsigned int event,
25
+ DelayLoadInfo * info)
26
+ {
27
+ static HMODULE node_dll = NULL;
28
+
29
+ switch (event)
30
+ {
31
+ case dliNoteStartProcessing:
32
+ if (node_dll == NULL)
33
+ {
34
+ HMODULE m = GetModuleHandle (NULL);
35
+ if (GetProcAddress (m, "napi_define_class") != NULL)
36
+ node_dll = m;
37
+ else
38
+ node_dll = GetModuleHandle ("node.dll");
39
+ }
40
+ return NULL;
41
+ case dliNotePreLoadLibrary:
42
+ if (_stricmp (info->szDll, "node.exe") == 0)
43
+ return (FARPROC) node_dll;
44
+ return NULL;
45
+ case dliNotePreGetProcAddress:
46
+ return GetProcAddress (node_dll, info->dlp.szProcName);
47
+ default:
48
+ return NULL;
49
+ }
50
+ }
51
+
52
+ const PfnDliHook __pfnDliNotifyHook2 = load_exe_hook;
53
+
54
+ #pragma managed(pop)
55
+
56
+ #endif
@@ -1,6 +1,6 @@
1
1
  [wrap-git]
2
2
  url = https://github.com/frida/frida-core.git
3
- revision = 16.7.14
3
+ revision = 16.7.16
4
4
  depth = 1
5
5
 
6
6
  [provide]
@@ -3,10 +3,10 @@ export function targetProgram() {
3
3
  if (platform === "win32") {
4
4
  return "C:\\Windows\\notepad.exe";
5
5
  } else if (platform === "darwin") {
6
- return __dirname + "/unixvictim-macos";
6
+ return new URL("./unixvictim-macos", import.meta.url).pathname;
7
7
  } else if (platform === "linux" && ["ia32", "x64"].includes(process.arch)) {
8
8
  const fridaArch = (process.arch === "x64") ? "x86_64" : "x86";
9
- return __dirname + "/unixvictim-linux-" + fridaArch;
9
+ return new URL("./unixvictim-linux-" + fridaArch, import.meta.url).pathname;
10
10
  } else {
11
11
  return "/bin/cat";
12
12
  }
package/test/device.ts CHANGED
@@ -1,6 +1,5 @@
1
- import * as frida from "../lib";
2
-
3
1
  import { expect } from "chai";
2
+ import frida from "frida";
4
3
  import "mocha";
5
4
 
6
5
  declare function gc(): void;
@@ -1,6 +1,5 @@
1
- import * as frida from "../lib";
2
-
3
1
  import { expect } from "chai";
2
+ import frida from "frida";
4
3
  import "mocha";
5
4
 
6
5
  declare function gc(): void;
package/test/labrat.ts CHANGED
@@ -1,5 +1,5 @@
1
- import * as frida from "../lib";
2
- import { targetProgram } from "./data";
1
+ import frida from "frida";
2
+ import { targetProgram } from "./data/index.js";
3
3
 
4
4
  export class LabRat {
5
5
  private constructor(private _pid: number) {
package/test/script.ts CHANGED
@@ -1,7 +1,7 @@
1
- import * as frida from "../lib";
2
- import { LabRat } from "./labrat";
1
+ import { LabRat } from "./labrat.js";
3
2
 
4
3
  import { expect } from "chai";
4
+ import frida from "frida";
5
5
  import "mocha";
6
6
 
7
7
  declare function gc(): void;
@@ -56,10 +56,10 @@ describe("Script", function () {
56
56
  try {
57
57
  await agent.add(1, -2);
58
58
  } catch (e) {
59
- thrownException = e;
59
+ thrownException = e as Error;
60
60
  }
61
61
  expect(thrownException).to.not.be.equal(null);
62
- expect(thrownException.message).to.equal("no");
62
+ expect(thrownException!.message).to.equal("no");
63
63
 
64
64
  const buf = await agent.speak();
65
65
  expect(buf.toJSON().data).to.deep.equal([0x59, 0x6f]);
@@ -88,10 +88,10 @@ describe("Script", function () {
88
88
  try {
89
89
  await script.exports.init();
90
90
  } catch (e) {
91
- thrownException = e;
91
+ thrownException = e as Error;
92
92
  }
93
93
  expect(thrownException).to.not.equal(null);
94
- expect(thrownException.message).to.equal("Script is destroyed");
94
+ expect(thrownException!.message).to.equal("Script is destroyed");
95
95
  });
96
96
 
97
97
  it("should fail rpc request if script is unloaded mid-request", async () => {
@@ -110,10 +110,10 @@ describe("Script", function () {
110
110
  try {
111
111
  await script.exports.waitForever();
112
112
  } catch (e) {
113
- thrownException = e;
113
+ thrownException = e as Error;
114
114
  }
115
115
  expect(thrownException).to.not.equal(null);
116
- expect(thrownException.message).to.equal("Script is destroyed");
116
+ expect(thrownException!.message).to.equal("Script is destroyed");
117
117
  });
118
118
 
119
119
  it("should fail rpc request if session gets detached mid-request", async () => {
@@ -132,10 +132,10 @@ describe("Script", function () {
132
132
  try {
133
133
  await script.exports.waitForever();
134
134
  } catch (e) {
135
- thrownException = e;
135
+ thrownException = e as Error;
136
136
  }
137
137
  expect(thrownException).to.not.equal(null);
138
- expect(thrownException.message).to.equal("Script is destroyed");
138
+ expect(thrownException!.message).to.equal("Script is destroyed");
139
139
  });
140
140
 
141
141
  it("should fail rpc request if cancelled mid-request", async () => {
@@ -156,10 +156,10 @@ describe("Script", function () {
156
156
  try {
157
157
  await script.exports.waitForever(cancellable);
158
158
  } catch (e) {
159
- thrownException = e;
159
+ thrownException = e as Error;
160
160
  }
161
161
  expect(thrownException).to.not.equal(null);
162
- expect(thrownException.message).to.equal("Operation was cancelled");
162
+ expect(thrownException!.message).to.equal("Operation was cancelled");
163
163
  });
164
164
 
165
165
  it("should support returning rpc exports object from async method", async () => {
package/test/session.ts CHANGED
@@ -1,7 +1,7 @@
1
- import * as frida from "../lib";
2
- import { LabRat } from "./labrat";
1
+ import { LabRat } from "./labrat.js";
3
2
 
4
3
  import { expect } from "chai";
4
+ import frida from "frida";
5
5
  import "mocha";
6
6
 
7
7
  declare function gc(): void;
@@ -32,7 +32,7 @@ describe("Session", () => {
32
32
  try {
33
33
  await evaluteScript("Script.runtime", { runtime: frida.ScriptRuntime.V8 });
34
34
  } catch (e) {
35
- if (/V8 runtime not available due to build configuration/.test(e.message)) {
35
+ if (/V8 runtime not available due to build configuration/.test((e as Error).message)) {
36
36
  return;
37
37
  }
38
38
  throw e;
package/tsconfig.json CHANGED
@@ -1,18 +1,13 @@
1
1
  {
2
2
  "compilerOptions": {
3
- "lib": ["es2017"],
4
- "target": "es2017",
5
- "module": "commonjs",
3
+ "lib": ["ES2022"],
4
+ "target": "ES2022",
5
+ "module": "Node16",
6
6
  "declaration": true,
7
- "outDir": "./dist",
8
- "typeRoots": [
9
- "node_modules/@types"
10
- ],
11
- "types": [
12
- "node"
13
- ]
7
+ "outDir": "./build/src",
8
+ "strict": true
14
9
  },
15
10
  "include": [
16
- "lib/**/*"
11
+ "src/**/*.ts"
17
12
  ]
18
13
  }
@@ -1,81 +0,0 @@
1
- import { Icon } from "./icon";
2
- import { SystemParameters } from "./system_parameters";
3
- export interface Application {
4
- identifier: string;
5
- name: string;
6
- pid: number;
7
- parameters: ApplicationParameters;
8
- }
9
- /**
10
- * Application parameters typically obtained through `enumerateApplications({ scope })`,
11
- * where `scope` is either `Scope.Metadata` or `Scope.Full`. The default of `Scope.Minimal`
12
- * means no parameters will be included.
13
- */
14
- export interface ApplicationParameters {
15
- /**
16
- * Version. Exposes `CFBundleShortVersionString` on Apple OSes, `versionName` on Android.
17
- */
18
- version?: string;
19
- /**
20
- * Build stamp. Exposes `CFBundleVersion` on Apple OSes, `versionCode` on Android.
21
- */
22
- build?: string;
23
- /**
24
- * Filesystem path of application. On Apple OSes this is where the bundle is.
25
- */
26
- path?: string;
27
- /**
28
- * Apple storage container locations.
29
- */
30
- containers?: {
31
- /**
32
- * Data container location.
33
- */
34
- data?: string;
35
- /**
36
- * App group container locations.
37
- */
38
- [name: string]: string | undefined;
39
- };
40
- /**
41
- * Android source APKs. Exposes `publicSourceDir` followed by `splitPublicSourceDirs`.
42
- */
43
- sources?: string[];
44
- /**
45
- * Android data directory location.
46
- */
47
- dataDir?: string;
48
- /**
49
- * Android target SDK.
50
- */
51
- targetSdk?: number;
52
- /**
53
- * Whether the application is debuggable. Applicable on e.g. iOS and Android.
54
- */
55
- debuggable?: boolean;
56
- /**
57
- * If application is running, whether it is currently frontmost.
58
- */
59
- frontmost?: boolean;
60
- /**
61
- * If application is running, name of user that it is running as.
62
- */
63
- user?: string;
64
- /**
65
- * If application is running, PID of its parent process.
66
- */
67
- ppid?: number;
68
- /**
69
- * If application is running, when it was started.
70
- */
71
- started?: Date;
72
- /**
73
- * One or more icons. Only included when `scope` is set to `Scope.Full`.
74
- */
75
- icons?: Icon[];
76
- /**
77
- * System parameters, available for applications accessed through a portal.
78
- */
79
- system?: SystemParameters;
80
- [name: string]: any;
81
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,3 +0,0 @@
1
- export interface AuthenticatedSessionInfo {
2
- [key: string]: any;
3
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
package/dist/bus.d.ts DELETED
@@ -1,16 +0,0 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
- import { Cancellable } from "./cancellable";
4
- import { Signal } from "./signals";
5
- import { inspect } from "util";
6
- export declare class Bus {
7
- private impl;
8
- detached: Signal<BusDetachedHandler>;
9
- message: Signal<BusMessageHandler>;
10
- constructor(impl: any);
11
- attach(cancellable?: Cancellable): Promise<void>;
12
- post(message: any, data?: Buffer | null): void;
13
- [inspect.custom](depth: any, options: any): string;
14
- }
15
- export type BusDetachedHandler = () => void;
16
- export type BusMessageHandler = (message: any, data: Buffer | null) => void;
package/dist/bus.js DELETED
@@ -1,23 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Bus = void 0;
4
- const signals_1 = require("./signals");
5
- const util_1 = require("util");
6
- class Bus {
7
- constructor(impl) {
8
- this.impl = impl;
9
- const signals = impl.signals;
10
- this.detached = new signals_1.Signal(signals, "detached");
11
- this.message = new signals_1.Signal(signals, "message");
12
- }
13
- attach(cancellable) {
14
- return this.impl.attach(cancellable);
15
- }
16
- post(message, data = null) {
17
- this.impl.post(message, data);
18
- }
19
- [util_1.inspect.custom](depth, options) {
20
- return "Bus {}";
21
- }
22
- }
23
- exports.Bus = Bus;
@@ -1,15 +0,0 @@
1
- /// <reference types="node" />
2
- import { Signal } from "./signals";
3
- import { inspect } from "util";
4
- export declare class Cancellable {
5
- private impl;
6
- cancelled: Signal<CancelledHandler>;
7
- constructor();
8
- get isCancelled(): boolean;
9
- throwIfCancelled(): void;
10
- cancel(): void;
11
- [inspect.custom](): string;
12
- combine(other: Cancellable): Cancellable;
13
- static withTimeout(ms: any): Cancellable;
14
- }
15
- export type CancelledHandler = () => void;
@@ -1,41 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Cancellable = void 0;
4
- const native_1 = require("./native");
5
- const signals_1 = require("./signals");
6
- const util_1 = require("util");
7
- class Cancellable {
8
- constructor() {
9
- this.impl = new native_1.binding.Cancellable();
10
- const { signals } = this.impl;
11
- this.cancelled = new signals_1.Signal(signals, "cancelled");
12
- }
13
- get isCancelled() {
14
- return this.impl.isCancelled;
15
- }
16
- throwIfCancelled() {
17
- this.impl.throwIfCancelled();
18
- }
19
- cancel() {
20
- return this.impl.cancel();
21
- }
22
- [util_1.inspect.custom]() {
23
- return "Cancellable {}";
24
- }
25
- combine(other) {
26
- const cancel = new Cancellable();
27
- this.cancelled.connect(() => cancel.cancel());
28
- other.cancelled.connect(() => cancel.cancel());
29
- if (this.isCancelled)
30
- cancel.cancel();
31
- if (other.isCancelled)
32
- cancel.cancel();
33
- return cancel;
34
- }
35
- static withTimeout(ms) {
36
- const cancel = new Cancellable();
37
- setTimeout(() => cancel.cancel(), ms).unref();
38
- return cancel;
39
- }
40
- }
41
- exports.Cancellable = Cancellable;
package/dist/child.d.ts DELETED
@@ -1,16 +0,0 @@
1
- export interface Child {
2
- pid: number;
3
- parentPid: number;
4
- origin: ChildOrigin;
5
- identifier: string | null;
6
- path: string | null;
7
- argv: string[] | null;
8
- envp: {
9
- [name: string]: string;
10
- } | null;
11
- }
12
- export declare enum ChildOrigin {
13
- Fork = "fork",
14
- Exec = "exec",
15
- Spawn = "spawn"
16
- }
package/dist/child.js DELETED
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ChildOrigin = void 0;
4
- var ChildOrigin;
5
- (function (ChildOrigin) {
6
- ChildOrigin["Fork"] = "fork";
7
- ChildOrigin["Exec"] = "exec";
8
- ChildOrigin["Spawn"] = "spawn";
9
- })(ChildOrigin || (exports.ChildOrigin = ChildOrigin = {}));
package/dist/crash.d.ts DELETED
@@ -1,10 +0,0 @@
1
- export interface Crash {
2
- pid: number;
3
- processName: string;
4
- summary: string;
5
- report: string;
6
- parameters: CrashParameters;
7
- }
8
- export interface CrashParameters {
9
- [name: string]: string | number | boolean;
10
- }
package/dist/crash.js DELETED
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });