fix: roundtrip XML values containing CDATA-like strings#3826
Merged
iBotPeaches merged 2 commits intoiBotPeaches:masterfrom Mar 25, 2025
Merged
fix: roundtrip XML values containing CDATA-like strings#3826iBotPeaches merged 2 commits intoiBotPeaches:masterfrom
iBotPeaches merged 2 commits intoiBotPeaches:masterfrom
Conversation
This fixes the case where the value for an XML element that needs to be
escaped contains text looking like the ending of a CDATA tag (']]>') as this
must be escaped.
Owner
|
Do you have a sample string from something in the wild that led to this? I understand these samples and description, but trying to piece together with something in the wild to understand the flaw Apktool originally had in escaping. |
Contributor
Author
|
@iBotPeaches You can find an example in the french resources of the uber app: apkeep -a com.ubercab -d google-play -o split_apk=true,locale=fr_FR .
cd com.ubercab
java -jar ~/apktool_2.11.1.jar d com.ubercab.config.fr.apk
cat com.ubercab.config.fr/res/values-fr/strings.xmlThis will look something like this: <?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="account_switcher_account_limit_error_modal_message">"<![CDATA[Vous avez atteint la limite de votre compte. Appuyez sur l'icône <b>Gérer</b> (icône en forme d'engrenage) pour vous déco
nnecter de l'un de vos comptes avant d'en ajouter un autre.]]>"</string>
</resources> |
iBotPeaches
reviewed
Mar 25, 2025
Owner
iBotPeaches
left a comment
There was a problem hiding this comment.
Looks good - just a few minor nitpicks.
brut.apktool/apktool-lib/src/test/java/brut/androlib/res/xml/ResXmlEncodersTest.java
Outdated
Show resolved
Hide resolved
* Reorder methods in ResXmlEncoderTest * Fix indent of 'throws' line in XmlUtils
371f1c1 to
8f564d2
Compare
Contributor
Author
|
Nitpicks should be fixed now |
iBotPeaches
approved these changes
Mar 25, 2025
iBotPeaches
added a commit
to iBotPeaches/apktool.org
that referenced
this pull request
Mar 25, 2025
Owner
|
thanks! |
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.
This fixes the case where the value (text content) for an XML element that needs to be escaped contains text looking like the ending of a CDATA tag (
]]>) as this must be escaped.Relevant specification: https://www.w3.org/TR/xml/#syntax