/** * Adds a flow from the given source to the given sink to the given method * summary * * @param source The source at which the data flow starts * @param sink The sink at which the data flow ends * @param isAlias True if the source and sink alias, otherwise false * @param summaries The method summary to which to add the data flow */ protected void addFlow(FlowSource source, FlowSink sink, boolean isAlias, MethodSummaries summaries) { // Convert the method signature into a subsignature String methodSubSig = SootMethodRepresentationParser.v().parseSootMethodString(method).getSubSignature(); // Ignore identity flows if (isIdentityFlow(source, sink)) return; MethodFlow mFlow = new MethodFlow(methodSubSig, source, sink, isAlias, true, false); if (summaries.addFlow(mFlow)) debugMSG(source, sink, isAlias); }
.getSubSignature()); SootMethod sootMethod = grabMethodWithoutReturn(className, subSignatureWithoutReturnType); if (sootMethod != null) String className = method.getClassName(); String subSignatureWithoutReturnType = (((MethodSourceSinkDefinition) sourceSinkDef) .getMethod().getSubSignature()); SootMethod sootMethod = grabMethodWithoutReturn(className, subSignatureWithoutReturnType); if (sootMethod != null)
SootMethodAndClass methodAndClass = SootMethodRepresentationParser.v().parseSootMethodString(method); SootMethod methodToInvoke = findMethod(Scene.v().getSootClass(methodAndClass.getClassName()), methodAndClass.getSubSignature());
for (String methodSig : applicationCallbackClasses.get(sc)) { SootMethodAndClass methodAndClass = SootMethodRepresentationParser.v().parseSootMethodString(methodSig); String subSig = methodAndClass.getSubSignature(); SootMethod method = findMethod(Scene.v().getSootClass(sc.getName()), subSig);
for (String methodSig : applicationCallbackClasses.get(sc)){ SootMethodAndClass methodAndClass = SootMethodRepresentationParser.v().parseSootMethodString(methodSig); String subSig = methodAndClass.getSubSignature(); SootMethod method = findMethod(Scene.v().getSootClass(sc.getName()), subSig);
SootMethodAndClass methodAndClass = SootMethodRepresentationParser.v().parseSootMethodString(method); SootMethod currentMethod = findMethod(Scene.v().getSootClass(methodAndClass.getClassName()), methodAndClass.getSubSignature()); if (currentMethod == null) { logger.warn("Entry point not found: {}", method);
/** * Gets the flow summaries for the given gap definition, i.e., for the method in * the gap * * @param gap The gap definition * @return The flow summaries for the method in the given gap if they exist, * otherwise null */ private MethodSummaries getFlowSummariesForGap(GapDefinition gap) { // If we have the method in Soot, we can be more clever if (Scene.v().containsMethod(gap.getSignature())) { SootMethod gapMethod = Scene.v().getMethod(gap.getSignature()); ClassSummaries flows = getFlowSummariesForMethod(null, gapMethod, null); if (flows != null && !flows.isEmpty()) { MethodSummaries summaries = new MethodSummaries(); summaries.mergeSummaries(flows.getAllMethodSummaries()); return summaries; } } // If we don't have the method, we can only directly look for the // signature SootMethodAndClass smac = SootMethodRepresentationParser.v().parseSootMethodString(gap.getSignature()); ClassMethodSummaries cms = flows.getMethodFlows(smac.getClassName(), smac.getSubSignature()); return cms == null ? null : cms.getMethodSummaries(); }
methodAndClass.getSubSignature()); if (sm == null) { logger.warn("Method for entry point {} not found in class, skipping...", method);