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 05377560..9bc4b629 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 @@ -70,7 +70,7 @@ public class Androlib { public void decodeSourcesRaw(ExtFile apkFile, File outDir, String filename) throws AndrolibException { try { - LOGGER.info("Copying raw classes.dex file..."); + LOGGER.info("Copying raw " + filename + " file..."); apkFile.getDirectory().copyToDir(outDir, filename); } catch (DirectoryException ex) { throw new AndrolibException(ex); @@ -301,6 +301,7 @@ public class Androlib { public void buildNonDefaultSources(ExtFile appDir) throws AndrolibException { try { + // loop through any smali_ directories for multi-dex apks Map dirs = appDir.getDirectory().getDirs(); for (Map.Entry directory : dirs.entrySet()) { String name = directory.getKey(); @@ -314,6 +315,18 @@ public class Androlib { } } } + + // loop through any classes#.dex files for multi-dex apks + File[] dexFiles = appDir.listFiles(); + if (dexFiles != null) { + for (File dex : dexFiles) { + + // skip classes.dex because we have handled it in buildSources() + if (dex.getName().endsWith(".dex") && ! dex.getName().equalsIgnoreCase("classes.dex")) { + buildSourcesRaw(appDir, dex.getName()); + } + } + } } catch(DirectoryException ex) { throw new AndrolibException(ex); }