Giter Club home page Giter Club logo

Comments (8)

iddoeldor avatar iddoeldor commented on August 29, 2024 22

find a way

console.log( Object.getOwnPropertyNames(Test.__proto__).join('\n') );

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));
}

from frida-java-bridge.

douniwan5788 avatar douniwan5788 commented on August 29, 2024 6

find a way

console.log( Object.getOwnPropertyNames(Test.__proto__).join('\n') );

from frida-java-bridge.

0x410c avatar 0x410c commented on August 29, 2024 6

empty method list
obtain like the fields :

var db1 = Java.use("your.class");
var methodArr = db1.class.getMethods();
for(var m in methodArr)
{
	console.log(methodArr[m]);
}

from frida-java-bridge.

wb14123 avatar wb14123 commented on August 29, 2024

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?

from frida-java-bridge.

wb14123 avatar wb14123 commented on August 29, 2024

BTW, @douniwan5788 are you figuring it out by reading the source code?

from frida-java-bridge.

KANGOD avatar KANGOD commented on August 29, 2024

@wb14123

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?

Indeed there is one, this._m.value in https://github.com/frida/frida-website/blob/master/_docs/examples/android.md. While it's in Examples section instead of API Reference, I can't say it's well documented.
frida/frida#833 is also the same topic. Maybe a doc PR is needed.

from frida-java-bridge.

wb14123 avatar wb14123 commented on August 29, 2024

@KANGOD Yes I added that one to the doc 😄

from frida-java-bridge.

mmkhitaryan avatar mmkhitaryan commented on August 29, 2024

I think @0x410c meant to use "of" instead of "in".

for(var m of methodArr)

var m inreturns a list of indices instead of objects. Calling 0.class.getMethods() returns error: TypeError: cannot read property 'getMethods' of undefined

from frida-java-bridge.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.