-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathenum_methods.js
More file actions
46 lines (42 loc) · 1.11 KB
/
enum_methods.js
File metadata and controls
46 lines (42 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/**
* Helper function to enumerate all declared methods of a class.
*
* @param {string} targetClass - Fully qualified Java class name.
* @returns {string[]} Array of method signatures.
*/
import Java from "frida-java-bridge";
function enumMethods(targetClass) {
var hook = Java.use(targetClass);
var ownMethods = hook.class.getDeclaredMethods();
hook.$dispose();
return ownMethods.map(method => method.toString());
}
rpc.exports = {
/**
* Enumerate all methods declared in a given Java class.
*
* @param {Object} args - An object containing parameters.
* @param {string} args.className - Fully qualified Java class name (e.g., "java.lang.String").
* @returns {void}
*/
run: function (args) {
const { className } = args;
var result = [];
Java.perform(function () {
result = enumMethods(className);
result.forEach(function (el) {
send(el);
});
});
},
schema: function () {
return {
type: "object",
properties: {
className: { type: "string" },
},
required: ["className"],
additionalProperties: false,
};
},
};