@efffrida/frida-tools 0.0.14 → 0.0.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 (92) hide show
  1. package/README.md +6 -10
  2. package/dist/{dts/FridaDevice.d.ts → FridaDevice.d.ts} +48 -4
  3. package/dist/FridaDevice.d.ts.map +1 -0
  4. package/dist/{esm/FridaDevice.js → FridaDevice.js} +22 -2
  5. package/dist/FridaDevice.js.map +1 -0
  6. package/dist/{dts/FridaDeviceAcquisitionError.d.ts → FridaDeviceAcquisitionError.d.ts} +2 -1
  7. package/dist/FridaDeviceAcquisitionError.d.ts.map +1 -0
  8. package/dist/{esm/FridaDeviceAcquisitionError.js → FridaDeviceAcquisitionError.js} +5 -1
  9. package/dist/FridaDeviceAcquisitionError.js.map +1 -0
  10. package/dist/FridaScript.d.ts +104 -0
  11. package/dist/FridaScript.d.ts.map +1 -0
  12. package/dist/{esm/FridaScript.js → FridaScript.js} +5 -0
  13. package/dist/FridaScript.js.map +1 -0
  14. package/dist/FridaSession.d.ts +72 -0
  15. package/dist/FridaSession.d.ts.map +1 -0
  16. package/dist/{esm/FridaSession.js → FridaSession.js} +10 -0
  17. package/dist/FridaSession.js.map +1 -0
  18. package/dist/FridaSessionError.d.ts.map +1 -0
  19. package/dist/FridaSessionError.js.map +1 -0
  20. package/dist/{dts/index.d.ts → index.d.ts} +8 -5
  21. package/dist/index.d.ts.map +1 -0
  22. package/dist/{esm/index.js → index.js} +3 -0
  23. package/dist/index.js.map +1 -0
  24. package/dist/{dts/internal → internal}/device.d.ts.map +1 -1
  25. package/dist/internal/device.js +189 -0
  26. package/dist/internal/device.js.map +1 -0
  27. package/dist/{dts/internal → internal}/script.d.ts.map +1 -1
  28. package/dist/internal/script.js +229 -0
  29. package/dist/internal/script.js.map +1 -0
  30. package/dist/{dts/internal → internal}/session.d.ts.map +1 -1
  31. package/dist/internal/session.js +124 -0
  32. package/dist/internal/session.js.map +1 -0
  33. package/package.json +54 -68
  34. package/src/FridaDevice.ts +92 -8
  35. package/src/FridaDeviceAcquisitionError.ts +6 -2
  36. package/src/FridaScript.ts +67 -31
  37. package/src/FridaSession.ts +31 -5
  38. package/src/FridaSessionError.ts +1 -1
  39. package/src/index.ts +9 -5
  40. package/src/internal/device.ts +311 -32
  41. package/src/internal/script.ts +286 -118
  42. package/src/internal/session.ts +136 -27
  43. package/FridaDevice/package.json +0 -6
  44. package/FridaDeviceAcquisitionError/package.json +0 -6
  45. package/FridaScript/package.json +0 -6
  46. package/FridaSession/package.json +0 -6
  47. package/FridaSessionError/package.json +0 -6
  48. package/dist/cjs/FridaDevice.js +0 -60
  49. package/dist/cjs/FridaDevice.js.map +0 -1
  50. package/dist/cjs/FridaDeviceAcquisitionError.js +0 -33
  51. package/dist/cjs/FridaDeviceAcquisitionError.js.map +0 -1
  52. package/dist/cjs/FridaScript.js +0 -40
  53. package/dist/cjs/FridaScript.js.map +0 -1
  54. package/dist/cjs/FridaSession.js +0 -45
  55. package/dist/cjs/FridaSession.js.map +0 -1
  56. package/dist/cjs/FridaSessionError.js +0 -37
  57. package/dist/cjs/FridaSessionError.js.map +0 -1
  58. package/dist/cjs/index.js +0 -18
  59. package/dist/cjs/index.js.map +0 -1
  60. package/dist/cjs/internal/device.js +0 -68
  61. package/dist/cjs/internal/device.js.map +0 -1
  62. package/dist/cjs/internal/script.js +0 -163
  63. package/dist/cjs/internal/script.js.map +0 -1
  64. package/dist/cjs/internal/session.js +0 -55
  65. package/dist/cjs/internal/session.js.map +0 -1
  66. package/dist/dts/FridaDevice.d.ts.map +0 -1
  67. package/dist/dts/FridaDeviceAcquisitionError.d.ts.map +0 -1
  68. package/dist/dts/FridaScript.d.ts +0 -80
  69. package/dist/dts/FridaScript.d.ts.map +0 -1
  70. package/dist/dts/FridaSession.d.ts +0 -56
  71. package/dist/dts/FridaSession.d.ts.map +0 -1
  72. package/dist/dts/FridaSessionError.d.ts.map +0 -1
  73. package/dist/dts/index.d.ts.map +0 -1
  74. package/dist/esm/FridaDevice.js.map +0 -1
  75. package/dist/esm/FridaDeviceAcquisitionError.js.map +0 -1
  76. package/dist/esm/FridaScript.js.map +0 -1
  77. package/dist/esm/FridaSession.js.map +0 -1
  78. package/dist/esm/FridaSessionError.js.map +0 -1
  79. package/dist/esm/index.js.map +0 -1
  80. package/dist/esm/internal/device.js +0 -55
  81. package/dist/esm/internal/device.js.map +0 -1
  82. package/dist/esm/internal/script.js +0 -155
  83. package/dist/esm/internal/script.js.map +0 -1
  84. package/dist/esm/internal/session.js +0 -44
  85. package/dist/esm/internal/session.js.map +0 -1
  86. package/dist/esm/package.json +0 -4
  87. package/index/package.json +0 -6
  88. /package/dist/{dts/FridaSessionError.d.ts → FridaSessionError.d.ts} +0 -0
  89. /package/dist/{esm/FridaSessionError.js → FridaSessionError.js} +0 -0
  90. /package/dist/{dts/internal → internal}/device.d.ts +0 -0
  91. /package/dist/{dts/internal → internal}/script.d.ts +0 -0
  92. /package/dist/{dts/internal → internal}/session.d.ts +0 -0
