protected boolean filterFunction(IMethod function) { return function.getDescriptor().equals(AstMethodReference.fnDesc); }
protected boolean filterFunction(IMethod function) { return function.getDescriptor().equals(AstMethodReference.fnDesc); }
public void visitProgram(FlowGraph flowgraph) { for(IClass klass : cha) { for(IMethod method : klass.getDeclaredMethods()) { if(method.getDescriptor().equals(AstMethodReference.fnDesc)) { visitFunction(flowgraph, method); } } } }
public void visitProgram(FlowGraph flowgraph) { for(IClass klass : cha) { for(IMethod method : klass.getDeclaredMethods()) { if(method.getDescriptor().equals(AstMethodReference.fnDesc)) { visitFunction(flowgraph, method); } } } }
private Collection<IMethod> lookupMethods(IClass c) { Collection<IMethod> matching = new LinkedList<>(); Atom atom = Atom.findOrCreateUnicodeAtom(memberName); Descriptor desc = descriptor == null ? null : Descriptor.findOrCreateUTF8(descriptor); Collection<? extends IMethod> allMethods = c.getAllMethods(); for(IMethod m: allMethods) { if(m.getName().equals(atom) && (desc == null || m.getDescriptor().equals(desc))) { matching.add(m); } } return matching; }
/** * Check if an Entrypoint takes an object. */ public boolean checkNoObjectInEntryPoints() { boolean pass = true; final List <AndroidEntryPoint> entrypoits = AndroidEntryPointManager.ENTRIES; for (AndroidEntryPoint ep : entrypoits) { final TypeName[] params = ep.getMethod().getDescriptor().getParameters(); if (params == null) continue; for (final TypeName type : params) { if (type.equals(TypeReference.JavaLangObject.getName())) { // Why if JavaLangObjectName private? .. narf pass = false; } } } return pass; } }
/** * Check if an Entrypoint takes an object. */ public boolean checkNoObjectInEntryPoints() { boolean pass = true; final List <AndroidEntryPoint> entrypoits = AndroidEntryPointManager.ENTRIES; for (AndroidEntryPoint ep : entrypoits) { final TypeName[] params = ep.getMethod().getDescriptor().getParameters(); if (params == null) continue; for (final TypeName type : params) { if (type.equals(TypeReference.JavaLangObject.getName())) { // Why if JavaLangObjectName private? .. narf pass = false; } } } return pass; } }
logger.trace("[getFuzzyDescriptor]"); logger.trace("- signature: " + m.getSignature()); logger.trace("- descriptor: " + m.getDescriptor().toString());
logger.trace("[getFuzzyDescriptor]"); logger.trace("- signature: " + m.getSignature()); logger.trace("- descriptor: " + m.getDescriptor().toString());
System.err.println(m2.getDeclaringClass().getName() + " " + m2.getName() + m2.getDescriptor());
public static CGNode findInstanceMethod(CallGraph cg, IClass declaringClass, Atom name, Descriptor args) { for (CGNode n : cg) { // System.err.println(n.getMethod().getDeclaringClass() + " " + // n.getMethod().getName() + " " + n.getMethod().getDescriptor()); if (n.getMethod().getDeclaringClass().equals(declaringClass) && n.getMethod().getName().equals(name) && n.getMethod().getDescriptor().equals(args)) { return n; } } Assertions.UNREACHABLE("failed to find method"); return null; }
public static CGNode findStaticMethod(CallGraph cg, Atom name, Descriptor args) { for (CGNode n : cg) { // System.err.println(n.getMethod().getName() + " " + // n.getMethod().getDescriptor()); if (n.getMethod().getName().equals(name) && n.getMethod().getDescriptor().equals(args)) { return n; } } Assertions.UNREACHABLE("failed to find method"); return null; }
logger.trace(Utils.INDENT + "descriptor: " + m.getDescriptor() + " # params: " + m.getNumberOfParameters());
logger.trace(Utils.INDENT + "descriptor: " + m.getDescriptor() + " # params: " + m.getNumberOfParameters());
int numberOfArgs = target.getNumberOfParameters() - (target.isStatic()? 0 : 1); return target.getDescriptor().toString().equals(test.getDescriptor().toString()) && numberOfArgs > 0 && (!WalaUtils.getName(target).equals("<init>")) &&
foundValidCtor = true; if (im.getDescriptor().getNumberOfParameters() == 1) { break; if (ctor.getDescriptor().getNumberOfParameters() == 0) params = new int[] {i}; else {
private static CGNode findMethod(CallGraph cg, Descriptor d, Atom name) { for (CGNode n : Iterator2Iterable.make(cg.getSuccNodes(cg.getFakeRootNode()))) { if (n.getMethod().getName().equals(name) && n.getMethod().getDescriptor().equals(d)) { return n; } } // if it's not a successor of fake root, just iterate over everything for (CGNode n : cg) { if (n.getMethod().getName().equals(name) && n.getMethod().getDescriptor().equals(d)) { return n; } } Assertions.UNREACHABLE("failed to find method " + name); return null; }
public static CGNode findMainMethod(CallGraph cg) { Descriptor d = Descriptor.findOrCreateUTF8("([Ljava/lang/String;)V"); Atom name = Atom.findOrCreateUnicodeAtom("main"); for (CGNode n : Iterator2Iterable.make(cg.getSuccNodes(cg.getFakeRootNode()))) { if (n.getMethod().getName().equals(name) && n.getMethod().getDescriptor().equals(d)) { return n; } } Assertions.UNREACHABLE("failed to find method"); return null; }