我使用sootclasses-trunk-jar-with-dependencies.jar
为具有API 19的Android应用程序构建CallGraph CHA。
以下是我的代码。
Options.v().set_include_all(true);
Options.v().set_app(true);
soot.Scene.v().loadNecessaryClasses();
//soot.Scene.v().setEntryPoints(EntryPoints.v().all());
HashMap opt = new HashMap();
//opt.put("include-all","true");
//opt.put("app","true");
opt.put("enabled","true");
opt.put("full-resolver","true");
opt.put("verbose", "false");
List<SootMethod> entryPoints = getAllEntryMethods();
logger.info("entry points: "+entryPoints);
Scene.v().setEntryPoints(entryPoints);
CHATransformer.v().transform("", opt);
callGraph = Scene.v().getCallGraph();
}`
所以当到达CHATransformer.v().transform("", opt);
指令时,它给了我以下错误:
Exception in thread "main" soot.SootMethodRefImpl$ClassResolutionFailedException: Class java.lang.Math doesn't have method floorDiv([long, long]) : long; failed to resolve in superclasses and interfacesLooking in java.lang.Math which has methods [<java.lang.Math: void <init>()>, <java.lang.Math: double IEEEremainder(double,double)>, <java.lang.Math: double abs(double)>, <java.lang.Math: float abs(float)>, <java.lang.Math: int abs(int)>, <java.lang.Math: long abs(long)>, <java.lang.Math: double acos(double)>, <java.lang.Math: double asin(double)>, <java.lang.Math: double atan(double)>, <java.lang.Math: double atan2(double,double)>, <java.lang.Math: double cbrt(double)>, <java.lang.Math: double ceil(double)>, ... ... looking in java.lang.Object which has methods [<java.lang.Object: void <init>()>, <java.lang.Object: java.lang.Object internalClone(java.lang.Cloneable)>, <java.lang.Object: java.lang.Object clone()>, <java.lang.Object: boolean equals(java.lang.Object)>, <java.lang.Object: void finalize()>, <java.lang.Object: java.lang.Class getClass()>, <java.lang.Object: int hashCode()>, <java.lang.Object: void notify()>, <java.lang.Object: void notifyAll()>, <java.lang.Object: java.lang.String toString()>, <java.lang.Object: void wait()>, <java.lang.Object: void wait(long)>, <java.lang.Obje```
at soot.SootMethodRefImpl.resolve(SootMethodRefImpl.java:285)
at soot.SootMethodRefImpl.resolve(SootMethodRefImpl.java:183)
at isoot.jimple.internal.AbstractInvokeExpr.getMethod(AbstractInvokeExpr.java:56)
at soot.jimple.toolkits.callgraph.OnFlyCallGraphBuilder.findReceivers(OnFlyCallGraphBuilder.java:801)
at soot.jimple.toolkits.callgraph.OnFlyCallGraphBuilder.processNewMethod(OnFlyCallGraphBuilder.java:763)
at soot.jimple.toolkits.callgraph.OnFlyCallGraphBuilder.processReachables(OnFlyCallGraphBuilder.java:270)
at soot.jimple.toolkits.callgraph.CallGraphBuilder.build(CallGraphBuilder.java:111)
at soot.jimple.toolkits.callgraph.CHATransformer.internalTransform(CHATransformer.java:51)
at soot.SceneTransformer.transform(SceneTransformer.java:36)
at edu.ksu.cis.envgen.analysis.cg.EnvCallGraphCHA.buildCHACallGraphAsTransformer(EnvCallGraphCHA.java:90)
at edu.ksu.cis.envgen.analysis.cg.EnvCallGraphCHA.buildCallGraph(EnvCallGraphCHA.java:60)
at edu.ksu.cis.envgen.applinfo.EnvInterfaceFinder.findInterface(EnvInterfaceFinder.java:145)
at edu.ksu.cis.envgen.EnvGenerator.main(EnvGenerator.java:66)`
如何解决这个问题?