Filter instanceInvokesFilter = new Filter(new InstanceInvokeEdgesPred());
String modifierOptions = "unsafe";
//HashMap instanceToStaticMap = new HashMap();
Scene.v().setCallGraph(new CallGraph());
CallGraph cg = Scene.v().getCallGraph();
Iterator classesIt = Scene.v().getApplicationClasses().iterator();
while (classesIt.hasNext()) {
SootClass c = (SootClass) classesIt.next();
LinkedList methodsList = new LinkedList();
methodsList.addAll(c.getMethods());
while (!methodsList.isEmpty()) {
SootMethod container = (SootMethod) methodsList.removeFirst();
if (!container.isConcrete()) {
// System.out.println("skipping " + container + ": not concrete");
continue;
}
if (!instanceInvokesFilter.wrap(cg.edgesOutOf(container))
.hasNext()) {
continue;
}
JimpleBody b = (JimpleBody) container.getActiveBody();
List unitList = new ArrayList();
unitList.addAll(b.getUnits());
Iterator unitIt = unitList.iterator();
while (unitIt.hasNext()) {
Stmt s = (Stmt) unitIt.next();
if (!s.containsInvokeExpr()) {
continue;
}
InvokeExpr ie = s.getInvokeExpr();
if (ie instanceof StaticInvokeExpr
|| ie instanceof SpecialInvokeExpr) {
// System.out.println("skipping " + container + ":" +
// s + ": not virtual");
continue;
}
Iterator targets = new Targets(cg.edgesOutOf(s));
if (!targets.hasNext()) {
continue;
}