Skip to content

Added feature to use headers for detect resource extensions#2495

Merged
skylot merged 2 commits intoskylot:masterfrom
MrIkso:rename_res_file_by_headers
May 20, 2025
Merged

Added feature to use headers for detect resource extensions#2495
skylot merged 2 commits intoskylot:masterfrom
MrIkso:rename_res_file_by_headers

Conversation

@MrIkso
Copy link
Copy Markdown
Contributor

@MrIkso MrIkso commented May 19, 2025

Currently jadx get resource extension from name. But if names hard obfuscated and don't have extensions. This PRs slove this problem for detect some popular resources used on apk. Also closes #1643 with correct detection of .9.png.
Example apk how to test: #584

@skylot
Copy link
Copy Markdown
Owner

skylot commented May 20, 2025

@MrIkso to be honest I don't like a additional decoding run, but since you made this feature opt-in and it also runs only if resource deobfuscation is applying alias, it is fine for now. I hope this will be resolved once a virtual file tree feature from #2304 is implemented, and it will be possible just rename already decoded resources 🙂

@skylot skylot merged commit 00608f8 into skylot:master May 20, 2025
4 checks passed
@MrIkso MrIkso deleted the rename_res_file_by_headers branch May 20, 2025 20:14
@MrIkso
Copy link
Copy Markdown
Contributor Author

MrIkso commented May 20, 2025

a additional decoding run

@skylot Can you be more informative? I guess I'm not decoding the resources again, or do you mean header parsing is implemented a little in the wrong place? I seen in gui, decoding of resources themselves happens when you open them.

@skylot
Copy link
Copy Markdown
Owner

skylot commented May 20, 2025

Oh, sure, instead decoding I mean unzipping since ResourcesLoader.decodeStream( will unzip resource entry if it inside apk. Also, it will be a full entry, because JadxZipParser.getInputStream actually read all bytes (link). Looks like it should be implemented propertly 😭

@MrIkso

This comment was marked as outdated.

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.

[Resource] decode 9-patch png image extension inconsistently

3 participants