Skip to content

Commit

Permalink
add getMethods
Browse files Browse the repository at this point in the history
  • Loading branch information
nnjun committed Jul 26, 2021
1 parent 24a5a78 commit 07e25ef
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion Bcore/src/main/java/top/niunaijun/blackbox/core/VMCore.java
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,20 @@ public static Object findMethod(String className, String methodName, String sign
}
}

Method[] declaredMethods = aClass.getDeclaredMethods();
try {
Method[] declaredMethods = aClass.getDeclaredMethods();
for (Method declaredMethod : declaredMethods) {
if (declaredMethod.getName().equals(methodName)) {
String desc = MethodUtils.getDesc(declaredMethod);
if (desc.equals(signature)) {
return declaredMethod;
}
}
}
} catch (Throwable ignored) {
}

Method[] declaredMethods = aClass.getMethods();
for (Method declaredMethod : declaredMethods) {
if (declaredMethod.getName().equals(methodName)) {
String desc = MethodUtils.getDesc(declaredMethod);
Expand Down

0 comments on commit 07e25ef

Please sign in to comment.