[Soot-list] soot process and output dir setup

Tamás Szabó szabta89 at gmail.com
Sat Apr 15 11:06:02 EDT 2017


Hi all,

I am struggling a bit with the proper setup of the process and output 
dirs for my use case.

Imagine that I have the following directory structure containing class 
files.
root/classes/a/b/... files ... (e.g. Example.class)
root/classes/a/c/... files ...
root/classes/b/d/... files ...

I would like to specify for Soot to process only the directory 
classes/a/b under root (and the class files that it finds under that 
folder).
In order to do that I set the process dir property to classes/a/b. Soot 
finds all of the class files in there, but the problem is that
the class files themselves have the package information, as well, and 
Soot will throw an exception that the class file names Example and 
a.b.Example do not match.

java.lang.RuntimeException: Class names not equal! a.b.Example != Example
     at soot.asm.SootClassBuilder.visit(SootClassBuilder.java:99)
     at org.objectweb.asm.ClassReader.accept(ClassReader.java:622)
     at org.objectweb.asm.ClassReader.accept(ClassReader.java:506)
     at soot.asm.AsmClassSource.resolve(AsmClassSource.java:59)
     at soot.SootResolver.bringToHierarchy(SootResolver.java:243)
     at soot.SootResolver.bringToSignatures(SootResolver.java:275)

If I specify the process dir as "classes", then Soot works nicely, but I 
do not want it to transform (in my case, to jimple) all class files.
In this case, the soot class files will have names that have the package 
name as a prefix. So in my output dir, I have jimple files with the name 
"a.b.Example.jimple" and so on.
Can I somehow force Soot to just use the simple name and create 
subdirectories according to the package name in the output dir that I 
specify?
In other words, a structure like root/jimple/a/b/ ... jimple files.

Ultimately, I would like to combine the solutions to the above two issues.

Thanks for the help,
Regards,
Tamas


More information about the Soot-list mailing list