Apktool icon indicating copy to clipboard operation
Apktool copied to clipboard

[BUG] <annotation> tags are escaped to &lt;annotation> in plurals.xml

Open FoseFx opened this issue 4 years ago • 1 comments

Information

  1. Apktool Version (apktool -version) - 2.5.0
  2. Operating System (Mac, Linux, Windows) - Linux
  3. APK From? (Playstore, ROM, Other) - Apkmirror

Steps to Reproduce

  1. Ensure app renders annotations properly
  2. apktool d
  3. Check res/values/plurals.xml to see all <annotation> tags are escaped to &lt;annotation>
  4. apktool b . --use-aapt2, sign and install
  5. App displays annotation string

Workaround

Replace all &lt;annotation with <annotation and &lt;/annotation with </annotation in plurals.xml and the app behaves as it should.

APK

https://www.dropbox.com/s/4afhhkxrduttn9c/twitch-11.0.0.apk

Questions to ask before submission

  1. Have you tried apktool d, apktool b without changing anything?

    Yes

  2. If you are trying to install a modified apk, did you resign it?

    Yes

  3. Are you using the latest apktool version?

    Yes

FoseFx avatar Jun 30 '21 08:06 FoseFx

Confirmed. Marked as bug.

Seems lots of confusion docs about this.

  1. Here is list of things we should escape (no <) - https://developer.android.com/guide/topics/resources/string-resource#FormattingAndStyling

  2. Later on in the HTML section it mentions escaping the HTML blocks per usual - https://developer.android.com/guide/topics/resources/string-resource

  3. Newly added is annotations which don't need to be escaped (?) yet all other HTML blocks do (??) - https://developer.android.com/guide/topics/resources/string-resource


Not going to be easy since Apktool doesn't presently have an allow/deny list of tags to escape or not.

iBotPeaches avatar Jun 30 '21 10:06 iBotPeaches