Skip to content

Commit 3f9763b

Browse files
authored
(chore) Bumping of dependencies. (#681)
* (chore) Dependency bump * Pin to major versions * Version pinning syntax fix
1 parent 5e45507 commit 3f9763b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+851
-2689
lines changed

agent/package-lock.json

+555-2,456
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

agent/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@
3030
"dependencies": {
3131
"frida-java-bridge": "^6",
3232
"frida-objc-bridge": "^7",
33-
"frida-screenshot": "^3",
33+
"frida-screenshot": "^5",
3434
"macho": "^1"
3535
},
3636
"devDependencies": {
3737
"@types/frida-gum": "^18",
38-
"@types/node": "^17",
39-
"frida-compile": "^10",
38+
"@types/node": "^18",
39+
"frida-compile": "^16",
4040
"tslint": "^6"
4141
}
4242
}

agent/src/android/clipboard.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { colors as c } from "../lib/color";
1+
import { colors as c } from "../lib/color.js";
22
import {
33
getApplicationContext,
44
wrapJavaPerform
5-
} from "./lib/libjava";
6-
import { ClipboardManager } from "./lib/types";
5+
} from "./lib/libjava.js";
6+
import { ClipboardManager } from "./lib/types.js";
77

88
export const monitor = (): Promise<void> => {
99
// -- Sample Java

agent/src/android/filesystem.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import * as fs from "fs";
2-
import { hexStringToBytes } from "../lib/helpers";
3-
import { IAndroidFilesystem } from "./lib/interfaces";
2+
import { hexStringToBytes } from "../lib/helpers.js";
3+
import { IAndroidFilesystem } from "./lib/interfaces.js";
44
import {
55
getApplicationContext,
66
wrapJavaPerform
7-
} from "./lib/libjava";
7+
} from "./lib/libjava.js";
88
import {
99
File,
1010
JavaClass
11-
} from "./lib/types";
11+
} from "./lib/types.js";
1212

1313
export const exists = (path: string): Promise<boolean> => {
1414
// -- Sample Java

agent/src/android/general.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { wrapJavaPerform } from "./lib/libjava";
1+
import { wrapJavaPerform } from "./lib/libjava.js";
22

33
export const deoptimize = (): Promise<void> => {
44
return wrapJavaPerform(() => {

agent/src/android/heap.ts

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { colors as c } from "../lib/color";
1+
import { colors as c } from "../lib/color.js";
22
import {
33
IHeapClassDictionary,
44
IHeapObject,
55
IJavaField,
66
IHeapNormalised
7-
} from "./lib/interfaces";
8-
import { wrapJavaPerform } from "./lib/libjava";
7+
} from "./lib/interfaces.js";
8+
import { wrapJavaPerform } from "./lib/libjava.js";
99

1010
export let handles: IHeapClassDictionary = {};
1111

@@ -72,20 +72,20 @@ export const getInstances = (clazz: string): Promise<any[]> => {
7272

7373
export const methods = (handle: number): Promise<string[]> => {
7474
return wrapJavaPerform(() => {
75-
const clazz: Java.Wrapper = getInstance(handle);
75+
const clazz = getInstance(handle);
7676
if (clazz == null) {
7777
return [];
7878
}
7979

80-
return clazz.class.getDeclaredMethods().map((method) => {
80+
return clazz.class.getDeclaredMethods().map((method: any) => {
8181
return method.toGenericString();
8282
});
8383
});
8484
};
8585

8686
export const execute = (handle: number, method: string, returnString: boolean = false): Promise<string | null> => {
8787
return wrapJavaPerform(() => {
88-
const clazz: Java.Wrapper = getInstance(handle);
88+
const clazz = getInstance(handle);
8989

9090
if (clazz == null) {
9191
return;
@@ -104,13 +104,13 @@ export const execute = (handle: number, method: string, returnString: boolean =
104104

105105
export const fields = (handle: number): Promise<IJavaField[]> => {
106106
return wrapJavaPerform(() => {
107-
const clazz: Java.Wrapper = getInstance(handle);
107+
const clazz = getInstance(handle);
108108

109109
if (clazz == null) {
110110
return;
111111
}
112112

113-
return clazz.class.getDeclaredFields().map((field): IJavaField => {
113+
return clazz.class.getDeclaredFields().map((field: any): IJavaField => {
114114
const fieldName: string = field.getName();
115115
const fieldInstance: Java.Wrapper = clazz.class.getDeclaredField(fieldName);
116116
fieldInstance.setAccessible(true);
@@ -132,7 +132,7 @@ export const fields = (handle: number): Promise<IJavaField[]> => {
132132

133133
export const evaluate = (handle: number, js: string): Promise<void> => {
134134
return wrapJavaPerform(() => {
135-
const clazz: Java.Wrapper = getInstance(handle);
135+
const clazz = getInstance(handle);
136136

137137
if (clazz == null) {
138138
return;

agent/src/android/hooking.ts

+20-10
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { colors as c } from "../lib/color";
2-
import { IJob } from "../lib/interfaces";
3-
import * as jobs from "../lib/jobs";
4-
import { ICurrentActivityFragment } from "./lib/interfaces";
1+
import { colors as c } from "../lib/color.js";
2+
import { IJob } from "../lib/interfaces.js";
3+
import * as jobs from "../lib/jobs.js";
4+
import { ICurrentActivityFragment } from "./lib/interfaces.js";
55
import {
66
getApplicationContext,
77
R,
88
wrapJavaPerform
9-
} from "./lib/libjava";
9+
} from "./lib/libjava.js";
1010
import {
1111
Activity,
1212
ActivityClientRecord,
@@ -16,7 +16,7 @@ import {
1616
PackageManager,
1717
Throwable,
1818
JavaMethodsOverloadsResult,
19-
} from "./lib/types";
19+
} from "./lib/types.js";
2020

2121
enum PatternType {
2222
Regex = 'regex',
@@ -400,7 +400,12 @@ const watchMethod = (
400400
};
401401

402402
// Push the implementation so that it can be nulled later
403-
job.implementations.push(m);
403+
if (job.implementations) {
404+
job.implementations.push(m);
405+
} else {
406+
job.implementations = [ m ];
407+
}
408+
404409
});
405410
});
406411
};
@@ -468,7 +473,7 @@ export const getServices = (): Promise<string[]> => {
468473
// not using the helper as we need other variables too
469474
const context = currentApplication.getApplicationContext();
470475

471-
let services = [];
476+
var services: string[] = [];
472477

473478
currentApplication.mLoadedApk.value.mServices.value.values().toArray().map((potentialServices) => {
474479
Java.cast(potentialServices, arrayMap).keySet().toArray().map((service) => {
@@ -502,7 +507,7 @@ export const getBroadcastReceivers = (): Promise<string[]> => {
502507
GET_RECEIVERS
503508
).receivers.value
504509

505-
let receivers = [];
510+
var receivers: string[] = [];
506511

507512
currentApplication.mLoadedApk.value.mReceivers.value.values().toArray().map((potentialReceivers) => {
508513
Java.cast(potentialReceivers, arrayMap).keySet().toArray().map((receiver) => {
@@ -565,7 +570,12 @@ export const setReturnValue = (fqClazz: string, filterOverload: string | null, n
565570
};
566571

567572
// record override
568-
job.implementations.push(m);
573+
if (job.implementations) {
574+
job.implementations.push(m);
575+
} else {
576+
job.implementations = [ m ];
577+
}
578+
569579
});
570580

571581
jobs.add(job);

agent/src/android/intent.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { colors as c } from "../lib/color";
1+
import { colors as c } from "../lib/color.js";
22
import {
33
getApplicationContext,
44
wrapJavaPerform
5-
} from "./lib/libjava";
6-
import { Intent } from "./lib/types";
5+
} from "./lib/libjava.js";
6+
import { Intent } from "./lib/types.js";
77

88
// https://developer.android.com/reference/android/content/Intent.html#FLAG_ACTIVITY_NEW_TASK
99
const FLAG_ACTIVITY_NEW_TASK = 0x10000000;

agent/src/android/keystore.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
import { colors as c } from "../lib/color";
1+
import { colors as c } from "../lib/color.js";
22
import {
33
IKeyStoreDetail,
44
IKeyStoreEntry
5-
} from "./lib/interfaces";
6-
import { wrapJavaPerform } from "./lib/libjava";
5+
} from "./lib/interfaces.js";
6+
import { wrapJavaPerform } from "./lib/libjava.js";
77
import {
88
KeyFactory,
99
KeyInfo,
1010
KeyStore,
1111
SecretKeyFactory
12-
} from "./lib/types";
13-
import { IJob } from "../lib/interfaces";
14-
import * as jobs from "../lib/jobs";
12+
} from "./lib/types.js";
13+
import { IJob } from "../lib/interfaces.js";
14+
import * as jobs from "../lib/jobs.js";
1515

1616
// Dump entries in the Android Keystore, together with a flag
1717
// indicating if its a key or a certificate.
@@ -220,9 +220,9 @@ const keystoreGetKey = (ident: string): any | undefined => {
220220
export const watchKeystore = (): void => {
221221
const job: IJob = {
222222
identifier: jobs.identifier(),
223-
implementations: [],
224223
type: "android-keystore-watch",
225224
};
225+
job.implementations = [];
226226

227227
job.implementations.push(keystoreLoad(job.identifier));
228228
job.implementations.push(keystoreGetKey(job.identifier));

agent/src/android/monitor.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { wrapJavaPerform } from "./lib/libjava";
1+
import { wrapJavaPerform } from "./lib/libjava.js";
22

33
export namespace monitor {
44
export const stringCanary = (can: string): Promise<void> => {

agent/src/android/pinning.ts

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { colors as c } from "../lib/color";
2-
import { qsend } from "../lib/helpers";
3-
import { IJob } from "../lib/interfaces";
4-
import * as jobs from "../lib/jobs";
5-
import { wrapJavaPerform } from "./lib/libjava";
1+
import { colors as c } from "../lib/color.js";
2+
import { qsend } from "../lib/helpers.js";
3+
import { IJob } from "../lib/interfaces.js";
4+
import * as jobs from "../lib/jobs.js";
5+
import { wrapJavaPerform } from "./lib/libjava.js";
66
import {
77
ArrayList,
88
CertificatePinner,
@@ -11,7 +11,7 @@ import {
1111
SSLContext,
1212
TrustManagerImpl,
1313
X509TrustManager,
14-
} from "./lib/types";
14+
} from "./lib/types.js";
1515

1616

1717
// a simple flag to control if we should be quiet or not
@@ -317,10 +317,11 @@ export const disable = (q: boolean): void => {
317317

318318
const job: IJob = {
319319
identifier: jobs.identifier(),
320-
implementations: [],
321320
type: "android-sslpinning-disable",
322321
};
323322

323+
job.implementations = [];
324+
324325
job.implementations.push(sslContextEmptyTrustManager(job.identifier));
325326
job.implementations.push(okHttp3CertificatePinnerCheck(job.identifier));
326327
job.implementations.push(okHttp3CertificatePinnerCheckOkHttp(job.identifier));

agent/src/android/proxy.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { wrapJavaPerform } from "./lib/libjava";
2-
import { colors as c } from "../lib/color";
1+
import { wrapJavaPerform } from "./lib/libjava.js";
2+
import { colors as c } from "../lib/color.js";
33

44
export const set = (host: string, port: string): Promise<void> => {
55
return wrapJavaPerform(() => {

agent/src/android/root.ts

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import { colors as c } from "../lib/color";
2-
import { IJob } from "../lib/interfaces";
3-
import * as jobs from "../lib/jobs";
4-
import { wrapJavaPerform } from "./lib/libjava";
1+
import { colors as c } from "../lib/color.js";
2+
import { IJob } from "../lib/interfaces.js";
3+
import * as jobs from "../lib/jobs.js";
4+
import { wrapJavaPerform } from "./lib/libjava.js";
55
import {
66
File,
77
IOException,
88
JavaString,
99
Runtime
10-
} from "./lib/types";
10+
} from "./lib/types.js";
1111

1212
const commonPaths = [
1313
"/data/local/bin/su",
@@ -294,10 +294,11 @@ const jailMonkeyBypass = (success: boolean, ident: string): any => {
294294
export const disable = (): void => {
295295
const job: IJob = {
296296
identifier: jobs.identifier(),
297-
implementations: [],
298297
type: "root-detection-disable",
299298
};
300299

300+
job.implementations = [];
301+
301302
job.implementations.push(testKeysCheck(false, job.identifier));
302303
job.implementations.push(execSuCheck(false, job.identifier));
303304
job.implementations.push(fileExistsCheck(false, job.identifier));
@@ -322,6 +323,7 @@ export const enable = (): void => {
322323
implementations: [],
323324
type: "root-detection-enable",
324325
};
326+
job.implementations = [];
325327

326328
job.implementations.push(testKeysCheck(true, job.identifier));
327329
job.implementations.push(execSuCheck(true, job.identifier));

agent/src/android/shell.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { IExecutedCommand } from "./lib/interfaces";
2-
import { wrapJavaPerform } from "./lib/libjava";
1+
import { IExecutedCommand } from "./lib/interfaces.js";
2+
import { wrapJavaPerform } from "./lib/libjava.js";
33
import {
44
BufferedReader,
55
InputStreamReader,
66
Runtime,
77
StringBuilder
8-
} from "./lib/types";
8+
} from "./lib/types.js";
99

1010

1111
// Executes shell commands on an Android device using Runtime.getRuntime().exec()

agent/src/android/userinterface.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import { colors as c } from "../lib/color";
2-
import { wrapJavaPerform } from "./lib/libjava";
1+
import { colors as c } from "../lib/color.js";
2+
import { wrapJavaPerform } from "./lib/libjava.js";
33
import {
44
Activity,
55
ActivityClientRecord,
66
ActivityThread,
77
Bitmap,
88
ByteArrayOutputStream,
99
CompressFormat,
10-
} from "./lib/types";
10+
} from "./lib/types.js";
1111

1212

1313
// https://developer.android.com/reference/android/view/WindowManager.LayoutParams.html#FLAG_SECURE

agent/src/generic/environment.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
import {
22
getApplicationContext,
33
wrapJavaPerform
4-
} from "../android/lib/libjava";
4+
} from "../android/lib/libjava.js";
55
import {
66
NSSearchPaths,
77
NSUserDomainMask
8-
} from "../ios/lib/constants";
8+
} from "../ios/lib/constants.js";
99
import {
1010
getNSFileManager,
1111
getNSMainBundle
12-
} from "../ios/lib/helpers";
13-
import { NSBundle } from "../ios/lib/types";
14-
import { DeviceType } from "../lib/constants";
12+
} from "../ios/lib/helpers.js";
13+
import { NSBundle } from "../ios/lib/types.js";
14+
import { DeviceType } from "../lib/constants.js";
1515
import {
1616
IAndroidPackage,
1717
IFridaInfo,
1818
IIosBundlePaths,
1919
IIosPackage
20-
} from "../lib/interfaces";
20+
} from "../lib/interfaces.js";
2121

2222

2323
// small helper function to lookup ios bundle paths

0 commit comments

Comments
 (0)