From 902b1b519f8ae89910f6f0d9f077738711349324 Mon Sep 17 00:00:00 2001 From: Cuchaz Date: Mon, 23 Mar 2015 16:26:44 -0400 Subject: add protectifier! Muwahahaha!!! --- src/cuchaz/enigma/CommandMain.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/cuchaz/enigma/CommandMain.java') 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 { String command = getArg(args, 0, "command", true); if (command.equalsIgnoreCase("deobfuscate")) { deobfuscate(args); - } else if(command.equalsIgnoreCase("decompile")) { + } else if (command.equalsIgnoreCase("decompile")) { decompile(args); + } else if (command.equalsIgnoreCase("protectify")) { + protectify(args); } else { throw new IllegalArgumentException("Command not recognized: " + command); } @@ -72,6 +74,7 @@ public class CommandMain { System.out.println("\twhere is one of:"); System.out.println("\t\tdeobfuscate []"); System.out.println("\t\tdecompile []"); + System.out.println("\t\tprotectify "); } private static void decompile(String[] args) @@ -92,6 +95,14 @@ public class CommandMain { deobfuscator.writeJar(fileJarOut, new ConsoleProgressListener()); } + private static void protectify(String[] args) + throws Exception { + File fileJarIn = getReadableFile(getArg(args, 1, "in jar", true)); + File fileJarOut = getWritableFile(getArg(args, 2, "out jar", true)); + Deobfuscator deobfuscator = getDeobfuscator(null, new JarFile(fileJarIn)); + deobfuscator.protectifyJar(fileJarOut, new ConsoleProgressListener()); + } + private static Deobfuscator getDeobfuscator(File fileMappings, JarFile jar) throws Exception { System.out.println("Reading jar..."); -- cgit v1.2.3