<div dir="ltr">I would like to build a callgraph for each class of the android framework and I am struggling. I haven't found much in the way of documentation or examples for using SPARK in general.<div><br></div><div>I have a basic program that does the following:</div><div><br></div><div>public class DumpClass {</div><div>public static void main(String[] args) {</div><div><br></div><div>Scene.v().loadBasicClasses();<br></div><div><div> <span class="" style="white-space:pre">        </span>SootClass mclass;</div></div><div> mclass = Scene.v().loadClassAndSupport(args[0]);<br></div><div><div> mclass.setApplicationClass();</div><div><br></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("cg.spark", "on");</div><div><span class="" style="white-space:pre">        </span>Scene.v().loadNecessaryClasses();</div><div><br></div><div><span class="" style="white-space:pre">        </span>Options.v().set_main_class(mclass.getMethods().get(0).toString());</div><div><span class="" style="white-space:pre">        </span>PackManager.v().runPacks();</div><div><br></div><div><span style="white-space:pre"> </span>new SparkTest(mclass);</div></div><div> }</div><div>}</div><div><br></div><div>Now, when I run this, I get: Exception in thread "main" java.lang.RuntimeException: There is no main class set!</div><div><br></div><div>I'm not quite sure what to do with that or what to do next if this thing ever works.</div>
</div>