From c1f20f78d736bd21d282db94cf875d650296117a Mon Sep 17 00:00:00 2001 From: Cat Core Date: Mon, 22 Apr 2024 18:54:10 +0200 Subject: [PATCH] Improve coremods compatibility by a lot + Clean up CCC and NEI compat --- .../fabricatedforge/compat/CompatUtils.java | 1 + .../fabricatedforge/compat/ExtraRemapper.java | 5 +- .../compat/asm/ASMRemapperTransformer.java | 93 +++++++++++++++++++ .../compat/{ => asm}/BetterClassWriter.java | 2 +- .../compat/asm/BetterFieldInsnNode.java | 35 +++++++ .../compat/asm/BetterMethodInsnNode.java | 29 ++++++ .../mixin/codechickencore/ASMHelperMixin.java | 13 --- .../FeatureHackTransformerMixin.java | 29 ------ .../TweakTransformerMixin.java | 37 -------- .../compat/mixin/nei/NEITransformerMixin.java | 28 ------ .../fabricated-forge.mods.mixins.json | 3 - .../fml/relauncher/IClassTransformer.java | 21 +++-- .../fabricatedforge/ForgeModRemapper.java | 2 +- 13 files changed, 179 insertions(+), 119 deletions(-) create mode 100644 mod-compat/src/main/java/fr/catcore/fabricatedforge/compat/asm/ASMRemapperTransformer.java rename mod-compat/src/main/java/fr/catcore/fabricatedforge/compat/{ => asm}/BetterClassWriter.java (96%) create mode 100644 mod-compat/src/main/java/fr/catcore/fabricatedforge/compat/asm/BetterFieldInsnNode.java create mode 100644 mod-compat/src/main/java/fr/catcore/fabricatedforge/compat/asm/BetterMethodInsnNode.java delete mode 100644 mod-compat/src/main/java/fr/catcore/fabricatedforge/compat/mixin/codechickencore/FeatureHackTransformerMixin.java delete mode 100644 mod-compat/src/main/java/fr/catcore/fabricatedforge/compat/mixin/codechickencore/TweakTransformerMixin.java delete mode 100644 mod-compat/src/main/java/fr/catcore/fabricatedforge/compat/mixin/nei/NEITransformerMixin.java diff --git a/mod-compat/src/main/java/fr/catcore/fabricatedforge/compat/CompatUtils.java b/mod-compat/src/main/java/fr/catcore/fabricatedforge/compat/CompatUtils.java index 6a1027e8..21840d08 100644 --- a/mod-compat/src/main/java/fr/catcore/fabricatedforge/compat/CompatUtils.java +++ b/mod-compat/src/main/java/fr/catcore/fabricatedforge/compat/CompatUtils.java @@ -1,5 +1,6 @@ package fr.catcore.fabricatedforge.compat; +import fr.catcore.fabricatedforge.compat.asm.BetterClassWriter; import org.objectweb.asm.ClassReader; import org.objectweb.asm.Opcodes; import org.objectweb.asm.tree.ClassNode; diff --git a/mod-compat/src/main/java/fr/catcore/fabricatedforge/compat/ExtraRemapper.java b/mod-compat/src/main/java/fr/catcore/fabricatedforge/compat/ExtraRemapper.java index c9b79f75..cfbaf559 100644 --- a/mod-compat/src/main/java/fr/catcore/fabricatedforge/compat/ExtraRemapper.java +++ b/mod-compat/src/main/java/fr/catcore/fabricatedforge/compat/ExtraRemapper.java @@ -1,6 +1,8 @@ package fr.catcore.fabricatedforge.compat; +import fr.catcore.fabricatedforge.compat.asm.ASMRemapperTransformer; import fr.catcore.fabricatedforge.util.Utils; +import fr.catcore.modremapperapi.ClassTransformer; import fr.catcore.modremapperapi.api.ModRemapper; import fr.catcore.modremapperapi.remapping.RemapUtil; import fr.catcore.modremapperapi.remapping.VisitorInfos; @@ -35,6 +37,7 @@ public void registerVisitors(VisitorInfos visitorInfos) { @Override public void afterRemap() { Mixins.addConfiguration("fabricated-forge.mods.mixins.json"); - Utils.TRANSFORMER_EXCLUSIONS.add("fr.catcore.fabricatedforge.compat.BetterClassWriter"); + Utils.TRANSFORMER_EXCLUSIONS.add("fr.catcore.fabricatedforge.compat.asm.BetterClassWriter"); + ClassTransformer.registerPostTransformer(new ASMRemapperTransformer()); } } diff --git a/mod-compat/src/main/java/fr/catcore/fabricatedforge/compat/asm/ASMRemapperTransformer.java b/mod-compat/src/main/java/fr/catcore/fabricatedforge/compat/asm/ASMRemapperTransformer.java new file mode 100644 index 00000000..a2100c74 --- /dev/null +++ b/mod-compat/src/main/java/fr/catcore/fabricatedforge/compat/asm/ASMRemapperTransformer.java @@ -0,0 +1,93 @@ +package fr.catcore.fabricatedforge.compat.asm; + +import fr.catcore.modremapperapi.api.IClassTransformer; +import org.objectweb.asm.ClassReader; +import org.objectweb.asm.ClassWriter; +import org.objectweb.asm.Opcodes; +import org.objectweb.asm.tree.*; + +import java.util.HashMap; +import java.util.Map; + +public class ASMRemapperTransformer implements IClassTransformer, Opcodes { + private final static String[] EXCLUDED = new String[]{ + "fr.catcore.", + "cpw.mods.fml.", + "net.minecraftforge.", + "org.objectweb.asm.", + "net.fabricmc.", + "com.llamalad7.", + "org.spongepowered.", + "org.lwjgl." + }; + + private final static Map INSTANCE_REPLACER = arrayToMap(new String[][]{ + {"org/objectweb/asm/tree/FieldInsnNode", "fr/catcore/fabricatedforge/compat/asm/BetterFieldInsnNode"}, + {"org/objectweb/asm/tree/MethodInsnNode", "fr/catcore/fabricatedforge/compat/asm/BetterMethodInsnNode"}, + {"org/objectweb/asm/ClassWriter", "fr/catcore/fabricatedforge/compat/asm/BetterClassWriter"} + }); + + @Override + public boolean handlesClass(String s, String s1) { + for (String exclude : EXCLUDED) { + if (s.startsWith(exclude)) return false; + } + + return true; + } + + @Override + public byte[] transformClass(String s, String s1, byte[] bytes) { + ClassNode classNode = new ClassNode(); + ClassReader classReader = new ClassReader(bytes); + classReader.accept(classNode, 0); + + boolean touched = false; + + for (MethodNode methodNode : classNode.methods) { + AbstractInsnNode insnNode = methodNode.instructions.getFirst(); + + if (insnNode != null) { + while (insnNode != null) { + if (insnNode.getOpcode() == NEW && insnNode instanceof TypeInsnNode) { + TypeInsnNode typeInsnNode = (TypeInsnNode) insnNode; + + if (INSTANCE_REPLACER.containsKey(typeInsnNode.desc)) { + typeInsnNode.desc = INSTANCE_REPLACER.get(typeInsnNode.desc); + touched = true; + } + } else if (insnNode.getOpcode() == INVOKESPECIAL && insnNode instanceof MethodInsnNode) { + MethodInsnNode methodInsnNode = (MethodInsnNode) insnNode; + + if (methodInsnNode.name.equals("") && INSTANCE_REPLACER.containsKey(methodInsnNode.owner)) { + methodInsnNode.owner = INSTANCE_REPLACER.get(methodInsnNode.owner); + touched = true; + } + } + + insnNode = insnNode.getNext(); + } + } + } + + if (touched) { + ClassWriter classWriter = new ClassWriter(3); + classNode.accept(classWriter); + + bytes = classWriter.toByteArray(); + System.out.println("ASMRemapper transformed: " + s); + } + + return bytes; + } + + private static Map arrayToMap(String[][] arrays) { + Map map = new HashMap<>(); + + for (String[] array : arrays) { + map.put(array[0], array[1]); + } + + return map; + } +} diff --git a/mod-compat/src/main/java/fr/catcore/fabricatedforge/compat/BetterClassWriter.java b/mod-compat/src/main/java/fr/catcore/fabricatedforge/compat/asm/BetterClassWriter.java similarity index 96% rename from mod-compat/src/main/java/fr/catcore/fabricatedforge/compat/BetterClassWriter.java rename to mod-compat/src/main/java/fr/catcore/fabricatedforge/compat/asm/BetterClassWriter.java index b76ca45d..39681dd1 100644 --- a/mod-compat/src/main/java/fr/catcore/fabricatedforge/compat/BetterClassWriter.java +++ b/mod-compat/src/main/java/fr/catcore/fabricatedforge/compat/asm/BetterClassWriter.java @@ -1,4 +1,4 @@ -package fr.catcore.fabricatedforge.compat; +package fr.catcore.fabricatedforge.compat.asm; import net.fabricmc.loader.api.FabricLoader; import org.objectweb.asm.ClassReader; diff --git a/mod-compat/src/main/java/fr/catcore/fabricatedforge/compat/asm/BetterFieldInsnNode.java b/mod-compat/src/main/java/fr/catcore/fabricatedforge/compat/asm/BetterFieldInsnNode.java new file mode 100644 index 00000000..d3c49c29 --- /dev/null +++ b/mod-compat/src/main/java/fr/catcore/fabricatedforge/compat/asm/BetterFieldInsnNode.java @@ -0,0 +1,35 @@ +package fr.catcore.fabricatedforge.compat.asm; + +import fr.catcore.fabricatedforge.Constants; +import io.github.fabriccompatibiltylayers.modremappingapi.api.MappingUtils; +import org.objectweb.asm.Type; +import org.objectweb.asm.tree.AbstractInsnNode; +import org.objectweb.asm.tree.FieldInsnNode; +import org.objectweb.asm.tree.LabelNode; + +import java.util.Map; + +public class BetterFieldInsnNode extends FieldInsnNode { + /** + * Constructs a new {@link FieldInsnNode}. + * + * @param opcode the opcode of the type instruction to be constructed. This opcode must be + * GETSTATIC, PUTSTATIC, GETFIELD or PUTFIELD. + * @param owner the internal name of the field's owner class (see {@link + * Type#getInternalName()}). + * @param name the field's name. + * @param descriptor the field's descriptor (see {@link Type}). + */ + public BetterFieldInsnNode(int opcode, String owner, String name, String descriptor) { + this(opcode, Constants.mapClass(owner), Constants.mapFieldFromRemappedClass(Constants.mapClass(owner), name, descriptor)); + } + + private BetterFieldInsnNode(int code, String owner, MappingUtils.ClassMember classMember) { + super(code, owner, classMember.name, Constants.mapTypeDescriptor(classMember.desc)); + } + + @Override + public AbstractInsnNode clone(Map clonedLabels) { + return new BetterFieldInsnNode(opcode, owner, name, desc).cloneAnnotations(this); + } +} diff --git a/mod-compat/src/main/java/fr/catcore/fabricatedforge/compat/asm/BetterMethodInsnNode.java b/mod-compat/src/main/java/fr/catcore/fabricatedforge/compat/asm/BetterMethodInsnNode.java new file mode 100644 index 00000000..c9af73bf --- /dev/null +++ b/mod-compat/src/main/java/fr/catcore/fabricatedforge/compat/asm/BetterMethodInsnNode.java @@ -0,0 +1,29 @@ +package fr.catcore.fabricatedforge.compat.asm; + +import fr.catcore.fabricatedforge.Constants; +import io.github.fabriccompatibiltylayers.modremappingapi.api.MappingUtils; +import org.objectweb.asm.Opcodes; +import org.objectweb.asm.tree.AbstractInsnNode; +import org.objectweb.asm.tree.LabelNode; +import org.objectweb.asm.tree.MethodInsnNode; + +import java.util.Map; + +public class BetterMethodInsnNode extends MethodInsnNode implements Opcodes { + public BetterMethodInsnNode(int opcode, String owner, String name, String descriptor) { + this(opcode, owner, name, descriptor, opcode == Opcodes.INVOKEINTERFACE); + } + + public BetterMethodInsnNode(int opcode, String owner, String name, String descriptor, boolean isInterface) { + this(opcode, Constants.mapClass(owner), Constants.mapMethodFromRemappedClass(Constants.mapClass(owner), name, descriptor), isInterface); + } + + private BetterMethodInsnNode(int opcode, String owner, MappingUtils.ClassMember member, boolean isInterface) { + super(opcode, owner, member.name, Constants.mapMethodDescriptor(member.desc), isInterface); + } + + @Override + public AbstractInsnNode clone(final Map clonedLabels) { + return new BetterMethodInsnNode(opcode, owner, name, desc, itf).cloneAnnotations(this); + } +} diff --git a/mod-compat/src/main/java/fr/catcore/fabricatedforge/compat/mixin/codechickencore/ASMHelperMixin.java b/mod-compat/src/main/java/fr/catcore/fabricatedforge/compat/mixin/codechickencore/ASMHelperMixin.java index 9cafa7ee..d24a01de 100644 --- a/mod-compat/src/main/java/fr/catcore/fabricatedforge/compat/mixin/codechickencore/ASMHelperMixin.java +++ b/mod-compat/src/main/java/fr/catcore/fabricatedforge/compat/mixin/codechickencore/ASMHelperMixin.java @@ -1,11 +1,7 @@ package fr.catcore.fabricatedforge.compat.mixin.codechickencore; import codechicken.core.asm.ASMHelper; -import fr.catcore.fabricatedforge.compat.BetterClassWriter; import fr.catcore.fabricatedforge.compat.CompatUtils; -import org.objectweb.asm.ClassReader; -import org.objectweb.asm.ClassWriter; -import org.objectweb.asm.Opcodes; import org.objectweb.asm.tree.ClassNode; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Overwrite; @@ -20,13 +16,4 @@ public class ASMHelperMixin { public static ClassNode createClassNode(byte[] bytes) { return CompatUtils.createNode(bytes, 0); } - - /** - * @author E - * @reason E - */ - @Overwrite(remap = false) - public static byte[] createBytes(ClassNode cnode, int i) { - return CompatUtils.writeClass(cnode, i); - } } diff --git a/mod-compat/src/main/java/fr/catcore/fabricatedforge/compat/mixin/codechickencore/FeatureHackTransformerMixin.java b/mod-compat/src/main/java/fr/catcore/fabricatedforge/compat/mixin/codechickencore/FeatureHackTransformerMixin.java deleted file mode 100644 index ce8ee84b..00000000 --- a/mod-compat/src/main/java/fr/catcore/fabricatedforge/compat/mixin/codechickencore/FeatureHackTransformerMixin.java +++ /dev/null @@ -1,29 +0,0 @@ -package fr.catcore.fabricatedforge.compat.mixin.codechickencore; - -import codechicken.core.asm.FeatureHackTransformer; -import com.llamalad7.mixinextras.injector.wrapoperation.Operation; -import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; -import fr.catcore.fabricatedforge.Constants; -import io.github.fabriccompatibiltylayers.modremappingapi.api.MappingUtils; -import org.objectweb.asm.tree.*; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; - -@Mixin(FeatureHackTransformer.class) -public class FeatureHackTransformerMixin { - @WrapOperation(method = {"transformer004", "transformer002"}, require = 0, at = @At(value = "NEW", target = "(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lorg/objectweb/asm/tree/FieldInsnNode;"), remap = false) - private FieldInsnNode flf$remapField(int opcode, String owner, String name, String descriptor, Operation original) { - String remappedOwner = Constants.mapClass(owner); - MappingUtils.ClassMember member = Constants.mapFieldFromRemappedClass(remappedOwner, name, descriptor); - - return original.call(opcode, remappedOwner, member.name, Constants.mapTypeDescriptor(member.desc)); - } - - @WrapOperation(method = {"transformer001", "transformer003", "transformer004"}, require = 0, at = @At(value = "NEW", target = "(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lorg/objectweb/asm/tree/MethodInsnNode;"), remap = false) - private MethodInsnNode flf$remapMethod(int opcode, String owner, String name, String descriptor, Operation original) { - String remappedOwner = Constants.mapClass(owner); - MappingUtils.ClassMember member = Constants.mapFieldFromRemappedClass(remappedOwner, name, descriptor); - - return original.call(opcode, remappedOwner, member.name, Constants.mapMethodDescriptor(member.desc)); - } -} diff --git a/mod-compat/src/main/java/fr/catcore/fabricatedforge/compat/mixin/codechickencore/TweakTransformerMixin.java b/mod-compat/src/main/java/fr/catcore/fabricatedforge/compat/mixin/codechickencore/TweakTransformerMixin.java deleted file mode 100644 index dece6418..00000000 --- a/mod-compat/src/main/java/fr/catcore/fabricatedforge/compat/mixin/codechickencore/TweakTransformerMixin.java +++ /dev/null @@ -1,37 +0,0 @@ -package fr.catcore.fabricatedforge.compat.mixin.codechickencore; - -import com.llamalad7.mixinextras.injector.wrapoperation.Operation; -import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; -import fr.catcore.fabricatedforge.Constants; -import io.github.fabriccompatibiltylayers.modremappingapi.api.MappingUtils; -import org.objectweb.asm.tree.*; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; - -@Mixin(targets = { - "codechicken.core.asm.TweakTransformer$1", - "codechicken.core.asm.TweakTransformer$2", - "codechicken.core.asm.TweakTransformer$3", - "codechicken.core.asm.TweakTransformer$4" -}) -public abstract class TweakTransformerMixin { - @WrapOperation(method = "alter", require = 0, - at = @At(value = "NEW", target = "(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lorg/objectweb/asm/tree/FieldInsnNode;"), remap = false) - private FieldInsnNode flf$remapField(int opcode, String owner, String name, String descriptor, Operation original) { - String remappedOwner = Constants.mapClass(owner); - MappingUtils.ClassMember member = Constants.mapFieldFromRemappedClass(remappedOwner, name, descriptor); - - return original.call(opcode, remappedOwner, member.name, Constants.mapTypeDescriptor(member.desc)); - } - - - - @WrapOperation(method = "alter", require = 0, - at = @At(value = "NEW", target = "(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lorg/objectweb/asm/tree/MethodInsnNode;"), remap = false) - private MethodInsnNode flf$remapMethod(int opcode, String owner, String name, String descriptor, Operation original) { - String remappedOwner = Constants.mapClass(owner); - MappingUtils.ClassMember member = Constants.mapFieldFromRemappedClass(remappedOwner, name, descriptor); - - return original.call(opcode, remappedOwner, member.name, Constants.mapMethodDescriptor(member.desc)); - } -} diff --git a/mod-compat/src/main/java/fr/catcore/fabricatedforge/compat/mixin/nei/NEITransformerMixin.java b/mod-compat/src/main/java/fr/catcore/fabricatedforge/compat/mixin/nei/NEITransformerMixin.java deleted file mode 100644 index dc683aa2..00000000 --- a/mod-compat/src/main/java/fr/catcore/fabricatedforge/compat/mixin/nei/NEITransformerMixin.java +++ /dev/null @@ -1,28 +0,0 @@ -package fr.catcore.fabricatedforge.compat.mixin.nei; - -import codechicken.nei.asm.NEITransformer; -import com.llamalad7.mixinextras.injector.wrapoperation.Operation; -import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; -import fr.catcore.fabricatedforge.Constants; -import fr.catcore.fabricatedforge.compat.BetterClassWriter; -import io.github.fabriccompatibiltylayers.modremappingapi.api.MappingUtils; -import org.objectweb.asm.ClassWriter; -import org.objectweb.asm.tree.*; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; - -@Mixin(NEITransformer.class) -public class NEITransformerMixin { - @WrapOperation(method = "transformer004", require = 0, at = @At(value = "NEW", target = "(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lorg/objectweb/asm/tree/FieldInsnNode;"), remap = false) - private FieldInsnNode flf$remapField(int opcode, String owner, String name, String descriptor, Operation original) { - String remappedOwner = Constants.mapClass(owner); - MappingUtils.ClassMember member = Constants.mapFieldFromRemappedClass(remappedOwner, name, descriptor); - - return original.call(opcode, remappedOwner, member.name, Constants.mapTypeDescriptor(member.desc)); - } - - @WrapOperation(method = {"transformer001", "transformer002", "transformer003"}, at = @At(value = "NEW", target = "(I)Lorg/objectweb/asm/ClassWriter;"), remap = false) - private ClassWriter flf$fixClassWriter(int flags, Operation original) { - return new BetterClassWriter(flags); - } -} diff --git a/mod-compat/src/main/resources/fabricated-forge.mods.mixins.json b/mod-compat/src/main/resources/fabricated-forge.mods.mixins.json index 327c6db6..6bd0ed91 100644 --- a/mod-compat/src/main/resources/fabricated-forge.mods.mixins.json +++ b/mod-compat/src/main/resources/fabricated-forge.mods.mixins.json @@ -11,10 +11,7 @@ "codechickencore.ClassOverriderMixin", "codechickencore.DelegatedTransformerMixin", "codechickencore.DescriptorMappingMixin", - "codechickencore.FeatureHackTransformerMixin", - "codechickencore.TweakTransformerMixin", "nei.FurnaceRecipeHandlerMixin", - "nei.NEITransformerMixin", "nei.TMIUninstallerMixin", "treecapitator.ItemInWorldManagerTransformerMixin" ], diff --git a/src/main/java/cpw/mods/fml/relauncher/IClassTransformer.java b/src/main/java/cpw/mods/fml/relauncher/IClassTransformer.java index 8833e6da..9e183ef8 100644 --- a/src/main/java/cpw/mods/fml/relauncher/IClassTransformer.java +++ b/src/main/java/cpw/mods/fml/relauncher/IClassTransformer.java @@ -14,6 +14,7 @@ package cpw.mods.fml.relauncher; import fr.catcore.fabricatedforge.util.Utils; +import net.legacyfabric.fabric.api.logger.v1.Logger; import java.util.ArrayList; import java.util.HashMap; @@ -22,6 +23,7 @@ public interface IClassTransformer extends fr.catcore.modremapperapi.api.IClassTransformer { static final List CLASS_NAMES = new ArrayList<>(); + static final Logger LOGGER = Logger.get("Fabricated-Legacy-Forge", "ClassTransformers"); Map> transformed = new HashMap<>(); @@ -30,26 +32,33 @@ public interface IClassTransformer extends fr.catcore.modremapperapi.api.IClassT @Override default byte[] transformClass(String name, String transformedName, byte[] original) { if (original == null) return null; - return this.transform(name, original); + byte[] transformed = this.transform(name, original); + + if (original != transformed && !this.toString().startsWith("cpw.mods.fml.common.asm.transformers.SideTransformer")) { + LOGGER.debug(name + " transformed by " + this); + } + + return transformed; } @Override default boolean handlesClass(String s, String s1) { - String className = this.getClass().getName(); + String className = this.toString(); if (!CLASS_NAMES.contains(className)) { CLASS_NAMES.add(className); transformed.put(this, new ArrayList<>()); } - if (CLASS_NAMES.contains(s)) return false; - for (String toExclude : Utils.TRANSFORMER_EXCLUSIONS) { - if (s.startsWith(toExclude)) return false; + if (s.startsWith(toExclude)) { + return false; + } } if (transformed.get(this).contains(s)) { - throw new RuntimeException("Detected transformation loop for class " + s + " in ClassTransformer " + className); + LOGGER.warn("Detected transformation loop for class " + s + " in ClassTransformer " + className); + return false; } transformed.get(this).add(s); diff --git a/src/main/java/fr/catcore/fabricatedforge/ForgeModRemapper.java b/src/main/java/fr/catcore/fabricatedforge/ForgeModRemapper.java index aba50930..a1acca1e 100644 --- a/src/main/java/fr/catcore/fabricatedforge/ForgeModRemapper.java +++ b/src/main/java/fr/catcore/fabricatedforge/ForgeModRemapper.java @@ -146,7 +146,7 @@ public Optional getDefaultPackage() { @Override public void afterRemap() { - + System.out.println(System.getProperty("java.security.properties")); } static {