Skip to content

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

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

Merged
merged 1 commit into from
Mar 14, 2025

Conversation

jpstotz
Copy link
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
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.

None yet

2 participants