<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;
font-family:"Calibri",sans-serif;
color:#1F497D;}
span.EmailStyle24
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:#1F497D;}
span.EmailStyle25
{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">Hi 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">Soot supports reading in dex files and converting them to Jimple. Soot does, however, not support modelling the Android lifecycle which is a prerequisite for
creating a callgraph unless you are satisfied with very coarse over-approximations such as treating every public method as a potential entry point. I actually thought you were analyzing an Android app together with the framework, i.e., use some app as the
driver for your framework analysis.<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">If you have main() methods, you should specify them as entry points using Scene.v().setEntryPoints() before you start the callgraph analysis with PackManager.v().runPacks().
Note that there might be some limits to the completeness of the callgraph for those parts in which Android uses reflection or passes data through native methods. I actually haven’t tried a full-fledged framework analysis on Android yet. Let me know how well
that works. Especially those cases in which Android evaluates configuration files to identify the methods to then call via reflection might be an issue.<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">You only need FlowDroid if you need to construct an artificial dummy main() method. If you are fine with those main() methods you already find in the Android
code, you don’t need it.<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> Wednesday, March 1, 2017 7:53 AM<br>
<b>To:</b> Arzt, Steven <steven.arzt@sit.fraunhofer.de><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">Good morning Steven,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Thanks for your reply. However, I do not analyze Android applications, I analyze Android framework. As far as I understand, I do not need Flowdroid for this because Soot already supports dex files. In the case of system services, there
are entry points, e.g., com.android.server.SystemServer contains main method, as well as a set of other services. Do you think that I still need Flowdroid to perform the analysis?<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Thank you for the remind about your thesis. I've seen it among my GScholar recommendations and wanted to read it, but I've forgotten to download it.<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 11:55 +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 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">You can read up on the concept of library classes vs. application classes here:
</span><a href="https://github.com/Sable/soot/wiki/Introduction:-Soot-as-a-command-line-tool"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">https://github.com/Sable/soot/wiki/Introduction:-Soot-as-a-command-line-tool</span></a><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">.
The whole article is a bit dated and focuses on Java, not Android, but the concepts are still pretty much the same aside from the usual surprise here and there.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><br>
For the callgraph, you have hit a more substantial issue. Soot’s callgraph algorithms start from an entry point. For a Java program, that is the main() method. Android apps, on the other hand, do not have a main() method. Consequently, there is nothing the
callgraph builder could work on (aside from some special cases such as JVM handlers, etc.) To solve this problem, you can use FlowDroid to construct a dummy main() method for you. This dummy main method() is equivalent to a pseudo-implementation of the Android
OS for the special case of callgraph construction. It is not executable, it is just good enough to tell the callgraph builder when which method from the app’s individual components are called and in which context. If you want to read up on the details, it’s
in my PhD thesis: </span><a href="http://tuprints.ulb.tu-darmstadt.de/5937/7/Thesis.pdf"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">http://tuprints.ulb.tu-darmstadt.de/5937/7/Thesis.pdf</span></a><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">,
section 4.15 and pretty much all of section 5. If you just want to get something that works, download soot-infoflow and soot-infoflow-android from Github and try this:<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" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">
</span><b><span style="font-size:10.0pt;font-family:Consolas;color:#7F0055">public</span></b><span style="font-size:10.0pt;font-family:Consolas;color:black">
</span><b><span style="font-size:10.0pt;font-family:Consolas;color:#7F0055">static</span></b><span style="font-size:10.0pt;font-family:Consolas;color:black">
</span><b><span style="font-size:10.0pt;font-family:Consolas;color:#7F0055">void</span></b><span style="font-size:10.0pt;font-family:Consolas;color:black"> main(String[]
</span><span style="font-size:10.0pt;font-family:Consolas;color:#6A3E3E">args</span><span style="font-size:10.0pt;font-family:Consolas;color:black">)
</span><b><span style="font-size:10.0pt;font-family:Consolas;color:#7F0055">throws</span></b><span style="font-size:10.0pt;font-family:Consolas;color:black"> IOException, XmlPullParserException {</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">
</span><span style="font-size:10.0pt;font-family:Consolas;color:#3F7F5F">// Initialize Soot</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black"> SetupApplication
</span><span style="font-size:10.0pt;font-family:Consolas;color:#6A3E3E">analyzer</span><span style="font-size:10.0pt;font-family:Consolas;color:black"> =
</span><b><span style="font-size:10.0pt;font-family:Consolas;color:#7F0055">new</span></b><span style="font-size:10.0pt;font-family:Consolas;color:black"> SetupApplication(</span><span style="font-size:10.0pt;font-family:Consolas;color:#2A00FF">"C:\\Program
Files (x86)</span><a href="file://Android/android-sdk/platforms"><span style="font-size:10.0pt;font-family:Consolas">\\Android\\android-sdk\\platforms</span></a><span style="font-size:10.0pt;font-family:Consolas;color:#2A00FF">"</span><span style="font-size:10.0pt;font-family:Consolas;color:black">,</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">
</span><span style="font-size:10.0pt;font-family:Consolas;color:#2A00FF">"D:/org.fdroid.k9_17046.apk"</span><span style="font-size:10.0pt;font-family:Consolas;color:black">);</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">
</span><span style="font-size:10.0pt;font-family:Consolas;color:#6A3E3E">analyzer</span><span style="font-size:10.0pt;font-family:Consolas;color:black">.getConfig().setTaintAnalysisEnabled(</span><b><span style="font-size:10.0pt;font-family:Consolas;color:#7F0055">false</span></b><span style="font-size:10.0pt;font-family:Consolas;color:black">);</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">
</span><span style="font-size:10.0pt;font-family:Consolas;color:#6A3E3E">analyzer</span><span style="font-size:10.0pt;font-family:Consolas;color:black">.<u>calculateSourcesSinksEntrypoints</u>(Collections.<i>emptySet</i>(), Collections.<i>emptySet</i>());</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">
</span><span style="font-size:10.0pt;font-family:Consolas;color:#6A3E3E">analyzer</span><span style="font-size:10.0pt;font-family:Consolas;color:black">.<u>runInfoflow</u>();</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">
</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">
</span><span style="font-size:10.0pt;font-family:Consolas;color:#3F7F5F">// Iterate over the
<u>callgraph</u></span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">
</span><b><span style="font-size:10.0pt;font-family:Consolas;color:#7F0055">for</span></b><span style="font-size:10.0pt;font-family:Consolas;color:black"> (Iterator<Edge>
</span><span style="font-size:10.0pt;font-family:Consolas;color:#6A3E3E">edgeIt</span><span style="font-size:10.0pt;font-family:Consolas;color:black"> = Scene.<i>v</i>().getCallGraph().iterator();
</span><span style="font-size:10.0pt;font-family:Consolas;color:#6A3E3E">edgeIt</span><span style="font-size:10.0pt;font-family:Consolas;color:black">.hasNext(); ) {</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black"> Edge
</span><span style="font-size:10.0pt;font-family:Consolas;color:#6A3E3E">edge</span><span style="font-size:10.0pt;font-family:Consolas;color:black"> =
</span><span style="font-size:10.0pt;font-family:Consolas;color:#6A3E3E">edgeIt</span><span style="font-size:10.0pt;font-family:Consolas;color:black">.next();</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">
</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black"> SootMethod
</span><span style="font-size:10.0pt;font-family:Consolas;color:#6A3E3E">smSrc</span><span style="font-size:10.0pt;font-family:Consolas;color:black"> =
</span><span style="font-size:10.0pt;font-family:Consolas;color:#6A3E3E">edge</span><span style="font-size:10.0pt;font-family:Consolas;color:black">.src();</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black"> Unit
</span><span style="font-size:10.0pt;font-family:Consolas;color:#6A3E3E">uSrc</span><span style="font-size:10.0pt;font-family:Consolas;color:black"> =
</span><span style="font-size:10.0pt;font-family:Consolas;color:#6A3E3E">edge</span><span style="font-size:10.0pt;font-family:Consolas;color:black">.srcStmt();</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black"> SootMethod
</span><span style="font-size:10.0pt;font-family:Consolas;color:#6A3E3E">smDest</span><span style="font-size:10.0pt;font-family:Consolas;color:black"> =
</span><span style="font-size:10.0pt;font-family:Consolas;color:#6A3E3E">edge</span><span style="font-size:10.0pt;font-family:Consolas;color:black">.tgt();</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">
</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black"> System.</span><b><i><span style="font-size:10.0pt;font-family:Consolas;color:#0000C0">out</span></i></b><span style="font-size:10.0pt;font-family:Consolas;color:black">.println(</span><span style="font-size:10.0pt;font-family:Consolas;color:#2A00FF">"Edge
from "</span><span style="font-size:10.0pt;font-family:Consolas;color:black"> + </span>
<span style="font-size:10.0pt;font-family:Consolas;color:#6A3E3E">uSrc</span><span style="font-size:10.0pt;font-family:Consolas;color:black"> +
</span><span style="font-size:10.0pt;font-family:Consolas;color:#2A00FF">" in "</span><span style="font-size:10.0pt;font-family:Consolas;color:black"> +
</span><span style="font-size:10.0pt;font-family:Consolas;color:#6A3E3E">smSrc</span><span style="font-size:10.0pt;font-family:Consolas;color:black"> +
</span><span style="font-size:10.0pt;font-family:Consolas;color:#2A00FF">" to "</span><span style="font-size:10.0pt;font-family:Consolas;color:black"> +
</span><span style="font-size:10.0pt;font-family:Consolas;color:#6A3E3E">smDest</span><span style="font-size:10.0pt;font-family:Consolas;color:black">);</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black"> }</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black"> }</span><span style="font-size:10.0pt;font-family:Consolas"><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 should give you a fairly complete callgraph of the app. There are various knobs you can turn here and there to make trade-offs between precision, completeness,
and performance if you need to. The full story is in my PhD thesis. The most important option is probably whether you want the callbacks to be included or not. Analyzing the callbacks is the process that takes most of the time. The configuration object (returned
by getConfig()) has an option setEnableCallbacks() for that.<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 [</span><a href="mailto:yzhauniarovich@hbku.edu.qa"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">mailto:yzhauniarovich@hbku.edu.qa</span></a><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">]
<br>
<b>Sent:</b> Tuesday, February 28, 2017 12:27 PM<br>
<b>To:</b> Arzt, Steven <</span><a href="mailto:steven.arzt@sit.fraunhofer.de"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">steven.arzt@sit.fraunhofer.de</span></a><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">>;
</span><a href="mailto:loscoccia@gmail.com"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">loscoccia@gmail.com</span></a><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><br>
<b>Cc:</b> </span><a href="mailto:soot-list@cs.mcgill.ca"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">soot-list@cs.mcgill.ca</span></a><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><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">Steven,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">You were right. retrieveActiveBody() does the trick even without addBasicClass() method. However, the set of calling methods is still empty for the second case. Can you please point me what optimizations should I disable in order to list
all methods that call second <span style="font-size:9.0pt;font-family:Consolas;color:#333333;background:#F7F7F7">addService method (now I obtain an empty set)?</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">One more question, is there any source where I can read about these optimizations, besides the sources of Soot:)?<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Thank you in advance! <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:Consolas;color:#333333;background:#F7F7F7"> </span> <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 10:37 +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">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 [</span><a href="mailto:yzhauniarovich@hbku.edu.qa"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">mailto:yzhauniarovich@hbku.edu.qa</span></a><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">]
<br>
<b>Sent:</b> Tuesday, February 28, 2017 11:29 AM<br>
<b>To:</b> Arzt, Steven <</span><a href="mailto:steven.arzt@sit.fraunhofer.de"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">steven.arzt@sit.fraunhofer.de</span></a><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">>;
</span><a href="mailto:loscoccia@gmail.com"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">loscoccia@gmail.com</span></a><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><br>
<b>Cc:</b> </span><a href="mailto:soot-list@cs.mcgill.ca"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">soot-list@cs.mcgill.ca</span></a><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><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 [</span><a href="mailto:soot-list-bounces@cs.mcgill.ca"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">mailto:soot-list-bounces@cs.mcgill.ca</span></a><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">]
<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 <</span><a href="mailto:yzhauniarovich@hbku.edu.qa"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">yzhauniarovich@hbku.edu.qa</span></a><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">><br>
<b>Cc:</b> </span><a href="mailto:soot-list@CS.McGill.CA"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">soot-list@CS.McGill.CA</span></a><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><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>
</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>
</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>