<div dir="ltr"><div><div>Got it now.<br></div>So you mean FlowDroid searches for code like addListener(callbackImpl), and only in such cases it will know to instantiate the callback in the dummy main. I'll look into it.<br><br></div>thanks!<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On 7 June 2016 at 00:40, Steven Arzt <span dir="ltr"><<a href="mailto:Steven.Arzt@cased.de" target="_blank">Steven.Arzt@cased.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div link="blue" vlink="purple" lang="DE"><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Hi Denis,<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" lang="EN-US">The list of callbacks was just created by taking all of the interfaces in Android and then ruling out those that are not callbacks. The second step was a manual effort based on the Android documentation.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" lang="EN-US">If you just need to make sure that all methods inside the fragments are called at some point, you still need to identify the fragments and their respective host activity so that fragment methods are associated with the right activity. Once you have that, you can have a simpler extension of the AndroidEntryPointCreator that just calls these methods sequentially.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" lang="EN-US">The AndroidCallbacks file is most likely not going to help you. FlowDroid expects an explicit registration function that registers such callback handlers. With fragments, this is not the case. They are rather defined in the layout XML files.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" lang="EN-US">Best regards,<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" lang="EN-US"> Steven<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">Von:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> <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>Denis Bogdanas<br><b>Gesendet:</b> Montag, 6. Juni 2016 20:37<br><b>An:</b> Steven Arzt<br><b>Cc:</b> <a href="mailto:soot-list@CS.McGill.CA" target="_blank">soot-list@CS.McGill.CA</a><br><b>Betreff:</b> Re: [Soot-list] FlowDroid: adding support for more components<u></u><u></u></span></p><div><div class="h5"><p class="MsoNormal"><u></u> <u></u></p><div><div><div><p class="MsoNormal">Thanks,<u></u><u></u></p></div><p class="MsoNormal" style="margin-bottom:12.0pt"><br>What if I just want to make sure all methods called by the framework on Fragment are included in the call graph? I don't need precise lifecycle modelling. Will my method above work?<u></u><u></u></p></div><p class="MsoNormal" style="margin-bottom:12.0pt">Also, can you please answer to q1? The list of callbacks seems large, I tend to believe it was generated somehow.<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal">On 6 June 2016 at 02:21, Steven Arzt <<a href="mailto:Steven.Arzt@cased.de" target="_blank">Steven.Arzt@cased.de</a>> wrote:<u></u><u></u></p><div><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" lang="EN-US">Hi Denis,</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" lang="EN-US"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" lang="EN-US">We might add support for fragments to FlowDroid in an internal project in the not-so-far future, but I cannot give you a definite schedule for that. If it happens and when it’s done, it will also be merged into the open-source tool.</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" lang="EN-US"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" lang="EN-US">The AndroidCallbacks.txt file doesn’t help here. That file only lists the interfaces that contain callback methods. If such an interface is implemented in the app, all of its methods are considered as callbacks. There is no ordering of callbacks, because they can happen at any time in Android. You can’t tell, for instance, whether there is first an incoming SMS message and then a low battery state or vice versa. Fragments, on the other hand, have a well-defined lifecycle just like an Activity. Even more, the Fragment lifecycle integrates with the one of its parent Activity. To faithfully model this lifecycle, you would have to extend the AndroidEntryPointCreator class. If you want to add this support, look at what we already have in that class. You essentially need to create a bigger and more involved dummy main method.</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" lang="EN-US"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" lang="EN-US">Best regards,</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" lang="EN-US"> Steven</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" lang="EN-US"> </span><u></u><u></u></p><p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">Von:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> <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>Denis Bogdanas<br><b>Gesendet:</b> Montag, 6. Juni 2016 00:41<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: adding support for more components</span><u></u><u></u></p><div><div><p class="MsoNormal"> <u></u><u></u></p><div><div><div><div><p class="MsoNormal">Hi Steven,<u></u><u></u></p></div><p class="MsoNormal" style="margin-bottom:12.0pt">I'm thinking to add support for more Android components to FlowDroid. At least supporting Fragment is a must for my project.<u></u><u></u></p></div><p class="MsoNormal">I have a few questions:<u></u><u></u></p></div><p class="MsoNormal">- How was the file AndroidCallbacks.txt produced? Manually, or through some tool/methodology?<br clear="all"><u></u><u></u></p><div><div><div><div><p class="MsoNormal"> <u></u><u></u></p></div><div><p class="MsoNormal">- To support Fragment: if I just read the top-level fragments from Manifest the way Activity classes are read, and add the Fragment to AndroidCallbacks.txt, will that work? If not, could you suggest what shoud I do?<u></u><u></u></p></div><div><p class="MsoNormal"> <u></u><u></u></p></div><div><p class="MsoNormal">thanks,<u></u><u></u></p></div><div><p class="MsoNormal">-- <u></u><u></u></p><div><div><p class="MsoNormal" style="margin-bottom:12.0pt">Denis<u></u><u></u></p></div></div></div></div></div></div></div></div></div></div></div></div><p class="MsoNormal"><br><br clear="all"><br>-- <u></u><u></u></p><div><div><p class="MsoNormal">Denis<u></u><u></u></p></div></div></div></div></div></div></div></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Denis<br></div></div>
</div>