[Soot-list] Compare 2 versions of the same jar

Eric Bodden bodden at st.informatik.tu-darmstadt.de
Sat Sep 26 06:08:18 EDT 2009


Hi Attlia.

I am afraid that, at least in my opinion, Soot is not really well
suited for this task.

> My first problem is: How can I create to create 2 Scene instances with
> separate classpaths, so that I can load both versions?

There is no means to have two Scene instances. The Scene is a
singleton object - by design.

> The next question is: Is there already an implementation available for such
> a comparison, e.g. a comparator for control flow graphs?

No, not that I am aware of. I sometimes thought about writing a
"control-flow-graph diff" but I never found the time. Plus it's not a
simple problem (graph matching is hard in terms of computation time).

You could probably get around the 1st problem by the following means:
1.) read in classes from the first JAR into the Scene
2.) store all SootClasses in a list (e.g. a static field)
3.) reset Soot using soot.G.reset()
4.) repeat step 1
5.) compare the classes in the Scene to the ones in the static list

Eric

-- 
Eric Bodden
Software Technology Group, Technische Universität Darmstadt, Germany
Tel: +49 6151 16-5478    Fax: +49 6151 16-5410
Mailing Address: S2|02 A209, Hochschulstraße 10, 64289 Darmstadt


More information about the Soot-list mailing list