Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase known config bytes to 64 #3133

Merged
merged 1 commit into from
Jul 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -500,13 +500,14 @@ private ResConfigFlags readConfigFlags() throws IOException, AndrolibException {
if (size >= 52) {
screenLayout2 = mIn.readByte();
colorMode = mIn.readByte();
mIn.skipBytes(2); // reserved padding
mIn.skipBytes(2); // screenConfigPad2
read = 52;
}

if (size >= 56) {
mIn.skipBytes(4);
read = 56;
if (size > 52) {
int length = size - read;
mIn.skipBytes(length); // localeNumberingSystem
read += length;
}

int exceedingSize = size - KNOWN_CONFIG_BYTES;
Expand Down Expand Up @@ -557,7 +558,7 @@ private char[] unpackLanguageOrRegion(byte in0, byte in1, char base) {
private String readScriptOrVariantChar(int length) throws IOException {
StringBuilder string = new StringBuilder(16);

while(length-- != 0) {
while (length-- != 0) {
short ch = mIn.readByte();
if (ch == 0) {
break;
Expand Down Expand Up @@ -641,7 +642,7 @@ private void checkChunkType(int expectedType) throws AndrolibException {
private final static short ENTRY_FLAG_PUBLIC = 0x0002;
private final static short ENTRY_FLAG_WEAK = 0x0004;

private static final int KNOWN_CONFIG_BYTES = 56;
private static final int KNOWN_CONFIG_BYTES = 64;

private static final Logger LOGGER = Logger.getLogger(ARSCDecoder.class.getName());
}