-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to get all java class fields/methods in frida? #44
Comments
find a way console.log( Object.getOwnPropertyNames(Test.__proto__).join('\n') ); |
I've spent a lot of time to figure out how to get the fields which have the same name of methods. Can we put this in the document? |
BTW, @douniwan5788 are you figuring it out by reading the source code? |
Get Java class methods & members function describeJavaClass(className) {
var jClass = Java.use(className);
console.log(JSON.stringify({
_name: className,
_methods: Object.getOwnPropertyNames(jClass.__proto__).filter(m => {
return !m.startsWith('$') // filter out Frida related special properties
|| m == 'class' || m == 'constructor' // optional
}),
_fields: jClass.class.getFields().map(f => {
return f.toString()
})
}, null, 2));
} |
empty method list
|
Indeed there is one, |
@KANGOD Yes I added that one to the doc 😄 |
I think @0x410c meant to use "of" instead of "in".
|
After dig into source, I finally found the way to get a field which has the same name of a method.
https://github.com/frida/frida-java/blob/82bc59a8389ae62a94e65841b34bb003e03f6518/lib/class-factory.js#L810-L813
My question is:
Is there a way to get all fields/methods of a java class?
The text was updated successfully, but these errors were encountered: