<div dir="ltr"><div><div><span style="font-family:arial,helvetica,sans-serif">Hi Steven,<br><br></span></div><span style="font-family:arial,helvetica,sans-serif">I have 2 doubts regarding how flowdroid works.<br><br></span></div><span style="font-family:arial,helvetica,sans-serif">Firstly,
I created a simple android application that makes a function call to
get the deviceID from the phone and passes the value as a string to
another function which will write the value into a logfile. The code
snippet is as follows<br><br></span><pre style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-size:9pt"><span style="font-family:arial,helvetica,sans-serif">TelephonyManager manager = (TelephonyManager) getSystemService(Context.<span style="color:rgb(102,14,122);font-weight:bold;font-style:italic">TELEP<wbr>HONY_SERVICE</span>);<br>String deviceid = manager.getDeviceId();<br><span style="color:rgb(128,128,128);font-style:italic">//Device Id is IMEI number<br></span>Log.<span style="font-style:italic">d</span>(<span style="color:rgb(0,128,0);font-weight:bold">"msg"</span>, <span style="color:rgb(0,128,0);font-weight:bold">"Device id" </span>+ deviceid);<br>System.<span style="color:rgb(102,14,122);font-weight:bold;font-style:italic">out</span>.println(<span style="color:rgb(0,128,0);font-weight:bold">"msg Device id" </span>+ deviceid);<br><span style="color:rgb(128,128,128);font-style:italic">//callFunc<br></span>myFunc(deviceid);</span></pre><pre style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-size:9pt"><span style="font-family:arial,helvetica,sans-serif"><span style="color:rgb(0,0,128);font-weight:bold">public boolean </span>myFunc(String info) {<br> Log.<span style="font-style:italic">d</span>(<span style="color:rgb(0,128,0);font-weight:bold">"msg"</span>, <span style="color:rgb(0,128,0);font-weight:bold">"Device id" </span>+ info);<br> System.<span style="color:rgb(102,14,122);font-weight:bold;font-style:italic">out</span>.<span style="background-color:rgb(228,228,255)">println</span>(<span style="color:rgb(0,128,0);font-weight:bold">"msg Device id++++" </span>);<br> <span style="color:rgb(0,0,128);font-weight:bold">return true</span>;<br>}</span></pre><span style="font-family:arial,helvetica,sans-serif"><br>However, it looks like flowdroid is not able to find the flow from the source function, </span><pre style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-size:9pt"><span style="font-family:arial,helvetica,sans-serif">getDeviceId() to the sink function, <span style="font-style:italic">d</span>(<span style="color:rgb(0,128,0);font-weight:bold">"msg"</span>, <span style="color:rgb(0,128,0);font-weight:bold">"Device id" </span>+ info). I am wondering why this might be the reason.<br><br><br></span></pre><pre style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-size:9pt"><span style="font-family:arial,helvetica,sans-serif">Secondly, I had inserted some print statements under the run function in the IFDSSolver.java file as shown below.<br><br>if(icfg.isExitStmt(edge.<wbr>getTarget())<br>{<br> System.out.println("run(): ExitStmt: "+"edge: factAtSrc: " + edge.factAtSource()+" getTgt: "+edge.getTarget()+" factAtTgt: "+edge.factAtTarget());<br> processExit(edge);<br>}<br></span><pre style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-size:9pt"><span style="font-family:arial,helvetica,sans-serif">When I look at the output, I saw some statements like the following statements.</span></pre><span style="font-family:arial,helvetica,sans-serif">run(): ExitStmt: edge: factAtSrc: zero(null_type) <+length> | >> getTgt: $r0 := @this: com.android.tools.fd.runtime.<wbr>BootstrapApplication factAtTgt: _$r1(android.app.Application$<wbr>OnProvideAssistDataListener) * <+length> | $r1 := @parameter0: android.app.Application$<wbr>OnProvideAssistDataListener>><br></span></pre><pre style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-family:"DejaVu Sans Mono";font-size:9pt"><span style="font-family:arial,helvetica,sans-serif">This statement does not look like an exit statement. I am wondering why it is considered as an exit statement. An exit statement is usually a return statement right?<br><br></span></pre><pre style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-family:"DejaVu Sans Mono";font-size:9pt"><span style="font-family:arial,helvetica,sans-serif">Thank you so much for any clarifications.<br><br></span></pre><pre style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-family:"DejaVu Sans Mono";font-size:9pt"><span style="font-family:arial,helvetica,sans-serif">Regards<br>Shaila</span></pre><br></div>