FlowDroid icon indicating copy to clipboard operation
FlowDroid copied to clipboard

Call graph for unreachable methods

Open gilm501 opened this issue 8 years ago • 6 comments

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!

gilm501 avatar Sep 02 '18 22:09 gilm501

@StevenArzt

gilm501 avatar Sep 08 '18 09:09 gilm501

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.

StevenArzt avatar Sep 10 '18 08:09 StevenArzt

@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

gh.txt

jyotigajrani avatar Dec 09 '18 07:12 jyotigajrani

@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.

StevenArzt avatar Dec 10 '18 10:12 StevenArzt

Thanks a lot @StevenArzt It worked...

jyotigajrani avatar Dec 12 '18 03:12 jyotigajrani

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~

ws1994 avatar Jun 05 '19 03:06 ws1994