blob: a58d9085bbd0b59f3c9ff6595f966fda690aea62 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
package cuchaz.enigma.command;
import cuchaz.enigma.Deobfuscator;
import java.io.File;
import java.nio.file.Path;
import java.util.jar.JarFile;
public class DecompileCommand extends Command {
public DecompileCommand() {
super("decompile");
}
@Override
public String getUsage() {
return "<in jar> <out folder> [<mappings file>]";
}
@Override
public boolean isValidArgument(int length) {
return length == 2 || length == 3;
}
@Override
public void run(String... args) throws Exception {
File fileJarIn = getReadableFile(getArg(args, 0, "in jar", true));
File fileJarOut = getWritableFolder(getArg(args, 1, "out folder", true));
Path fileMappings = getReadablePath(getArg(args, 2, "mappings file", false));
Deobfuscator deobfuscator = getDeobfuscator(fileMappings, new JarFile(fileJarIn));
deobfuscator.writeSources(fileJarOut.toPath(), new Command.ConsoleProgressListener());
}
}
|