@@ -1,13 +1,15 @@
1
1
  import type * as Scope from "effect/Scope";
2
- import type * as Frida from "frida";
3
- import type * as FridaSession from "../FridaSession.js";
2
+ import type * as FridaSession from "../FridaSession.ts";
4
3
 
5
4
  import * as Context from "effect/Context";
6
5
  import * as Effect from "effect/Effect";
7
6
  import * as Layer from "effect/Layer";
7
+ import * as Match from "effect/Match";
8
8
  import * as Predicate from "effect/Predicate";
9
- import * as FridaDevice from "../FridaDevice.js";
10
- import * as FridaSessionError from "../FridaSessionError.js";
9
+ import * as Frida from "frida";
10
+
11
+ import * as FridaDevice from "../FridaDevice.ts";
12
+ import * as FridaSessionError from "../FridaSessionError.ts";
11
13
 
12
14
  /** @internal */
13
15
  export const FridaSessionTypeId: FridaSession.FridaSessionTypeId = Symbol.for(
@@ -21,21 +23,70 @@ export const Tag = Context.GenericTag<FridaSession.FridaSession>("@efffrida/frid
21
23
  export const isFridaSession = (u: unknown): u is FridaSession.FridaSession =>
22
24
  Predicate.hasProperty(u, FridaSessionTypeId);
23
25
 
26
+ /** @internal */
27
+ export const frontmost = (
28
+ options?: Frida.FrontmostQueryOptions | undefined
29
+ ): Effect.Effect<Frida.Application, FridaSessionError.FridaSessionError, FridaDevice.FridaDevice> =>
30
+ Effect.flatMap(FridaDevice.FridaDevice, ({ device }) =>
31
+ Effect.tryPromise((signal) => {
32
+ const cancellable = new Frida.Cancellable();
33
+ signal.onabort = () => cancellable.cancel();
34
+ return device.getFrontmostApplication(options, cancellable);
35
+ })
36
+ )
37
+ .pipe(Effect.flatMap(Effect.fromNullable))
38
+ .pipe(Effect.mapError((cause) => new FridaSessionError.FridaSessionError({ cause, when: "attach" })));
39
+
24
40
  /** @internal */
25
41
  export const spawn = (
26
- program: string | Array<string>,
42
+ program: string | ReadonlyArray<string>,
27
43
  options?: Frida.SpawnOptions | undefined
28
- ): Effect.Effect<number, FridaSessionError.FridaSessionError, FridaDevice.FridaDevice | Scope.Scope> =>
29
- Effect.flatMap(FridaDevice.FridaDevice, ({ device }) =>
30
- Effect.acquireRelease(
31
- Effect.tryPromise({
32
- try: () => device.spawn(program, options),
33
- catch: (cause) => new FridaSessionError.FridaSessionError({ cause, when: "spawn" }),
34
- }),
35
- (pid) => Effect.promise(() => device.kill(pid))
36
- )
44
+ ): Effect.Effect<number, FridaSessionError.FridaSessionError, FridaDevice.FridaDevice | Scope.Scope> => {
45
+ const spawnEffect = Effect.flatMap(FridaDevice.FridaDevice, ({ device }) =>
46
+ Effect.tryPromise({
47
+ try: (signal) => {
48
+ const cancellable = new Frida.Cancellable();
49
+ signal.onabort = () => cancellable.cancel();
50
+ return device.spawn(program as string | Array<string>, options, cancellable);
51
+ },
52
+ catch: (cause) =>
53
+ new FridaSessionError.FridaSessionError({
54
+ cause,
55
+ when: "spawn",
56
+ }),
57
+ })
37
58
  );
38
59
 
60
+ const resumeEffect = (pid: number) =>
61
+ Effect.flatMap(FridaDevice.FridaDevice, ({ device }) =>
62
+ Effect.tryPromise({
63
+ try: (signal) => {
64
+ const cancellable = new Frida.Cancellable();
65
+ signal.onabort = () => cancellable.cancel();
66
+ return device.resume(pid, cancellable);
67
+ },
68
+ catch: (cause) =>
69
+ new FridaSessionError.FridaSessionError({
70
+ cause,
71
+ when: "resume",
72
+ }),
73
+ })
74
+ );
75
+
76
+ const release = (pid: number) =>
77
+ Effect.flatMap(FridaDevice.FridaDevice, ({ device }) =>
78
+ Effect.promise((signal) => {
79
+ const cancellable = new Frida.Cancellable();
80
+ signal.onabort = () => cancellable.cancel();
81
+ return device.kill(pid, cancellable);
82
+ })
83
+ );
84
+
85
+ const acquire = Effect.tap(spawnEffect, resumeEffect);
86
+ const resource = Effect.acquireRelease(acquire, release);
87
+ return resource;
88
+ };
89
+
39
90
  /** @internal */
40
91
  export const attach = (
41
92
  target: Frida.TargetProcess,
@@ -44,30 +95,88 @@ export const attach = (
44
95
  FridaSession.FridaSession,
45
96
  FridaSessionError.FridaSessionError,
46
97
  FridaDevice.FridaDevice | Scope.Scope
47
- > =>
48
- Effect.flatMap(FridaDevice.FridaDevice, ({ device }) =>
49
- Effect.acquireRelease(
50
- Effect.map(
51
- Effect.tryPromise({
52
- try: () => device.attach(target, options),
53
- catch: (cause) => new FridaSessionError.FridaSessionError({ cause, when: "attach" }),
98
+ > => {
99
+ const acquire = Effect.flatMap(FridaDevice.FridaDevice, ({ device }) =>
100
+ Effect.tryPromise({
101
+ try: (signal) => {
102
+ const cancellable = new Frida.Cancellable();
103
+ signal.onabort = () => cancellable.cancel();
104
+ return device.attach(target, options, cancellable);
105
+ },
106
+ catch: (cause) =>
107
+ new FridaSessionError.FridaSessionError({
108
+ cause,
109
+ when: "attach",
110
+ }),
111
+ })
112
+ );
113
+
114
+ const release = (session: Frida.Session) =>
115
+ Effect.promise((signal) => {
116
+ const cancellable = new Frida.Cancellable();
117
+ signal.onabort = () => cancellable.cancel();
118
+ return session.detach(cancellable);
119
+ });
120
+
121
+ const resource = Effect.acquireRelease(acquire, release);
122
+ return Effect.map(
123
+ resource,
124
+ (session) =>
125
+ ({
126
+ session,
127
+ resume: Effect.tryPromise((signal) => {
128
+ const cancellable = new Frida.Cancellable();
129
+ signal.onabort = () => cancellable.cancel();
130
+ return session.resume(cancellable);
54
131
  }),
55
- (session) => ({ session, [FridaSessionTypeId]: FridaSessionTypeId }) as const
56
- ),
57
- ({ session }: FridaSession.FridaSession) => Effect.promise(() => session.detach())
58
- )
132
+ enableChildGating: Effect.tryPromise((signal) => {
133
+ const cancellable = new Frida.Cancellable();
134
+ signal.onabort = () => cancellable.cancel();
135
+ return session.enableChildGating(cancellable);
136
+ }),
137
+ disableChildGating: Effect.tryPromise((signal) => {
138
+ const cancellable = new Frida.Cancellable();
139
+ signal.onabort = () => cancellable.cancel();
140
+ return session.disableChildGating(cancellable);
141
+ }),
142
+ setupPeerConnection: (opts?: Frida.PeerOptions | undefined) =>
143
+ Effect.tryPromise((signal) => {
144
+ const cancellable = new Frida.Cancellable();
145
+ signal.onabort = () => cancellable.cancel();
146
+ return session.setupPeerConnection(opts, cancellable);
147
+ }),
148
+ joinPortal: (address: string, opts?: Frida.PortalOptions | undefined) =>
149
+ Effect.tryPromise((signal) => {
150
+ const cancellable = new Frida.Cancellable();
151
+ signal.onabort = () => cancellable.cancel();
152
+ return session.joinPortal(address, opts, cancellable);
153
+ }),
154
+ [FridaSessionTypeId]: FridaSessionTypeId,
155
+ }) as const
59
156
  );
157
+ };
60
158
 
61
159
  /** @internal */
62
160
  export const layer = (
63
- target: string,
161
+ target: number | string | ReadonlyArray<string>,
64
162
  options?: (Frida.SpawnOptions & Frida.SessionOptions) | undefined
65
163
  ): Layer.Layer<FridaSession.FridaSession, FridaSessionError.FridaSessionError, FridaDevice.FridaDevice> =>
66
164
  Layer.scoped(
67
165
  Tag,
68
166
  Effect.gen(function* () {
69
- const pid = yield* spawn(target, options);
167
+ const pid = yield* Match.value(target).pipe(
168
+ Match.when(Match.number, (pid) => Effect.succeed(pid)),
169
+ Match.when(Match.string, (proc) => spawn(proc)),
170
+ Match.orElse((proc) => spawn(proc))
171
+ );
172
+
70
173
  const session = yield* attach(pid, options);
71
174
  return session;
72
175
  })
73
176
  );
177
+
178
+ /** @internal */
179
+ export const layerFrontmost = (
180
+ options?: Frida.FrontmostQueryOptions | undefined
181
+ ): Layer.Layer<FridaSession.FridaSession, FridaSessionError.FridaSessionError, FridaDevice.FridaDevice> =>
182
+ Layer.unwrapEffect(Effect.map(frontmost(options), (app) => layer(app.pid)));
@@ -1,6 +0,0 @@
1
- {
2
- "sideEffects": [],
3
- "main": "../dist/cjs/FridaDevice.js",
4
- "module": "../dist/esm/FridaDevice.js",
5
- "types": "../dist/dts/FridaDevice.d.ts"
6
- }
@@ -1,6 +0,0 @@
1
- {
2
- "sideEffects": [],
3
- "main": "../dist/cjs/FridaDeviceAcquisitionError.js",
4
- "module": "../dist/esm/FridaDeviceAcquisitionError.js",
5
- "types": "../dist/dts/FridaDeviceAcquisitionError.d.ts"
6
- }
@@ -1,6 +0,0 @@
1
- {
2
- "sideEffects": [],
3
- "main": "../dist/cjs/FridaScript.js",
4
- "module": "../dist/esm/FridaScript.js",
5
- "types": "../dist/dts/FridaScript.d.ts"
6
- }
@@ -1,6 +0,0 @@
1
- {
2
- "sideEffects": [],
3
- "main": "../dist/cjs/FridaSession.js",
4
- "module": "../dist/esm/FridaSession.js",
5
- "types": "../dist/dts/FridaSession.d.ts"
6
- }
@@ -1,6 +0,0 @@
1
- {
2
- "sideEffects": [],
3
- "main": "../dist/cjs/FridaSessionError.js",
4
- "module": "../dist/esm/FridaSessionError.js",
5
- "types": "../dist/dts/FridaSessionError.d.ts"
6
- }
@@ -1,60 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.layerUsbDevice = exports.layerRemoteDevice = exports.layerLocalDevice = exports.isFridaDevice = exports.acquireUsbDevice = exports.acquireRemoteDevice = exports.acquireLocalDevice = exports.FridaDeviceTypeId = exports.FridaDevice = void 0;
7
- var internal = _interopRequireWildcard(require("./internal/device.js"));
8
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
9
- /**
10
- * Frida devices
11
- *
12
- * @since 1.0.0
13
- */
14
-
15
- /**
16
- * @since 1.0.0
17
- * @category Type ids
18
- */
19
- const FridaDeviceTypeId = exports.FridaDeviceTypeId = internal.FridaDeviceTypeId;
20
- /**
21
- * @since 1.0.0
22
- * @category Tags
23
- */
24
- const FridaDevice = exports.FridaDevice = internal.Tag;
25
- /**
26
- * @since 1.0.0
27
- * @category Predicates
28
- */
29
- const isFridaDevice = exports.isFridaDevice = internal.isFridaDevice;
30
- /**
31
- * @since 1.0.0
32
- * @category Device acquisition
33
- */
34
- const acquireUsbDevice = exports.acquireUsbDevice = internal.acquireUsbDevice;
35
- /**
36
- * @since 1.0.0
37
- * @category Device acquisition
38
- */
39
- const acquireRemoteDevice = exports.acquireRemoteDevice = internal.acquireRemoteDevice;
40
- /**
41
- * @since 1.0.0
42
- * @category Device acquisition
43
- */
44
- const acquireLocalDevice = exports.acquireLocalDevice = internal.acquireLocalDevice;
45
- /**
46
- * @since 1.0.0
47
- * @category Layers
48
- */
49
- const layerRemoteDevice = exports.layerRemoteDevice = internal.layerRemoteDevice;
50
- /**
51
- * @since 1.0.0
52
- * @category Layers
53
- */
54
- const layerUsbDevice = exports.layerUsbDevice = internal.layerUsbDevice;
55
- /**
56
- * @since 1.0.0
57
- * @category Layers
58
- */
59
- const layerLocalDevice = exports.layerLocalDevice = internal.layerLocalDevice;
60
- //# sourceMappingURL=FridaDevice.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FridaDevice.js","names":["internal","_interopRequireWildcard","require","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","FridaDeviceTypeId","exports","FridaDevice","Tag","isFridaDevice","acquireUsbDevice","acquireRemoteDevice","acquireLocalDevice","layerRemoteDevice","layerUsbDevice","layerLocalDevice"],"sources":["../../src/FridaDevice.ts"],"sourcesContent":[null],"mappings":";;;;;;AAYA,IAAAA,QAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAgD,SAAAD,wBAAAE,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAJ,uBAAA,YAAAA,CAAAE,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAAO,CAAA,KAAAR,CAAA,EAAAC,CAAA;AAZhD;;;;;;AAcA;;;;AAIO,MAAMkB,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAkBtB,QAAQ,CAACsB,iBAAiB;AAiB1E;;;;AAIO,MAAME,WAAW,GAAAD,OAAA,CAAAC,WAAA,GAA0CxB,QAAQ,CAACyB,GAAG;AAE9E;;;;AAIO,MAAMC,aAAa,GAAAH,OAAA,CAAAG,aAAA,GAAqC1B,QAAQ,CAAC0B,aAAa;AAErF;;;;AAIO,MAAMC,gBAAgB,GAAAJ,OAAA,CAAAI,gBAAA,GAGzB3B,QAAQ,CAAC2B,gBAAgB;AAE7B;;;;AAIO,MAAMC,mBAAmB,GAAAL,OAAA,CAAAK,mBAAA,GAI5B5B,QAAQ,CAAC4B,mBAAmB;AAEhC;;;;AAIO,MAAMC,kBAAkB,GAAAN,OAAA,CAAAM,kBAAA,GAI3B7B,QAAQ,CAAC6B,kBAAkB;AAE/B;;;;AAIO,MAAMC,iBAAiB,GAAAP,OAAA,CAAAO,iBAAA,GAI1B9B,QAAQ,CAAC8B,iBAAiB;AAE9B;;;;AAIO,MAAMC,cAAc,GAAAR,OAAA,CAAAQ,cAAA,GAEqE/B,QAAQ,CAAC+B,cAAc;AAEvH;;;;AAIO,MAAMC,gBAAgB,GAAAT,OAAA,CAAAS,gBAAA,GAIzBhC,QAAQ,CAACgC,gBAAgB","ignoreList":[]}
@@ -1,33 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.isFridaDeviceAcquisitionError = exports.FridaDeviceAcquisitionErrorTypeId = exports.FridaDeviceAcquisitionError = void 0;
7
- var PlatformError = _interopRequireWildcard(require("@effect/platform/Error"));
8
- var Predicate = _interopRequireWildcard(require("effect/Predicate"));
9
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
10
- /**
11
- * Frida device acquisition errors
12
- *
13
- * @since 1.0.0
14
- */
15
-
16
- /**
17
- * @since 1.0.0
18
- * @category Errors
19
- */
20
- const FridaDeviceAcquisitionErrorTypeId = exports.FridaDeviceAcquisitionErrorTypeId = /*#__PURE__*/Symbol.for("@efffrida/FridaError/FridaDeviceAcquisitionError");
21
- /**
22
- * @since 1.0.0
23
- * @category Errors
24
- */
25
- const isFridaDeviceAcquisitionError = u => Predicate.hasProperty(u, FridaDeviceAcquisitionErrorTypeId);
26
- /**
27
- * @since 1.0.0
28
- * @category Errors
29
- */
30
- exports.isFridaDeviceAcquisitionError = isFridaDeviceAcquisitionError;
31
- class FridaDeviceAcquisitionError extends /*#__PURE__*/PlatformError.TypeIdError(FridaDeviceAcquisitionErrorTypeId, "FridaDeviceAcquisitionError") {}
32
- exports.FridaDeviceAcquisitionError = FridaDeviceAcquisitionError;
33
- //# sourceMappingURL=FridaDeviceAcquisitionError.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FridaDeviceAcquisitionError.js","names":["PlatformError","_interopRequireWildcard","require","Predicate","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","FridaDeviceAcquisitionErrorTypeId","exports","Symbol","for","isFridaDeviceAcquisitionError","u","hasProperty","FridaDeviceAcquisitionError","TypeIdError"],"sources":["../../src/FridaDeviceAcquisitionError.ts"],"sources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pDzB,SAAS,CAAC0B,WAAW,CAACD,CAAC,EAAEL,iCAAiC,CAAC;AAE/D;;;;AAAAC,OAAA,CAAAG,6BAAA,GAAAA,6BAAA;AAIM,MAAOG,2BAA4B,sBAAQ9B,aAAa,CAAC+B,WAAW,CACtER,iCAAiC,EACjC,6BAA6B,CAK/B;AAAAC,OAAA,CAAAM,2BAAA,GAAAA,2BAAA","ignoreList":[]}
@@ -1,40 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.load = exports.layer = exports.isFridaScript = exports.FridaScriptTypeId = exports.FridaScript = void 0;
7
- var internal = _interopRequireWildcard(require("./internal/script.js"));
8
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
9
- /**
10
- * Frida scripts
11
- *
12
- * @since 1.0.0
13
- */
14
-
15
- /**
16
- * @since 1.0.0
17
- * @category Type ids
18
- */
19
- const FridaScriptTypeId = exports.FridaScriptTypeId = internal.FridaScriptTypeId;
20
- /**
21
- * @since 1.0.0
22
- * @category Tags
23
- */
24
- const FridaScript = exports.FridaScript = internal.Tag;
25
- /**
26
- * @since 1.0.0
27
- * @category Predicates
28
- */
29
- const isFridaScript = exports.isFridaScript = internal.isFridaScript;
30
- /**
31
- * @since 1.0.0
32
- * @category Frida
33
- */
34
- const load = exports.load = internal.load;
35
- /**
36
- * @since 1.0.0
37
- * @category Layers
38
- */
39
- const layer = exports.layer = internal.layer;
40
- //# sourceMappingURL=FridaScript.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FridaScript.js","names":["internal","_interopRequireWildcard","require","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","FridaScriptTypeId","exports","FridaScript","Tag","isFridaScript","load","layer"],"sources":["../../src/FridaScript.ts"],"sourcesContent":[null],"mappings":";;;;;;AAmBA,IAAAA,QAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAgD,SAAAD,wBAAAE,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAJ,uBAAA,YAAAA,CAAAE,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAAO,CAAA,KAAAR,CAAA,EAAAC,CAAA;AAnBhD;;;;;;AAqBA;;;;AAIO,MAAMkB,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAkBtB,QAAQ,CAACsB,iBAAiB;AAiC1E;;;;AAIO,MAAME,WAAW,GAAAD,OAAA,CAAAC,WAAA,GAA0CxB,QAAQ,CAACyB,GAAG;AAE9E;;;;AAIO,MAAMC,aAAa,GAAAH,OAAA,CAAAG,aAAA,GAAqC1B,QAAQ,CAAC0B,aAAa;AAErF;;;;AAIO,MAAMC,IAAI,GAAAJ,OAAA,CAAAI,IAAA,GAkBb3B,QAAQ,CAAC2B,IAAI;AAEjB;;;;AAIO,MAAMC,KAAK,GAAAL,OAAA,CAAAK,KAAA,GAkBd5B,QAAQ,CAAC4B,KAAK","ignoreList":[]}
@@ -1,45 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.spawn = exports.layer = exports.isFridaSession = exports.attach = exports.FridaSessionTypeId = exports.FridaSession = void 0;
7
- var internal = _interopRequireWildcard(require("./internal/session.js"));
8
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
9
- /**
10
- * Frida sessions
11
- *
12
- * @since 1.0.0
13
- */
14
-
15
- /**
16
- * @since 1.0.0
17
- * @category Type ids
18
- */
19
- const FridaSessionTypeId = exports.FridaSessionTypeId = internal.FridaSessionTypeId;
20
- /**
21
- * @since 1.0.0
22
- * @category Tags
23
- */
24
- const FridaSession = exports.FridaSession = internal.Tag;
25
- /**
26
- * @since 1.0.0
27
- * @category Predicates
28
- */
29
- const isFridaSession = exports.isFridaSession = internal.isFridaSession;
30
- /**
31
- * @since 1.0.0
32
- * @category Frida
33
- */
34
- const spawn = exports.spawn = internal.spawn;
35
- /**
36
- * @since 1.0.0
37
- * @category Frida
38
- */
39
- const attach = exports.attach = internal.attach;
40
- /**
41
- * @since 1.0.0
42
- * @category Layers
43
- */
44
- const layer = exports.layer = internal.layer;
45
- //# sourceMappingURL=FridaSession.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FridaSession.js","names":["internal","_interopRequireWildcard","require","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","FridaSessionTypeId","exports","FridaSession","Tag","isFridaSession","spawn","attach","layer"],"sources":["../../src/FridaSession.ts"],"sourcesContent":[null],"mappings":";;;;;;AAcA,IAAAA,QAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAiD,SAAAD,wBAAAE,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAJ,uBAAA,YAAAA,CAAAE,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAAO,CAAA,KAAAR,CAAA,EAAAC,CAAA;AAdjD;;;;;;AAgBA;;;;AAIO,MAAMkB,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,GAAkBtB,QAAQ,CAACsB,kBAAkB;AAiB5E;;;;AAIO,MAAME,YAAY,GAAAD,OAAA,CAAAC,YAAA,GAA4CxB,QAAQ,CAACyB,GAAG;AAEjF;;;;AAIO,MAAMC,cAAc,GAAAH,OAAA,CAAAG,cAAA,GAAsC1B,QAAQ,CAAC0B,cAAc;AAExF;;;;AAIO,MAAMC,KAAK,GAAAJ,OAAA,CAAAI,KAAA,GAGuF3B,QAAQ,CAAC2B,KAAK;AAEvH;;;;AAIO,MAAMC,MAAM,GAAAL,OAAA,CAAAK,MAAA,GAIf5B,QAAQ,CAAC4B,MAAM;AAEnB;;;;AAIO,MAAMC,KAAK,GAAAN,OAAA,CAAAM,KAAA,GAG6E7B,QAAQ,CAAC6B,KAAK","ignoreList":[]}
@@ -1,37 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.isFridaSessionError = exports.FridaSessionErrorTypeId = exports.FridaSessionError = void 0;
7
- var PlatformError = _interopRequireWildcard(require("@effect/platform/Error"));
8
- var Predicate = _interopRequireWildcard(require("effect/Predicate"));
9
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
10
- /**
11
- * Frida session errors
12
- *
13
- * @since 1.0.0
14
- */
15
-
16
- /**
17
- * @since 1.0.0
18
- * @category Errors
19
- */
20
- const FridaSessionErrorTypeId = exports.FridaSessionErrorTypeId = /*#__PURE__*/Symbol.for("@efffrida/FridaError/FridaSessionError");
21
- /**
22
- * @since 1.0.0
23
- * @category Errors
24
- */
25
- const isFridaSessionError = u => Predicate.hasProperty(u, FridaSessionErrorTypeId);
26
- /**
27
- * @since 1.0.0
28
- * @category Errors
29
- */
30
- exports.isFridaSessionError = isFridaSessionError;
31
- class FridaSessionError extends /*#__PURE__*/PlatformError.TypeIdError(FridaSessionErrorTypeId, "FridaSessionError") {
32
- get message() {
33
- return `A Frida session error occurred on ${this.when}`;
34
- }
35
- }
36
- exports.FridaSessionError = FridaSessionError;
37
- //# sourceMappingURL=FridaSessionError.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FridaSessionError.js","names":["PlatformError","_interopRequireWildcard","require","Predicate","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","FridaSessionErrorTypeId","exports","Symbol","for","isFridaSessionError","u","hasProperty","FridaSessionError","TypeIdError","message","when"],"sources":["../../src/FridaSessionError.ts"],"sourcesContent":[null],"mappings":";;;;;;AAMA,IAAAA,aAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAF,uBAAA,CAAAC,OAAA;AAA6C,SAAAD,wBAAAG,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CA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ACE,IAAIS,OAAOA,CAAA;IACP,OAAO,qCAAqC,IAAI,CAACC,IAAI,EAAE;EAC3D","ignoreList":[]}
package/dist/cjs/index.js DELETED
@@ -1,18 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.FridaSessionError = exports.FridaSession = exports.FridaScript = exports.FridaDeviceAcquisitionError = exports.FridaDevice = void 0;
7
- var _FridaDevice = _interopRequireWildcard(require("./FridaDevice.js"));
8
- exports.FridaDevice = _FridaDevice;
9
- var _FridaDeviceAcquisitionError = _interopRequireWildcard(require("./FridaDeviceAcquisitionError.js"));
10
- exports.FridaDeviceAcquisitionError = _FridaDeviceAcquisitionError;
11
- var _FridaScript = _interopRequireWildcard(require("./FridaScript.js"));
12
- exports.FridaScript = _FridaScript;
13
- var _FridaSession = _interopRequireWildcard(require("./FridaSession.js"));
14
- exports.FridaSession = _FridaSession;
15
- var _FridaSessionError = _interopRequireWildcard(require("./FridaSessionError.js"));
16
- exports.FridaSessionError = _FridaSessionError;
17
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
18
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"","ignoreList":[]}
@@ -1,68 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.layerUsbDevice = exports.layerRemoteDevice = exports.layerLocalDevice = exports.isFridaDevice = exports.acquireUsbDevice = exports.acquireRemoteDevice = exports.acquireLocalDevice = exports.Tag = exports.FridaDeviceTypeId = void 0;
7
- var Context = _interopRequireWildcard(require("effect/Context"));
8
- var Effect = _interopRequireWildcard(require("effect/Effect"));
9
- var Layer = _interopRequireWildcard(require("effect/Layer"));
10
- var Predicate = _interopRequireWildcard(require("effect/Predicate"));
11
- var Frida = _interopRequireWildcard(require("frida"));
12
- var FridaDeviceAcquisitionError = _interopRequireWildcard(require("../FridaDeviceAcquisitionError.js"));
13
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
14
- /** @internal */
15
- const FridaDeviceTypeId = exports.FridaDeviceTypeId = /*#__PURE__*/Symbol.for("@efffrida/frida-tools/FridaDevice");
16
- /** @internal */
17
- const Tag = exports.Tag = /*#__PURE__*/Context.GenericTag("@efffrida/frida-tools/FridaDevice");
18
- /** @internal */
19
- const isFridaDevice = u => Predicate.hasProperty(u, FridaDeviceTypeId);
20
- /** @internal */
21
- exports.isFridaDevice = isFridaDevice;
22
- const acquireUsbDevice = options => Effect.map(Effect.tryPromise({
23
- try: () => Frida.getUsbDevice(options),
24
- catch: cause => new FridaDeviceAcquisitionError.FridaDeviceAcquisitionError({
25
- cause,
26
- attempts: 1,
27
- acquisitionMethod: "usb"
28
- })
29
- }), device => ({
30
- device,
31
- [FridaDeviceTypeId]: FridaDeviceTypeId
32
- }));
33
- /** @internal */
34
- exports.acquireUsbDevice = acquireUsbDevice;
35
- const acquireRemoteDevice = (address, options) => Effect.map(Effect.tryPromise({
36
- try: () => Frida.getDeviceManager().addRemoteDevice(address, options),
37
- catch: cause => new FridaDeviceAcquisitionError.FridaDeviceAcquisitionError({
38
- cause,
39
- attempts: 1,
40
- acquisitionMethod: "remote"
41
- })
42
- }), device => ({
43
- device,
44
- [FridaDeviceTypeId]: FridaDeviceTypeId
45
- }));
46
- /** @internal */
47
- exports.acquireRemoteDevice = acquireRemoteDevice;
48
- const acquireLocalDevice = () => Effect.map(Effect.tryPromise({
49
- try: () => Frida.getLocalDevice(),
50
- catch: cause => new FridaDeviceAcquisitionError.FridaDeviceAcquisitionError({
51
- cause,
52
- attempts: 1,
53
- acquisitionMethod: "local"
54
- })
55
- }), device => ({
56
- device,
57
- [FridaDeviceTypeId]: FridaDeviceTypeId
58
- }));
59
- /** @internal */
60
- exports.acquireLocalDevice = acquireLocalDevice;
61
- const layerRemoteDevice = (address, options) => Layer.effect(Tag, acquireRemoteDevice(address, options));
62
- /** @internal */
63
- exports.layerRemoteDevice = layerRemoteDevice;
64
- const layerUsbDevice = options => Layer.effect(Tag, acquireUsbDevice(options));
65
- /** @internal */
66
- exports.layerUsbDevice = layerUsbDevice;
67
- const layerLocalDevice = exports.layerLocalDevice = /*#__PURE__*/Layer.effect(Tag, /*#__PURE__*/acquireLocalDevice());
68
- //# sourceMappingURL=device.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"device.js","names":["Context","_interopRequireWildcard","require","Effect","Layer","Predicate","Frida","FridaDeviceAcquisitionError","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","FridaDeviceTypeId","exports","Symbol","for","Tag","GenericTag","isFridaDevice","u","hasProperty","acquireUsbDevice","options","map","tryPromise","try","getUsbDevice","catch","cause","attempts","acquisitionMethod","device","acquireRemoteDevice","address","getDeviceManager","addRemoteDevice","acquireLocalDevice","getLocalDevice","layerRemoteDevice","effect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