Skip to content

fix(res): chunk parsing was aborted too early for unordered entries#2444

Merged
skylot merged 1 commit intoskylot:masterfrom
jpstotz:resUnordered
Mar 14, 2025
Merged

fix(res): chunk parsing was aborted too early for unordered entries#2444
skylot merged 1 commit intoskylot:masterfrom
jpstotz:resUnordered

Conversation

@jpstotz
Copy link
Copy Markdown
Collaborator

@jpstotz jpstotz commented Mar 14, 2025

The changes introduced in #2344 allow to parser resources that are not ordered.

I forgot to also consider the new behavior in the code that stops reading entries that are located outside of the chunk.

The old behavior with ordered entries was to stop parsing if we have reached the end of the chunk. Now with unordered entries we can't stop parsing when we reached the end of the chunk because the next entry may have a lower offset and thus may be located again inside the chunk.

Without this change entries may be ignored even so they are fully valid. In the sample app mentioned in #2343 all 15 entries of resources.arsc/res/values/bools.xml are now present instead of only 5 without this PR.

Copy link
Copy Markdown
Owner

@skylot skylot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice fix, thank you 👍

@skylot skylot merged commit 6eeb303 into skylot:master Mar 14, 2025
4 checks passed
@jpstotz jpstotz deleted the resUnordered branch March 18, 2025 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants