dump_class
Dump all methods, fields, and constructors of a Java class in Android applications for security analysis and reverse engineering.
Instructions
Dump all methods, fields, and constructors of a Java class
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| class_name | Yes | Full Java class name |
Implementation Reference
- agent/agent.js:332-364 (handler)Actual Frida agent RPC implementation that uses Java.use() and reflection to dump all methods, fields, and constructors of a Java class via the frida-java-bridge.
dumpClass(className) { if (!Java.available) { throw new Error("Java runtime not available"); } const result = { methods: [], fields: [], constructors: [] }; Java.performNow(() => { try { const clazz = Java.use(className); const jClass = clazz.class; // Methods const methods = jClass.getDeclaredMethods(); for (let i = 0; i < methods.length; i++) { result.methods.push(methods[i].toString()); } // Fields const fields = jClass.getDeclaredFields(); for (let i = 0; i < fields.length; i++) { result.fields.push(fields[i].toString()); } // Constructors const ctors = jClass.getDeclaredConstructors(); for (let i = 0; i < ctors.length; i++) { result.constructors.push(ctors[i].toString()); } } catch (e) { result.error = e.message; } }); return result; }, - src/frida_mcp/android.py:55-58 (handler)Python server-side handler that gets the active Frida RPC API and calls dump_class on the agent with a 10-second timeout.
def dump_class(class_name: str) -> dict: """Dump all methods and fields of a Java class.""" api = get_api() return with_timeout(lambda: api.dump_class(class_name), timeout=10) - src/frida_mcp/tools.py:353-363 (registration)MCP tool registration defining the tool name, description, and input schema requiring a class_name string.
Tool( name="dump_class", description="Dump all methods, fields, and constructors of a Java class", inputSchema={ "type": "object", "properties": { "class_name": {"type": "string", "description": "Full Java class name"}, }, "required": ["class_name"], }, ), - src/frida_mcp/server.py:94-95 (schema)Dispatcher that routes the 'dump_class' tool call to the android.dump_class handler, passing the class_name argument.
elif name == "dump_class": return android.dump_class(arguments["class_name"]) - src/frida_mcp/session.py:179-187 (helper)Helper that retrieves the active Frida session's RPC API, which android.dump_class uses to call the agent's dumpClass.
def get_api(): """Get the current Frida RPC API or raise error.""" fs = registry.get_active() if fs is None: raise RuntimeError("Not connected. Use 'connect' tool first.") if not fs.is_alive(): registry.remove(fs.id) raise RuntimeError("Session disconnected unexpectedly. Use 'connect' to reconnect.") return fs.api