mirror of
https://github.com/ReaJason/MemShellParty.git
synced 2026-09-24 16:01:52 +08:00
refactor: rm useless code
This commit is contained in:
@@ -13,27 +13,11 @@ import net.bytebuddy.dynamic.DynamicType;
|
|||||||
* @since 2024/12/9
|
* @since 2024/12/9
|
||||||
*/
|
*/
|
||||||
public class TemplateUtils {
|
public class TemplateUtils {
|
||||||
public static final String ANN_INV_HANDLER_CLASS = "sun.reflect.annotation.AnnotationInvocationHandler";
|
|
||||||
public static Class TPL_CLASS = TemplatesImpl.class;
|
|
||||||
public static Class ABST_TRANSLET = AbstractTranslet.class;
|
|
||||||
public static Class TRANS_FACTORY = TransformerFactoryImpl.class;
|
|
||||||
|
|
||||||
static {
|
|
||||||
try {
|
|
||||||
// 兼容不同 JDK 版本
|
|
||||||
if (Boolean.parseBoolean(System.getProperty("properXalan", "false"))) {
|
|
||||||
TPL_CLASS = Class.forName("org.apache.xalan.xsltc.trax.TemplatesImpl");
|
|
||||||
ABST_TRANSLET = Class.forName("org.apache.xalan.xsltc.runtime.AbstractTranslet");
|
|
||||||
TRANS_FACTORY = Class.forName("org.apache.xalan.xsltc.trax.TransformerFactoryImpl");
|
|
||||||
}
|
|
||||||
} catch (Exception ignored) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@SneakyThrows
|
@SneakyThrows
|
||||||
public static TemplatesImpl createTemplatesImpl(byte[] bytes) {
|
public static TemplatesImpl createTemplatesImpl(byte[] bytes) {
|
||||||
TemplatesImpl templates = new TemplatesImpl();
|
TemplatesImpl templates = new TemplatesImpl();
|
||||||
byte[] fooBytes = new byte[0];
|
byte[] fooBytes;
|
||||||
try (DynamicType.Unloaded<Object> make = new ByteBuddy()
|
try (DynamicType.Unloaded<Object> make = new ByteBuddy()
|
||||||
.subclass(Object.class).name("foo")
|
.subclass(Object.class).name("foo")
|
||||||
.make()) {
|
.make()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user