arshidkv12 / android-apktool

Automatically exported from code.google.com/p/android-apktool
0 stars 1 forks source link

Error parsing XML: not well-formed (invalid token) #776

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
- Download and recompile this APK: 
https://www.dropbox.com/s/916e1t25k6notia/locus.apk?dl=1

What is the expected output? What do you see instead?

warning: string 'pref_map_show_center_cross' has no default translation.
warning: string 'pref_map_show_center_cross_desc' has no default translation.

C:\Apktool\res\layout\abc_action_menu_layout.xml:2: error: Error parsing XML: 
not well-formed (invalid token)

C:\Apktool\res\layout\abc_action_mode_bar.xml:2: error: Error parsing XML: not 
well-formed (invalid token)

C:\Apktool\res\layout\abc_activity_chooser_view.xml:2: error: Error parsing 
XML: not well-formed (invalid token)

--- And 5 more similar errors ---

C:\Apktool\res\layout\fragment_track_record.xml:24: error: No resource 
identifier found for attribute 'pw_text' in package 'android'

C:\Apktool\res\layout\fragment_track_record.xml:24: error: No resource 
identifier found for attribute 'pw_textSize' in package 'android'

C:\Apktool\res\layout\fragment_track_record.xml:24: error: No resource 
identifier found for attribute 'pw_barColor' in package 'android'

-- And >10 similar errors ---

C:\Apktool\res\layout\view_color_picker_basic_tab.xml:5: error: Error parsing 
XML: duplicate attribute

What version of the product are you using? On what operating system?
- Apktool RC4
- aapt.exe (from the Apktool GitHub repository)

Please provide any additional information below.
Seems that XML tags are corrupt. Tried to fix these XML tags manually - no 
luck. Also tried different aapt and Apktool releases - still the same. Removing 
"framework/1.apk" does not help.

Original issue reported on code.google.com by kefir...@gmail.com on 4 Mar 2015 at 10:57

GoogleCodeExporter commented 9 years ago
Yeah no idea what this is. There are some strange characters in the layout 
files.

<o.ᴗ android:gravity

Dumping out the resources via aapt

ibotpeaches@raganok:~/Downloads/Apktool/Bug776$ aapt d xmltree locus.apk 
res/layout/abc_action_menu_layout.xml
N: android=http://schemas.android.com/apk/res/android
  N: app=http://schemas.android.com/apk/res-auto
    E: o.ᴗ (line=17)

Yields the same weird character. Needs more investigation.

Original comment by connor.tumbleson on 11 Mar 2015 at 12:25

GoogleCodeExporter commented 9 years ago
The unknow tag name is actually the full qualified name of a custom UI class, 
which has been obfuscated. I suffered the same issue and I found the symbol in 
smali files.
I think this could be a common case for lots of commerical apps.

Original comment by Liquid.S...@gmail.com on 13 Mar 2015 at 11:20

GoogleCodeExporter commented 9 years ago
Is this from a certain ROM/OEM then? How does an obfuscated resource work 
without being de-obfuscated prior to use? 

Its not like Android knows this mapping of obfuscation -> real resource names.

Original comment by connor.tumbleson on 13 Mar 2015 at 11:21

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
DexGuard could generate non-ASCII characters for class/method/field names, 
which is not supported by stock AAPT. 

Original comment by Liquid.S...@gmail.com on 14 Mar 2015 at 12:18

GoogleCodeExporter commented 9 years ago
aapt is all about resources. It doesn't manage the source (java) at all, so 
those points aren't relatable. 

Original comment by connor.tumbleson on 14 Mar 2015 at 12:20

GoogleCodeExporter commented 9 years ago
You can claim a custom UI class (TextView for example) and reference it in the 
layout xml file. In this case it would involve compiled resoruce file.

Once that class was obfuscate by something like DexGuard, the class reference 
in layout xml file would be modified as well.

Original comment by Liquid.S...@gmail.com on 14 Mar 2015 at 12:25

GoogleCodeExporter commented 9 years ago
Ah true true. Custom UI classes then are just localized mapping in an 
application. So it doesn't matter if the naming is Foo or some crazy UTF8 
character.

The question remains AAPT is obviously not liking it. So as you said a custom 
AAPT must be used. With that being said, do you have any information on this? I 
looked around there website (Dexguard/Proguard) and couldn't find anything.

Original comment by connor.tumbleson on 14 Mar 2015 at 12:50