diff --git a/pom.xml b/pom.xml index e07d050..988448c 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 libra AndroidProjectCreator - 1.2-stable + 1.2.2-stable jar UTF-8 diff --git a/src/main/java/apc/AndroidProjectCreator.java b/src/main/java/apc/AndroidProjectCreator.java index ef9d86e..3c5f372 100644 --- a/src/main/java/apc/AndroidProjectCreator.java +++ b/src/main/java/apc/AndroidProjectCreator.java @@ -19,6 +19,7 @@ import enumeration.Action; import enumeration.DecompilerType; import java.io.File; +import library.OperatingSystemDetector; import model.ArgumentPackage; /** @@ -48,7 +49,7 @@ public static void main(String[] args) { if (debugging) { //installTest(); //updateTest(); - decompileTest(DecompilerType.JEB3); + decompileTest(DecompilerType.FERNFLOWER); System.exit(0); } @@ -110,7 +111,12 @@ private static void decompileTest(DecompilerType decompiler) { } args[0] = "-decompile"; args[1] = decompiler.toString().toLowerCase(); - args[2] = "/home/libra/Documents/apc-test/apk/challenge1_release.apk"; + //Mac is excluded from the tests + if (OperatingSystemDetector.isLinux()) { + args[2] = "/home/libra/Documents/apc-test/apk/challenge1_release.apk"; + } else if (OperatingSystemDetector.isWindows()) { + args[2] = "C:\\Users\\Libra\\Downloads\\ap k.apk"; + } args[3] = "./test-output-guid-" + java.util.UUID.randomUUID(); if (decompiler == DecompilerType.JEB3) { args[4] = "/home/libra/Downloads/jeb-pro"; @@ -119,7 +125,7 @@ private static void decompileTest(DecompilerType decompiler) { ArgumentPackage argumentPackage = argumentParser.setArguments(args); manager.execute(argumentPackage); } - + //TODO refactor this method into the argument parser private static void handleAction(ArgumentManager manager, String[] args) { //If no arguments are given, the general usage information should be given diff --git a/src/main/java/apc/ArgumentManager.java b/src/main/java/apc/ArgumentManager.java index fe8d5c9..bf251e1 100644 --- a/src/main/java/apc/ArgumentManager.java +++ b/src/main/java/apc/ArgumentManager.java @@ -159,9 +159,9 @@ private void showError(Exception ex) { * Display the version information */ public void showVersion() { - String versionNumber = "1.2-stable"; + String versionNumber = "1.2.2-stable"; StringBuilder version = new StringBuilder(); - version.append("[+]AndroidProjectCreator " + versionNumber + " [developed by Max 'Libra' Kersten ]\n"); + version.append("[+]AndroidProjectCreator " + versionNumber + " [developed by Max 'Libra' Kersten or @LibraAnalysis on Twitter]\n"); System.out.println(version.toString()); } } diff --git a/src/main/java/command/Decompiler.java b/src/main/java/command/Decompiler.java index b54ea76..552b622 100644 --- a/src/main/java/command/Decompiler.java +++ b/src/main/java/command/Decompiler.java @@ -89,7 +89,7 @@ public void decompile() throws IOException, InterruptedException, ZipException { command = "java -jar ./apktool-cli-all.jar"; } //Append the flags and the file paths to the commands. These are the same on any platform due to the Java runtime - command += " d -f -s -m -k -o " + new File(Constants.TEMP_LIBRARY_FOLDER).getAbsolutePath() + "/apktool" + " " + argumentPackage.getApk().getAbsolutePath(); + command += " d -f -s -m -k -o " + new File(Constants.TEMP_LIBRARY_FOLDER + "/apktool").getAbsolutePath() + " \"" + argumentPackage.getApk().getAbsolutePath() + "\""; workingDirectory = new File(Constants.APKTOOL_LIBRARY_FOLDER); executeCommand(DecompilerType.APKTOOL, command, workingDirectory); @@ -112,7 +112,7 @@ public void decompile() throws IOException, InterruptedException, ZipException { command = "java -jar ./apktool-cli-all.jar"; } //Append the flags and the file paths to the commands. These are the same on any platform due to the Java runtime - command += " d -f --no-assets --no-res -m -o " + new File(Constants.TEMP_LIBRARY_FOLDER).getAbsolutePath() + "/apktool-smali" + " " + argumentPackage.getApk().getAbsolutePath(); + command += " d -f --no-assets --no-res -m -o " + new File(Constants.TEMP_LIBRARY_FOLDER + "/apktool-smali").getAbsolutePath() + " \"" + argumentPackage.getApk().getAbsolutePath() + "\""; workingDirectory = new File(Constants.APKTOOL_LIBRARY_FOLDER); executeCommand(DecompilerType.APKTOOL, command, workingDirectory); @@ -249,7 +249,7 @@ public void decompile() throws IOException, InterruptedException, ZipException { } else { command = "java -jar ./bin/app/jeb.jar"; } - command += " --srv2 --script=" + Constants.JEB3_CLI_ANDROID_SCRIPT_LIBRARY_FOLDER + "/DecompileAndroid.py -- " + argumentPackage.getApk().getAbsolutePath() + " " + new File(Constants.TEMP_SOURCES_FOLDER).getAbsolutePath(); + command += " --srv2 --script=" + new File(Constants.JEB3_CLI_ANDROID_SCRIPT_LIBRARY_FOLDER + "/DecompileAndroid.py").getAbsolutePath() + " -- " + argumentPackage.getApk().getAbsolutePath() + " " + new File(Constants.TEMP_SOURCES_FOLDER).getAbsolutePath(); workingDirectory = argumentPackage.getJeb3Folder(); } executeCommand(argumentPackage.getDecompilerType(), command, workingDirectory); @@ -296,4 +296,4 @@ private void executeCommand(DecompilerType name, String commandString, File work throw new IOException("Something went wrong with the I/O during the decompilation. Check the permissions of the output directory and try again."); } } -} +} \ No newline at end of file diff --git a/target/AndroidProjectCreator-1.2-stable-jar-with-dependencies.jar b/target/AndroidProjectCreator-1.2.2-stable-jar-with-dependencies.jar similarity index 95% rename from target/AndroidProjectCreator-1.2-stable-jar-with-dependencies.jar rename to target/AndroidProjectCreator-1.2.2-stable-jar-with-dependencies.jar index c80311b..360255b 100644 Binary files a/target/AndroidProjectCreator-1.2-stable-jar-with-dependencies.jar and b/target/AndroidProjectCreator-1.2.2-stable-jar-with-dependencies.jar differ