frida-screenshot 5.0.2 → 6.0.1

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/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- /// <reference types="frida-gum" />
1
+ import ObjC from "frida-objc-bridge";
2
2
  export default function screenshot(view: ObjC.Object): Promise<ArrayBuffer>;
package/dist/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ import ObjC from "frida-objc-bridge";
1
2
  import { ios } from './lib/ios.js';
2
3
  const IOS = Symbol('ios');
3
4
  const UNKNOWN = Symbol('unknown');
package/dist/lib/ios.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- /// <reference types="frida-gum" />
1
+ import ObjC from "frida-objc-bridge";
2
2
  export declare function ios(view: ObjC.Object): Promise<ArrayBuffer>;
package/dist/lib/ios.js CHANGED
@@ -1,3 +1,4 @@
1
+ import ObjC from "frida-objc-bridge";
1
2
  const CGFloat = (Process.pointerSize === 4) ? 'float' : 'double';
2
3
  const CGSize = [CGFloat, CGFloat];
3
4
  const blocks = new Set();
@@ -60,14 +61,15 @@ function performOnMainThread(action) {
60
61
  let cachedApi = null;
61
62
  function getApi() {
62
63
  if (cachedApi === null) {
64
+ const uikit = Process.getModuleByName('UIKit');
63
65
  cachedApi = {
64
66
  UIApplication: ObjC.classes.UIApplication,
65
67
  UIWindow: ObjC.classes.UIWindow,
66
68
  NSThread: ObjC.classes.NSThread,
67
- UIGraphicsBeginImageContextWithOptions: new NativeFunction(Module.getExportByName('UIKit', 'UIGraphicsBeginImageContextWithOptions'), 'void', [CGSize, 'bool', CGFloat]),
68
- UIGraphicsEndImageContext: new NativeFunction(Module.getExportByName('UIKit', 'UIGraphicsEndImageContext'), 'void', []),
69
- UIGraphicsGetImageFromCurrentImageContext: new NativeFunction(Module.getExportByName('UIKit', 'UIGraphicsGetImageFromCurrentImageContext'), 'pointer', []),
70
- UIImagePNGRepresentation: new NativeFunction(Module.getExportByName('UIKit', 'UIImagePNGRepresentation'), 'pointer', ['pointer'])
69
+ UIGraphicsBeginImageContextWithOptions: new NativeFunction(uikit.getExportByName('UIGraphicsBeginImageContextWithOptions'), 'void', [CGSize, 'bool', CGFloat]),
70
+ UIGraphicsEndImageContext: new NativeFunction(uikit.getExportByName('UIGraphicsEndImageContext'), 'void', []),
71
+ UIGraphicsGetImageFromCurrentImageContext: new NativeFunction(uikit.getExportByName('UIGraphicsGetImageFromCurrentImageContext'), 'pointer', []),
72
+ UIImagePNGRepresentation: new NativeFunction(uikit.getExportByName('UIImagePNGRepresentation'), 'pointer', ['pointer'])
71
73
  };
72
74
  }
73
75
  return cachedApi;
package/package.json CHANGED
@@ -1,7 +1,10 @@
1
1
  {
2
2
  "name": "frida-screenshot",
3
- "version": "5.0.2",
3
+ "version": "6.0.1",
4
4
  "description": "Grab screenshots using Frida",
5
+ "keywords": [
6
+ "frida-gum"
7
+ ],
5
8
  "main": "dist/index.js",
6
9
  "type": "module",
7
10
  "files": [
@@ -22,8 +25,11 @@
22
25
  },
23
26
  "homepage": "https://github.com/nowsecure/frida-screenshot#readme",
24
27
  "devDependencies": {
25
- "@types/frida-gum": "^18.3.0",
28
+ "@types/frida-gum": "^19.0.0",
26
29
  "@types/node": "^18.11.18",
27
30
  "typescript": "^4.7.3"
31
+ },
32
+ "dependencies": {
33
+ "frida-objc-bridge": "^8.0.4"
28
34
  }
29
35
  }