mirror of
https://github.com/revanced/Apktool.git
synced 2025-05-09 18:24:26 +02:00
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:
parent
ebb2f6d623
commit
2509e402e7
@ -215,7 +215,7 @@ public class Main {
|
|||||||
"Copyright 2010 Ryszard Wiśniewski <brut.alll@gmail.com>\n" +
|
"Copyright 2010 Ryszard Wiśniewski <brut.alll@gmail.com>\n" +
|
||||||
"with smali v" + ApktoolProperties.get("smaliVersion") +
|
"with smali v" + ApktoolProperties.get("smaliVersion") +
|
||||||
", and baksmali v" + ApktoolProperties.get("baksmaliVersion") + "\n" +
|
", 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" +
|
"Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)\n" +
|
||||||
"\n" +
|
"\n" +
|
||||||
"Usage: apktool [-q|--quiet OR -v|--verbose] COMMAND [...]\n" +
|
"Usage: apktool [-q|--quiet OR -v|--verbose] COMMAND [...]\n" +
|
||||||
|
@ -200,6 +200,7 @@ final public class AndrolibResources {
|
|||||||
cmd.add("aapt");
|
cmd.add("aapt");
|
||||||
cmd.add("p");
|
cmd.add("p");
|
||||||
cmd.add("-v"); //mega debug mode.@todo REMOVE ON FINAL
|
cmd.add("-v"); //mega debug mode.@todo REMOVE ON FINAL
|
||||||
|
|
||||||
if (update) {
|
if (update) {
|
||||||
cmd.add("-u");
|
cmd.add("-u");
|
||||||
}
|
}
|
||||||
|
@ -173,7 +173,7 @@ public class ARSCDecoder {
|
|||||||
/*size*/ mIn.skipBytes(2);
|
/*size*/ mIn.skipBytes(2);
|
||||||
short flags = mIn.readShort();
|
short flags = mIn.readShort();
|
||||||
int specNamesId = mIn.readInt();
|
int specNamesId = mIn.readInt();
|
||||||
|
|
||||||
ResValue value = (flags & ENTRY_FLAG_COMPLEX) == 0 ?
|
ResValue value = (flags & ENTRY_FLAG_COMPLEX) == 0 ?
|
||||||
readValue() : readComplexEntry();
|
readValue() : readComplexEntry();
|
||||||
|
|
||||||
@ -214,8 +214,8 @@ public class ARSCDecoder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private ResValue readValue() throws IOException, AndrolibException {
|
private ResValue readValue() throws IOException, AndrolibException {
|
||||||
/*size*/ mIn.skipCheckShort((short) 8);
|
/*size*/ mIn.skipCheckShort((short) 8);
|
||||||
/*zero*/ mIn.skipCheckByte((byte) 0);
|
/*zero*/ mIn.skipCheckByte((byte) 0);
|
||||||
byte type = mIn.readByte();
|
byte type = mIn.readByte();
|
||||||
int data = mIn.readInt();
|
int data = mIn.readInt();
|
||||||
|
|
||||||
@ -247,13 +247,13 @@ public class ARSCDecoder {
|
|||||||
byte keyboard = mIn.readByte();
|
byte keyboard = mIn.readByte();
|
||||||
byte navigation = mIn.readByte();
|
byte navigation = mIn.readByte();
|
||||||
byte inputFlags = mIn.readByte();
|
byte inputFlags = mIn.readByte();
|
||||||
mIn.skipBytes(1);
|
mIn.skipBytes(1);
|
||||||
|
|
||||||
short screenWidth = mIn.readShort();
|
short screenWidth = mIn.readShort();
|
||||||
short screenHeight = mIn.readShort();
|
short screenHeight = mIn.readShort();
|
||||||
|
|
||||||
short sdkVersion = mIn.readShort();
|
short sdkVersion = mIn.readShort();
|
||||||
mIn.skipBytes(2);
|
mIn.skipBytes(2);
|
||||||
|
|
||||||
byte screenLayout = 0;
|
byte screenLayout = 0;
|
||||||
byte uiMode = 0;
|
byte uiMode = 0;
|
||||||
@ -266,10 +266,15 @@ public class ARSCDecoder {
|
|||||||
|
|
||||||
short screenWidthDp = 0;
|
short screenWidthDp = 0;
|
||||||
short screenHeightDp = 0;
|
short screenHeightDp = 0;
|
||||||
|
|
||||||
if (size >= 36) {
|
if (size >= 36) {
|
||||||
screenWidthDp = mIn.readShort();
|
screenWidthDp = mIn.readShort();
|
||||||
screenHeightDp = mIn.readShort();
|
screenHeightDp = mIn.readShort();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (size >= 40) {
|
||||||
|
mIn.skipBytes(2);
|
||||||
|
}
|
||||||
|
|
||||||
int exceedingSize = size - KNOWN_CONFIG_BYTES;
|
int exceedingSize = size - KNOWN_CONFIG_BYTES;
|
||||||
if (exceedingSize > 0) {
|
if (exceedingSize > 0) {
|
||||||
|
@ -118,7 +118,7 @@ public class BuildAndDecodeTest {
|
|||||||
@Test
|
@Test
|
||||||
public void qualifiersTest() throws BrutException {
|
public void qualifiersTest() throws BrutException {
|
||||||
compareValuesFiles("values-mcc004-mnc4-en-rUS-sw100dp-w200dp-h300dp" +
|
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");
|
"-navhidden-dpad/strings.xml");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
version: 1.4.7
|
version: 1.5.0
|
||||||
apkFileName: testapp.apk
|
apkFileName: testapp.apk
|
||||||
isFrameworkApk: false
|
isFrameworkApk: false
|
||||||
usesFramework:
|
usesFramework:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user