Skip to content

Conversation

Copy link

Copilot AI commented Dec 21, 2025

When decoding resources with non-standard package IDs (e.g., 0x58), Apktool logged warnings and replaced unresolvable references with @null, losing the original resource information needed for rebuilding.

Changes

  • ResReference.encodeAsResXmlValue(): Return hex-formatted resource ID (e.g., @0x580f0000) when resolution fails, instead of @null
  • ResReferenceTest: Add unit tests covering unresolvable references, attribute references, and null handling

Before

// Unresolvable resource 0x580f0000
// Logs: "Could not decode attr value: ns=android, name=resource, value=0x580f0000"
// Encodes as: "@null" (information lost)

After

// Unresolvable resource 0x580f0000
// No warning
// Encodes as: "@0x580f0000" (preserves original reference)

This eliminates spurious warnings while maintaining the ability to round-trip APKs with external or obfuscated resource references.

Original prompt

How to fix Decoding AndroidManifest.xml with resources...
W: Could not decode attr value: ns=android, name=resource, value=0x580f0000
I: Baksmaling classes35.dex...


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

When a resource reference cannot be resolved (e.g., resources with non-standard package IDs like 0x58), preserve the resource ID in hex format instead of returning "@null". This ensures the reference is not lost and can be properly rebuilt.

Also added comprehensive unit tests to verify the fix.

Co-authored-by: Eduardob3677 <212653915+Eduardob3677@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix decoding issues in AndroidManifest.xml Preserve unresolvable resource IDs instead of converting to @null Dec 21, 2025
Copilot AI requested a review from Eduardob3677 December 21, 2025 17:46
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