Apktool icon indicating copy to clipboard operation
Apktool copied to clipboard

Decompiled strings.xml is invalid

Open omervk opened this issue 9 years ago • 4 comments

Using apktool 2.0.3, decompile com.google.android.apps.docs.editors.slides (version 60521040). In the output directory, res/values/strings.xml contains the following in line 808:

<string name="document_info_panel_path">On <g example="My device (Nexus 4) > foo > bar\" id=\"document_info_panel_path\">%1$s</g></string>

This is invalid XML and the expected result is either:

<string name="document_info_panel_path">On &lt;g example=\"My device (Nexus 4) &gt; foo &gt; bar\" id=\"document_info_panel_path\"&gt;%1$s&lt;/g&lt;</string>

or:

<string name="document_info_panel_path">On <g example="My device (Nexus 4) > foo > bar" id="document_info_panel_path">%1$s</g></string>

Now, this may be similar to Issue 859, but this APK is coming from Google themselves, which makes me doubtful that it's an issue of non-standard coding and mentioned in that issue.

Note that this issue exists throughout the file and is inconsistent:

  1. Line 914: <string name="empty_doclist_for_pinned_view_details_can_edit">"Tap \"Available offline\" in a file's menu so you can keep working on it offline."</string> (escaped quotes vs. unescaped quotes)
  2. Line 1369: <string name="navigation_search_results">Search: \"<g example="Cruise" id="searchTerm">%s</g>\"</string> (no escaping except around xml element)
  3. Line 2420: <string name="template_list_brand_link">" by &lt;a href=\""<g example="http://billnye.com/" id="brand_name">%2$s</g>\"><g example="Bill Nye, The Science Guy" id="brand_name">%1$s</g>"&lt;/a> "</string> (wat)

It's all very strange and I'd love to hear what you think.

Thanks for taking the time and for the great tool! :+1:

omervk avatar Feb 21 '16 11:02 omervk

I'll have to build some unit-tests using these values, because I'm not sure why values weren't escaped or converted at all.

iBotPeaches avatar Feb 21 '16 15:02 iBotPeaches

Thanks! The APK upload expires in a week, so if you need me to re-upload it at any point, please let me know.

omervk avatar Feb 21 '16 15:02 omervk

I've got the apk already, just a little hard to effectively debug a file as large as google applications. Once I create the unit-tests that replicate the behavior, it'll be a lot easier to investigate.

iBotPeaches avatar Feb 21 '16 15:02 iBotPeaches

I've got several apks where apktool 2.3.0 produces strings.xml files without well-formed xml. There are basically unbalanced html-tags as content of a string tag interspersed with quoted strings.

  <string name="welcome">" ...
..."<b>hallo</b></i>"...
..."</string>

cmaeder avatar Nov 01 '17 15:11 cmaeder