From 2af523d5d4b2eaef055427694035202b07601e6b Mon Sep 17 00:00:00 2001 From: Connor Tumbleson Date: Mon, 13 Jan 2014 17:43:09 -0600 Subject: [PATCH] correctly handles apk's with one package named "android" --- CHANGES | 1 + .../src/main/java/brut/androlib/res/data/ResTable.java | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index fe446e00..254dc0a5 100644 --- a/CHANGES +++ b/CHANGES @@ -29,6 +29,7 @@ v2.0.0 (TBA) -Fixed (issue #550) - Correctly labels incorrect type handling of -Fixed (issue #571) - Fixed truncated strings (Thanks jtmuhone) -Fixed (issue #578) - Fixed apk's with multiple empty types via ignoring them +-Fixed (issue #589) - Fixed apk's with one package named "android" from improper decoding. -Added output to list Apktool version to help debugging. -Updated known bytes for configurations to 38 (from addition of layout direction) -Fixed NPE when handling odex apks even with --no-src specified. (Thanks Rodrigo Chiossi) diff --git a/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/data/ResTable.java b/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/data/ResTable.java index c851ac63..d637ec5a 100644 --- a/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/data/ResTable.java +++ b/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/data/ResTable.java @@ -87,7 +87,8 @@ public class ResTable { id = resPackage.getId(); } } - return getPackage(id); + // if id is still 0, we only have one pkgId which is "android" -> 1 + return (id == 0) ? getPackage(1) : getPackage(id); } public ResPackage getPackage(String name) throws AndrolibException {