<div dir="ltr">Hi Steven,<div><br></div><div>Thanks for the reply! I had not considered the implications of the Android lifecycle and the fact that there isn&#39;t a single entry point as there would be with normal Java code. It looks like I will be able to get what I need from the single method, extracted via iCfg.getOrCreateUnitGraph(method).<br></div><div><br></div><div>Thank you again for your help</div><div><br></div><div>Katie</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 19 November 2015 at 02:38, Steven Arzt <span dir="ltr">&lt;<a href="mailto:Steven.Arzt@cased.de" target="_blank">Steven.Arzt@cased.de</a>&gt;</span> wrote:<br><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 lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Hi Katie,<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">If you are looking for paths, what are the start and end points of these paths? In a normal Java program, you could say that you take the beginning of the main method as the start point of all your paths and the point(s) where the control flow leaves the main method as the end point(s) of your paths. In Android, there is no such single entry point into the app that could serve as a natural start and end point of a path. That’s also why there is no easy access to “all paths” in FlowDroid: It’s totally unclear what such paths should look like. We do have a couple of path notations, though:<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><u></u><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><span>1.<span style="font:7.0pt &quot;Times New Roman&quot;">       </span></span></span><u></u><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Taint propagation paths. They start at a source and go wherever the respective taint goes.<u></u><u></u></span></p><p><u></u><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><span>2.<span style="font:7.0pt &quot;Times New Roman&quot;">       </span></span></span><u></u><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Source-to-sink paths: A subset of the taint propagation paths, namely those that end up in a sink.<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">Unrelated to data flows, there are also other path notations one could think of:<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><u></u><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><span>1.<span style="font:7.0pt &quot;Times New Roman&quot;">       </span></span></span><u></u><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Control flow paths through a single method. That’s available in the iCfg.<u></u><u></u></span></p><p><u></u><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><span>2.<span style="font:7.0pt &quot;Times New Roman&quot;">       </span></span></span><u></u><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Control flow paths from the beginning of the dummy main method which emulates the Android lifecycle to the end of that dummy main method. You can build that from the iCfg. When using those, you however need to be really careful about the semantics of your results (i.e., what does such a path represent in the end?). This would essentially be a single trajectory through the app given a specific interaction of the Android OS and the user with the app. Usually, the set of those trajectories is of infinite 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>kaunder<br><b>Gesendet:</b> Donnerstag, 19. November 2015 06:51<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] FlowDroid - full set of nodes for calculating diameter of control-flow graph?<u></u><u></u></span></p><div><div class="h5"><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal">Hello All,<u></u><u></u></p><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">Another FlowDroid question for you. I&#39;m interested in calculating the diameter (i.e. the longest path out of the set of shortest paths between all nodes) of the control-flow graph that FlowDroid uses for it&#39;s analysis. I have been working under the assumption that this graph is the variable iCfg of type InfoflowCFG in the class soot.jimple.infoflow.Infoflow.java. However, InfoflowCFG does not appear to have a way to access the set of all nodes in the control flow graph. <u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">The closest thing I&#39;ve found appears to be the sets of Units returned by InfoflowCFG.getNonCallEndNodes() and InfoflowCFG.getNonCallStartNodes(), but clearly this is not the full set of nodes in the graph. I made an attempt at an approximate calculation by running the Floyd-Warshall algorithm on the union of these two sets, but my calculated diameter was significantly smaller than I would expect so I assume that I&#39;m still missing a lot of nodes.<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">Is there a way to get access the set of all nodes in the graph, so that I can use them in a shortest-path algorithm? Or is there another class that I should be looking at?<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">Thanks and regards,<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">Katie<u></u><u></u></p></div></div></div></div></div></div></blockquote></div><br></div>