<div dir="ltr">I have a thread that identifies a class to bring into the Soot Scene.  I do so through the following method:<div><pre style="background-color:#2b2b2b;color:#a9b7c6;font-family:&#39;Menlo&#39;;font-size:12.0pt"><span style="color:#cc7832">protected synchronized </span>SootClass <span style="color:#ffc66d">bringClassToScene</span>(String className) {<br>    SootClass sootClass<span style="color:#cc7832">;<br></span><span style="color:#cc7832">    </span>sootClass = Scene.<span style="font-style:italic">v</span>().forceResolve(className<span style="color:#cc7832">, </span>SootClass.<span style="color:#9876aa;font-style:italic">BODIES</span>)<span style="color:#cc7832">;<br></span><span style="color:#cc7832">    </span>sootClass.setApplicationClass()<span style="color:#cc7832">;<br></span><span style="color:#cc7832">    return </span>sootClass<span style="color:#cc7832">;<br></span>}<br></pre>Which is invoked by means of: <span style="color:rgb(169,183,198);font-family:Menlo;font-size:12pt;background-color:rgb(43,43,43)">SootClass sootClass = bringClassToScene(</span><span style="color:rgb(169,183,198);font-family:Menlo;font-size:12pt;background-color:rgb(52,65,52)">className</span><span style="color:rgb(169,183,198);font-family:Menlo;font-size:12pt;background-color:rgb(43,43,43)">)</span><span style="font-family:Menlo;font-size:12pt;color:rgb(204,120,50)">;</span></div><div><span style="font-family:Menlo;font-size:12pt;color:rgb(204,120,50)"><br></span></div>className is simply a string in the format: &quot;path.to.package.ClassName&quot;.<div><br></div><div>I then try to get the active bodies of a method in the class by means of: </div><div><font color="#a9b7c6" face="Menlo"><span style="font-size:16px;background-color:rgb(43,43,43)">for(SootMethod m : sootClass.getMethods()) {</span></font></div><div><span style="color:rgb(169,183,198);font-family:Menlo;font-size:12pt;background-color:rgb(43,43,43)">Body body = m.retrieveActiveBody()</span><span style="font-family:Menlo;font-size:12pt;color:rgb(204,120,50)">;</span></div><div><span style="font-family:Menlo;font-size:12pt;color:rgb(204,120,50)">// do other work here</span></div><div><span style="font-family:Menlo;font-size:12pt;color:rgb(204,120,50)">}</span></div><div><span style="font-family:Menlo;font-size:12pt;color:rgb(204,120,50)"><br></span></div>At which point I get the following error: <div><br></div><div>java.lang.RuntimeException: No method source set for method <span style="background-color:rgb(234,153,153)">&lt;com.android.server.power.PowerManagerService$BinderService: void &lt;init&gt;(com.android.server.power.PowerManagerService)&gt;</span><div><span style="background-color:rgb(234,153,153)">Error retrieving active body of: &lt;com.android.server.power.PowerManagerService$BinderService: void &lt;init&gt;(com.android.server.power.PowerManagerService)&gt;</span></div></div><div><br></div><div>I am using Soot with the following arguments:</div><div><pre style="background-color:#2b2b2b;color:#a9b7c6;font-family:&#39;Menlo&#39;;font-size:12.0pt">-cp /path/to/classes/:/path/to/other/classes/:. -f J -w -allow-phantom-refs</pre><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.</div><div><br></div><div>Thanks,</div><div>Jason</div></div>