<div dir="ltr">This is the &quot;inner workings&quot;?  I thought retrieving method bodies was one of the basic functionalities of Soot.  I was looking through the source on Github, and I don&#39;t fully understand why Soot can properly retrieve the class, but the method bodies aren&#39;t being built properly; while both are concrete.  I don&#39;t think I&#39;m misusing Soot by using it in this way.  Is there something more concrete or a more direct path you could direct me to help me understand this problem more fully.</div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 24, 2015 at 9:39 AM, Steven Arzt <span dir="ltr">&lt;<a href="mailto:Steven.Arzt@cased.de" target="_blank">Steven.Arzt@cased.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="DE" link="blue" vlink="purple"><div><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Hi Jason,<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;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.<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Best regards,<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">  Steven <u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">Von:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"> <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:&quot;Tahoma&quot;,&quot;sans-serif&quot;">trag von </span></b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">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;<u></u><u></u></span></p><div><div class="h5"><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal">I have a thread that identifies a class to bring into the Soot Scene.  I do so through the following method:<u></u><u></u></p><div><pre style="background:#2b2b2b"><span style="font-size:12.0pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#cc7832">protected synchronized </span><span style="font-size:12.0pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#a9b7c6">SootClass </span><span style="font-size:12.0pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#ffc66d">bringClassToScene</span><span style="font-size:12.0pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#a9b7c6">(String className) {<br>    SootClass sootClass</span><span style="font-size:12.0pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#cc7832">;<br>    </span><span style="font-size:12.0pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#a9b7c6">sootClass = Scene.<i>v</i>().forceResolve(className</span><span style="font-size:12.0pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#cc7832">, </span><span style="font-size:12.0pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#a9b7c6">SootClass.</span><i><span style="font-size:12.0pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#9876aa">BODIES</span></i><span style="font-size:12.0pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#a9b7c6">)</span><span style="font-size:12.0pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#cc7832">;<br>    </span><span style="font-size:12.0pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#a9b7c6">sootClass.setApplicationClass()</span><span style="font-size:12.0pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#cc7832">;<br>    return </span><span style="font-size:12.0pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#a9b7c6">sootClass</span><span style="font-size:12.0pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#cc7832">;<br></span><span style="font-size:12.0pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#a9b7c6">}<u></u><u></u></span></pre><p class="MsoNormal">Which is invoked by means of: <span style="font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#a9b7c6;background:#2b2b2b">SootClass sootClass = bringClassToScene(</span><span style="font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#a9b7c6;background:#344134">className</span><span style="font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#a9b7c6;background:#2b2b2b">)</span><span style="font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#cc7832">;</span><u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><p class="MsoNormal">className is simply a string in the format: &quot;path.to.package.ClassName&quot;.<u></u><u></u></p><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">I then try to get the active bodies of a method in the class by means of: <u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#a9b7c6;background:#2b2b2b">for(SootMethod m : sootClass.getMethods()) {</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#a9b7c6;background:#2b2b2b">Body body = m.retrieveActiveBody()</span><span style="font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#cc7832">;</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#cc7832">// do other work here</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#cc7832">}</span><u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><p class="MsoNormal">At which point I get the following error: <u></u><u></u></p><div><p class="MsoNormal"><u></u> <u></u></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><u></u><u></u></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><u></u><u></u></p></div></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">I am using Soot with the following arguments:<u></u><u></u></p></div><div><pre style="background:#2b2b2b"><span style="font-size:12.0pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#a9b7c6">-cp /path/to/classes/:/path/to/other/classes/:. -f J -w -allow-phantom-refs<u></u><u></u></span></pre><p class="MsoNormal"><br>I do not understand why Soot cannot fetch the active body of a given method.  This doesn&#39;t happen with every method, but I have not been able to discern any pattern.<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">Thanks,<u></u><u></u></p></div><div><p class="MsoNormal">Jason<u></u><u></u></p></div></div></div></div></div></div></blockquote></div><br></div>