[Soot-list] Using soot as a library

Patrick Lam p.lam at ece.uwaterloo.ca
Fri Jul 6 22:25:09 EDT 2012


On 07/06/2012 07:00 PM, David Given wrote:
> On 06/07/12 12:51, Eric Bodden wrote:
> [...]
>> An easier way to set options is to use the "Options" class. You can
>> use Options.v().setXYZ(..) to set options.
>>
>> Then you typically call Soot's main method or do something more
>> elaborate if needed.
>
> Yes, that's much easier; ta. I'm actually invoking Soot by setting up
> Options, then calling Scene.v().loadNecessaryClasses() and
> PackManager.v().runPacks(); at this point, getClasses() seems to be
> returning valid data. Is this the right way to do it?

That would probably work, but no guarantees... we find that calling 
Soot's main method is more foolproof.

> Next newbie question: is there an easy way of asking Soot what classes a
> particular class references? AFAICT it should just be a matter of
> pulling the class references out of the constant pool, but I can't find
> any API to do it.

We get rid of the constant pool in Soot. You can consult the 
SootResolver class and see what it does; there's no specific call to 
find all references.

pat



More information about the Soot-list mailing list