From 484feea28425943c79b120dcae6e3ce97ac0b6c3 Mon Sep 17 00:00:00 2001 From: Connor Tumbleson Date: Sat, 19 Jan 2013 16:35:48 -0600 Subject: [PATCH] removing dead code, code cleanup --- .../src/main/java/brut/apktool/Main.java | 46 +++++++++---------- .../src/main/java/brut/androlib/Androlib.java | 32 ++----------- 2 files changed, 26 insertions(+), 52 deletions(-) diff --git a/brut.apktool/apktool-cli/src/main/java/brut/apktool/Main.java b/brut.apktool/apktool-cli/src/main/java/brut/apktool/Main.java index e84435ed..ea2c55e9 100644 --- a/brut.apktool/apktool-cli/src/main/java/brut/apktool/Main.java +++ b/brut.apktool/apktool-cli/src/main/java/brut/apktool/Main.java @@ -223,31 +223,31 @@ public class Main { new Androlib().build(new File(appDirName), outFile, flags, mOrigApk, mAaptPath); } - private static void cmdInstallFramework(String[] args) - throws AndrolibException { - String tag = null; - String frame_path = null; - int i = 0; - switch (args.length) { - case 4: - if (args[2].equalsIgnoreCase("--frame-path")) { - i++; - } else { - throw new InvalidArgsError(); + private static void cmdInstallFramework(String[] args) + throws AndrolibException { + String tag = null; + String frame_path = null; + int i = 0; + switch (args.length) { + case 4: + if (args[2].equalsIgnoreCase("--frame-path")) { + i++; + } else { + throw new InvalidArgsError(); + } + case 3: + frame_path = args[2 + i]; + case 2: + if (!(args[1].equalsIgnoreCase("--frame-path"))) { + tag = args[1]; + } + case 1: + new Androlib().installFramework(new File(args[0]), tag, frame_path); + return; } - case 3: - frame_path = args[2 + i]; - case 2: - if (!(args[1].equalsIgnoreCase("--frame-path"))) { - tag = args[1]; - } - case 1: - new Androlib().installFramework(new File(args[0]), tag,frame_path); - return; - } - throw new InvalidArgsError(); - } + throw new InvalidArgsError(); + } private static void cmdPublicizeResources(String[] args) throws InvalidArgsError, AndrolibException { diff --git a/brut.apktool/apktool-lib/src/main/java/brut/androlib/Androlib.java b/brut.apktool/apktool-lib/src/main/java/brut/androlib/Androlib.java index 3b1f7cb6..1d1d62d8 100644 --- a/brut.apktool/apktool-lib/src/main/java/brut/androlib/Androlib.java +++ b/brut.apktool/apktool-lib/src/main/java/brut/androlib/Androlib.java @@ -455,37 +455,11 @@ public class Androlib { mAndRes.aaptPackage(outApk, null, null, new File(appDir, APK_DIRNAME), assetDir, null, flags, mAaptPath); - - - /* check for re-insert */ + // retain signature + // aapt r (remove) + // aapt a (add) if (flags.get("injectOriginal")) { - //try { - //LOGGER.info("Building resources into original apk file..."); LOGGER.info("Injecting contents isn't ready yet. Sorry :("); - //ZipFile editOrig = new ZipFile(mOrigApkFile.getAbsoluteFile()); - - // no compression levels, paras - //ZipParameters parameters = new ZipParameters(); - //parameters.setCompressionMethod(Zip4jConstants.COMP_STORE); - //parameters.setCompressionLevel(0); - //parameters.setIncludeRootFolder(true); - //parameters.setRootFolderInZip("/"); - - // add res folder - //editOrig.addFolder(new File(appDir, APK_DIRNAME + "/res").getAbsolutePath(), parameters); - //System.out.println("file: " + new File(appDir, APK_DIRNAME + "/res").getAbsolutePath()); - - // add assets, if there - //if (assetDir != null) { - //editOrig.addFolder(new File(appDir, APK_DIRNAME + "/assets").getAbsolutePath(), parameters); - //} - - // add resources.arsc - // parameters.setFileNameInZip("resources.arsc"); - // editOrig.addFile(new File(appDir, "resources.arsc"), parameters); - //} catch(ZipException ex) { - // throw new AndrolibException(ex); - //} } }