Update enigma
parent
5296c98606
commit
b598d87680
|
@ -54,7 +54,7 @@ dependencies {
|
||||||
transitive = false
|
transitive = false
|
||||||
}
|
}
|
||||||
shade 'org.ow2.asm:asm-debug-all:5.2'
|
shade 'org.ow2.asm:asm-debug-all:5.2'
|
||||||
shade 'cuchaz:enigma:0.11.0.33:lib'
|
shade 'enigma-asm:enigma:0.12.0.6:lib'
|
||||||
shade 'net.fabricmc:tiny-remapper:+'
|
shade 'net.fabricmc:tiny-remapper:+'
|
||||||
shade 'net.sf.jopt-simple:jopt-simple:5.0.4'
|
shade 'net.sf.jopt-simple:jopt-simple:5.0.4'
|
||||||
shade 'org.apache.logging.log4j:log4j-api:2.11.0'
|
shade 'org.apache.logging.log4j:log4j-api:2.11.0'
|
||||||
|
@ -122,4 +122,4 @@ publishing {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,12 +28,15 @@ import cuchaz.enigma.Deobfuscator;
|
||||||
import cuchaz.enigma.TranslatingTypeLoader;
|
import cuchaz.enigma.TranslatingTypeLoader;
|
||||||
import cuchaz.enigma.mapping.MappingsEnigmaReader;
|
import cuchaz.enigma.mapping.MappingsEnigmaReader;
|
||||||
import cuchaz.enigma.mapping.TranslationDirection;
|
import cuchaz.enigma.mapping.TranslationDirection;
|
||||||
|
import cuchaz.enigma.mapping.Translator;
|
||||||
|
import cuchaz.enigma.mapping.entry.ReferencedEntryPool;
|
||||||
import cuchaz.enigma.throwables.MappingParseException;
|
import cuchaz.enigma.throwables.MappingParseException;
|
||||||
import javassist.CtClass;
|
|
||||||
import net.fabricmc.loom.LoomGradleExtension;
|
import net.fabricmc.loom.LoomGradleExtension;
|
||||||
import net.fabricmc.loom.util.Constants;
|
import net.fabricmc.loom.util.Constants;
|
||||||
import org.gradle.api.DefaultTask;
|
import org.gradle.api.DefaultTask;
|
||||||
import org.gradle.api.tasks.TaskAction;
|
import org.gradle.api.tasks.TaskAction;
|
||||||
|
import org.objectweb.asm.ClassWriter;
|
||||||
|
import org.objectweb.asm.tree.ClassNode;
|
||||||
import org.zeroturnaround.zip.ZipUtil;
|
import org.zeroturnaround.zip.ZipUtil;
|
||||||
import org.zeroturnaround.zip.commons.FileUtils;
|
import org.zeroturnaround.zip.commons.FileUtils;
|
||||||
|
|
||||||
|
@ -93,7 +96,9 @@ public class MapJarsTask extends DefaultTask {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void writeJar(File out, Deobfuscator.ProgressListener progress, Deobfuscator deobfuscator) {
|
public void writeJar(File out, Deobfuscator.ProgressListener progress, Deobfuscator deobfuscator) {
|
||||||
TranslatingTypeLoader loader = new TranslatingTypeLoader(deobfuscator.getJar(), deobfuscator.getJarIndex(), deobfuscator.getTranslator(TranslationDirection.Obfuscating), deobfuscator.getTranslator(TranslationDirection.Deobfuscating));
|
Translator obfuscationTranslator = deobfuscator.getTranslator(TranslationDirection.OBFUSCATING);
|
||||||
|
Translator deobfuscationTranslator = deobfuscator.getTranslator(TranslationDirection.DEOBFUSCATING);
|
||||||
|
TranslatingTypeLoader loader = new TranslatingTypeLoader(deobfuscator.getJar(), deobfuscator.getJarIndex(), new ReferencedEntryPool(), obfuscationTranslator, deobfuscationTranslator);
|
||||||
deobfuscator.transformJar(out, progress, new CustomClassTransformer(loader));
|
deobfuscator.transformJar(out, progress, new CustomClassTransformer(loader));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,8 +111,8 @@ public class MapJarsTask extends DefaultTask {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CtClass transform(CtClass ctClass) throws Exception {
|
public void write(ClassNode classNode, ClassWriter classWriter) {
|
||||||
return loader.transformClass(ctClass);
|
loader.createTransformer(classNode, classWriter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue