Example #1
0
 public ResolvedEntry resolve(SootClass clazz) {
   while (clazz != null) {
     for (SootMethod m : clazz.getMethods()) {
       if (m.getName().equals(name) && desc.equals(Types.getDescriptor(m))) {
         return new ResolvedEntry(this, m);
       }
     }
     clazz = clazz.hasSuperclass() ? clazz.getSuperclass() : null;
   }
   return null;
 }
 private Type signatureToType(String desc) {
   String rawDesc = desc.replaceAll("<.*>", "");
   String internalName = rawDesc.replaceAll("^\\[*", "");
   int dims = rawDesc.length() - internalName.length();
   internalName = Types.getInternalNameFromDescriptor(internalName);
   soot.Type sootType = SootResolver.v().makeClassRef(internalName.replace('/', '.')).getType();
   for (int i = 0; i < dims; i++) {
     sootType = sootType.makeArrayType();
   }
   SootMethod m = new SootMethod("foo", Arrays.asList(sootType), VoidType.v());
   m.addTag(new SignatureTag("(" + desc + ")V"));
   SootMethodType mType = new SootMethodType(m);
   return mType.getGenericParameterTypes()[0];
 }
Example #3
0
 public Entry getEntry(SootMethod method) {
   if (!Modifier.isPublic(method.getModifiers())) {
     return null;
   }
   return findEntry(method.getName(), Types.getDescriptor(method));
 }
Example #4
0
 Entry(int index, SootMethod method) {
   this(index, method.getName(), Types.getDescriptor(method));
 }