Skip to content

fix: improve ResAttribute value formatting#3994

Merged
iBotPeaches merged 1 commit into
iBotPeaches:mainfrom
IgorEisberg:3.x-fix
Sep 24, 2025
Merged

fix: improve ResAttribute value formatting#3994
iBotPeaches merged 1 commit into
iBotPeaches:mainfrom
IgorEisberg:3.x-fix

Conversation

@IgorEisberg
Copy link
Copy Markdown
Collaborator

@IgorEisberg IgorEisberg commented Sep 23, 2025

  • Fixes incorrect TYPE_ANY check in renderFormat.
  • Fixes forcing integer encoded as a string to remain a string by prepending a backslash.
  • Formats attribute values using a centralized method.
  • Formats unqualified or unresolved attributes using a default ResAttribute instance.
  • xmlSmallNumbersDontEscapeTest removed as it tested a normal aapt2 behavior (redundant), and already covered by meta-data tag test.
  • AndroidManifestResourceParser and BinaryXmlResourceParser's getAttributeValueType (non-standard API) no longer needed, the above changes already cover that.
  • Fix support for featureFlags prefixed with ! (false rather than true).
  • Support skipping ResFlags symbols if the key resource cannot be resolved.
  • Some variables and functions renamed for consistency with the rest of code.

Fixes incorrect TYPE_ANY check in renderFormat.
Fixes forcing integer encoded as a string to remain a string by prepending a backslash.
Formats attribute values using a centralized method.
Formats unqualified or unresolved attributes using a default ResAttribute instance.
xmlSmallNumbersDontEscapeTest removed as it tested a normal aapt2 behavior (redundant), and already covered by meta-data tag test.
AndroidManifestResourceParser and BinaryXmlResourceParser's getAttributeValueType (non-standard API) no longer needed, the above changes already cover that.
Some variables and functions renamed for consistency with the rest of code.
@IgorEisberg
Copy link
Copy Markdown
Collaborator Author

This also fixes this case #3898.
Only integer escaping is handled, which is the only case that appears often, to keep it light.

@iBotPeaches iBotPeaches added this to the 3.0.0 milestone Sep 24, 2025
@iBotPeaches iBotPeaches merged commit 8fd4b31 into iBotPeaches:main Sep 24, 2025
18 checks passed
@iBotPeaches
Copy link
Copy Markdown
Owner

thanks!

iBotPeaches added a commit to iBotPeaches/apktool.org that referenced this pull request Sep 24, 2025
@IgorEisberg IgorEisberg deleted the 3.x-fix branch September 25, 2025 14:35
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