From 2e44e3a856d0a2e91a5bfd55c6b27c1bdd77a6dd Mon Sep 17 00:00:00 2001 From: Connor Tumbleson Date: Sun, 31 Mar 2013 09:05:07 -0500 Subject: [PATCH] handle com.htc.resources correctly --- .../main/java/brut/androlib/res/decoder/ARSCDecoder.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/decoder/ARSCDecoder.java b/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/decoder/ARSCDecoder.java index 37b62b84..d8aed51b 100644 --- a/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/decoder/ARSCDecoder.java +++ b/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/decoder/ARSCDecoder.java @@ -246,7 +246,13 @@ public class ARSCDecoder { byte orientation = mIn.readByte(); byte touchscreen = mIn.readByte(); + short density = mIn.readShort(); + // some htc apks have 40 byte configs, with int(s) as density + // we are just gonna ignore the rest of the qualifer for now. + if (this.mPkg.getName().equalsIgnoreCase("com.htc") && size == 40) { + mIn.skipBytes(2); + } byte keyboard = mIn.readByte(); byte navigation = mIn.readByte();