From 559a3024ccd0bc4655b86bdc36364718209fb724 Mon Sep 17 00:00:00 2001 From: Connor Tumbleson Date: Mon, 6 Jan 2014 06:39:51 -0600 Subject: [PATCH] Ignore multiple types --- CHANGES | 1 + .../main/java/brut/androlib/res/data/ResPackage.java | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index f5c52d05..fe446e00 100644 --- a/CHANGES +++ b/CHANGES @@ -28,6 +28,7 @@ v2.0.0 (TBA) -Fixed (issue #531) - JAR disassembling borking is fixed -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 -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/ResPackage.java b/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/data/ResPackage.java index 168e45b8..d0d77697 100644 --- a/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/data/ResPackage.java +++ b/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/data/ResPackage.java @@ -23,6 +23,7 @@ import brut.androlib.res.data.value.ResValueFactory; import brut.androlib.res.xml.ResValuesXmlSerializable; import brut.util.Duo; import java.util.*; +import java.util.logging.Logger; /** * @author Ryszard Wiśniewski @@ -168,9 +169,11 @@ public class ResPackage { } public void addType(ResType type) throws AndrolibException { - if (mTypes.put(type.getName(), type) != null) { - throw new AndrolibException("Multiple types: " + type); - } + if (mTypes.containsKey(type.getName())) { + LOGGER.warning("Multiple types detected! " + type + " ignored!"); + } else { + mTypes.put(type.getName(), type); + } } public void addResource(ResResource res) { @@ -220,4 +223,7 @@ public class ResPackage { } return mValueFactory; } + + private final static Logger LOGGER = Logger + .getLogger(ResPackage.class.getName()); }