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

[core] Resource table is being parsed twice #2263

Closed
pubiqq opened this issue Sep 2, 2024 · 2 comments
Closed

[core] Resource table is being parsed twice #2263

pubiqq opened this issue Sep 2, 2024 · 2 comments
Labels
bug Core Issues in jadx-core module regression resources
Milestone

Comments

@pubiqq
Copy link
Contributor

pubiqq commented Sep 2, 2024

Issue details

This bug used to only increase parsing time, but now because of it and b85900a, resources are being generated with double entries.

Screenshot

Jadx version

cca706c

@pubiqq pubiqq added bug Core Issues in jadx-core module labels Sep 2, 2024
@skylot skylot added this to the TBD milestone Sep 3, 2024
@skylot
Copy link
Owner

skylot commented Sep 4, 2024

Fixed. Some details:

  • actually running decode of arsc file twice is fine. First time needed to collect some info used during decompilation (like mapping to replace resource IDs with res names in code). And second time is lazy loading/generation of resource xml files. So second time is optional (not invoked in jadx-gui if user not open arsc file content).
  • issue was introduced in PR Moved AAB input to separate plugin #2165 by keeping parser instance in memory like a singleton, so second decode was adding arsc entries again.
  • I changed code to not store parser instance and also, just in case, to create entries storage right before decode to prevent possible duplication.

@pubiqq thank you for report, it was very helpful 👍

@skylot skylot closed this as completed Sep 4, 2024
@pubiqq
Copy link
Contributor Author

pubiqq commented Sep 4, 2024

Honestly I was rather hoping that the solution would be to cache the ResourceStorage, and then the resources wouldn't have to be re-decoded.

Well, at least the resources are no longer duplicated now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Core Issues in jadx-core module regression resources
Projects
None yet
Development

No branches or pull requests

2 participants