frida-java-bridge 6.3.8 → 7.0.0

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/lib/mkdex.js CHANGED
@@ -1,4 +1,5 @@
1
- const SHA1 = require('jssha/dist/sha1');
1
+ // import SHA1 from 'jssha/dist/sha1';
2
+ import { Buffer } from 'buffer';
2
3
 
3
4
  const kAccPublic = 0x0001;
4
5
  const kAccNative = 0x0100;
@@ -430,9 +431,9 @@ class DexBuilder {
430
431
  dex.writeUInt32LE(offset, itemOffset + 8);
431
432
  });
432
433
 
433
- const hash = new SHA1('SHA-1', 'ARRAYBUFFER');
434
+ const hash = new Checksum('sha1');
434
435
  hash.update(dex.slice(signatureOffset + signatureSize));
435
- Buffer.from(hash.getHash('ARRAYBUFFER')).copy(dex, signatureOffset);
436
+ Buffer.from(hash.getDigest()).copy(dex, signatureOffset);
436
437
 
437
438
  dex.writeUInt32LE(adler32(dex, signatureOffset), checksumOffset);
438
439
 
@@ -930,4 +931,4 @@ function adler32 (buffer, offset) {
930
931
  return ((b << 16) | a) >>> 0;
931
932
  }
932
933
 
933
- module.exports = mkdex;
934
+ export default mkdex;
package/lib/result.js CHANGED
@@ -1,12 +1,7 @@
1
- const JNI_OK = 0;
1
+ export const JNI_OK = 0;
2
2
 
3
- function checkJniResult (name, result) {
3
+ export function checkJniResult (name, result) {
4
4
  if (result !== JNI_OK) {
5
5
  throw new Error(name + ' failed: ' + result);
6
6
  }
7
7
  }
8
-
9
- module.exports = {
10
- checkJniResult,
11
- JNI_OK: 0
12
- };
package/lib/types.js CHANGED
@@ -1,4 +1,4 @@
1
- const Env = require('./env');
1
+ import Env from './env.js';
2
2
 
3
3
  const JNILocalRefType = 1;
4
4
 
@@ -6,7 +6,7 @@ let vm = null;
6
6
 
7
7
  let primitiveArrayHandler = null;
8
8
 
9
- function initialize (_vm) {
9
+ export function initialize (_vm) {
10
10
  vm = _vm;
11
11
  }
12
12
 
@@ -14,7 +14,7 @@ function initialize (_vm) {
14
14
  * http://docs.oracle.com/javase/6/docs/technotes/guides/jni/spec/types.html#wp9502
15
15
  * http://www.liaohuqiu.net/posts/android-object-size-dalvik/
16
16
  */
17
- function getType (typeName, unbox, factory) {
17
+ export function getType (typeName, unbox, factory) {
18
18
  let type = getPrimitiveType(typeName);
19
19
  if (type === null) {
20
20
  if (typeName.indexOf('[') === 0) {
@@ -235,7 +235,7 @@ const primitiveTypes = {
235
235
 
236
236
  const primitiveTypesNames = new Set(Object.values(primitiveTypes).map(t => t.name));
237
237
 
238
- function getPrimitiveType (name) {
238
+ export function getPrimitiveType (name) {
239
239
  const result = primitiveTypes[name];
240
240
  return (result !== undefined) ? result : null;
241
241
  }
@@ -425,7 +425,7 @@ function makePrimitiveArrayType (shorty, name) {
425
425
  };
426
426
  }
427
427
 
428
- function getArrayType (typeName, unbox, factory) {
428
+ export function getArrayType (typeName, unbox, factory) {
429
429
  const primitiveType = primitiveArrayTypes[typeName];
430
430
  if (primitiveType !== undefined) {
431
431
  return primitiveType;
@@ -789,7 +789,7 @@ Object.defineProperties(PrimitiveArray.prototype, {
789
789
  }
790
790
  });
791
791
 
792
- function makeJniObjectTypeName (typeName) {
792
+ export function makeJniObjectTypeName (typeName) {
793
793
  return 'L' + typeName.replace(/\./g, '/') + ';';
794
794
  }
795
795
 
@@ -800,11 +800,3 @@ function toTitleCase (str) {
800
800
  function identity (value) {
801
801
  return value;
802
802
  }
803
-
804
- module.exports = {
805
- initialize,
806
- getType,
807
- getPrimitiveType,
808
- getArrayType,
809
- makeJniObjectTypeName
810
- };
package/lib/vm.js CHANGED
@@ -1,5 +1,5 @@
1
- const Env = require('./env');
2
- const { JNI_OK, checkJniResult } = require('./result');
1
+ import Env from './env.js';
2
+ import { JNI_OK, checkJniResult } from './result.js';
3
3
 
4
4
  const JNI_VERSION_1_6 = 0x00010006;
5
5
 
@@ -9,7 +9,7 @@ const jsThreadID = Process.getCurrentThreadId();
9
9
  const attachedThreads = new Map();
10
10
  const activeEnvs = new Map();
11
11
 
12
- function VM (api) {
12
+ export default function VM (api) {
13
13
  const handle = api.vm;
14
14
  let attachCurrentThread = null;
15
15
  let detachCurrentThread = null;
@@ -166,7 +166,3 @@ VM.dispose = function (vm) {
166
166
  vm.detachCurrentThread();
167
167
  }
168
168
  };
169
-
170
- module.exports = VM;
171
-
172
- /* global Memory, NativeFunction, NULL, Process */
package/package.json CHANGED
@@ -1,10 +1,12 @@
1
1
  {
2
2
  "name": "frida-java-bridge",
3
- "version": "6.3.8",
3
+ "version": "7.0.0",
4
4
  "description": "Java runtime interop from Frida",
5
+ "type": "module",
5
6
  "main": "index.js",
6
7
  "files": [
7
8
  "/index.js",
9
+ "/index.d.ts",
8
10
  "/lib/**/*.js",
9
11
  "/lib/**/*.d.ts"
10
12
  ],
@@ -21,15 +23,11 @@
21
23
  "lint": "eslint lib",
22
24
  "fix": "eslint --fix lib"
23
25
  },
24
- "dependencies": {
25
- "jssha": "^3.1.2"
26
- },
27
26
  "devDependencies": {
28
- "eslint": "^8.33.0",
29
- "eslint-config-semistandard": "^17.0.0",
30
- "eslint-config-standard": "^17.0.0",
31
- "eslint-plugin-import": "^2.27.5",
32
- "eslint-plugin-n": "^15.6.1",
33
- "eslint-plugin-promise": "^6.1.1"
27
+ "@types/frida-gum": "^18.7.2",
28
+ "frida-compile": "^16.4.1",
29
+ "@eslint/js": "^9.20.0",
30
+ "eslint": "^9.20.0",
31
+ "neostandard": "^0.12.1"
34
32
  }
35
33
  }