<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
code
        {mso-style-priority:99;
        font-family:"Courier New";}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
span.hoenzb
        {mso-style-name:hoenzb;}
span.EmailStyle22
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.EmailStyle23
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Hu Yury,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Did you add the addBasicClass() call before calling loadNecessaryClasses()? Did you try retrieveActiveBody() instead of getActiveBody()?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">The problem is most likely not with overloads, but with on-demand loading. As I wrote, Soot only loads what is ultimately necessary. That means, if the callgraph
 algorithm, for example, accesses some overload A of the method, but not some other overload B, it will only load A’s body, and not the one of B, even though both are overloads of the same method. What you need to do is tell Soot that you want the respective
 body anyway.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Best regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">  Steven<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Dr. Yury Zhauniarovich [mailto:yzhauniarovich@hbku.edu.qa]
<br>
<b>Sent:</b> Tuesday, February 28, 2017 11:29 AM<br>
<b>To:</b> Arzt, Steven <steven.arzt@sit.fraunhofer.de>; loscoccia@gmail.com<br>
<b>Cc:</b> soot-list@cs.mcgill.ca<br>
<b>Subject:</b> Re: [Soot-list] Soot cannot get the body and the callers of the overloaded method<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">Hi Gian Luca, Steven,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">First of all, thank you for your tips. Gian Luca,<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal">Where did you get the android framework files? Keep in mind that those that those that come with Flowdroid (<a href="https://github.com/secure-software-engineering/soot-infoflow-android">https://github.com/secure-software-engineering/soot-infoflow-android</a>)
 only contain stubs/summaries of many methods. You have to get your own android jar files.<o:p></o:p></p>
</div>
</blockquote>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">To get the corresponding jar and dex filex I've build Android, so I know that they contain all the information inside.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Steven, I've added the following code into my app:<o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal">SootClass clz = Scene.v().getSootClass("android.os.ServiceManager");<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">System.out.println("IsPhantom: " + clz.isPhantom());<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">System.out.println("Resolving Level: " + clz.resolvingLevel());<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">The output is the following:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">IsPhantom: false<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Resolving Level: 3<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">It seems that the output is the one that you've assumed. However, the error is still there. Moreover, this does not explains why I get the correct data for the first method, but not for the second <b>overloaded</b> method. I guess there
 maybe a bug in Soot dealing with the overloaded methods.<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">-- <o:p></o:p></p>
<div>
<p class="MsoNormal">Best Regards,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Yury Zhauniarovich<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">On Tue, 2017-02-28 at 09:54 +0000, Arzt, Steven wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Hi Yuri,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">There are several possible explanations for the behavior you encounter. One is that Soot didn’t actually find the class. Can you check whether the class ServiceManager
 is a phantom, i.e., isPhantom() returns true on the SootClass? If that is the case, the class is probably missing from the JAR file you are using.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">An alternative explanation would be that the class is there, but is not loaded. The easiest solution would be to do something like this right before you call
 loadNecessaryClasses():<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">                Scene.v().addBasicClass(“android.os.ServiceManager”, SootClass.BODIES);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">That line tells Soot to load this class and all method bodies inside it, even if would normally be excluded for some reason. To see whether a class was loaded
 (and to which extent), check the “resolvingLevel” property of the SootClass. You need level 3 (=SootClass.BODIES) to be able to have bodies. Since method bodies are loaded on demand, you might have level 3 and no bodies in some cases. In that case, SootMethod.retrieveActiveBody()
 should do the trick. That might all sound complex at first, but the core idea is that Soot only loads what is ultimately necessary to improve speed and reduce memory pressure.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Best regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">  Steven<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Soot-list [<a href="mailto:soot-list-bounces@cs.mcgill.ca">mailto:soot-list-bounces@cs.mcgill.ca</a>]
<b>On Behalf Of </b>Gian Luca Scoccia<br>
<b>Sent:</b> Tuesday, February 28, 2017 10:44 AM<br>
<b>To:</b> Dr. Yury Zhauniarovich <<a href="mailto:yzhauniarovich@hbku.edu.qa">yzhauniarovich@hbku.edu.qa</a>><br>
<b>Cc:</b> <a href="mailto:soot-list@CS.McGill.CA">soot-list@CS.McGill.CA</a><br>
<b>Subject:</b> Re: [Soot-list] Soot cannot get the body and the callers of the overloaded method<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">Where did you get the android framework files? Keep in mind that those that those that come with Flowdroid (<a href="https://github.com/secure-software-engineering/soot-infoflow-android">https://github.com/secure-software-engineering/soot-infoflow-android</a>)
 only contain stubs/summaries of many methods. You have to get your own android jar files.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">2017-02-28 8:26 GMT+01:00 Dr. Yury Zhauniarovich <<a href="mailto:yzhauniarovich@hbku.edu.qa" target="_blank">yzhauniarovich@hbku.edu.qa</a>>:<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt">
<div>
<div>
<p class="MsoNormal">Dear community,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I faced with a problem and do not know how to solve an issue and what is its cause. I would be glad if someone can point me for a direction.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I have the following issue with Soot. I try to analyze the Android framework files. In particular, I would like to find all places in the code where system services are added, the corresponding method signatures are defined in the smAddMethodSignatures
 array (see the code in the end).<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">When I ran the following code, I am able to find the callers and the body of the method for the first signature but not for the second. For the second signature, the active body is an empty string, and there are no caller, although from
 the sources it is obvious that such methods exist. Here is the error when I try to get active body:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<pre style="margin-bottom:12.0pt;background:#F7F7F7;box-sizing:border-box;word-wrap:normal;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;overflow:auto"><code><span style="font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0in">Exception in thread "main" java.lang.RuntimeException: no active body present for method <android.os.ServiceManager: void addService(java.lang.String,android.os.IBinder,boolean)><o:p></o:p></span></code></pre>
<pre style="margin-bottom:12.0pt;background:#F7F7F7"><code><span style="font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0in">       at soot.SootMethod.getActiveBody(SootMethod.java:323)<o:p></o:p></span></code></pre>
<pre style="margin-bottom:12.0pt;background:#F7F7F7"><code><span style="font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0in">       at com.tmp.BAnalysisApp.getRegisteredServicesClasses(BAnalysisApp.java:85)<o:p></o:p></span></code></pre>
<pre style="margin-bottom:12.0pt;background:#F7F7F7"><code><span style="font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0in">       at com.tmp.BAnalysisApp.main(BAnalysisApp.java:47)</span></code><o:p></o:p></pre>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I am a novice with Soot, and I may miss something. However, it seems to me that there is a bug in Soot analyzing overloaded methods. I also filled an issue in the tracker with a pretty 700 number: <a href="https://github.com/Sable/soot/issues/700" target="_blank">https://github.com/Sable/soot/issues/700</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Here is the code of an MWE that I use:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<pre style="background:#F7F7F7;box-sizing:border-box;word-wrap:normal;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;overflow:auto"><code><span style="font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0in">import java.util.Collections;<o:p></o:p></span></code></pre>
<pre style="background:#F7F7F7"><code><span style="font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0in">import java.util.Iterator;<o:p></o:p></span></code></pre>
<pre style="background:#F7F7F7"><code><span style="font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0in">import java.util.List;<o:p></o:p></span></code></pre>
<pre style="background:#F7F7F7"><code><span style="font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0in"><o:p> </o:p></span></code></pre>
<pre style="background:#F7F7F7"><code><span style="font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0in">import soot.PackManager;<o:p></o:p></span></code></pre>
<pre style="background:#F7F7F7"><code><span style="font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0in">import soot.Scene;<o:p></o:p></span></code></pre>
<pre style="background:#F7F7F7"><code><span style="font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0in">import soot.SootClass;<o:p></o:p></span></code></pre>
<pre style="background:#F7F7F7"><code><span style="font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0in">import soot.SootMethod;<o:p></o:p></span></code></pre>
<pre style="background:#F7F7F7"><code><span style="font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0in">import soot.jimple.toolkits.callgraph.CallGraph;<o:p></o:p></span></code></pre>
<pre style="background:#F7F7F7"><code><span style="font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0in">import soot.jimple.toolkits.callgraph.Edge;<o:p></o:p></span></code></pre>
<pre style="background:#F7F7F7"><code><span style="font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0in">import soot.options.Options;<o:p></o:p></span></code></pre>
<pre style="background:#F7F7F7"><code><span style="font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0in"><o:p> </o:p></span></code></pre>
<pre style="background:#F7F7F7"><code><span style="font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0in">public class BAnalysisApp {<o:p></o:p></span></code></pre>
<pre style="background:#F7F7F7"><code><span style="font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0in">    private final static String SERVICES_DEX_DIR_PATH = "/home/yury/tmp/tmp_services/";<o:p></o:p></span></code></pre>
<pre style="background:#F7F7F7"><code><span style="font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0in">    private final static String ANDROID_BOOT_JAR_PATH = "/home/yury/tmp/android-boot-25.jar";<o:p></o:p></span></code></pre>
<pre style="background:#F7F7F7"><code><span style="font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0in"><o:p> </o:p></span></code></pre>
<pre style="background:#F7F7F7"><code><span style="font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0in">    // searched method signatures<o:p></o:p></span></code></pre>
<pre style="background:#F7F7F7"><code><span style="font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0in">    // public static void addService(String name, IBinder service)<o:p></o:p></span></code></pre>
<pre style="background:#F7F7F7"><code><span style="font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0in">    // public static void addService(String name, IBinder service, boolean allowIsolated)<o:p></o:p></span></code></pre>
<pre style="background:#F7F7F7"><code><span style="font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0in">    private final static String[] smAddMethodSignatures = {<o:p></o:p></span></code></pre>
<pre style="background:#F7F7F7"><code><span style="font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0in">           "<android.os.ServiceManager: void addService(java.lang.String,android.os.IBinder)>",<o:p></o:p></span></code></pre>
<pre style="background:#F7F7F7"><code><span style="font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0in">           "<android.os.ServiceManager: void addService(java.lang.String,android.os.IBinder,boolean)>" };<o:p></o:p></span></code></pre>
<pre style="background:#F7F7F7"><code><span style="font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0in"><o:p> </o:p></span></code></pre>
<pre style="background:#F7F7F7"><code><span style="font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0in">    public static void main(String[] args) {<o:p></o:p></span></code></pre>
<pre style="background:#F7F7F7"><code><span style="font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0in">       prepareSoot();<o:p></o:p></span></code></pre>
<pre style="background:#F7F7F7"><code><span style="font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0in">       List<SootClass> registeredServices = getRegisteredServicesClasses();<o:p></o:p></span></code></pre>
<pre style="background:#F7F7F7"><code><span style="font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0in">    }<o:p></o:p></span></code></pre>
<pre style="background:#F7F7F7"><code><span style="font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0in"><o:p> </o:p></span></code></pre>
<pre style="background:#F7F7F7"><code><span style="font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0in">    private static void prepareSoot() {<o:p></o:p></span></code></pre>
<pre style="background:#F7F7F7"><code><span style="font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0in">       soot.G.reset();<o:p></o:p></span></code></pre>
<pre style="background:#F7F7F7"><code><span style="font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0in">       Options.v().set_src_prec(Options.src_prec_apk);<o:p></o:p></span></code></pre>
<pre style="background:#F7F7F7"><code><span style="font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0in">       Options.v().set_process_dir(Collections.singletonList(SERVICES_DEX_DIR_PATH));<o:p></o:p></span></code></pre>
<pre style="background:#F7F7F7"><code><span style="font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0in">       Options.v().set_process_multiple_dex(true);<o:p></o:p></span></code></pre>
<pre style="background:#F7F7F7"><code><span style="font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0in">       Options.v().set_force_android_jar(ANDROID_BOOT_JAR_PATH);<o:p></o:p></span></code></pre>
<pre style="background:#F7F7F7"><code><span style="font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0in">       Options.v().set_whole_program(true);<o:p></o:p></span></code></pre>
<pre style="background:#F7F7F7"><code><span style="font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0in">       Options.v().set_allow_phantom_refs(true);<o:p></o:p></span></code></pre>
<pre style="background:#F7F7F7"><code><span style="font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0in">       Options.v().set_output_format(Options.output_format_none);<o:p></o:p></span></code></pre>
<pre style="background:#F7F7F7"><code><span style="font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0in">       Options.v().setPhaseOption("cg.spark", "on");<o:p></o:p></span></code></pre>
<pre style="background:#F7F7F7"><code><span style="font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0in">       Scene.v().loadNecessaryClasses();<o:p></o:p></span></code></pre>
<pre style="background:#F7F7F7"><code><span style="font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0in">       PackManager.v().runPacks();<o:p></o:p></span></code></pre>
<pre style="background:#F7F7F7"><code><span style="font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0in">    }<o:p></o:p></span></code></pre>
<pre style="background:#F7F7F7"><code><span style="font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0in"><o:p> </o:p></span></code></pre>
<pre style="background:#F7F7F7"><code><span style="font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0in">    private static List<SootClass> getRegisteredServicesClasses() {<o:p></o:p></span></code></pre>
<pre style="background:#F7F7F7"><code><span style="font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0in">       final CallGraph cg = Scene.v().getCallGraph();<o:p></o:p></span></code></pre>
<pre style="background:#F7F7F7"><code><span style="font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0in">       for (String mthSig : smAddMethodSignatures) {<o:p></o:p></span></code></pre>
<pre style="background:#F7F7F7"><code><span style="font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0in">           SootMethod smAddServiceMth = Scene.v().grabMethod(mthSig);<o:p></o:p></span></code></pre>
<pre style="background:#F7F7F7"><code><span style="font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0in">           System.out.println(mthSig);<o:p></o:p></span></code></pre>
<pre style="background:#F7F7F7"><code><span style="font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0in">            //printing the body<o:p></o:p></span></code></pre>
<pre style="background:#F7F7F7"><code><span style="font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0in">           System.out.println(smAddServiceMth.getActiveBody().toString());<o:p></o:p></span></code></pre>
<pre style="background:#F7F7F7"><code><span style="font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0in">            //iterating over the caller methods<o:p></o:p></span></code></pre>
<pre style="background:#F7F7F7"><code><span style="font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0in">           Iterator<Edge> edgeIterator = cg.edgesInto(smAddServiceMth);<o:p></o:p></span></code></pre>
<pre style="background:#F7F7F7"><code><span style="font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0in">           while (edgeIterator.hasNext()) {<o:p></o:p></span></code></pre>
<pre style="background:#F7F7F7"><code><span style="font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0in">               Edge mtdEdge = edgeIterator.next();<o:p></o:p></span></code></pre>
<pre style="background:#F7F7F7"><code><span style="font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0in">               SootMethod srcMtd = mtdEdge.src();<o:p></o:p></span></code></pre>
<pre style="background:#F7F7F7"><code><span style="font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0in">               System.out.println(srcMtd.getSignature());<o:p></o:p></span></code></pre>
<pre style="background:#F7F7F7"><code><span style="font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0in">               System.out.println(mtdEdge.srcStmt().toString());<o:p></o:p></span></code></pre>
<pre style="background:#F7F7F7"><code><span style="font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0in">           }<o:p></o:p></span></code></pre>
<pre style="background:#F7F7F7"><code><span style="font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0in">       }<o:p></o:p></span></code></pre>
<pre style="background:#F7F7F7"><code><span style="font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0in">       return null;<o:p></o:p></span></code></pre>
<pre style="background:#F7F7F7"><code><span style="font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0in">    }<o:p></o:p></span></code></pre>
<pre style="background:#F7F7F7"><code><span style="font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0in">}</span></code><o:p></o:p></pre>
</div>
<div>
<p class="MsoNormal"><span style="color:#888888"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="color:#888888"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="color:#888888">-- <o:p></o:p></span></p>
<div>
<p class="MsoNormal"><span style="color:#888888">Best Regards,<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="color:#888888">Yury Zhauniarovich<o:p></o:p></span></p>
</div>
</div>
<div>
<p class="MsoNormal"><span style="color:#888888"><o:p> </o:p></span></p>
</div>
<p class="MsoNormal"><span style="color:#888888"><br>
<span class="hoenzb">CONFIDENTIALITY NOTICE:</span><br>
<span class="hoenzb">This email and any attachments transmitted with it are confidential and intended for the use of individual or entity to which it is addressed. If you have received this email in error, please delete it immediately and inform the sender.
 Unless you are the intended recipient, you may not use, disclose, copy or distribute this email or any attachments included. The contents of this email, including any attachments, may be subjected to copyright law. In such cases, the contents may not be copied,
 adapted, distributed or transmitted without the consent of the copyright owner.</span></span><o:p></o:p></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
_______________________________________________<br>
Soot-list mailing list<br>
<a href="mailto:Soot-list@CS.McGill.CA">Soot-list@CS.McGill.CA</a><br>
<a href="https://mailman.CS.McGill.CA/mailman/listinfo/soot-list" target="_blank">https://mailman.CS.McGill.CA/mailman/listinfo/soot-list</a><o:p></o:p></p>
</blockquote>
</div>
<p class="MsoNormal"><br>
<br clear="all">
<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal">-- <o:p></o:p></p>
<div>
<div>
<p class="MsoNormal">_______________________________________________________<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Ph.D. Student at <a href="http://www.gssi.infn.it" target="_blank">
Gran Sasso Science Institute (GSSI)</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><a href="http://cs.gssi.infn.it/people/scoccia/" target="_blank">Personal Page</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><a href="https://it.linkedin.com/in/gianlucascoccia" target="_blank">Linkedin Profile</a><o:p></o:p></p>
</div>
</div>
</div>
</div>
</blockquote>
<p class="MsoNormal"><br>
CONFIDENTIALITY NOTICE:<br>
This email and any attachments transmitted with it are confidential and intended for the use of individual or entity to which it is addressed. If you have received this email in error, please delete it immediately and inform the sender. Unless you are the intended
 recipient, you may not use, disclose, copy or distribute this email or any attachments included. The contents of this email, including any attachments, may be subjected to copyright law. In such cases, the contents may not be copied, adapted, distributed or
 transmitted without the consent of the copyright owner.<o:p></o:p></p>
</div>
</body>
</html>