@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.
- package/README.md +6 -10
- package/dist/{dts/FridaDevice.d.ts → FridaDevice.d.ts} +48 -4
- package/dist/FridaDevice.d.ts.map +1 -0
- package/dist/{esm/FridaDevice.js → FridaDevice.js} +22 -2
- package/dist/FridaDevice.js.map +1 -0
- package/dist/{dts/FridaDeviceAcquisitionError.d.ts → FridaDeviceAcquisitionError.d.ts} +2 -1
- package/dist/FridaDeviceAcquisitionError.d.ts.map +1 -0
- package/dist/{esm/FridaDeviceAcquisitionError.js → FridaDeviceAcquisitionError.js} +5 -1
- package/dist/FridaDeviceAcquisitionError.js.map +1 -0
- package/dist/FridaScript.d.ts +104 -0
- package/dist/FridaScript.d.ts.map +1 -0
- package/dist/{esm/FridaScript.js → FridaScript.js} +5 -0
- package/dist/FridaScript.js.map +1 -0
- package/dist/FridaSession.d.ts +72 -0
- package/dist/FridaSession.d.ts.map +1 -0
- package/dist/{esm/FridaSession.js → FridaSession.js} +10 -0
- package/dist/FridaSession.js.map +1 -0
- package/dist/FridaSessionError.d.ts.map +1 -0
- package/dist/FridaSessionError.js.map +1 -0
- package/dist/{dts/index.d.ts → index.d.ts} +8 -5
- package/dist/index.d.ts.map +1 -0
- package/dist/{esm/index.js → index.js} +3 -0
- package/dist/index.js.map +1 -0
- package/dist/{dts/internal → internal}/device.d.ts.map +1 -1
- package/dist/internal/device.js +189 -0
- package/dist/internal/device.js.map +1 -0
- package/dist/{dts/internal → internal}/script.d.ts.map +1 -1
- package/dist/internal/script.js +229 -0
- package/dist/internal/script.js.map +1 -0
- package/dist/{dts/internal → internal}/session.d.ts.map +1 -1
- package/dist/internal/session.js +124 -0
- package/dist/internal/session.js.map +1 -0
- package/package.json +54 -68
- package/src/FridaDevice.ts +92 -8
- package/src/FridaDeviceAcquisitionError.ts +6 -2
- package/src/FridaScript.ts +67 -31
- package/src/FridaSession.ts +31 -5
- package/src/FridaSessionError.ts +1 -1
- package/src/index.ts +9 -5
- package/src/internal/device.ts +311 -32
- package/src/internal/script.ts +286 -118
- package/src/internal/session.ts +136 -27
- package/FridaDevice/package.json +0 -6
- package/FridaDeviceAcquisitionError/package.json +0 -6
- package/FridaScript/package.json +0 -6
- package/FridaSession/package.json +0 -6
- package/FridaSessionError/package.json +0 -6
- package/dist/cjs/FridaDevice.js +0 -60
- package/dist/cjs/FridaDevice.js.map +0 -1
- package/dist/cjs/FridaDeviceAcquisitionError.js +0 -33
- package/dist/cjs/FridaDeviceAcquisitionError.js.map +0 -1
- package/dist/cjs/FridaScript.js +0 -40
- package/dist/cjs/FridaScript.js.map +0 -1
- package/dist/cjs/FridaSession.js +0 -45
- package/dist/cjs/FridaSession.js.map +0 -1
- package/dist/cjs/FridaSessionError.js +0 -37
- package/dist/cjs/FridaSessionError.js.map +0 -1
- package/dist/cjs/index.js +0 -18
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/internal/device.js +0 -68
- package/dist/cjs/internal/device.js.map +0 -1
- package/dist/cjs/internal/script.js +0 -163
- package/dist/cjs/internal/script.js.map +0 -1
- package/dist/cjs/internal/session.js +0 -55
- package/dist/cjs/internal/session.js.map +0 -1
- package/dist/dts/FridaDevice.d.ts.map +0 -1
- package/dist/dts/FridaDeviceAcquisitionError.d.ts.map +0 -1
- package/dist/dts/FridaScript.d.ts +0 -80
- package/dist/dts/FridaScript.d.ts.map +0 -1
- package/dist/dts/FridaSession.d.ts +0 -56
- package/dist/dts/FridaSession.d.ts.map +0 -1
- package/dist/dts/FridaSessionError.d.ts.map +0 -1
- package/dist/dts/index.d.ts.map +0 -1
- package/dist/esm/FridaDevice.js.map +0 -1
- package/dist/esm/FridaDeviceAcquisitionError.js.map +0 -1
- package/dist/esm/FridaScript.js.map +0 -1
- package/dist/esm/FridaSession.js.map +0 -1
- package/dist/esm/FridaSessionError.js.map +0 -1
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/internal/device.js +0 -55
- package/dist/esm/internal/device.js.map +0 -1
- package/dist/esm/internal/script.js +0 -155
- package/dist/esm/internal/script.js.map +0 -1
- package/dist/esm/internal/session.js +0 -44
- package/dist/esm/internal/session.js.map +0 -1
- package/dist/esm/package.json +0 -4
- package/index/package.json +0 -6
- /package/dist/{dts/FridaSessionError.d.ts → FridaSessionError.d.ts} +0 -0
- /package/dist/{esm/FridaSessionError.js → FridaSessionError.js} +0 -0
- /package/dist/{dts/internal → internal}/device.d.ts +0 -0
- /package/dist/{dts/internal → internal}/script.d.ts +0 -0
- /package/dist/{dts/internal → internal}/session.d.ts +0 -0
package/package.json
CHANGED
|
@@ -1,84 +1,70 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@efffrida/frida-tools",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.16",
|
|
4
4
|
"description": "Frida with effect-ts",
|
|
5
|
-
"
|
|
5
|
+
"keywords": [
|
|
6
|
+
"frida.re",
|
|
7
|
+
"reverse engineering",
|
|
8
|
+
"effect-ts"
|
|
9
|
+
],
|
|
10
|
+
"homepage": "https://github.com/leonitousconforti/efffrida",
|
|
6
11
|
"repository": {
|
|
7
12
|
"type": "git",
|
|
8
13
|
"url": "https://github.com/leonitousconforti/efffrida.git",
|
|
9
14
|
"directory": "packages/frida-tools"
|
|
10
15
|
},
|
|
11
|
-
"
|
|
16
|
+
"license": "GPL-3.0-only",
|
|
12
17
|
"author": "Leo Conforti <leo@leoconforti.us> (https://leoconforti.us)",
|
|
13
|
-
"
|
|
18
|
+
"sideEffects": [],
|
|
19
|
+
"type": "module",
|
|
20
|
+
"exports": {
|
|
21
|
+
"./package.json": "./package.json",
|
|
22
|
+
".": "./dist/index.js",
|
|
23
|
+
"./*": "./dist/*.js",
|
|
24
|
+
"./internal/*": null
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"src/**/*.ts",
|
|
28
|
+
"dist/**/*.js",
|
|
29
|
+
"dist/**/*.js.map",
|
|
30
|
+
"dist/**/*.d.ts",
|
|
31
|
+
"dist/**/*.d.ts.map"
|
|
32
|
+
],
|
|
14
33
|
"dependencies": {
|
|
15
|
-
"frida": "
|
|
34
|
+
"frida": "17.5.1"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@effect/cluster": "0.54.0",
|
|
38
|
+
"@effect/experimental": "0.57.8",
|
|
39
|
+
"@effect/platform": "0.93.5",
|
|
40
|
+
"@effect/platform-node": "0.102.0",
|
|
41
|
+
"@effect/rpc": "0.72.2",
|
|
42
|
+
"@effect/sql": "0.48.5",
|
|
43
|
+
"@effect/vitest": "0.27.0",
|
|
44
|
+
"@effect/workflow": "0.14.0",
|
|
45
|
+
"@types/frida-gum": "19.0.1",
|
|
46
|
+
"@types/node": "24.10.1",
|
|
47
|
+
"effect": "3.19.8",
|
|
48
|
+
"vitest": "4.0.14",
|
|
49
|
+
"@efffrida/polyfills": "0.0.1"
|
|
16
50
|
},
|
|
17
51
|
"peerDependencies": {
|
|
18
|
-
"@effect/platform": "0.
|
|
19
|
-
"effect": "3.
|
|
52
|
+
"@effect/platform": "0.93.5",
|
|
53
|
+
"effect": "3.19.8"
|
|
20
54
|
},
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
"types": "./dist/dts/index.d.ts",
|
|
24
|
-
"exports": {
|
|
25
|
-
"./package.json": "./package.json",
|
|
26
|
-
".": {
|
|
27
|
-
"types": "./dist/dts/index.d.ts",
|
|
28
|
-
"import": "./dist/esm/index.js",
|
|
29
|
-
"default": "./dist/cjs/index.js"
|
|
30
|
-
},
|
|
31
|
-
"./FridaDevice": {
|
|
32
|
-
"types": "./dist/dts/FridaDevice.d.ts",
|
|
33
|
-
"import": "./dist/esm/FridaDevice.js",
|
|
34
|
-
"default": "./dist/cjs/FridaDevice.js"
|
|
35
|
-
},
|
|
36
|
-
"./FridaDeviceAcquisitionError": {
|
|
37
|
-
"types": "./dist/dts/FridaDeviceAcquisitionError.d.ts",
|
|
38
|
-
"import": "./dist/esm/FridaDeviceAcquisitionError.js",
|
|
39
|
-
"default": "./dist/cjs/FridaDeviceAcquisitionError.js"
|
|
40
|
-
},
|
|
41
|
-
"./FridaScript": {
|
|
42
|
-
"types": "./dist/dts/FridaScript.d.ts",
|
|
43
|
-
"import": "./dist/esm/FridaScript.js",
|
|
44
|
-
"default": "./dist/cjs/FridaScript.js"
|
|
45
|
-
},
|
|
46
|
-
"./FridaSession": {
|
|
47
|
-
"types": "./dist/dts/FridaSession.d.ts",
|
|
48
|
-
"import": "./dist/esm/FridaSession.js",
|
|
49
|
-
"default": "./dist/cjs/FridaSession.js"
|
|
50
|
-
},
|
|
51
|
-
"./FridaSessionError": {
|
|
52
|
-
"types": "./dist/dts/FridaSessionError.d.ts",
|
|
53
|
-
"import": "./dist/esm/FridaSessionError.js",
|
|
54
|
-
"default": "./dist/cjs/FridaSessionError.js"
|
|
55
|
-
},
|
|
56
|
-
"./index": {
|
|
57
|
-
"types": "./dist/dts/index.d.ts",
|
|
58
|
-
"import": "./dist/esm/index.js",
|
|
59
|
-
"default": "./dist/cjs/index.js"
|
|
60
|
-
}
|
|
55
|
+
"publishConfig": {
|
|
56
|
+
"access": "public"
|
|
61
57
|
},
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
"FridaSession": [
|
|
74
|
-
"./dist/dts/FridaSession.d.ts"
|
|
75
|
-
],
|
|
76
|
-
"FridaSessionError": [
|
|
77
|
-
"./dist/dts/FridaSessionError.d.ts"
|
|
78
|
-
],
|
|
79
|
-
"index": [
|
|
80
|
-
"./dist/dts/index.d.ts"
|
|
81
|
-
]
|
|
82
|
-
}
|
|
58
|
+
"tags": [
|
|
59
|
+
"frida.re",
|
|
60
|
+
"reverse engineering",
|
|
61
|
+
"effect-ts"
|
|
62
|
+
],
|
|
63
|
+
"scripts": {
|
|
64
|
+
"build": "tsc -b tsconfig.build.json && babel dist --plugins annotate-pure-calls --out-dir dist --source-maps",
|
|
65
|
+
"check": "tsc -b tsconfig.json",
|
|
66
|
+
"codegen": "build-utils prepare-v4",
|
|
67
|
+
"coverage": "vitest --coverage",
|
|
68
|
+
"test": "vitest"
|
|
83
69
|
}
|
|
84
70
|
}
|
package/src/FridaDevice.ts
CHANGED
|
@@ -4,13 +4,16 @@
|
|
|
4
4
|
* @since 1.0.0
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
import type * as CommandExecutor from "@effect/platform/CommandExecutor";
|
|
8
|
+
import type * as ConfigError from "effect/ConfigError";
|
|
7
9
|
import type * as Context from "effect/Context";
|
|
8
10
|
import type * as Effect from "effect/Effect";
|
|
9
11
|
import type * as Layer from "effect/Layer";
|
|
12
|
+
import type * as Scope from "effect/Scope";
|
|
10
13
|
import type * as Frida from "frida";
|
|
11
|
-
import type * as FridaDeviceAcquisitionError from "./FridaDeviceAcquisitionError.
|
|
14
|
+
import type * as FridaDeviceAcquisitionError from "./FridaDeviceAcquisitionError.ts";
|
|
12
15
|
|
|
13
|
-
import * as internal from "./internal/device.
|
|
16
|
+
import * as internal from "./internal/device.ts";
|
|
14
17
|
|
|
15
18
|
/**
|
|
16
19
|
* @since 1.0.0
|
|
@@ -30,6 +33,7 @@ export type FridaDeviceTypeId = typeof FridaDeviceTypeId;
|
|
|
30
33
|
*/
|
|
31
34
|
export interface FridaDevice {
|
|
32
35
|
readonly device: Frida.Device;
|
|
36
|
+
readonly host: `usb://` | `local://` | `remote://${string}` | `android-emulator://${string}`;
|
|
33
37
|
readonly [FridaDeviceTypeId]: typeof FridaDeviceTypeId;
|
|
34
38
|
}
|
|
35
39
|
|
|
@@ -45,6 +49,16 @@ export const FridaDevice: Context.Tag<FridaDevice, FridaDevice> = internal.Tag;
|
|
|
45
49
|
*/
|
|
46
50
|
export const isFridaDevice: (u: unknown) => u is FridaDevice = internal.isFridaDevice;
|
|
47
51
|
|
|
52
|
+
/**
|
|
53
|
+
* @since 1.0.0
|
|
54
|
+
* @category Device acquisition
|
|
55
|
+
*/
|
|
56
|
+
export const acquireLocalDevice: () => Effect.Effect<
|
|
57
|
+
FridaDevice,
|
|
58
|
+
FridaDeviceAcquisitionError.FridaDeviceAcquisitionError,
|
|
59
|
+
never
|
|
60
|
+
> = internal.acquireLocalDevice;
|
|
61
|
+
|
|
48
62
|
/**
|
|
49
63
|
* @since 1.0.0
|
|
50
64
|
* @category Device acquisition
|
|
@@ -61,18 +75,58 @@ export const acquireUsbDevice: (
|
|
|
61
75
|
export const acquireRemoteDevice: (
|
|
62
76
|
address: string,
|
|
63
77
|
options?: Frida.RemoteDeviceOptions | undefined
|
|
64
|
-
) => Effect.Effect<FridaDevice, FridaDeviceAcquisitionError.FridaDeviceAcquisitionError,
|
|
78
|
+
) => Effect.Effect<FridaDevice, FridaDeviceAcquisitionError.FridaDeviceAcquisitionError, Scope.Scope> =
|
|
65
79
|
internal.acquireRemoteDevice;
|
|
66
80
|
|
|
67
81
|
/**
|
|
68
82
|
* @since 1.0.0
|
|
69
83
|
* @category Device acquisition
|
|
70
84
|
*/
|
|
71
|
-
export const
|
|
85
|
+
export const acquireAndroidEmulatorDevice: (
|
|
86
|
+
name: string,
|
|
87
|
+
options?:
|
|
88
|
+
| {
|
|
89
|
+
hidden?: boolean | undefined;
|
|
90
|
+
adbExecutable?: string | undefined;
|
|
91
|
+
fridaExecutable?: string | undefined;
|
|
92
|
+
emulatorExecutable?: string | undefined;
|
|
93
|
+
extraEmulatorArgs?: Array<string> | undefined;
|
|
94
|
+
}
|
|
95
|
+
| undefined
|
|
96
|
+
) => Effect.Effect<
|
|
97
|
+
FridaDevice,
|
|
98
|
+
FridaDeviceAcquisitionError.FridaDeviceAcquisitionError,
|
|
99
|
+
CommandExecutor.CommandExecutor | Scope.Scope
|
|
100
|
+
> = internal.acquireAndroidEmulatorDevice;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* @since 1.0.0
|
|
104
|
+
* @category Device acquisition
|
|
105
|
+
*/
|
|
106
|
+
export const acquireAndroidEmulatorDeviceConfig: (
|
|
107
|
+
name: string,
|
|
108
|
+
options?:
|
|
109
|
+
| {
|
|
110
|
+
hidden?: boolean | undefined;
|
|
111
|
+
fridaExecutable?: string | undefined;
|
|
112
|
+
extraEmulatorArgs?: Array<string> | undefined;
|
|
113
|
+
}
|
|
114
|
+
| undefined
|
|
115
|
+
) => Effect.Effect<
|
|
116
|
+
FridaDevice,
|
|
117
|
+
ConfigError.ConfigError | FridaDeviceAcquisitionError.FridaDeviceAcquisitionError,
|
|
118
|
+
CommandExecutor.CommandExecutor | Scope.Scope
|
|
119
|
+
> = internal.acquireAndroidEmulatorDeviceConfig;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* @since 1.0.0
|
|
123
|
+
* @category Layers
|
|
124
|
+
*/
|
|
125
|
+
export const layerLocalDevice: Layer.Layer<
|
|
72
126
|
FridaDevice,
|
|
73
127
|
FridaDeviceAcquisitionError.FridaDeviceAcquisitionError,
|
|
74
128
|
never
|
|
75
|
-
> = internal.
|
|
129
|
+
> = internal.layerLocalDevice;
|
|
76
130
|
|
|
77
131
|
/**
|
|
78
132
|
* @since 1.0.0
|
|
@@ -96,8 +150,38 @@ export const layerUsbDevice: (
|
|
|
96
150
|
* @since 1.0.0
|
|
97
151
|
* @category Layers
|
|
98
152
|
*/
|
|
99
|
-
export const
|
|
153
|
+
export const layerAndroidEmulatorDevice: (
|
|
154
|
+
name: string,
|
|
155
|
+
options?:
|
|
156
|
+
| {
|
|
157
|
+
hidden?: boolean | undefined;
|
|
158
|
+
adbExecutable?: string | undefined;
|
|
159
|
+
fridaExecutable?: string | undefined;
|
|
160
|
+
emulatorExecutable?: string | undefined;
|
|
161
|
+
extraEmulatorArgs?: Array<string> | undefined;
|
|
162
|
+
}
|
|
163
|
+
| undefined
|
|
164
|
+
) => Layer.Layer<
|
|
100
165
|
FridaDevice,
|
|
101
166
|
FridaDeviceAcquisitionError.FridaDeviceAcquisitionError,
|
|
102
|
-
|
|
103
|
-
> = internal.
|
|
167
|
+
CommandExecutor.CommandExecutor
|
|
168
|
+
> = internal.layerAndroidEmulatorDevice;
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* @since 1.0.0
|
|
172
|
+
* @category Layers
|
|
173
|
+
*/
|
|
174
|
+
export const layerAndroidEmulatorDeviceConfig: (
|
|
175
|
+
name: string,
|
|
176
|
+
options?:
|
|
177
|
+
| {
|
|
178
|
+
hidden?: boolean | undefined;
|
|
179
|
+
fridaExecutable?: string | undefined;
|
|
180
|
+
extraEmulatorArgs?: Array<string> | undefined;
|
|
181
|
+
}
|
|
182
|
+
| undefined
|
|
183
|
+
) => Layer.Layer<
|
|
184
|
+
FridaDevice,
|
|
185
|
+
ConfigError.ConfigError | FridaDeviceAcquisitionError.FridaDeviceAcquisitionError,
|
|
186
|
+
CommandExecutor.CommandExecutor
|
|
187
|
+
> = internal.layerAndroidEmulatorDeviceConfig;
|
|
@@ -38,5 +38,9 @@ export class FridaDeviceAcquisitionError extends PlatformError.TypeIdError(
|
|
|
38
38
|
)<{
|
|
39
39
|
cause: unknown;
|
|
40
40
|
attempts: number;
|
|
41
|
-
acquisitionMethod: "usb" | "remote" | "local";
|
|
42
|
-
}> {
|
|
41
|
+
acquisitionMethod: "usb" | "remote" | "local" | "android-emulator";
|
|
42
|
+
}> {
|
|
43
|
+
public override get message(): string {
|
|
44
|
+
return `Failed to acquire ${this.acquisitionMethod} Frida device after ${this.attempts} attempt(s)`;
|
|
45
|
+
}
|
|
46
|
+
}
|
package/src/FridaScript.ts
CHANGED
|
@@ -4,20 +4,23 @@
|
|
|
4
4
|
* @since 1.0.0
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
import type * as Path from "@effect/platform/Path";
|
|
7
8
|
import type * as Context from "effect/Context";
|
|
8
9
|
import type * as Deferred from "effect/Deferred";
|
|
10
|
+
import type * as Duration from "effect/Duration";
|
|
9
11
|
import type * as Effect from "effect/Effect";
|
|
10
12
|
import type * as Layer from "effect/Layer";
|
|
11
13
|
import type * as Option from "effect/Option";
|
|
14
|
+
import type * as ParseResult from "effect/ParseResult";
|
|
15
|
+
import type * as Schema from "effect/Schema";
|
|
12
16
|
import type * as Scope from "effect/Scope";
|
|
13
17
|
import type * as Sink from "effect/Sink";
|
|
14
18
|
import type * as Stream from "effect/Stream";
|
|
15
19
|
import type * as Frida from "frida";
|
|
16
|
-
import type * as
|
|
17
|
-
import type * as
|
|
18
|
-
import type * as FridaSessionError from "./FridaSessionError.js";
|
|
20
|
+
import type * as FridaSession from "./FridaSession.ts";
|
|
21
|
+
import type * as FridaSessionError from "./FridaSessionError.ts";
|
|
19
22
|
|
|
20
|
-
import * as internal from "./internal/script.
|
|
23
|
+
import * as internal from "./internal/script.ts";
|
|
21
24
|
|
|
22
25
|
/**
|
|
23
26
|
* @since 1.0.0
|
|
@@ -37,23 +40,25 @@ export type FridaScriptTypeId = typeof FridaScriptTypeId;
|
|
|
37
40
|
*/
|
|
38
41
|
export interface FridaScript {
|
|
39
42
|
readonly script: Frida.Script;
|
|
40
|
-
readonly destroyed: Deferred.Deferred<void, never>;
|
|
41
43
|
readonly [FridaScriptTypeId]: typeof FridaScriptTypeId;
|
|
44
|
+
readonly destroyed: Deferred.Deferred<void, never>;
|
|
45
|
+
readonly scriptError: Deferred.Deferred<unknown, never>;
|
|
42
46
|
readonly stream: Stream.Stream<
|
|
43
|
-
{ message:
|
|
47
|
+
{ message: unknown; data: Option.Option<Buffer> },
|
|
44
48
|
FridaSessionError.FridaSessionError,
|
|
45
49
|
never
|
|
46
50
|
>;
|
|
47
51
|
readonly sink: Sink.Sink<
|
|
48
52
|
void,
|
|
49
|
-
{ message:
|
|
53
|
+
{ message: unknown; data: Option.Option<Buffer> },
|
|
50
54
|
never,
|
|
51
55
|
FridaSessionError.FridaSessionError,
|
|
52
56
|
never
|
|
53
57
|
>;
|
|
54
|
-
readonly callExport: (
|
|
55
|
-
exportName: string
|
|
56
|
-
|
|
58
|
+
readonly callExport: <A, I, R>(
|
|
59
|
+
exportName: string,
|
|
60
|
+
schema: Schema.Schema<A, I, R>
|
|
61
|
+
) => (...args: Array<any>) => Effect.Effect<A, FridaSessionError.FridaSessionError | ParseResult.ParseError, R>;
|
|
57
62
|
}
|
|
58
63
|
|
|
59
64
|
/**
|
|
@@ -68,27 +73,68 @@ export const FridaScript: Context.Tag<FridaScript, FridaScript> = internal.Tag;
|
|
|
68
73
|
*/
|
|
69
74
|
export const isFridaScript: (u: unknown) => u is FridaScript = internal.isFridaScript;
|
|
70
75
|
|
|
76
|
+
/**
|
|
77
|
+
* @since 1.0.0
|
|
78
|
+
* @category Options
|
|
79
|
+
*/
|
|
80
|
+
export interface LoadOptions extends Frida.ScriptOptions, Frida.CompilerOptions {
|
|
81
|
+
readonly messageMailboxCapacity?:
|
|
82
|
+
| number
|
|
83
|
+
| {
|
|
84
|
+
readonly capacity?: number;
|
|
85
|
+
readonly strategy?: "suspend" | "dropping" | "sliding";
|
|
86
|
+
}
|
|
87
|
+
| undefined;
|
|
88
|
+
readonly streamShareOptions?:
|
|
89
|
+
| {
|
|
90
|
+
readonly capacity: "unbounded";
|
|
91
|
+
readonly replay?: number | undefined;
|
|
92
|
+
readonly idleTimeToLive?: Duration.DurationInput | undefined;
|
|
93
|
+
}
|
|
94
|
+
| {
|
|
95
|
+
readonly capacity: number;
|
|
96
|
+
readonly strategy?: "sliding" | "dropping" | "suspend" | undefined;
|
|
97
|
+
readonly replay?: number | undefined;
|
|
98
|
+
readonly idleTimeToLive?: Duration.DurationInput | undefined;
|
|
99
|
+
}
|
|
100
|
+
| undefined;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* @since 1.0.0
|
|
105
|
+
* @category Frida
|
|
106
|
+
*/
|
|
107
|
+
export const compile: {
|
|
108
|
+
(
|
|
109
|
+
entrypoint: string,
|
|
110
|
+
options?: Frida.CompilerOptions | undefined
|
|
111
|
+
): Effect.Effect<string, FridaSessionError.FridaSessionError, Scope.Scope>;
|
|
112
|
+
(
|
|
113
|
+
options?: Frida.CompilerOptions | undefined
|
|
114
|
+
): (entrypoint: string) => Effect.Effect<string, FridaSessionError.FridaSessionError, Scope.Scope>;
|
|
115
|
+
} = internal.compile;
|
|
116
|
+
|
|
71
117
|
/**
|
|
72
118
|
* @since 1.0.0
|
|
73
119
|
* @category Frida
|
|
74
120
|
*/
|
|
75
121
|
export const load: {
|
|
76
122
|
(
|
|
77
|
-
|
|
78
|
-
options?:
|
|
123
|
+
entrypoint: URL,
|
|
124
|
+
options?: LoadOptions | undefined
|
|
79
125
|
): Effect.Effect<
|
|
80
126
|
FridaScript,
|
|
81
127
|
FridaSessionError.FridaSessionError,
|
|
82
|
-
|
|
128
|
+
Path.Path | FridaSession.FridaSession | Scope.Scope
|
|
83
129
|
>;
|
|
84
130
|
(
|
|
85
|
-
options?:
|
|
131
|
+
options?: LoadOptions | undefined
|
|
86
132
|
): (
|
|
87
|
-
|
|
133
|
+
entrypoint: URL
|
|
88
134
|
) => Effect.Effect<
|
|
89
135
|
FridaScript,
|
|
90
136
|
FridaSessionError.FridaSessionError,
|
|
91
|
-
|
|
137
|
+
Path.Path | FridaSession.FridaSession | Scope.Scope
|
|
92
138
|
>;
|
|
93
139
|
} = internal.load;
|
|
94
140
|
|
|
@@ -98,20 +144,10 @@ export const load: {
|
|
|
98
144
|
*/
|
|
99
145
|
export const layer: {
|
|
100
146
|
(
|
|
101
|
-
|
|
102
|
-
options?:
|
|
103
|
-
): Layer.Layer<
|
|
104
|
-
FridaScript,
|
|
105
|
-
FridaSessionError.FridaSessionError,
|
|
106
|
-
FridaDevice.FridaDevice | FridaSession.FridaSession
|
|
107
|
-
>;
|
|
147
|
+
entrypoint: URL,
|
|
148
|
+
options?: LoadOptions | undefined
|
|
149
|
+
): Layer.Layer<FridaScript, FridaSessionError.FridaSessionError, FridaSession.FridaSession>;
|
|
108
150
|
(
|
|
109
|
-
options?:
|
|
110
|
-
): (
|
|
111
|
-
source: string | Buffer
|
|
112
|
-
) => Layer.Layer<
|
|
113
|
-
FridaScript,
|
|
114
|
-
FridaSessionError.FridaSessionError,
|
|
115
|
-
FridaDevice.FridaDevice | FridaSession.FridaSession
|
|
116
|
-
>;
|
|
151
|
+
options?: LoadOptions | undefined
|
|
152
|
+
): (entrypoint: URL) => Layer.Layer<FridaScript, FridaSessionError.FridaSessionError, FridaSession.FridaSession>;
|
|
117
153
|
} = internal.layer;
|
package/src/FridaSession.ts
CHANGED
|
@@ -4,15 +4,16 @@
|
|
|
4
4
|
* @since 1.0.0
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
import type * as Cause from "effect/Cause";
|
|
7
8
|
import type * as Context from "effect/Context";
|
|
8
9
|
import type * as Effect from "effect/Effect";
|
|
9
10
|
import type * as Layer from "effect/Layer";
|
|
10
11
|
import type * as Scope from "effect/Scope";
|
|
11
12
|
import type * as Frida from "frida";
|
|
12
|
-
import type * as FridaDevice from "./FridaDevice.
|
|
13
|
-
import type * as FridaSessionError from "./FridaSessionError.
|
|
13
|
+
import type * as FridaDevice from "./FridaDevice.ts";
|
|
14
|
+
import type * as FridaSessionError from "./FridaSessionError.ts";
|
|
14
15
|
|
|
15
|
-
import * as internal from "./internal/session.
|
|
16
|
+
import * as internal from "./internal/session.ts";
|
|
16
17
|
|
|
17
18
|
/**
|
|
18
19
|
* @since 1.0.0
|
|
@@ -33,6 +34,14 @@ export type FridaSessionTypeId = typeof FridaSessionTypeId;
|
|
|
33
34
|
export interface FridaSession {
|
|
34
35
|
readonly session: Frida.Session;
|
|
35
36
|
readonly [FridaSessionTypeId]: typeof FridaSessionTypeId;
|
|
37
|
+
readonly resume: Effect.Effect<void, Cause.UnknownException>;
|
|
38
|
+
readonly enableChildGating: Effect.Effect<void, Cause.UnknownException>;
|
|
39
|
+
readonly disableChildGating: Effect.Effect<void, Cause.UnknownException>;
|
|
40
|
+
setupPeerConnection(options?: Frida.PeerOptions | undefined): Effect.Effect<void, Cause.UnknownException>;
|
|
41
|
+
joinPortal(
|
|
42
|
+
address: string,
|
|
43
|
+
options?: Frida.PortalOptions | undefined
|
|
44
|
+
): Effect.Effect<Frida.PortalMembership, Cause.UnknownException>;
|
|
36
45
|
}
|
|
37
46
|
|
|
38
47
|
/**
|
|
@@ -47,12 +56,21 @@ export const FridaSession: Context.Tag<FridaSession, FridaSession> = internal.Ta
|
|
|
47
56
|
*/
|
|
48
57
|
export const isFridaSession: (u: unknown) => u is FridaSession = internal.isFridaSession;
|
|
49
58
|
|
|
59
|
+
/**
|
|
60
|
+
* @since 1.0.0
|
|
61
|
+
* @category Frida
|
|
62
|
+
*/
|
|
63
|
+
export const frontmost: (
|
|
64
|
+
options?: Frida.FrontmostQueryOptions | undefined
|
|
65
|
+
) => Effect.Effect<Frida.Application, FridaSessionError.FridaSessionError, FridaDevice.FridaDevice> =
|
|
66
|
+
internal.frontmost;
|
|
67
|
+
|
|
50
68
|
/**
|
|
51
69
|
* @since 1.0.0
|
|
52
70
|
* @category Frida
|
|
53
71
|
*/
|
|
54
72
|
export const spawn: (
|
|
55
|
-
program: string |
|
|
73
|
+
program: string | ReadonlyArray<string>,
|
|
56
74
|
options?: Frida.SpawnOptions | undefined
|
|
57
75
|
) => Effect.Effect<number, FridaSessionError.FridaSessionError, FridaDevice.FridaDevice | Scope.Scope> = internal.spawn;
|
|
58
76
|
|
|
@@ -71,6 +89,14 @@ export const attach: (
|
|
|
71
89
|
* @category Layers
|
|
72
90
|
*/
|
|
73
91
|
export const layer: (
|
|
74
|
-
target: string
|
|
92
|
+
target: number | string | ReadonlyArray<string>,
|
|
75
93
|
options?: (Frida.SpawnOptions & Frida.SessionOptions) | undefined
|
|
76
94
|
) => Layer.Layer<FridaSession, FridaSessionError.FridaSessionError, FridaDevice.FridaDevice> = internal.layer;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* @since 1.0.0
|
|
98
|
+
* @category Layers
|
|
99
|
+
*/
|
|
100
|
+
export const layerFrontmost: (
|
|
101
|
+
options?: Frida.FrontmostQueryOptions | undefined
|
|
102
|
+
) => Layer.Layer<FridaSession, FridaSessionError.FridaSessionError, FridaDevice.FridaDevice> = internal.layerFrontmost;
|
package/src/FridaSessionError.ts
CHANGED
|
@@ -36,7 +36,7 @@ export class FridaSessionError extends PlatformError.TypeIdError(FridaSessionErr
|
|
|
36
36
|
cause: unknown;
|
|
37
37
|
when: "spawn" | "kill" | "attach" | "detach" | "compile" | "load" | "unload" | "resume" | "message" | "rpcCall";
|
|
38
38
|
}> {
|
|
39
|
-
get message() {
|
|
39
|
+
override get message() {
|
|
40
40
|
return `A Frida session error occurred on ${this.when}`;
|
|
41
41
|
}
|
|
42
42
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,34 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @since 1.0.0
|
|
3
|
+
*/
|
|
4
|
+
|
|
1
5
|
/**
|
|
2
6
|
* Frida devices
|
|
3
7
|
*
|
|
4
8
|
* @since 1.0.0
|
|
5
9
|
*/
|
|
6
|
-
export * as FridaDevice from "./FridaDevice.
|
|
10
|
+
export * as FridaDevice from "./FridaDevice.ts"
|
|
7
11
|
|
|
8
12
|
/**
|
|
9
13
|
* Frida device acquisition errors
|
|
10
14
|
*
|
|
11
15
|
* @since 1.0.0
|
|
12
16
|
*/
|
|
13
|
-
export * as FridaDeviceAcquisitionError from "./FridaDeviceAcquisitionError.
|
|
17
|
+
export * as FridaDeviceAcquisitionError from "./FridaDeviceAcquisitionError.ts"
|
|
14
18
|
|
|
15
19
|
/**
|
|
16
20
|
* Frida scripts
|
|
17
21
|
*
|
|
18
22
|
* @since 1.0.0
|
|
19
23
|
*/
|
|
20
|
-
export * as FridaScript from "./FridaScript.
|
|
24
|
+
export * as FridaScript from "./FridaScript.ts"
|
|
21
25
|
|
|
22
26
|
/**
|
|
23
27
|
* Frida sessions
|
|
24
28
|
*
|
|
25
29
|
* @since 1.0.0
|
|
26
30
|
*/
|
|
27
|
-
export * as FridaSession from "./FridaSession.
|
|
31
|
+
export * as FridaSession from "./FridaSession.ts"
|
|
28
32
|
|
|
29
33
|
/**
|
|
30
34
|
* Frida session errors
|
|
31
35
|
*
|
|
32
36
|
* @since 1.0.0
|
|
33
37
|
*/
|
|
34
|
-
export * as FridaSessionError from "./FridaSessionError.
|
|
38
|
+
export * as FridaSessionError from "./FridaSessionError.ts"
|