<div dir="ltr">Hi,<div><br></div><div>I want to construct a call graph from an entry point, making sure all the classes transitively referenced are loaded along the way. I thought forceResolve() should do the trick, but despite calling it using the following code, I&#39;m still getting some important edges. Could you please tell me if this is the correct way to do so? I don&#39;t want any phantom classes and methods. I have all the necessary class files so I shouldn&#39;t be getting these. Also, could you please tell me the relationship between &quot;addBasicClass()&quot; and rt.jar? If I have the jar in my soot classpath, which classes still need to be added through &quot;addBasicClass()&quot;? Thanks.</div><div><br></div><div><div><span class="" style="white-space:pre">                </span>soot.G.reset();</div><div>               <br></div><div><span class="" style="white-space:pre">                </span>Scene.v().addBasicClass(&quot;java.lang.IllegalArgumentException&quot;, SootClass.SIGNATURES);</div><div><span class="" style="white-space:pre">                </span>Scene.v().addBasicClass(&quot;java.lang.CloneNotSupportedException&quot;, SootClass.SIGNATURES);</div><div><span class="" style="white-space:pre">                </span>Scene.v().addBasicClass(&quot;java.lang.InterruptedException&quot;, SootClass.SIGNATURES);</div><div><span class="" style="white-space:pre">                </span>Scene.v().addBasicClass(&quot;java.lang.StringBuilder&quot;, SootClass.SIGNATURES);</div><div><span class="" style="white-space:pre">                </span>Scene.v().addBasicClass(&quot;java.lang.CharSequence&quot;, SootClass.SIGNATURES);</div><div><span class="" style="white-space:pre">                </span>Scene.v().addBasicClass(&quot;java.security.Security&quot;, SootClass.SIGNATURES);</div><div><span class="" style="white-space:pre">                </span>Scene.v().addBasicClass(&quot;java.io.PrintWriter&quot;, SootClass.SIGNATURES);</div><div><span class="" style="white-space:pre">                </span>Scene.v().addBasicClass(&quot;java.util.Locale&quot;, SootClass.SIGNATURES);</div><div>                // ....</div><div><span class="" style="white-space:pre">                </span><span style="white-space:pre">                </span></div><div><span class="" style="white-space:pre">                </span>Options.v().set_no_bodies_for_excluded(true);</div><div><span class="" style="white-space:pre">                </span>Options.v().set_allow_phantom_refs(false);</div><div><br></div><div><span class="" style="white-space:pre">                </span>Options.v().set_soot_classpath(classesToAnalyze + File.pathSeparator + RT_JAR);</div><div><span class="" style="white-space:pre">                </span>Options.v().set_process_dir(Collections.singletonList(classesToAnalyze));</div><div><br></div><div><span class="" style="white-space:pre">                </span>Options.v().setPhaseOption(&quot;cg.spark&quot;, &quot;on&quot;);</div><div><span class="" style="white-space:pre">                </span>Options.v().setPhaseOption(&quot;cg.spark&quot;, &quot;string-constants:true&quot;);</div><div><span class="" style="white-space:pre">                </span>Options.v().set_whole_program(true);</div><div><span class="" style="white-space:pre">                </span>Options.v().setPhaseOption(&quot;cg&quot;, &quot;trim-clinit:false&quot;);</div><div><span class="" style="white-space:pre">                </span>// do not merge variables (causes problems with PointsToSets)</div><div><span class="" style="white-space:pre">                </span>Options.v().setPhaseOption(&quot;jb.ulp&quot;, &quot;off&quot;);</div><div><span class="" style="white-space:pre">                </span>Options.v().set_src_prec(Options.src_prec_class);</div><div><br></div><div><span class="" style="white-space:pre">                </span>// Set entry point</div><div><span class="" style="white-space:pre">                </span>SootClass mainClass = Scene.v().forceResolve(SOME_METHOD, SootClass.BODIES);</div><div><span class="" style="white-space:pre">                </span>mainClass.setApplicationClass();<span class="" style="white-space:pre">                </span></div><div><span class="" style="white-space:pre">                </span>Scene.v().loadNecessaryClasses();</div><div><span class="" style="white-space:pre">                </span>mainMethod = mainClass.getMethodByName(MAIN_METHOD_NAME);</div><div><span class="" style="white-space:pre">                </span>Scene.v().setEntryPoints(Collections.singletonList(mainMethod));</div><div><br></div><div><span class="" style="white-space:pre">                </span>// Patch the java.lang.Thread implementation</div><div><span class="" style="white-space:pre">                </span>patchThreadImplementation();</div><div><br></div><div><span class="" style="white-space:pre">                </span>PackManager.v().getPack(&quot;wjpp&quot;).apply();</div><div><span class="" style="white-space:pre">                </span>PackManager.v().getPack(&quot;cg&quot;).apply();</div><div><span class="" style="white-space:pre">                </span></div></div></div>