diff options
| author | 2015-03-23 16:26:44 -0400 | |
|---|---|---|
| committer | 2015-03-23 16:26:44 -0400 | |
| commit | 902b1b519f8ae89910f6f0d9f077738711349324 (patch) | |
| tree | 1ce8a1d05e8797a62ae0d5391ae5b3c951e19b5d /src/cuchaz/enigma/CommandMain.java | |
| parent | repackage for 0.10.3 beta (diff) | |
| download | enigma-fork-902b1b519f8ae89910f6f0d9f077738711349324.tar.gz enigma-fork-902b1b519f8ae89910f6f0d9f077738711349324.tar.xz enigma-fork-902b1b519f8ae89910f6f0d9f077738711349324.zip | |
add protectifier! Muwahahaha!!!v0.10.3_beta
Diffstat (limited to 'src/cuchaz/enigma/CommandMain.java')
| -rw-r--r-- | src/cuchaz/enigma/CommandMain.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/cuchaz/enigma/CommandMain.java b/src/cuchaz/enigma/CommandMain.java index 0253a92..74c0191 100644 --- a/src/cuchaz/enigma/CommandMain.java +++ b/src/cuchaz/enigma/CommandMain.java | |||
| @@ -54,8 +54,10 @@ public class CommandMain { | |||
| 54 | String command = getArg(args, 0, "command", true); | 54 | String command = getArg(args, 0, "command", true); |
| 55 | if (command.equalsIgnoreCase("deobfuscate")) { | 55 | if (command.equalsIgnoreCase("deobfuscate")) { |
| 56 | deobfuscate(args); | 56 | deobfuscate(args); |
| 57 | } else if(command.equalsIgnoreCase("decompile")) { | 57 | } else if (command.equalsIgnoreCase("decompile")) { |
| 58 | decompile(args); | 58 | decompile(args); |
| 59 | } else if (command.equalsIgnoreCase("protectify")) { | ||
| 60 | protectify(args); | ||
| 59 | } else { | 61 | } else { |
| 60 | throw new IllegalArgumentException("Command not recognized: " + command); | 62 | throw new IllegalArgumentException("Command not recognized: " + command); |
| 61 | } | 63 | } |
| @@ -72,6 +74,7 @@ public class CommandMain { | |||
| 72 | System.out.println("\twhere <command> is one of:"); | 74 | System.out.println("\twhere <command> is one of:"); |
| 73 | System.out.println("\t\tdeobfuscate <in jar> <out jar> [<mappings file>]"); | 75 | System.out.println("\t\tdeobfuscate <in jar> <out jar> [<mappings file>]"); |
| 74 | System.out.println("\t\tdecompile <in jar> <out folder> [<mappings file>]"); | 76 | System.out.println("\t\tdecompile <in jar> <out folder> [<mappings file>]"); |
| 77 | System.out.println("\t\tprotectify <in jar> <out jar>"); | ||
| 75 | } | 78 | } |
| 76 | 79 | ||
| 77 | private static void decompile(String[] args) | 80 | private static void decompile(String[] args) |
| @@ -92,6 +95,14 @@ public class CommandMain { | |||
| 92 | deobfuscator.writeJar(fileJarOut, new ConsoleProgressListener()); | 95 | deobfuscator.writeJar(fileJarOut, new ConsoleProgressListener()); |
| 93 | } | 96 | } |
| 94 | 97 | ||
| 98 | private static void protectify(String[] args) | ||
| 99 | throws Exception { | ||
| 100 | File fileJarIn = getReadableFile(getArg(args, 1, "in jar", true)); | ||
| 101 | File fileJarOut = getWritableFile(getArg(args, 2, "out jar", true)); | ||
| 102 | Deobfuscator deobfuscator = getDeobfuscator(null, new JarFile(fileJarIn)); | ||
| 103 | deobfuscator.protectifyJar(fileJarOut, new ConsoleProgressListener()); | ||
| 104 | } | ||
| 105 | |||
| 95 | private static Deobfuscator getDeobfuscator(File fileMappings, JarFile jar) | 106 | private static Deobfuscator getDeobfuscator(File fileMappings, JarFile jar) |
| 96 | throws Exception { | 107 | throws Exception { |
| 97 | System.out.println("Reading jar..."); | 108 | System.out.println("Reading jar..."); |