lots of changes to handling of ARSCDecoder. Needs support to handle something that I don't know yet. Something todo with ResSpecs of dual packages.

This commit is contained in:
Connor Tumbleson 2012-08-28 21:26:56 -05:00
parent ebb2f6d623
commit 2509e402e7
6 changed files with 14 additions and 8 deletions

View File

@ -215,7 +215,7 @@ public class Main {
"Copyright 2010 Ryszard Wiśniewski <brut.alll@gmail.com>\n" +
"with smali v" + ApktoolProperties.get("smaliVersion") +
", and baksmali v" + ApktoolProperties.get("baksmaliVersion") + "\n" +
"Updated by iBotPeaches (@iBotPeaches) and yyj \n" +
"Updated by iBotPeaches (@iBotPeaches)\n" +
"Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)\n" +
"\n" +
"Usage: apktool [-q|--quiet OR -v|--verbose] COMMAND [...]\n" +

View File

@ -200,6 +200,7 @@ final public class AndrolibResources {
cmd.add("aapt");
cmd.add("p");
cmd.add("-v"); //mega debug mode.@todo REMOVE ON FINAL
if (update) {
cmd.add("-u");
}

View File

@ -173,7 +173,7 @@ public class ARSCDecoder {
/*size*/ mIn.skipBytes(2);
short flags = mIn.readShort();
int specNamesId = mIn.readInt();
ResValue value = (flags & ENTRY_FLAG_COMPLEX) == 0 ?
readValue() : readComplexEntry();
@ -214,8 +214,8 @@ public class ARSCDecoder {
}
private ResValue readValue() throws IOException, AndrolibException {
/*size*/ mIn.skipCheckShort((short) 8);
/*zero*/ mIn.skipCheckByte((byte) 0);
/*size*/ mIn.skipCheckShort((short) 8);
/*zero*/ mIn.skipCheckByte((byte) 0);
byte type = mIn.readByte();
int data = mIn.readInt();
@ -247,13 +247,13 @@ public class ARSCDecoder {
byte keyboard = mIn.readByte();
byte navigation = mIn.readByte();
byte inputFlags = mIn.readByte();
mIn.skipBytes(1);
mIn.skipBytes(1);
short screenWidth = mIn.readShort();
short screenHeight = mIn.readShort();
short sdkVersion = mIn.readShort();
mIn.skipBytes(2);
mIn.skipBytes(2);
byte screenLayout = 0;
byte uiMode = 0;
@ -266,10 +266,15 @@ public class ARSCDecoder {
short screenWidthDp = 0;
short screenHeightDp = 0;
if (size >= 36) {
screenWidthDp = mIn.readShort();
screenHeightDp = mIn.readShort();
}
if (size >= 40) {
mIn.skipBytes(2);
}
int exceedingSize = size - KNOWN_CONFIG_BYTES;
if (exceedingSize > 0) {

View File

@ -118,7 +118,7 @@ public class BuildAndDecodeTest {
@Test
public void qualifiersTest() throws BrutException {
compareValuesFiles("values-mcc004-mnc4-en-rUS-sw100dp-w200dp-h300dp" +
"-xlarge-long-land-night-xhdpi-finger-keyssoft-12key" +
"-xlarge-long-land-desk-night-xhdpi-finger-keyssoft-12key" +
"-navhidden-dpad/strings.xml");
}

View File

@ -1,4 +1,4 @@
version: 1.4.7
version: 1.5.0
apkFileName: testapp.apk
isFrameworkApk: false
usesFramework: