Пример #1
0
 private static boolean checkMethodUsedByBaseClassOrInterface(
     BytecodeMethod mtd, ByteCodeClass cls) {
   if (cls == null) {
     return false;
   }
   if (cls.getBaseInterfacesObject() != null) {
     for (ByteCodeClass bc : cls.getBaseInterfacesObject()) {
       for (BytecodeMethod m : bc.getMethods()) {
         if (m.getMethodName().equals(mtd.getMethodName())) {
           if (m.isUsedByNative()) {
             return true;
           }
           break;
         }
       }
     }
   }
   for (BytecodeMethod m : cls.getMethods()) {
     if (m.getMethodName().equals(mtd.getMethodName())) {
       if (m.isUsedByNative()) {
         return true;
       }
       break;
     }
   }
   return false;
 }
Пример #2
0
 private static void appendClassOffset(ByteCodeClass bc, List<Integer> clsIds) {
   if (bc.getBaseClassObject() != null) {
     if (!clsIds.contains(bc.getBaseClassObject().getClassOffset())) {
       clsIds.add(bc.getBaseClassObject().getClassOffset());
       appendClassOffset(bc.getBaseClassObject(), clsIds);
     }
   }
   if (bc.getBaseInterfacesObject() != null) {
     for (ByteCodeClass c : bc.getBaseInterfacesObject()) {
       if (c != null && !clsIds.contains(c.getClassOffset())) {
         clsIds.add(c.getClassOffset());
         if (c.getBaseClassObject() != null) {
           appendClassOffset(c, clsIds);
         }
       }
     }
   }
 }
Пример #3
0
 private static boolean isMethodUsedByBaseClassOrInterface(BytecodeMethod mtd, ByteCodeClass cls) {
   boolean b = checkMethodUsedByBaseClassOrInterface(mtd, cls.getBaseClassObject());
   if (b) {
     return true;
   }
   for (ByteCodeClass bc : cls.getBaseInterfacesObject()) {
     b = checkMethodUsedByBaseClassOrInterface(mtd, bc);
     if (b) {
       return true;
     }
   }
   return false;
 }