[Soot-list] Generating Android method call graph

Tek Hai teklishtheman at gmail.com
Mon Oct 27 06:36:41 EDT 2014


Hi guys, 

I am trying to generate a method call graph of an android application using 
soot. [using the flowdroid dummy method as an entry point]. The code is as 
follows :

               SetupApplication app=new SetupApplication(args[1],args[0]);
app.calculateSourcesSinksEntrypoints("SourcesAndSinks.txt");
soot.G.reset();
Options.v().set_src_prec(Options.src_prec_apk);
Options.v().set_process_dir(Collections.singletonList(args[0]));
Options.v().set_android_jars(args[1]);
Options.v().set_whole_program(true);
Options.v().set_allow_phantom_refs(true);
Options.v().set_output_format(Options.output_format_class);
Options.v().setPhaseOption("cg.spark", "on");
Scene.v().loadNecessaryClasses();
SootMethod entryPoint=app.getEntryPointCreator().createDummyMain();
Options.v().set_main_class(entryPoint.getSignature());
Scene.v().setEntryPoints(Collections.singletonList(entryPoint));
System.out.println(entryPoint.getActiveBody());
 PackManager.v().runPacks(); 
                System.out.println(Scene.v().getCallGraph().toString());

Where: args[0] is an apk file and args[1] is android platforms directory. 
This, however, gives me a textual output of method invocations. Is there 
any way I can get that result as a graph (method call graph)?
Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20141027/1e930e68/attachment.html 


More information about the Soot-list mailing list