frida-packing-detector 1.0.3 → 1.0.4
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/{index.d.ts → dist/index.d.ts} +28 -29
- package/dist/index.js +5 -5
- package/package.json +5 -4
- package/src/index.ts +6 -7
- package/src/test.ts +1 -1
- package/tsconfig.json +5 -3
|
@@ -1,29 +1,28 @@
|
|
|
1
|
-
export declare namespace FridaPackingDetector {
|
|
2
|
-
/**
|
|
3
|
-
* 壳检测回调接口
|
|
4
|
-
*/
|
|
5
|
-
interface DetectCallback {
|
|
6
|
-
/**
|
|
7
|
-
* 检测到加固状态时触发
|
|
8
|
-
* @param isProtected - true 表示已加固,false 表示未加固
|
|
9
|
-
*/
|
|
10
|
-
onDetected?: (isProtected: boolean) => void;
|
|
11
|
-
/**
|
|
12
|
-
* 壳解包完成、原始应用加载完成时触发
|
|
13
|
-
*/
|
|
14
|
-
onUnpacked?: () => void;
|
|
15
|
-
/**
|
|
16
|
-
* 发生错误时触发
|
|
17
|
-
* @param message - 错误信息
|
|
18
|
-
*/
|
|
19
|
-
onError?: (message: string) => void;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* @param
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
1
|
+
export declare namespace FridaPackingDetector {
|
|
2
|
+
/**
|
|
3
|
+
* 壳检测回调接口
|
|
4
|
+
*/
|
|
5
|
+
interface DetectCallback {
|
|
6
|
+
/**
|
|
7
|
+
* 检测到加固状态时触发
|
|
8
|
+
* @param isProtected - true 表示已加固,false 表示未加固
|
|
9
|
+
*/
|
|
10
|
+
onDetected?: (isProtected: boolean) => void;
|
|
11
|
+
/**
|
|
12
|
+
* 壳解包完成、原始应用加载完成时触发
|
|
13
|
+
*/
|
|
14
|
+
onUnpacked?: () => void;
|
|
15
|
+
/**
|
|
16
|
+
* 发生错误时触发
|
|
17
|
+
* @param message - 错误信息
|
|
18
|
+
*/
|
|
19
|
+
onError?: (message: string) => void;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* 注册加固检测
|
|
23
|
+
*
|
|
24
|
+
* @param callback 回调
|
|
25
|
+
* @param isLogging 是否开启日志
|
|
26
|
+
*/
|
|
27
|
+
function register(callback: DetectCallback, isLogging?: boolean): void;
|
|
28
|
+
}
|
package/dist/index.js
CHANGED
|
@@ -170,16 +170,16 @@ export var FridaPackingDetector;
|
|
|
170
170
|
}
|
|
171
171
|
// Call from ActivityThread.handleBindApplication
|
|
172
172
|
let appInfo = this.getApplicationInfo();
|
|
173
|
-
if (appInfo.className
|
|
173
|
+
if (!appInfo.className) {
|
|
174
|
+
callback?.onError?.("ApplicationInfo has not 'className' field");
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
if (appInfo.className.value == null) {
|
|
174
178
|
// 没有自定义 Application,判定未加固
|
|
175
179
|
callback?.onDetected?.(false);
|
|
176
180
|
}
|
|
177
181
|
else {
|
|
178
182
|
let appClassName = appInfo.className.value;
|
|
179
|
-
if (!appClassName) {
|
|
180
|
-
callback?.onError?.("Application class is null");
|
|
181
|
-
return;
|
|
182
|
-
}
|
|
183
183
|
Logger.info("Application class name: " + appClassName);
|
|
184
184
|
hookCustomApplication(appClassName, callback);
|
|
185
185
|
}
|
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "frida-packing-detector",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A general method for detecting packed APKs at runtime",
|
|
6
|
-
"main": "dist/index.js",
|
|
7
|
-
"types": "index.d.ts",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
8
|
"homepage": "https://github.com/poping520/frida-packing-detector",
|
|
9
9
|
"scripts": {
|
|
10
|
-
"build": "tsc
|
|
10
|
+
"build": "tsc",
|
|
11
|
+
"watch": "tsc -w",
|
|
11
12
|
"test": "frida-compile -w -c -o ./dist/test_agent.js ./src/test.ts"
|
|
12
13
|
},
|
|
13
14
|
"keywords": [
|
package/src/index.ts
CHANGED
|
@@ -226,17 +226,16 @@ export namespace FridaPackingDetector {
|
|
|
226
226
|
|
|
227
227
|
// Call from ActivityThread.handleBindApplication
|
|
228
228
|
let appInfo = this.getApplicationInfo()
|
|
229
|
-
if (appInfo.className
|
|
229
|
+
if (!appInfo.className) {
|
|
230
|
+
callback?.onError?.("ApplicationInfo has not 'className' field");
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
if (appInfo.className.value == null) {
|
|
230
235
|
// 没有自定义 Application,判定未加固
|
|
231
236
|
callback?.onDetected?.(false);
|
|
232
|
-
|
|
233
237
|
} else {
|
|
234
238
|
let appClassName = appInfo.className.value;
|
|
235
|
-
if (!appClassName) {
|
|
236
|
-
callback?.onError?.("Application class is null");
|
|
237
|
-
return;
|
|
238
|
-
}
|
|
239
|
-
|
|
240
239
|
Logger.info("Application class name: " + appClassName);
|
|
241
240
|
hookCustomApplication(appClassName, callback);
|
|
242
241
|
}
|
package/src/test.ts
CHANGED
package/tsconfig.json
CHANGED
|
@@ -4,9 +4,11 @@
|
|
|
4
4
|
],
|
|
5
5
|
"compilerOptions": {
|
|
6
6
|
"target": "ES2020",
|
|
7
|
-
"module": "
|
|
8
|
-
"moduleResolution": "
|
|
9
|
-
"
|
|
7
|
+
"module": "Node16",
|
|
8
|
+
"moduleResolution": "Node16",
|
|
9
|
+
"strict": true,
|
|
10
|
+
"declaration": true,
|
|
11
|
+
"outDir": "./dist",
|
|
10
12
|
"skipLibCheck": true
|
|
11
13
|
}
|
|
12
14
|
}
|