<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 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
        {font-family:Menlo;
        panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        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;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Vorformatiert Zchn";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Sprechblasentext Zchn";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.HTMLVorformatiertZchn
        {mso-style-name:"HTML Vorformatiert Zchn";
        mso-style-priority:99;
        mso-style-link:"HTML Vorformatiert";
        font-family:Consolas;
        mso-fareast-language:DE;}
span.E-MailFormatvorlage19
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.SprechblasentextZchn
        {mso-style-name:"Sprechblasentext Zchn";
        mso-style-priority:99;
        mso-style-link:Sprechblasentext;
        font-family:"Tahoma","sans-serif";
        mso-fareast-language:DE;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
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=DE link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Hi Jason,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Normally, you never have to explicitly load a method. Soot will automatically load all methods of all classes on your process-dir for you. These classes are also automatically set as application classes. For your analysis or transformation, you register a BodyTransformer or a SceneTransformer and then call Soot’s main method. Soot will make sure that all application classes are properly loaded before invoking your custom transformers.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Soot can be thought of as a compiler pipeline. You put your program in and register different actions that shall be done to it. In Soot, these actions are organized in packs and phases (see <a href="http://www.bodden.de/2008/11/26/soot-packs/">http://www.bodden.de/2008/11/26/soot-packs/</a>). The framework handles all the rest such as loading classes, finding dependencies, and so on.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>There are some special cases in which you need to deviate from this path, but those are rare and then you need to exactly know when to do what. Loading a method body for instance only works if the method can have a body at all. If it’s, for instance, native or abstract and you try to load its body, you’ll get the exception you have reported. That’s what I meant with “inner workings”: Normally, the framework does all these checks and gives you a valid Scene to work with inside your transformers.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Best regards,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>  Steven<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></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"'> Jason Ott [mailto:jott002@ucr.edu] <br><b>Gesendet:</b> Freitag, 24. Juli 2015 18:46<br><b>An:</b> Steven Arzt<br><b>Cc:</b> soot-list@cs.mcgill.ca<br><b>Betreff:</b> Re: [Soot-list] No Method Source Set for Method &lt;{method signature here}&gt;<o:p></o:p></span></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><div><p class=MsoNormal>This is the &quot;inner workings&quot;?&nbsp; I thought retrieving method bodies was one of the basic functionalities of Soot.&nbsp; I was looking through the source on Github, and I don't fully understand why Soot can properly retrieve the class, but the method bodies aren't being built properly; while both are concrete.&nbsp; I don't think I'm misusing Soot by using it in this way.&nbsp; Is there something more concrete or a more direct path you could direct me to help me understand this problem more fully.<o:p></o:p></p></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p><div><p class=MsoNormal>On Fri, Jul 24, 2015 at 9:39 AM, Steven Arzt &lt;<a href="mailto:Steven.Arzt@cased.de" target="_blank">Steven.Arzt@cased.de</a>&gt; wrote:<o:p></o:p></p><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Hi Jason,</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>&nbsp;</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>You are really accessing internals of Soot. This is something I would generally avoid unless you have a very thorough understanding of Soot’s inner workings. If you for instance try to load the body of a non-concrete method (which by definition cannot have a body), this will fail. Since you are accessing the loader directly, you have to take care of all of that stuff on your own.</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>&nbsp;</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Best regards,</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>&nbsp; Steven </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>&nbsp;</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>Von:</span></b><span lang=EN-US 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 Auf</b></span><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>trag von </span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>Jason Ott<br><b>Gesendet:</b> Freitag, 24. Juli 2015 02:22<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] No Method Source Set for Method &lt;{method signature here}&gt;</span><o:p></o:p></p><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>I have a thread that identifies a class to bring into the Soot Scene.&nbsp; I do so through the following method:<o:p></o:p></p><div><pre style='background:#2B2B2B'><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#CC7832'>protected synchronized </span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#A9B7C6'>SootClass </span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#FFC66D'>bringClassToScene</span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#A9B7C6'>(String className) {<br>&nbsp;&nbsp;&nbsp; SootClass sootClass</span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#CC7832'>;<br>&nbsp;&nbsp;&nbsp; </span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#A9B7C6'>sootClass = Scene.<i>v</i>().forceResolve(className</span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#CC7832'>, </span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#A9B7C6'>SootClass.</span><i><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#9876AA'>BODIES</span></i><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#A9B7C6'>)</span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#CC7832'>;<br>&nbsp;&nbsp;&nbsp; </span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#A9B7C6'>sootClass.setApplicationClass()</span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#CC7832'>;<br>&nbsp;&nbsp;&nbsp; return </span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#A9B7C6'>sootClass</span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#CC7832'>;<br></span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#A9B7C6'>}</span><o:p></o:p></pre><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Which is invoked by means of: <span style='font-family:"Menlo","serif";color:#A9B7C6;background:#2B2B2B'>SootClass sootClass = bringClassToScene(</span><span style='font-family:"Menlo","serif";color:#A9B7C6;background:#344134'>className</span><span style='font-family:"Menlo","serif";color:#A9B7C6;background:#2B2B2B'>)</span><span style='font-family:"Menlo","serif";color:#CC7832'>;</span><o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p></div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>className is simply a string in the format: &quot;path.to.package.ClassName&quot;.<o:p></o:p></p><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>I then try to get the active bodies of a method in the class by means of:&nbsp;<o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-family:"Menlo","serif";color:#A9B7C6;background:#2B2B2B'>for(SootMethod m : sootClass.getMethods()) {</span><o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-family:"Menlo","serif";color:#A9B7C6;background:#2B2B2B'>Body body = m.retrieveActiveBody()</span><span style='font-family:"Menlo","serif";color:#CC7832'>;</span><o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-family:"Menlo","serif";color:#CC7832'>// do other work here</span><o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-family:"Menlo","serif";color:#CC7832'>}</span><o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p></div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>At which point I get the following error:&nbsp;<o:p></o:p></p><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>java.lang.RuntimeException: No method source set for method <span style='background:#EA9999'>&lt;com.android.server.power.PowerManagerService$BinderService: void &lt;init&gt;(com.android.server.power.PowerManagerService)&gt;</span><o:p></o:p></p><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='background:#EA9999'>Error retrieving active body of: &lt;com.android.server.power.PowerManagerService$BinderService: void &lt;init&gt;(com.android.server.power.PowerManagerService)&gt;</span><o:p></o:p></p></div></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>I am using Soot with the following arguments:<o:p></o:p></p></div><div><pre style='background:#2B2B2B'><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#A9B7C6'>-cp /path/to/classes/:/path/to/other/classes/:. -f J -w -allow-phantom-refs</span><o:p></o:p></pre><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><br>I do not understand why Soot cannot fetch the active body of a given method.&nbsp; This doesn't happen with every method, but I have not been able to discern any pattern.<o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Thanks,<o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Jason<o:p></o:p></p></div></div></div></div></div></div></div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div></div></body></html>