remove hardcoded htc stuff

This commit is contained in:
Connor Tumbleson 2013-04-03 14:07:18 -05:00
parent 9a6fd7de63
commit 3a5530e67b
2 changed files with 4 additions and 11 deletions

View File

@ -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,

View File

@ -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();
}