Update enigma

dev/0.11
gegy1000 2018-06-23 09:53:53 +02:00
parent 5296c98606
commit b598d87680
2 changed files with 11 additions and 6 deletions

View File

@ -54,7 +54,7 @@ dependencies {
transitive = false
}
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.sf.jopt-simple:jopt-simple:5.0.4'
shade 'org.apache.logging.log4j:log4j-api:2.11.0'
@ -122,4 +122,4 @@ publishing {
}
}
}
}
}

View File

@ -28,12 +28,15 @@ import cuchaz.enigma.Deobfuscator;
import cuchaz.enigma.TranslatingTypeLoader;
import cuchaz.enigma.mapping.MappingsEnigmaReader;
import cuchaz.enigma.mapping.TranslationDirection;
import cuchaz.enigma.mapping.Translator;
import cuchaz.enigma.mapping.entry.ReferencedEntryPool;
import cuchaz.enigma.throwables.MappingParseException;
import javassist.CtClass;
import net.fabricmc.loom.LoomGradleExtension;
import net.fabricmc.loom.util.Constants;
import org.gradle.api.DefaultTask;
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.commons.FileUtils;
@ -93,7 +96,9 @@ public class MapJarsTask extends DefaultTask {
}
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));
}
@ -106,8 +111,8 @@ public class MapJarsTask extends DefaultTask {
}
@Override
public CtClass transform(CtClass ctClass) throws Exception {
return loader.transformClass(ctClass);
public void write(ClassNode classNode, ClassWriter classWriter) {
loader.createTransformer(classNode, classWriter);
}
}