Skip to content

Commit

Permalink
(chore) Bumping of dependencies. (#681)
Browse files Browse the repository at this point in the history
* (chore) Dependency bump

* Pin to major versions

* Version pinning syntax fix
  • Loading branch information
IPMegladon authored May 24, 2024
1 parent 5e45507 commit 3f9763b
Show file tree
Hide file tree
Showing 45 changed files with 851 additions and 2,689 deletions.
3,011 changes: 555 additions & 2,456 deletions agent/package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions agent/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@
"dependencies": {
"frida-java-bridge": "^6",
"frida-objc-bridge": "^7",
"frida-screenshot": "^3",
"frida-screenshot": "^5",
"macho": "^1"
},
"devDependencies": {
"@types/frida-gum": "^18",
"@types/node": "^17",
"frida-compile": "^10",
"@types/node": "^18",
"frida-compile": "^16",
"tslint": "^6"
}
}
6 changes: 3 additions & 3 deletions agent/src/android/clipboard.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { colors as c } from "../lib/color";
import { colors as c } from "../lib/color.js";
import {
getApplicationContext,
wrapJavaPerform
} from "./lib/libjava";
import { ClipboardManager } from "./lib/types";
} from "./lib/libjava.js";
import { ClipboardManager } from "./lib/types.js";

export const monitor = (): Promise<void> => {
// -- Sample Java
Expand Down
8 changes: 4 additions & 4 deletions agent/src/android/filesystem.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import * as fs from "fs";
import { hexStringToBytes } from "../lib/helpers";
import { IAndroidFilesystem } from "./lib/interfaces";
import { hexStringToBytes } from "../lib/helpers.js";
import { IAndroidFilesystem } from "./lib/interfaces.js";
import {
getApplicationContext,
wrapJavaPerform
} from "./lib/libjava";
} from "./lib/libjava.js";
import {
File,
JavaClass
} from "./lib/types";
} from "./lib/types.js";

export const exists = (path: string): Promise<boolean> => {
// -- Sample Java
Expand Down
2 changes: 1 addition & 1 deletion agent/src/android/general.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { wrapJavaPerform } from "./lib/libjava";
import { wrapJavaPerform } from "./lib/libjava.js";

export const deoptimize = (): Promise<void> => {
return wrapJavaPerform(() => {
Expand Down
18 changes: 9 additions & 9 deletions agent/src/android/heap.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { colors as c } from "../lib/color";
import { colors as c } from "../lib/color.js";
import {
IHeapClassDictionary,
IHeapObject,
IJavaField,
IHeapNormalised
} from "./lib/interfaces";
import { wrapJavaPerform } from "./lib/libjava";
} from "./lib/interfaces.js";
import { wrapJavaPerform } from "./lib/libjava.js";

export let handles: IHeapClassDictionary = {};

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

export const methods = (handle: number): Promise<string[]> => {
return wrapJavaPerform(() => {
const clazz: Java.Wrapper = getInstance(handle);
const clazz = getInstance(handle);
if (clazz == null) {
return [];
}

return clazz.class.getDeclaredMethods().map((method) => {
return clazz.class.getDeclaredMethods().map((method: any) => {
return method.toGenericString();
});
});
};

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

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

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

if (clazz == null) {
return;
}

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

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

if (clazz == null) {
return;
Expand Down
30 changes: 20 additions & 10 deletions agent/src/android/hooking.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { colors as c } from "../lib/color";
import { IJob } from "../lib/interfaces";
import * as jobs from "../lib/jobs";
import { ICurrentActivityFragment } from "./lib/interfaces";
import { colors as c } from "../lib/color.js";
import { IJob } from "../lib/interfaces.js";
import * as jobs from "../lib/jobs.js";
import { ICurrentActivityFragment } from "./lib/interfaces.js";
import {
getApplicationContext,
R,
wrapJavaPerform
} from "./lib/libjava";
} from "./lib/libjava.js";
import {
Activity,
ActivityClientRecord,
Expand All @@ -16,7 +16,7 @@ import {
PackageManager,
Throwable,
JavaMethodsOverloadsResult,
} from "./lib/types";
} from "./lib/types.js";

enum PatternType {
Regex = 'regex',
Expand Down Expand Up @@ -400,7 +400,12 @@ const watchMethod = (
};

// Push the implementation so that it can be nulled later
job.implementations.push(m);
if (job.implementations) {
job.implementations.push(m);
} else {
job.implementations = [ m ];
}

});
});
};
Expand Down Expand Up @@ -468,7 +473,7 @@ export const getServices = (): Promise<string[]> => {
// not using the helper as we need other variables too
const context = currentApplication.getApplicationContext();

let services = [];
var services: string[] = [];

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

let receivers = [];
var receivers: string[] = [];

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

// record override
job.implementations.push(m);
if (job.implementations) {
job.implementations.push(m);
} else {
job.implementations = [ m ];
}

});

