diff --git a/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/data/ResConfigFlags.java b/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/data/ResConfigFlags.java index 28f18522..15fd458a 100644 --- a/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/data/ResConfigFlags.java +++ b/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/data/ResConfigFlags.java @@ -32,7 +32,7 @@ public class ResConfigFlags { public final byte orientation; public final byte touchscreen; - public final short density; + public final int density; public final byte keyboard; public final byte navigation; @@ -80,7 +80,7 @@ public class ResConfigFlags { public ResConfigFlags(short mcc, short mnc, char[] language, char[] country, short layoutDirection, byte orientation, - byte touchscreen, short density, byte keyboard, byte navigation, + byte touchscreen, int density, byte keyboard, byte navigation, byte inputFlags, short screenWidth, short screenHeight, short sdkVersion, byte screenLayout, byte uiMode, short smallestScreenWidthDp, short screenWidthDp, 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 d8aed51b..ef617540 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 @@ -247,12 +247,7 @@ 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); - } + int density = mIn.readUnsignedShort(); byte keyboard = mIn.readByte(); byte navigation = mIn.readByte(); @@ -276,15 +271,13 @@ public class ARSCDecoder { short screenWidthDp = 0; short screenHeightDp = 0; - if (size >= 36) { screenWidthDp = mIn.readShort(); screenHeightDp = mIn.readShort(); } short layoutDirection = 0; - if (size >= 38 && sdkVersion >= 17 - && !this.mPkg.getName().equalsIgnoreCase("com.htc")) { + if (size >= 38) { layoutDirection = mIn.readShort(); }