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

fix: support decoding application with duplicate res entries #3252

Merged
merged 1 commit into from
Aug 5, 2023

Conversation

iBotPeaches
Copy link
Owner

fixes: #2824

In the sample above. We find a duplicate resource at end of chunk.

      [ResTable_entry] id: 0x0595 name: zero_corner_chip keyIndex: 5176 size: 8 flags: 0x0004
        [Res_value] size: 8 dataType: 0x12 data: 0x00000000 ((id))
      [ResTable_entry] id: 0x0596 name: zoom keyIndex: 5177 size: 8 flags: 0x0004
        [Res_value] size: 8 dataType: 0x12 data: 0x00000000 ((id))
      [ResTable_entry] id: 0x0597 name: zoom keyIndex: 5177 size: 8 flags: 0x0004
        [Res_value] size: 3 dataType: 0x12 data: 0x00000000 ((id))

The last entry has the same index to the previous and malformed. The size reported is also wrong. There are still 8 bytes, but its a duplicate entry.

I've debated a few paths.

  • Detecting read vs actual during value read
  • Skipping reading if we have less than 8 bytes in value read

In this patch we return early from value read if size less than 8, fallback to null and let the end chunk reading (read vs actual) skip what is remaining.

@iBotPeaches iBotPeaches added this to the v2.8.2 milestone Aug 5, 2023
@iBotPeaches iBotPeaches marked this pull request as ready for review August 5, 2023 13:42
@iBotPeaches iBotPeaches merged commit 50226e5 into master Aug 5, 2023
31 checks passed
@iBotPeaches iBotPeaches deleted the issue-2824 branch August 5, 2023 16:21
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.

[BUG]Exception in thread "main" brut.androlib.AndrolibException: Could not decode arsc file
1 participant