<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";}
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;}
.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 lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Hi Jason,<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'>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.<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 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"'> soot-list-bounces@CS.McGill.CA [mailto:soot-list-bounces@CS.McGill.CA] <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> soot-list@cs.mcgill.ca<br><b>Betreff:</b> [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>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>    SootClass 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'>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>    </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>    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'>}<o:p></o:p></span></pre><p class=MsoNormal>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><o:p>&nbsp;</o:p></p></div><p class=MsoNormal>className is simply a string in the format: &quot;path.to.package.ClassName&quot;.<o:p></o:p></p><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>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><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><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><span style='font-family:"Menlo","serif";color:#CC7832'>// do other work here</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Menlo","serif";color:#CC7832'>}</span><o:p></o:p></p></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><p class=MsoNormal>At which point I get the following error:&nbsp;<o:p></o:p></p><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>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><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><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>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<o:p></o:p></span></pre><p class=MsoNormal><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><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>Thanks,<o:p></o:p></p></div><div><p class=MsoNormal>Jason<o:p></o:p></p></div></div></div></body></html>