@efffrida/frida-tools 0.0.26 → 0.0.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/FridaDevice.d.ts +9 -8
- package/dist/FridaDevice.d.ts.map +1 -1
- package/dist/FridaDevice.js.map +1 -1
- package/dist/FridaDeviceAcquisitionError.d.ts +3 -18
- package/dist/FridaDeviceAcquisitionError.d.ts.map +1 -1
- package/dist/FridaDeviceAcquisitionError.js +2 -13
- package/dist/FridaDeviceAcquisitionError.js.map +1 -1
- package/dist/FridaScript.d.ts +12 -13
- package/dist/FridaScript.d.ts.map +1 -1
- package/dist/FridaScript.js +10 -9
- package/dist/FridaScript.js.map +1 -1
- package/dist/FridaSession.d.ts +21 -7
- package/dist/FridaSession.d.ts.map +1 -1
- package/dist/FridaSession.js.map +1 -1
- package/dist/FridaSessionError.d.ts +1 -16
- package/dist/FridaSessionError.d.ts.map +1 -1
- package/dist/FridaSessionError.js +2 -13
- package/dist/FridaSessionError.js.map +1 -1
- package/dist/internal/compiler.d.ts +2 -0
- package/dist/internal/compiler.d.ts.map +1 -0
- package/dist/internal/compiler.js +82 -0
- package/dist/internal/compiler.js.map +1 -0
- package/dist/internal/device.js +33 -32
- package/dist/internal/device.js.map +1 -1
- package/dist/internal/script.js +56 -105
- package/dist/internal/script.js.map +1 -1
- package/dist/internal/session.js +90 -48
- package/dist/internal/session.js.map +1 -1
- package/package.json +11 -17
- package/src/FridaDevice.ts +11 -10
- package/src/FridaDeviceAcquisitionError.ts +4 -29
- package/src/FridaScript.ts +22 -23
- package/src/FridaSession.ts +25 -7
- package/src/FridaSessionError.ts +2 -24
- package/src/internal/compiler.ts +122 -0
- package/src/internal/device.ts +85 -67
- package/src/internal/script.ts +209 -292
- package/src/internal/session.ts +116 -52
package/dist/internal/session.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import * as Context from "effect/Context";
|
|
2
|
+
import * as Deferred from "effect/Deferred";
|
|
2
3
|
import * as Effect from "effect/Effect";
|
|
3
4
|
import * as Layer from "effect/Layer";
|
|
4
5
|
import * as Match from "effect/Match";
|
|
6
|
+
import * as Option from "effect/Option";
|
|
5
7
|
import * as Predicate from "effect/Predicate";
|
|
6
8
|
import * as Frida from "frida";
|
|
7
9
|
import * as FridaDevice from "../FridaDevice.js";
|
|
@@ -9,23 +11,47 @@ import * as FridaSessionError from "../FridaSessionError.js";
|
|
|
9
11
|
/** @internal */
|
|
10
12
|
export const FridaSessionTypeId = /*#__PURE__*/Symbol.for("@efffrida/frida-tools/FridaSession");
|
|
11
13
|
/** @internal */
|
|
12
|
-
export const Tag = /*#__PURE__*/Context.
|
|
14
|
+
export const Tag = /*#__PURE__*/Context.Service("@efffrida/frida-tools/FridaSession");
|
|
13
15
|
/** @internal */
|
|
14
16
|
export const isFridaSession = u => Predicate.hasProperty(u, FridaSessionTypeId);
|
|
15
17
|
/** @internal */
|
|
18
|
+
export const resume = session => Effect.tryPromise({
|
|
19
|
+
try: signal => {
|
|
20
|
+
const cancellable = new Frida.Cancellable();
|
|
21
|
+
signal.onabort = () => cancellable.cancel();
|
|
22
|
+
return session.resume(cancellable);
|
|
23
|
+
},
|
|
24
|
+
catch: cause => new FridaSessionError.FridaSessionError({
|
|
25
|
+
when: "resume",
|
|
26
|
+
cause
|
|
27
|
+
})
|
|
28
|
+
});
|
|
29
|
+
/** @internal */
|
|
30
|
+
export const detach = session => Effect.tryPromise({
|
|
31
|
+
try: signal => {
|
|
32
|
+
const cancellable = new Frida.Cancellable();
|
|
33
|
+
signal.onabort = () => cancellable.cancel();
|
|
34
|
+
return session.detach(cancellable);
|
|
35
|
+
},
|
|
36
|
+
catch: cause => new FridaSessionError.FridaSessionError({
|
|
37
|
+
when: "detach",
|
|
38
|
+
cause
|
|
39
|
+
})
|
|
40
|
+
});
|
|
41
|
+
/** @internal */
|
|
16
42
|
export const frontmost = options => Effect.flatMap(FridaDevice.FridaDevice, ({
|
|
17
43
|
device
|
|
18
44
|
}) => Effect.tryPromise(signal => {
|
|
19
45
|
const cancellable = new Frida.Cancellable();
|
|
20
46
|
signal.onabort = () => cancellable.cancel();
|
|
21
47
|
return device.getFrontmostApplication(options, cancellable);
|
|
22
|
-
})).pipe(Effect.flatMap(Effect.
|
|
48
|
+
})).pipe(Effect.flatMap(Effect.fromNullishOr), Effect.mapError(cause => new FridaSessionError.FridaSessionError({
|
|
23
49
|
when: "attach",
|
|
24
50
|
cause
|
|
25
51
|
})));
|
|
26
52
|
/** @internal */
|
|
27
53
|
export const spawn = (program, options) => {
|
|
28
|
-
const
|
|
54
|
+
const acquire = Effect.flatMap(FridaDevice.FridaDevice, ({
|
|
29
55
|
device
|
|
30
56
|
}) => Effect.tryPromise({
|
|
31
57
|
try: signal => {
|
|
@@ -38,19 +64,6 @@ export const spawn = (program, options) => {
|
|
|
38
64
|
cause
|
|
39
65
|
})
|
|
40
66
|
}));
|
|
41
|
-
const resumeEffect = pid => Effect.flatMap(FridaDevice.FridaDevice, ({
|
|
42
|
-
device
|
|
43
|
-
}) => Effect.tryPromise({
|
|
44
|
-
try: signal => {
|
|
45
|
-
const cancellable = new Frida.Cancellable();
|
|
46
|
-
signal.onabort = () => cancellable.cancel();
|
|
47
|
-
return device.resume(pid, cancellable);
|
|
48
|
-
},
|
|
49
|
-
catch: cause => new FridaSessionError.FridaSessionError({
|
|
50
|
-
when: "resume",
|
|
51
|
-
cause
|
|
52
|
-
})
|
|
53
|
-
}));
|
|
54
67
|
const release = pid => Effect.flatMap(FridaDevice.FridaDevice, ({
|
|
55
68
|
device
|
|
56
69
|
}) => Effect.promise(signal => {
|
|
@@ -58,12 +71,24 @@ export const spawn = (program, options) => {
|
|
|
58
71
|
signal.onabort = () => cancellable.cancel();
|
|
59
72
|
return device.kill(pid, cancellable);
|
|
60
73
|
}));
|
|
61
|
-
const acquire = Effect.tap(spawnEffect, resumeEffect);
|
|
62
74
|
const resource = Effect.acquireRelease(acquire, release);
|
|
63
75
|
return resource;
|
|
64
76
|
};
|
|
65
77
|
/** @internal */
|
|
66
78
|
export const attach = (target, options) => {
|
|
79
|
+
const detached = Deferred.makeUnsafe();
|
|
80
|
+
const onDetached = (reason, crash) => {
|
|
81
|
+
Deferred.doneUnsafe(detached, Effect.succeed({
|
|
82
|
+
reason,
|
|
83
|
+
crash: Option.fromNullOr(crash).pipe(Option.map(c => ({
|
|
84
|
+
pid: c.pid,
|
|
85
|
+
processName: c.processName,
|
|
86
|
+
summary: c.summary,
|
|
87
|
+
report: c.report,
|
|
88
|
+
parameters: c.parameters
|
|
89
|
+
})))
|
|
90
|
+
}));
|
|
91
|
+
};
|
|
67
92
|
const acquire = Effect.flatMap(FridaDevice.FridaDevice, ({
|
|
68
93
|
device
|
|
69
94
|
}) => Effect.tryPromise({
|
|
@@ -80,45 +105,62 @@ export const attach = (target, options) => {
|
|
|
80
105
|
const release = session => Effect.promise(signal => {
|
|
81
106
|
const cancellable = new Frida.Cancellable();
|
|
82
107
|
signal.onabort = () => cancellable.cancel();
|
|
108
|
+
session.detached.disconnect(onDetached);
|
|
83
109
|
return session.detach(cancellable);
|
|
84
110
|
});
|
|
85
111
|
const resource = Effect.acquireRelease(acquire, release);
|
|
86
|
-
return Effect.map(resource, session =>
|
|
87
|
-
session
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
112
|
+
return Effect.map(resource, session => {
|
|
113
|
+
session.detached.connect(onDetached);
|
|
114
|
+
return {
|
|
115
|
+
session,
|
|
116
|
+
pid: session.pid,
|
|
117
|
+
detached: detached,
|
|
118
|
+
resume: resume(session),
|
|
119
|
+
detach: detach(session),
|
|
120
|
+
enableChildGating: Effect.tryPromise(signal => {
|
|
121
|
+
const cancellable = new Frida.Cancellable();
|
|
122
|
+
signal.onabort = () => cancellable.cancel();
|
|
123
|
+
return session.enableChildGating(cancellable);
|
|
124
|
+
}),
|
|
125
|
+
disableChildGating: Effect.tryPromise(signal => {
|
|
126
|
+
const cancellable = new Frida.Cancellable();
|
|
127
|
+
signal.onabort = () => cancellable.cancel();
|
|
128
|
+
return session.disableChildGating(cancellable);
|
|
129
|
+
}),
|
|
130
|
+
setupPeerConnection: opts => Effect.tryPromise(signal => {
|
|
131
|
+
const cancellable = new Frida.Cancellable();
|
|
132
|
+
signal.onabort = () => cancellable.cancel();
|
|
133
|
+
return session.setupPeerConnection(opts, cancellable);
|
|
134
|
+
}),
|
|
135
|
+
joinPortal: (address, opts) => Effect.tryPromise(signal => {
|
|
136
|
+
const cancellable = new Frida.Cancellable();
|
|
137
|
+
signal.onabort = () => cancellable.cancel();
|
|
138
|
+
return session.joinPortal(address, opts, cancellable);
|
|
139
|
+
}),
|
|
140
|
+
[FridaSessionTypeId]: FridaSessionTypeId
|
|
141
|
+
};
|
|
142
|
+
});
|
|
115
143
|
};
|
|
116
144
|
/** @internal */
|
|
117
|
-
export const layer = (target, options) => Layer.
|
|
145
|
+
export const layer = (target, options) => Layer.effect(Tag, Effect.gen(function* () {
|
|
146
|
+
const {
|
|
147
|
+
device
|
|
148
|
+
} = yield* FridaDevice.FridaDevice;
|
|
118
149
|
const pid = yield* Match.value(target).pipe(Match.when(Match.number, proc => Effect.succeed(proc)), Match.when(Match.string, proc => spawn(proc)), Match.orElse(proc => spawn(proc)));
|
|
119
150
|
const session = yield* attach(pid, options);
|
|
151
|
+
yield* Effect.tryPromise({
|
|
152
|
+
try: signal => {
|
|
153
|
+
const cancellable = new Frida.Cancellable();
|
|
154
|
+
signal.onabort = () => cancellable.cancel();
|
|
155
|
+
return device.resume(session.pid, cancellable);
|
|
156
|
+
},
|
|
157
|
+
catch: cause => new FridaSessionError.FridaSessionError({
|
|
158
|
+
when: "resume",
|
|
159
|
+
cause
|
|
160
|
+
})
|
|
161
|
+
});
|
|
120
162
|
return session;
|
|
121
163
|
}));
|
|
122
164
|
/** @internal */
|
|
123
|
-
export const layerFrontmost = options => Layer.
|
|
165
|
+
export const layerFrontmost = options => Layer.unwrap(Effect.map(frontmost(options), app => layer(app.pid)));
|
|
124
166
|
//# sourceMappingURL=session.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.js","names":["Context","Effect","Layer","Match","Predicate","Frida","FridaDevice","FridaSessionError","FridaSessionTypeId","Symbol","for","Tag","
|
|
1
|
+
{"version":3,"file":"session.js","names":["Context","Deferred","Effect","Layer","Match","Option","Predicate","Frida","FridaDevice","FridaSessionError","FridaSessionTypeId","Symbol","for","Tag","Service","isFridaSession","u","hasProperty","resume","session","tryPromise","try","signal","cancellable","Cancellable","onabort","cancel","catch","cause","when","detach","frontmost","options","flatMap","device","getFrontmostApplication","pipe","fromNullishOr","mapError","spawn","program","acquire","release","pid","promise","kill","resource","acquireRelease","attach","target","detached","makeUnsafe","onDetached","reason","crash","doneUnsafe","succeed","fromNullOr","map","c","processName","summary","report","parameters","disconnect","connect","enableChildGating","disableChildGating","setupPeerConnection","opts","joinPortal","address","layer","effect","gen","value","number","proc","string","orElse","layerFrontmost","unwrap","app"],"sources":["../../src/internal/session.ts"],"sourcesContent":[null],"mappings":"AAEA,OAAO,KAAKA,OAAO,MAAM,gBAAgB;AACzC,OAAO,KAAKC,QAAQ,MAAM,iBAAiB;AAC3C,OAAO,KAAKC,MAAM,MAAM,eAAe;AACvC,OAAO,KAAKC,KAAK,MAAM,cAAc;AACrC,OAAO,KAAKC,KAAK,MAAM,cAAc;AACrC,OAAO,KAAKC,MAAM,MAAM,eAAe;AACvC,OAAO,KAAKC,SAAS,MAAM,kBAAkB;AAI7C,OAAO,KAAKC,KAAK,MAAM,OA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
4
4
|
"description": "Frida with effect-ts",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"effect-ts",
|
|
@@ -31,29 +31,23 @@
|
|
|
31
31
|
"./internal/*": null
|
|
32
32
|
},
|
|
33
33
|
"publishConfig": {
|
|
34
|
-
"access": "public"
|
|
34
|
+
"access": "public",
|
|
35
|
+
"provenance": true
|
|
35
36
|
},
|
|
36
37
|
"dependencies": {
|
|
37
|
-
"frida": "17.9.
|
|
38
|
+
"frida": "17.9.10"
|
|
38
39
|
},
|
|
39
40
|
"devDependencies": {
|
|
40
|
-
"@effect/
|
|
41
|
-
"@effect/
|
|
42
|
-
"@effect/platform": "0.96.1",
|
|
43
|
-
"@effect/platform-node": "0.106.0",
|
|
44
|
-
"@effect/rpc": "0.75.1",
|
|
45
|
-
"@effect/sql": "0.51.1",
|
|
46
|
-
"@effect/vitest": "0.29.0",
|
|
47
|
-
"@effect/workflow": "0.18.1",
|
|
41
|
+
"@effect/platform-node": "4.0.0-beta.66",
|
|
42
|
+
"@effect/vitest": "4.0.0-beta.66",
|
|
48
43
|
"@types/frida-gum": "19.1.0",
|
|
49
|
-
"@types/node": "25.
|
|
50
|
-
"effect": "
|
|
51
|
-
"
|
|
52
|
-
"
|
|
44
|
+
"@types/node": "25.9.0",
|
|
45
|
+
"effect": "4.0.0-beta.66",
|
|
46
|
+
"ioredis": "5.10.1",
|
|
47
|
+
"vitest": "4.1.6"
|
|
53
48
|
},
|
|
54
49
|
"peerDependencies": {
|
|
55
|
-
"
|
|
56
|
-
"effect": "3.21.2"
|
|
50
|
+
"effect": "4.0.0-beta.66"
|
|
57
51
|
},
|
|
58
52
|
"tags": [
|
|
59
53
|
"frida.re",
|
package/src/FridaDevice.ts
CHANGED
|
@@ -4,15 +4,16 @@
|
|
|
4
4
|
* @since 1.0.0
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import type * as
|
|
8
|
-
import type * as ConfigError from "effect/ConfigError";
|
|
7
|
+
import type * as Config from "effect/Config";
|
|
9
8
|
import type * as Context from "effect/Context";
|
|
10
9
|
import type * as Effect from "effect/Effect";
|
|
11
10
|
import type * as Layer from "effect/Layer";
|
|
11
|
+
import type * as Path from "effect/Path";
|
|
12
12
|
import type * as Scope from "effect/Scope";
|
|
13
|
-
import type * as
|
|
13
|
+
import type * as ChildProcessSpawner from "effect/unstable/process/ChildProcessSpawner";
|
|
14
14
|
|
|
15
15
|
import type * as FridaDeviceAcquisitionError from "./FridaDeviceAcquisitionError.ts";
|
|
16
|
+
import type * as Frida from "frida";
|
|
16
17
|
|
|
17
18
|
import * as internal from "./internal/device.ts";
|
|
18
19
|
|
|
@@ -42,7 +43,7 @@ export interface FridaDevice {
|
|
|
42
43
|
* @since 1.0.0
|
|
43
44
|
* @category Tags
|
|
44
45
|
*/
|
|
45
|
-
export const FridaDevice: Context.
|
|
46
|
+
export const FridaDevice: Context.Service<FridaDevice, FridaDevice> = internal.Tag;
|
|
46
47
|
|
|
47
48
|
/**
|
|
48
49
|
* @since 1.0.0
|
|
@@ -97,7 +98,7 @@ export const acquireAndroidEmulatorDevice: (
|
|
|
97
98
|
) => Effect.Effect<
|
|
98
99
|
FridaDevice,
|
|
99
100
|
FridaDeviceAcquisitionError.FridaDeviceAcquisitionError,
|
|
100
|
-
|
|
101
|
+
ChildProcessSpawner.ChildProcessSpawner | Scope.Scope
|
|
101
102
|
> = internal.acquireAndroidEmulatorDevice;
|
|
102
103
|
|
|
103
104
|
/**
|
|
@@ -115,8 +116,8 @@ export const acquireAndroidEmulatorDeviceConfig: (
|
|
|
115
116
|
| undefined
|
|
116
117
|
) => Effect.Effect<
|
|
117
118
|
FridaDevice,
|
|
118
|
-
|
|
119
|
-
|
|
119
|
+
Config.ConfigError | FridaDeviceAcquisitionError.FridaDeviceAcquisitionError,
|
|
120
|
+
ChildProcessSpawner.ChildProcessSpawner | Path.Path | Scope.Scope
|
|
120
121
|
> = internal.acquireAndroidEmulatorDeviceConfig;
|
|
121
122
|
|
|
122
123
|
/**
|
|
@@ -165,7 +166,7 @@ export const layerAndroidEmulatorDevice: (
|
|
|
165
166
|
) => Layer.Layer<
|
|
166
167
|
FridaDevice,
|
|
167
168
|
FridaDeviceAcquisitionError.FridaDeviceAcquisitionError,
|
|
168
|
-
|
|
169
|
+
ChildProcessSpawner.ChildProcessSpawner
|
|
169
170
|
> = internal.layerAndroidEmulatorDevice;
|
|
170
171
|
|
|
171
172
|
/**
|
|
@@ -183,6 +184,6 @@ export const layerAndroidEmulatorDeviceConfig: (
|
|
|
183
184
|
| undefined
|
|
184
185
|
) => Layer.Layer<
|
|
185
186
|
FridaDevice,
|
|
186
|
-
|
|
187
|
-
|
|
187
|
+
Config.ConfigError | FridaDeviceAcquisitionError.FridaDeviceAcquisitionError,
|
|
188
|
+
ChildProcessSpawner.ChildProcessSpawner | Path.Path
|
|
188
189
|
> = internal.layerAndroidEmulatorDeviceConfig;
|
|
@@ -4,41 +4,16 @@
|
|
|
4
4
|
* @since 1.0.0
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import * as
|
|
8
|
-
import * as Predicate from "effect/Predicate";
|
|
7
|
+
import * as Data from "effect/Data";
|
|
9
8
|
|
|
10
9
|
/**
|
|
11
10
|
* @since 1.0.0
|
|
12
11
|
* @category Errors
|
|
13
12
|
*/
|
|
14
|
-
export
|
|
15
|
-
"@efffrida/FridaError/FridaDeviceAcquisitionError"
|
|
16
|
-
) as FridaDeviceAcquisitionErrorTypeId;
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* @since 1.0.0
|
|
20
|
-
* @category Errors
|
|
21
|
-
*/
|
|
22
|
-
export type FridaDeviceAcquisitionErrorTypeId = typeof FridaDeviceAcquisitionErrorTypeId;
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* @since 1.0.0
|
|
26
|
-
* @category Errors
|
|
27
|
-
*/
|
|
28
|
-
export const isFridaDeviceAcquisitionError = (u: unknown): u is FridaDeviceAcquisitionError =>
|
|
29
|
-
Predicate.hasProperty(u, FridaDeviceAcquisitionErrorTypeId);
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* @since 1.0.0
|
|
33
|
-
* @category Errors
|
|
34
|
-
*/
|
|
35
|
-
export class FridaDeviceAcquisitionError extends PlatformError.TypeIdError(
|
|
36
|
-
FridaDeviceAcquisitionErrorTypeId,
|
|
37
|
-
"FridaDeviceAcquisitionError"
|
|
38
|
-
)<{
|
|
39
|
-
cause: unknown;
|
|
40
|
-
attempts: number;
|
|
13
|
+
export class FridaDeviceAcquisitionError extends Data.TaggedError("FridaDeviceAcquisitionError")<{
|
|
41
14
|
acquisitionMethod: "usb" | "remote" | "local" | "android-emulator";
|
|
15
|
+
attempts: number;
|
|
16
|
+
cause: unknown;
|
|
42
17
|
}> {
|
|
43
18
|
public override get message(): string {
|
|
44
19
|
return `Failed to acquire ${this.acquisitionMethod} Frida device after ${this.attempts} attempt(s)`;
|
package/src/FridaScript.ts
CHANGED
|
@@ -4,32 +4,32 @@
|
|
|
4
4
|
* @since 1.0.0
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import type * as FileSystem from "@effect/platform/FileSystem";
|
|
8
|
-
import type * as Path from "@effect/platform/Path";
|
|
9
7
|
import type * as Context from "effect/Context";
|
|
10
8
|
import type * as Deferred from "effect/Deferred";
|
|
11
9
|
import type * as Duration from "effect/Duration";
|
|
12
10
|
import type * as Effect from "effect/Effect";
|
|
13
11
|
import type * as Exit from "effect/Exit";
|
|
12
|
+
import type * as FileSystem from "effect/FileSystem";
|
|
14
13
|
import type * as Layer from "effect/Layer";
|
|
15
14
|
import type * as Option from "effect/Option";
|
|
16
|
-
import type * as
|
|
15
|
+
import type * as Path from "effect/Path";
|
|
17
16
|
import type * as Schema from "effect/Schema";
|
|
18
17
|
import type * as Scope from "effect/Scope";
|
|
19
18
|
import type * as Sink from "effect/Sink";
|
|
20
19
|
import type * as Stream from "effect/Stream";
|
|
21
|
-
import type * as Frida from "frida";
|
|
22
20
|
|
|
23
21
|
import type * as FridaSession from "./FridaSession.ts";
|
|
24
22
|
import type * as FridaSessionError from "./FridaSessionError.ts";
|
|
23
|
+
import type * as Frida from "frida";
|
|
25
24
|
|
|
26
|
-
import * as
|
|
25
|
+
import * as internalCompiler from "./internal/compiler.ts";
|
|
26
|
+
import * as internalScript from "./internal/script.ts";
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
* @since 1.0.0
|
|
30
30
|
* @category Type ids
|
|
31
31
|
*/
|
|
32
|
-
export const FridaScriptTypeId: unique symbol =
|
|
32
|
+
export const FridaScriptTypeId: unique symbol = internalScript.FridaScriptTypeId;
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
35
|
* @since 1.0.0
|
|
@@ -58,23 +58,23 @@ export interface FridaScript {
|
|
|
58
58
|
FridaSessionError.FridaSessionError,
|
|
59
59
|
never
|
|
60
60
|
>;
|
|
61
|
-
readonly callExport: <A
|
|
61
|
+
readonly callExport: <A = unknown, R = never>(
|
|
62
62
|
exportName: string,
|
|
63
|
-
schema
|
|
64
|
-
) => (...args: Array<any>) => Effect.Effect<A, FridaSessionError.FridaSessionError |
|
|
63
|
+
schema?: Schema.Decoder<A, R> | undefined
|
|
64
|
+
) => (...args: Array<any>) => Effect.Effect<A, FridaSessionError.FridaSessionError | Schema.SchemaError, R>;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
/**
|
|
68
68
|
* @since 1.0.0
|
|
69
69
|
* @category Tags
|
|
70
70
|
*/
|
|
71
|
-
export const FridaScript: Context.
|
|
71
|
+
export const FridaScript: Context.Service<FridaScript, FridaScript> = internalScript.Tag;
|
|
72
72
|
|
|
73
73
|
/**
|
|
74
74
|
* @since 1.0.0
|
|
75
75
|
* @category Predicates
|
|
76
76
|
*/
|
|
77
|
-
export const isFridaScript: (u: unknown) => u is FridaScript =
|
|
77
|
+
export const isFridaScript: (u: unknown) => u is FridaScript = internalScript.isFridaScript;
|
|
78
78
|
|
|
79
79
|
/**
|
|
80
80
|
* @since 1.0.0
|
|
@@ -82,23 +82,22 @@ export const isFridaScript: (u: unknown) => u is FridaScript = internal.isFridaS
|
|
|
82
82
|
*/
|
|
83
83
|
export interface LoadOptions extends Frida.ScriptOptions, Frida.CompilerOptions {
|
|
84
84
|
readonly messageMailboxCapacity?:
|
|
85
|
-
| number
|
|
86
85
|
| {
|
|
87
|
-
readonly capacity?: number;
|
|
88
|
-
readonly strategy?: "suspend" | "dropping" | "sliding";
|
|
86
|
+
readonly capacity?: number | undefined;
|
|
87
|
+
readonly strategy?: "suspend" | "dropping" | "sliding" | undefined;
|
|
89
88
|
}
|
|
90
89
|
| undefined;
|
|
91
90
|
readonly streamShareOptions?:
|
|
92
91
|
| {
|
|
93
92
|
readonly capacity: "unbounded";
|
|
94
93
|
readonly replay?: number | undefined;
|
|
95
|
-
readonly idleTimeToLive?: Duration.
|
|
94
|
+
readonly idleTimeToLive?: Duration.Input | undefined;
|
|
96
95
|
}
|
|
97
96
|
| {
|
|
98
97
|
readonly capacity: number;
|
|
99
98
|
readonly strategy?: "sliding" | "dropping" | "suspend" | undefined;
|
|
100
99
|
readonly replay?: number | undefined;
|
|
101
|
-
readonly idleTimeToLive?: Duration.
|
|
100
|
+
readonly idleTimeToLive?: Duration.Input | undefined;
|
|
102
101
|
}
|
|
103
102
|
| undefined;
|
|
104
103
|
}
|
|
@@ -111,11 +110,11 @@ export const compile: {
|
|
|
111
110
|
(
|
|
112
111
|
entrypoint: string,
|
|
113
112
|
options?: Frida.CompilerOptions | undefined
|
|
114
|
-
): Effect.Effect<string, FridaSessionError.FridaSessionError
|
|
113
|
+
): Effect.Effect<string, FridaSessionError.FridaSessionError>;
|
|
115
114
|
(
|
|
116
115
|
options?: Frida.CompilerOptions | undefined
|
|
117
|
-
): (entrypoint: string) => Effect.Effect<string, FridaSessionError.FridaSessionError
|
|
118
|
-
} =
|
|
116
|
+
): (entrypoint: string) => Effect.Effect<string, FridaSessionError.FridaSessionError>;
|
|
117
|
+
} = internalCompiler.compile;
|
|
119
118
|
|
|
120
119
|
/**
|
|
121
120
|
* @since 1.0.0
|
|
@@ -139,7 +138,7 @@ export const load: {
|
|
|
139
138
|
FridaSessionError.FridaSessionError,
|
|
140
139
|
Path.Path | FridaSession.FridaSession | Scope.Scope
|
|
141
140
|
>;
|
|
142
|
-
} =
|
|
141
|
+
} = internalScript.load;
|
|
143
142
|
|
|
144
143
|
/**
|
|
145
144
|
* @since 1.0.0
|
|
@@ -153,7 +152,7 @@ export const layer: {
|
|
|
153
152
|
(
|
|
154
153
|
options?: LoadOptions | undefined
|
|
155
154
|
): (entrypoint: URL) => Layer.Layer<FridaScript, FridaSessionError.FridaSessionError, FridaSession.FridaSession>;
|
|
156
|
-
} =
|
|
155
|
+
} = internalScript.layer;
|
|
157
156
|
|
|
158
157
|
/**
|
|
159
158
|
* @since 1.0.0
|
|
@@ -179,7 +178,7 @@ export const watch: {
|
|
|
179
178
|
FridaSessionError.FridaSessionError,
|
|
180
179
|
FileSystem.FileSystem | FridaSession.FridaSession | Exclude<R, FridaScript>
|
|
181
180
|
>;
|
|
182
|
-
} =
|
|
181
|
+
} = internalScript.watch;
|
|
183
182
|
|
|
184
183
|
/**
|
|
185
184
|
* Successes will be logged with info, failures with warning, defects with
|
|
@@ -190,4 +189,4 @@ export const watch: {
|
|
|
190
189
|
*/
|
|
191
190
|
export const logWatchErrors: <A, E1, E2, R>(
|
|
192
191
|
watchStream: Stream.Stream<Exit.Exit<A, E1>, E2, R>
|
|
193
|
-
) => Stream.Stream<Exit.Exit<A, E1>, E2, R> =
|
|
192
|
+
) => Stream.Stream<Exit.Exit<A, E1>, E2, R> = internalScript.logWatchErrors;
|
package/src/FridaSession.ts
CHANGED
|
@@ -6,13 +6,15 @@
|
|
|
6
6
|
|
|
7
7
|
import type * as Cause from "effect/Cause";
|
|
8
8
|
import type * as Context from "effect/Context";
|
|
9
|
+
import type * as Deferred from "effect/Deferred";
|
|
9
10
|
import type * as Effect from "effect/Effect";
|
|
10
11
|
import type * as Layer from "effect/Layer";
|
|
12
|
+
import type * as Option from "effect/Option";
|
|
11
13
|
import type * as Scope from "effect/Scope";
|
|
12
|
-
import type * as Frida from "frida";
|
|
13
14
|
|
|
14
15
|
import type * as FridaDevice from "./FridaDevice.ts";
|
|
15
16
|
import type * as FridaSessionError from "./FridaSessionError.ts";
|
|
17
|
+
import type * as Frida from "frida";
|
|
16
18
|
|
|
17
19
|
import * as internal from "./internal/session.ts";
|
|
18
20
|
|
|
@@ -33,23 +35,39 @@ export type FridaSessionTypeId = typeof FridaSessionTypeId;
|
|
|
33
35
|
* @category Models
|
|
34
36
|
*/
|
|
35
37
|
export interface FridaSession {
|
|
38
|
+
readonly pid: number;
|
|
36
39
|
readonly session: Frida.Session;
|
|
40
|
+
|
|
37
41
|
readonly [FridaSessionTypeId]: typeof FridaSessionTypeId;
|
|
38
|
-
readonly
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
+
readonly detached: Deferred.Deferred<
|
|
43
|
+
{
|
|
44
|
+
reason: Frida.SessionDetachReason;
|
|
45
|
+
crash: Option.Option<{
|
|
46
|
+
pid: number;
|
|
47
|
+
processName: string;
|
|
48
|
+
summary: string;
|
|
49
|
+
report: string;
|
|
50
|
+
parameters: unknown;
|
|
51
|
+
}>;
|
|
52
|
+
},
|
|
53
|
+
FridaSessionError.FridaSessionError
|
|
54
|
+
>;
|
|
55
|
+
readonly resume: Effect.Effect<void, FridaSessionError.FridaSessionError, never>;
|
|
56
|
+
readonly detach: Effect.Effect<void, FridaSessionError.FridaSessionError, never>;
|
|
57
|
+
readonly enableChildGating: Effect.Effect<void, Cause.UnknownError, never>;
|
|
58
|
+
readonly disableChildGating: Effect.Effect<void, Cause.UnknownError, never>;
|
|
59
|
+
setupPeerConnection(options?: Frida.PeerOptions | undefined): Effect.Effect<void, Cause.UnknownError, never>;
|
|
42
60
|
joinPortal(
|
|
43
61
|
address: string,
|
|
44
62
|
options?: Frida.PortalOptions | undefined
|
|
45
|
-
): Effect.Effect<Frida.PortalMembership, Cause.
|
|
63
|
+
): Effect.Effect<Frida.PortalMembership, Cause.UnknownError, never>;
|
|
46
64
|
}
|
|
47
65
|
|
|
48
66
|
/**
|
|
49
67
|
* @since 1.0.0
|
|
50
68
|
* @category Tags
|
|
51
69
|
*/
|
|
52
|
-
export const FridaSession: Context.
|
|
70
|
+
export const FridaSession: Context.Service<FridaSession, FridaSession> = internal.Tag;
|
|
53
71
|
|
|
54
72
|
/**
|
|
55
73
|
* @since 1.0.0
|
package/src/FridaSessionError.ts
CHANGED
|
@@ -4,35 +4,13 @@
|
|
|
4
4
|
* @since 1.0.0
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import * as
|
|
8
|
-
import * as Predicate from "effect/Predicate";
|
|
7
|
+
import * as Data from "effect/Data";
|
|
9
8
|
|
|
10
9
|
/**
|
|
11
10
|
* @since 1.0.0
|
|
12
11
|
* @category Errors
|
|
13
12
|
*/
|
|
14
|
-
export
|
|
15
|
-
"@efffrida/FridaError/FridaSessionError"
|
|
16
|
-
) as FridaSessionErrorTypeId;
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* @since 1.0.0
|
|
20
|
-
* @category Errors
|
|
21
|
-
*/
|
|
22
|
-
export type FridaSessionErrorTypeId = typeof FridaSessionErrorTypeId;
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* @since 1.0.0
|
|
26
|
-
* @category Errors
|
|
27
|
-
*/
|
|
28
|
-
export const isFridaSessionError = (u: unknown): u is FridaSessionError =>
|
|
29
|
-
Predicate.hasProperty(u, FridaSessionErrorTypeId);
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* @since 1.0.0
|
|
33
|
-
* @category Errors
|
|
34
|
-
*/
|
|
35
|
-
export class FridaSessionError extends PlatformError.TypeIdError(FridaSessionErrorTypeId, "FridaSessionError")<{
|
|
13
|
+
export class FridaSessionError extends Data.TaggedError("FridaSessionError")<{
|
|
36
14
|
cause: unknown;
|
|
37
15
|
when:
|
|
38
16
|
| "spawn"
|