jobs.add(job);
Expand Down
6 changes: 3 additions & 3 deletions agent/src/android/intent.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { colors as c } from "../lib/color";
import { colors as c } from "../lib/color.js";
import {
getApplicationContext,
wrapJavaPerform
} from "./lib/libjava";
import { Intent } from "./lib/types";
} from "./lib/libjava.js";
import { Intent } from "./lib/types.js";

// https://developer.android.com/reference/android/content/Intent.html#FLAG_ACTIVITY_NEW_TASK
const FLAG_ACTIVITY_NEW_TASK = 0x10000000;
Expand Down
14 changes: 7 additions & 7 deletions agent/src/android/keystore.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { colors as c } from "../lib/color";
import { colors as c } from "../lib/color.js";
import {
IKeyStoreDetail,
IKeyStoreEntry
} from "./lib/interfaces";
import { wrapJavaPerform } from "./lib/libjava";
} from "./lib/interfaces.js";
import { wrapJavaPerform } from "./lib/libjava.js";
import {
KeyFactory,
KeyInfo,
KeyStore,
SecretKeyFactory
} from "./lib/types";
import { IJob } from "../lib/interfaces";
import * as jobs from "../lib/jobs";
} from "./lib/types.js";
import { IJob } from "../lib/interfaces.js";
import * as jobs from "../lib/jobs.js";

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

job.implementations.push(keystoreLoad(job.identifier));
job.implementations.push(keystoreGetKey(job.identifier));
Expand Down
2 changes: 1 addition & 1 deletion agent/src/android/monitor.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { wrapJavaPerform } from "./lib/libjava";
import { wrapJavaPerform } from "./lib/libjava.js";

