[Soot-list] reflection

Phil Pratt-Szeliga pcpratts at trifort.org
Thu Feb 19 22:18:20 EST 2015


Hello Peter,

> Classes referenced through reflection are being loaded by calling
> forceResolve() against the entry point, but their methods are not reachable.
> I tried dynamic_package and dynamic_class options. Do you know how to make
> them reachable?

You can programmatically make the RTAClassLoader to cross a reflection
boundary if the dynamically loaded classes follow an interface or
there is some other programatic way to describe them. I have used this
to link Thread.start to Runnable.run for example.

> Your class loader sounds great, but I want to first get the up-optimized
> class loading, that loads all the classes, to work. Do you, or anyone else
> here, know how to do this? My understanding is that if you do
> Scene.v().forceResolve(mainClass, SootClass.BODIES), then all classes
> transitively referenced should be loaded, but this is not happening for me.

You may want to still look at the API to see if it will help you. Even
though RTAClassLoader contains optimizations, these are done mainly to
help class loading issues. However, please note that RTAClassLoader is
still in a beta phase and may not work for you.

If you want to simply read the bytecode from every class you can look
at BCEL. It doesn't require class loading but please be warned that
the IR is much simpler and you won't have access to many of the tools
that work with Soot.

Phil Pratt-Szeliga
http://trifort.org/


More information about the Soot-list mailing list