fix: improve ResAttribute value formatting#3994
Merged
Merged
Conversation
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.
Collaborator
Author
|
This also fixes this case #3898. |
iBotPeaches
approved these changes
Sep 24, 2025
Owner
|
thanks! |
iBotPeaches
added a commit
to iBotPeaches/apktool.org
that referenced
this pull request
Sep 24, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TYPE_ANYcheck inrenderFormat.ResAttributeinstance.xmlSmallNumbersDontEscapeTestremoved as it tested a normal aapt2 behavior (redundant), and already covered by meta-data tag test.AndroidManifestResourceParserandBinaryXmlResourceParser'sgetAttributeValueType(non-standard API) no longer needed, the above changes already cover that.featureFlagsprefixed with!(falserather thantrue).ResFlagssymbols if the key resource cannot be resolved.