<div dir="ltr">Thanks Steven, I have tried your code, but it still doesn&#39;t give me any result. Could you give me a more concrete example? Maybe include how to query the result. Thanks a lot</div><br><div class="gmail_quote"><div dir="ltr">On Tue, Jul 7, 2015 at 4:45 AM Steven Arzt &lt;<a href="mailto:Steven.Arzt@cased.de">Steven.Arzt@cased.de</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="DE" link="blue" vlink="purple"><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Hi Ding,<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">You are trying to use SPARK on an Android app. SPARK requires an entry point which Android applications, however, do not have. Android apps instead tightly integrate with the Android OS using a pre-defined lifecycle. One approach to build a callgraph for Android apps is thus to generate a dummy entry point (i.e., main method) which simulates the interactions between the app and the OS. You can build such a dummy main method using FlowDroid as follows:<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">             SetupApplication app = new SetupApplication<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">                           (&quot;D:/Tools/adt-bundle-windows-x86_64-20140321/sdk/platforms&quot;,<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">                           &quot;D:/Temp/com.tweakersoft.aroundme-1.apk&quot;);<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">             app.calculateSourcesSinksEntrypoints(&quot;D:/Arbeit/Android Analyse/soot-infoflow-android/SourcesAndSinks.txt&quot;);<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">             soot.G.reset();<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">             <u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">             Options.v().set_src_prec(Options.src_prec_apk);<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">             Options.v().set_process_dir(Collections.singletonList(&quot;D:/Temp/com.tweakersoft.aroundme-1.apk&quot;));<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">             Options.v().set_android_jars(&quot;D:/Tools/adt-bundle-windows-x86_64-20140321/sdk/platforms&quot;);<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">             Options.v().set_whole_program(true);<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">             Options.v().set_allow_phantom_refs(true);<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">             Options.v().set_output_format(Options.output_format_class);<u></u><u></u></span></p></div></div><div lang="DE" link="blue" vlink="purple"><div><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">             Options.v().setPhaseOption(&quot;cg.spark&quot;, &quot;on&quot;);<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">             <u></u><u></u></span></p></div></div><div lang="DE" link="blue" vlink="purple"><div><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">             Scene.v().loadNecessaryClasses();<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">             <u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">             SootMethod entryPoint = app.getEntryPointCreator().createDummyMain();<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">             Options.v().set_main_class(entryPoint.getSignature());<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">             Scene.v().setEntryPoints(Collections.singletonList(entryPoint));<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">             System.out.println(entryPoint.getActiveBody());<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">             <u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">             PackManager.v().runPacks();<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">             JimpleBasedInterproceduralCFG icfg = new JimpleBasedInterproceduralCFG();             <u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">             System.out.println(Scene.v().getCallGraph().size()); <u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Best regards,<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">  Steven<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">Von:</span></b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"> <a href="mailto:soot-list-bounces@CS.McGill.CA" target="_blank">soot-list-bounces@CS.McGill.CA</a> [mailto:<a href="mailto:soot-list-bounces@CS.McGill.CA" target="_blank">soot-list-bounces@CS.McGill.CA</a>] <b>Im Auftrag von </b>Ding Li<br><b>Gesendet:</b> Dienstag, 7. Juli 2015 04:01<br><b>An:</b> <a href="mailto:soot-list@CS.McGill.CA" target="_blank">soot-list@CS.McGill.CA</a><br><b>Betreff:</b> [Soot-list] Recarding spark<u></u><u></u></span></p></div></div><div lang="DE" link="blue" vlink="purple"><div><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal">Hi I have encountered some problem with spark:<u></u><u></u></p><div><p class="MsoNormal">My code is like this:<u></u><u></u></p></div><div><pre style="background:#2b2b2b"><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#a9b7c6">Options.<i>v</i>().set_src_prec(Options.</span><i><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#9876aa">src_prec_apk</span></i><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#a9b7c6">)</span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#cc7832">;<br></span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#a9b7c6">Options.<i>v</i>().set_android_jars(androidpath)</span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#cc7832">;<br></span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#a9b7c6">Options.<i>v</i>().set_whole_program(</span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#cc7832">true</span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#a9b7c6">)</span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#cc7832">;<br></span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#a9b7c6">Options.<i>v</i>().set_verbose(</span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#cc7832">false</span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#a9b7c6">)</span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#cc7832">;<br></span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#a9b7c6">Options.<i>v</i>().setPhaseOption(</span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#6a8759">&quot;cg.spark&quot;</span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#cc7832">, </span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#6a8759">&quot;on&quot;</span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#a9b7c6">)</span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#cc7832">;<br></span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#a9b7c6">Options.<i>v</i>().set_output_format(Options.</span><i><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#9876aa">src_prec_J</span></i><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#a9b7c6">)</span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#cc7832">;<br></span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#a9b7c6">Options.<i>v</i>().set_keep_line_number(</span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#cc7832">true</span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#a9b7c6">)</span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#cc7832">;<br></span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#a9b7c6">Options.<i>v</i>().set_keep_offset(</span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#cc7832">true</span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#a9b7c6">)</span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#cc7832">;<br></span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#a9b7c6">Options.<i>v</i>().set_allow_phantom_refs(</span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#cc7832">true</span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#a9b7c6">)</span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#cc7832">;<br></span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#a9b7c6">Options.<i>v</i>().set_process_dir(path_list)</span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#cc7832">;<br></span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#a9b7c6">Scene.<i>v</i>().loadNecessaryClasses()</span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#cc7832">;<br></span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#a9b7c6">Scene.<i>v</i>().setEntryPoints(entryPoints)</span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#cc7832">;<br></span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#a9b7c6">PackManager.<i>v</i>().runPacks()</span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#cc7832">;<br></span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#a9b7c6">PAG pag=(PAG)Scene.<i>v</i>().getPointsToAnalysis()</span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#cc7832">;<br><br><br></span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:gray">//for any method<br></span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#cc7832">while </span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#a9b7c6">(stmtIt.hasNext()) {<br>    Unit u = (Unit) stmtIt.next()</span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#cc7832">;<br>    </span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#a9b7c6">Stmt stmt=(Stmt)u</span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#cc7832">;<br><br>    if</span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#a9b7c6">(stmt.containsInvokeExpr())<br>    {<br>        InvokeExpr exp = stmt.getInvokeExpr()</span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#cc7832">;<br>        if</span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#a9b7c6">(exp.getUseBoxes().size()&gt;</span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#6897bb">1</span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#a9b7c6">)<br>        {<br>            Value l=exp.getUseBoxes().get(</span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#6897bb">0</span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#a9b7c6">).getValue()</span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#cc7832">;<br>            if</span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#a9b7c6">(l </span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#cc7832">instanceof </span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#a9b7c6">Local)<br>            {<br>                Node n=pag.findLocalVarNode((Local) l)</span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#cc7832">;<br>                </span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#a9b7c6">System.</span><i><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#9876aa">out</span></i><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#a9b7c6">.println(n)</span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#cc7832">; </span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:gray">//it is null<br>                </span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#a9b7c6">PointsToSetInternal pset=(PointsToSetInternal)pag.reachingObjects((Local) l)</span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#cc7832">;<br>                </span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#a9b7c6">System.</span><i><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#9876aa">out</span></i><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#a9b7c6">.println(pset.size())</span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#cc7832">; </span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:gray">//the size is 0<br><br>            </span><span style="font-size:10.5pt;font-family:&quot;Source Code Pro&quot;;color:#a9b7c6">}<br><br><br><br>        }<br><br>    }<br>}<u></u><u></u></span></pre></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">I initialize soot with the first half, and then for any methods, I check the PointedToSet for the first arg of each method invocation. However, for any , I always get size of 0 in the PointedToSet and the Node of the argument in PAG is always null. I think at list the PointedToSet should contain the variable itself and the size should be at least 1, instead of empty. I am not quite sure where is wrong here, what should I set in oder to get pag.reachingObjects return a non-empty set? Thanks<u></u><u></u></p></div></div></div></div></blockquote></div>