Call graph for unreachable methods
Hey, Im trying to build a call graph for all the methods of an apk. More precisely I would like to know for each methods all the methods that it calls.
When using:
SetupApplication app = new SetupApplication(androidJarPath, apkPath);
app.constructCallgraph();
It works great but the methods who are unreachable(unused) do not seem to appear in the call graph.
I have tried to use the soot options "all-reachable" but this did not help.
What am I doing wrong? Thanks in advanced!
@StevenArzt
FlowDroid uses Soot's SPARK callgraph algorithm by default. If you would like to use the all-reachables option, you need to switch your callgraph to CHA in the InfoflowConfiguration object.
@gilm501
I request your help...
When I use simple code like this with soot-infoflow.jar and soot-infoflow-android.jar from FlowDroid version 2.6 and 2.6.1 both...-
try{
SetupApplication analyzer = new SetupApplication(androidJarPath,apkPath);
analyzer.constructCallgraph();
}
catch(Exception e){
}
It gives Exception.....
[main] INFO soot.jimple.infoflow.android.SetupApplication - Initializing Soot...
Exception in thread "main" java.lang.NoSuchMethodError: soot.options.Options.set_process_multiple_dex(Z)V
at soot.jimple.infoflow.android.SetupApplication.initializeSoot(SetupApplication.java:1074)
at soot.jimple.infoflow.android.SetupApplication.runInfoflow(SetupApplication.java:1333)
at soot.jimple.infoflow.android.SetupApplication.constructCallgraph(SetupApplication.java:1204)
I have two versions of soot-trunk.jar. when I change the soot-trunk.jar, it again get stuck with another Exception...........
Exception in thread "main" java.lang.NoSuchMethodError: soot.Body.getUnits()Lsoot/UnitPatchingChain;
at soot.jimple.infoflow.cfg.LibraryClassPatcher.patchHandlerPostBody(LibraryClassPatcher.java:559)
at soot.jimple.infoflow.cfg.LibraryClassPatcher.patchHandlerImplementation(LibraryClassPatcher.java:458)
at soot.jimple.infoflow.cfg.LibraryClassPatcher.patchLibraries(LibraryClassPatcher.java:60)
at soot.jimple.infoflow.android.SetupApplication.initializeSoot(SetupApplication.java:1097)
at soot.jimple.infoflow.android.SetupApplication.runInfoflow(SetupApplication.java:1333)
at soot.jimple.infoflow.android.SetupApplication.constructCallgraph(SetupApplication.java:1204)
I am attaching my code. May you please see what mistake I am doing while constructing CallGraph...I think the issue is with Jars... Please suggest which Jar versions I have to use? I am using Java 8 OpenJDK. Please help
@jyotigajrani If you have a new question, please do not post that question into an existing thread that deals with an unrelated topic. Please always open a new thread if you have a new topic or issue to discuss.
Still, the new matter: It should work when you download the newest version of Soot and compile it. FlowDroid currently depends on the development branch of Soot, until we have a new release of Soot, which should be available shortly.
Thanks a lot @StevenArzt It worked...
Hey, Im trying to build a call graph for all the methods of an apk. More precisely I would like to know for each methods all the methods that it calls. When using:
SetupApplication app = new SetupApplication(androidJarPath, apkPath); app.constructCallgraph();It works great but the methods who are unreachable(unused) do not seem to appear in the call graph. I have tried to use the soot options "all-reachable" but this did not help.What am I doing wrong? Thanks in advanced!
Hey, how did you set the soot options "all-reachable" in flowdroid? Thank you~