add getMethods

pull/46/head
Milk 3 years ago
parent 24a5a78dc4
commit 07e25ef1df
  1. 13
      Bcore/src/main/java/top/niunaijun/blackbox/core/VMCore.java

@ -160,6 +160,7 @@ public class VMCore {
} }
} }
try {
Method[] declaredMethods = aClass.getDeclaredMethods(); Method[] declaredMethods = aClass.getDeclaredMethods();
for (Method declaredMethod : declaredMethods) { for (Method declaredMethod : declaredMethods) {
if (declaredMethod.getName().equals(methodName)) { if (declaredMethod.getName().equals(methodName)) {
@ -171,6 +172,18 @@ public class VMCore {
} }
} catch (Throwable ignored) { } catch (Throwable ignored) {
} }
Method[] declaredMethods = aClass.getMethods();
for (Method declaredMethod : declaredMethods) {
if (declaredMethod.getName().equals(methodName)) {
String desc = MethodUtils.getDesc(declaredMethod);
if (desc.equals(signature)) {
return declaredMethod;
}
}
}
} catch (Throwable ignored) {
}
return null; return null;
} }
} }

Loading…
Cancel
Save