/** * Constructs a NewInterfaceInvokeExpr(Local base, SootMethodRef method, List of Immediate) grammar chunk. */ public InterfaceInvokeExpr newInterfaceInvokeExpr(Local base, SootMethodRef method, Value... args) { return newInterfaceInvokeExpr(base, method, Arrays.asList(args)); }
public InterfaceInvokeExpr newInterfaceInvokeExpr(Local base, SootMethodRef method, Value arg) { return newInterfaceInvokeExpr(base, method, Collections.<Value>singletonList(arg)); }
public InterfaceInvokeExpr newInterfaceInvokeExpr(Local base, SootMethodRef method) { return newInterfaceInvokeExpr(base, method, Collections.<Value>emptyList()); }
public soot.jimple.InterfaceInvokeExpr newInterfaceInvokeExpr(Local base, SootMethodRef method, java.util.List args, ASTNode location) { soot.jimple.InterfaceInvokeExpr expr = Jimple.v().newInterfaceInvokeExpr(base, method, args); createTag(expr, location); for(int i = 0; i < args.size(); i++) { soot.tagkit.Tag tag = getTag((Value)args.get(i)); if(tag != null) expr.getArgBox(i).addTag(tag); } return expr; }
public void outANonstaticInvokeExpr(ANonstaticInvokeExpr node) { List args; if (node.getArgList() != null) { args = (List) mProductions.removeLast(); } else { args = new ArrayList(); } SootMethodRef method = (SootMethodRef) mProductions.removeLast(); String local = (String) mProductions.removeLast(); Local l = mLocals.get(local); if (l == null) { throw new RuntimeException("did not find local: " + local); } Node invokeType = node.getNonstaticInvoke(); Expr invokeExpr; if (invokeType instanceof ASpecialNonstaticInvoke) { invokeExpr = Jimple.v().newSpecialInvokeExpr(l, method, args); } else if (invokeType instanceof AVirtualNonstaticInvoke) { invokeExpr = Jimple.v().newVirtualInvokeExpr(l, method, args); } else { if (debug) { if (!(invokeType instanceof AInterfaceNonstaticInvoke)) { throw new RuntimeException("expected interface invoke."); } } invokeExpr = Jimple.v().newInterfaceInvokeExpr(l, method, args); } mProductions.addLast(invokeExpr); }
/** Executes the "jimplify" operation for an interface invocation */ protected void jimplifyInterface(DexBody body) { // In some applications, VirtualInvokes are disguised as InterfaceInvokes. // We fix this silently SootMethodRef ref = getInterfaceSootMethodRef(); if (!ref.declaringClass().isInterface()) { jimplifyVirtual(body); return; } MethodReference item = (MethodReference) ((ReferenceInstruction) instruction).getReference(); List<Local> parameters = buildParameters(body, item.getParameterTypes(), false); invocation = Jimple.v().newInterfaceInvokeExpr(parameters.get(0), ref, parameters.subList(1, parameters.size())); body.setDanglingInstruction(this); }
invocation = Jimple.v().newInterfaceInvokeExpr(invoker, ref, parms); } else { invocation = Jimple.v().newVirtualInvokeExpr(invoker, ref, parms);
Local libObj = args.remove(args.size() - 1); if (origIE instanceof InterfaceInvokeExpr) { ie = Jimple.v().newInterfaceInvokeExpr(libObj, sm.makeRef(), args); } else if (origIE instanceof VirtualInvokeExpr) { ie = Jimple.v().newVirtualInvokeExpr(libObj, sm.makeRef(), args);
iinvoke = Jimple.v().newVirtualInvokeExpr(base, ref, argList); } else if (op == INVOKEINTERFACE) { iinvoke = Jimple.v().newInterfaceInvokeExpr(base, ref, argList); } else { throw new AssertionError("Unknown invoke op:" + op);
return Jimple.v().newStaticInvokeExpr(methodRef, args); case REF_INVOKE_INTERFACE: return Jimple.v().newInterfaceInvokeExpr(args.get(0), methodRef, rest(args)); case REF_INVOKE_VIRTUAL: return Jimple.v().newVirtualInvokeExpr(args.get(0), methodRef, rest(args));
invoke = soot.jimple.Jimple.v().newStaticInvokeExpr(methToCall, params); } else if (soot.Modifier.isInterface(receiverTypeClass.getModifiers()) && call.methodInstance().flags().isAbstract()) { invoke = soot.jimple.Jimple.v().newInterfaceInvokeExpr(baseLocal, methToCall, params); } else { invoke = soot.jimple.Jimple.v().newVirtualInvokeExpr(baseLocal, methToCall, params);
for (String className : RTI.classForNameClassNames(m)) { InterfaceInvokeExpr invokeExpr = Jimple.v().newInterfaceInvokeExpr(setLocal, addMethodRef, StringConstant.v(callSiteId + className)); newUnits.add(Jimple.v().newInvokeStmt(invokeExpr)); for (String className : RTI.classNewInstanceClassNames(m)) { InterfaceInvokeExpr invokeExpr = Jimple.v().newInterfaceInvokeExpr(setLocal, addMethodRef, StringConstant.v(callSiteId + className)); newUnits.add(Jimple.v().newInvokeStmt(invokeExpr)); for (String constrSig : RTI.constructorNewInstanceSignatures(m)) { InterfaceInvokeExpr invokeExpr = Jimple.v().newInterfaceInvokeExpr(setLocal, addMethodRef, StringConstant.v(callSiteId + constrSig)); newUnits.add(Jimple.v().newInvokeStmt(invokeExpr)); for (String methodSig : RTI.methodInvokeSignatures(m)) { InterfaceInvokeExpr invokeExpr = Jimple.v().newInterfaceInvokeExpr(setLocal, addMethodRef, StringConstant.v(callSiteId + methodSig)); newUnits.add(Jimple.v().newInvokeStmt(invokeExpr));
invokeExpr = soot.jimple.Jimple.v().newInterfaceInvokeExpr(baseLocal, callMethod, sootParams); } else if (methodInstance.flags().isStatic()) {
rvalue = Jimple.v().newInterfaceInvokeExpr(Util.v().getLocalForStackOp(listBody, typeStack, typeStack.topIndex()), methodRef, Arrays.asList(params));
InvokeExpr invoke; if (sc.isInterface()) { invoke = Jimple.v().newInterfaceInvokeExpr(originActivityParameterLocal, method.makeRef(), args); } else { invoke = Jimple.v().newVirtualInvokeExpr(originActivityParameterLocal, method.makeRef(), args);
b.getUnits().add(Jimple.v().newInvokeStmt(Jimple.v().newInterfaceInvokeExpr(firstParam, Scene.v().makeMethodRef(runnable, "run", Collections.<Type>emptyList(), VoidType.v(), false))));
Jimple.v().newInterfaceInvokeExpr(targetLocal, runnable.getMethod("void run()").makeRef())));
rvalue = Jimple.v().newInterfaceInvokeExpr(Util.v().getLocalForStackOp(listBody, typeStack, typeStack.topIndex()), methodRef, Arrays.asList(params));
rvalue = Jimple.v().newInterfaceInvokeExpr(Util.v().getLocalForStackOp(listBody, typeStack, typeStack.topIndex()), methodRef, Arrays.asList(params));