export namespace monitor {
export const stringCanary = (can: string): Promise<void> => {
Expand Down
15 changes: 8 additions & 7 deletions agent/src/android/pinning.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { colors as c } from "../lib/color";
import { qsend } from "../lib/helpers";
import { IJob } from "../lib/interfaces";
import * as jobs from "../lib/jobs";
import { wrapJavaPerform } from "./lib/libjava";
import { colors as c } from "../lib/color.js";
import { qsend } from "../lib/helpers.js";
import { IJob } from "../lib/interfaces.js";
import * as jobs from "../lib/jobs.js";
import { wrapJavaPerform } from "./lib/libjava.js";
import {
ArrayList,
CertificatePinner,
Expand All @@ -11,7 +11,7 @@ import {
SSLContext,
TrustManagerImpl,
X509TrustManager,
} from "./lib/types";
} from "./lib/types.js";


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

const job: IJob = {
identifier: jobs.identifier(),
implementations: [],
type: "android-sslpinning-disable",
};

job.implementations = [];

job.implementations.push(sslContextEmptyTrustManager(job.identifier));
job.implementations.push(okHttp3CertificatePinnerCheck(job.identifier));
job.implementations.push(okHttp3CertificatePinnerCheckOkHttp(job.identifier));
Expand Down
4 changes: 2 additions & 2 deletions agent/src/android/proxy.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { wrapJavaPerform } from "./lib/libjava";
import { colors as c } from "../lib/color";
import { wrapJavaPerform } from "./lib/libjava.js";
import { colors as c } from "../lib/color.js";

export const set = (host: string, port: string): Promise<void> => {
return wrapJavaPerform(() => {
Expand Down
14 changes: 8 additions & 6 deletions agent/src/android/root.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { colors as c } from "../lib/color";
import { IJob } from "../lib/interfaces";
import * as jobs from "../lib/jobs";
import { wrapJavaPerform } from "./lib/libjava";
import { colors as c } from "../lib/color.js";
import { IJob } from "../lib/interfaces.js";
import * as jobs from "../lib/jobs.js";
import { wrapJavaPerform } from "./lib/libjava.js";
import {
File,
IOException,
JavaString,
Runtime
} from "./lib/types";
} from "./lib/types.js";

const commonPaths = [
"/data/local/bin/su",
Expand Down Expand Up @@ -294,10 +294,11 @@ const jailMonkeyBypass = (success: boolean, ident: string): any => {
export const disable = (): void => {
const job: IJob = {
identifier: jobs.identifier(),
implementations: [],
type: "root-detection-disable",
};

job.implementations = [];

job.implementations.push(testKeysCheck(false, job.identifier));
job.implementations.push(execSuCheck(false, job.identifier));
job.implementations.push(fileExistsCheck(false, job.identifier));
Expand All @@ -322,6 +323,7 @@ export const enable = (): void => {
implementations: [],
type: "root-detection-enable",
};
job.implementations = [];

job.implementations.push(testKeysCheck(true, job.identifier));
job.implementations.push(execSuCheck(true, job.identifier));
Expand Down
6 changes: 3 additions & 3 deletions agent/src/android/shell.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { IExecutedCommand } from "./lib/interfaces";
import { wrapJavaPerform } from "./lib/libjava";
import { IExecutedCommand } from "./lib/interfaces.js";
import { wrapJavaPerform } from "./lib/libjava.js";
import {
BufferedReader,
InputStreamReader,
Runtime,
StringBuilder
} from "./lib/types";
} from "./lib/types.js";


// Executes shell commands on an Android device using Runtime.getRuntime().exec()
Expand Down
6 changes: 3 additions & 3 deletions agent/src/android/userinterface.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { colors as c } from "../lib/color";
import { wrapJavaPerform } from "./lib/libjava";
import { colors as c } from "../lib/color.js";
import { wrapJavaPerform } from "./lib/libjava.js";
import {
Activity,
ActivityClientRecord,
ActivityThread,
Bitmap,
ByteArrayOutputStream,
CompressFormat,
} from "./lib/types";
} from "./lib/types.js";


// https://developer.android.com/reference/android/view/WindowManager.LayoutParams.html#FLAG_SECURE
Expand Down
12 changes: 6 additions & 6 deletions agent/src/generic/environment.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
import {
getApplicationContext,
wrapJavaPerform
} from "../android/lib/libjava";
} from "../android/lib/libjava.js";
import {
NSSearchPaths,
NSUserDomainMask
} from "../ios/lib/constants";
} from "../ios/lib/constants.js";
import {
getNSFileManager,
getNSMainBundle
} from "../ios/lib/helpers";
import { NSBundle } from "../ios/lib/types";
import { DeviceType } from "../lib/constants";
} from "../ios/lib/helpers.js";
import { NSBundle } from "../ios/lib/types.js";
import { DeviceType } from "../lib/constants.js";
import {
IAndroidPackage,
IFridaInfo,
IIosBundlePaths,
IIosPackage
} from "../lib/interfaces";
} from "../lib/interfaces.js";


// small helper function to lookup ios bundle paths
Expand Down
Loading

0 comments on commit 3f9763b

Please sign in to comment.