Classes with non-ascii characters don't build with resources #1389

Closed
gilhartman opened this Issue Dec 22, 2016 · 2 comments

Projects

None yet

2 participants

@gilhartman

Information

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

Stacktrace/Logcat

I: Using Apktool 2.2.1
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
I: Checking whether resources has changed...
I: Building resources...
W: /tmp/titanium/AndroidManifest.xml:34: Tag <application> attribute name has invalid character ''.
W: /tmp/titanium/AndroidManifest.xml:42: Tag <activity> attribute name has invalid character '�'.
W: /tmp/titanium/AndroidManifest.xml:43: Tag <activity> attribute name has invalid character '�'.
W: /tmp/titanium/AndroidManifest.xml:44: Tag <activity> attribute name has invalid character ';'.
W: /tmp/titanium/AndroidManifest.xml:45: Tag <activity> attribute name has invalid character '�'.
W: /tmp/titanium/AndroidManifest.xml:46: Tag <activity> attribute name has invalid character '('.
W: /tmp/titanium/AndroidManifest.xml:57: Tag <activity> attribute name has invalid character '�'.
W: /tmp/titanium/AndroidManifest.xml:58: Tag <activity> attribute name has invalid character '9'.
W: /tmp/titanium/AndroidManifest.xml:59: Tag <activity> attribute name has invalid character ''.
W: /tmp/titanium/AndroidManifest.xml:61: Tag <activity> attribute name has invalid character '0'.
W: /tmp/titanium/AndroidManifest.xml:62: Tag <activity> attribute name has invalid character '�'.
W: /tmp/titanium/AndroidManifest.xml:63: Tag <activity> attribute name has invalid character '�'.
W: /tmp/titanium/AndroidManifest.xml:64: Tag <activity> attribute name has invalid character '='.
W: /tmp/titanium/AndroidManifest.xml:65: Tag <activity> attribute name has invalid character 'u'.
W: /tmp/titanium/AndroidManifest.xml:66: Tag <activity> attribute name has invalid character '{'.
W: /tmp/titanium/AndroidManifest.xml:67: Tag <activity> attribute name has invalid character '�'.
W: /tmp/titanium/AndroidManifest.xml:118: Tag <activity> attribute name has invalid character 'v'.
W: /tmp/titanium/AndroidManifest.xml:119: Tag <activity> attribute name has invalid character '�'.
W: /tmp/titanium/AndroidManifest.xml:158: Tag <service> attribute name has invalid character 'x'.
Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [/var/folders/r_/lfrzsqgn4cxb416ysxq75sqh0000gn/T/brut_util_Jar_5106856621505491191.tmp, p, --forced-package-id, 127, --min-sdk-version, 3, --target-sdk-version, 21, --version-code, 389, --version-name, 7.6.0.1, -F, /var/folders/r_/lfrzsqgn4cxb416ysxq75sqh0000gn/T/APKTOOL6448860587238653316.tmp, -0, R, -0, arsc, -0, apk, -0, arsc, -I, /Users/gil/Library/apktool/framework/1.apk, -S, /tmp/titanium/res, -M, /tmp/titanium/AndroidManifest.xml]
	at brut.androlib.Androlib.buildResourcesFull(Androlib.java:478)
	at brut.androlib.Androlib.buildResources(Androlib.java:412)
	at brut.androlib.Androlib.build(Androlib.java:311)
	at brut.androlib.Androlib.build(Androlib.java:264)
	at brut.apktool.Main.cmdBuild(Main.java:227)
	at brut.apktool.Main.main(Main.java:84)
Caused by: brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [/var/folders/r_/lfrzsqgn4cxb416ysxq75sqh0000gn/T/brut_util_Jar_5106856621505491191.tmp, p, --forced-package-id, 127, --min-sdk-version, 3, --target-sdk-version, 21, --version-code, 389, --version-name, 7.6.0.1, -F, /var/folders/r_/lfrzsqgn4cxb416ysxq75sqh0000gn/T/APKTOOL6448860587238653316.tmp, -0, R, -0, arsc, -0, apk, -0, arsc, -I, /Users/gil/Library/apktool/framework/1.apk, -S, /tmp/titanium/res, -M, /tmp/titanium/AndroidManifest.xml]
	at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:439)
	at brut.androlib.Androlib.buildResourcesFull(Androlib.java:464)
	... 5 more
Caused by: brut.common.BrutException: could not exec (exit code = 1): [/var/folders/r_/lfrzsqgn4cxb416ysxq75sqh0000gn/T/brut_util_Jar_5106856621505491191.tmp, p, --forced-package-id, 127, --min-sdk-version, 3, --target-sdk-version, 21, --version-code, 389, --version-name, 7.6.0.1, -F, /var/folders/r_/lfrzsqgn4cxb416ysxq75sqh0000gn/T/APKTOOL6448860587238653316.tmp, -0, R, -0, arsc, -0, apk, -0, arsc, -I, /Users/gil/Library/apktool/framework/1.apk, -S, /tmp/titanium/res, -M, /tmp/titanium/AndroidManifest.xml]
	at brut.util.OS.exec(OS.java:95)/tmp
	at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:433)
	... 6 more

Steps to Reproduce

  1. apktool d titanium_backup.apk
  2. apktool b titanium_backup -o titanium_2.apk
  • Maybe related to issue #885

Frameworks

Android 7.0 from Nexus 5X

APK

http://www.apkmirror.com/apk/titanium-track/titanium-backup/titanium-backup-7-6-0-1-release/titanium-backup-%E2%98%85-root-7-6-0-1-android-apk-download/

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? Not relevant
  3. Are you using the latest apktool version? Yes
@iBotPeaches
Owner

Yeah almost certain duplicate of #885

I need to patch aapt. I've made good progress on this and should have a commit in soon for this.

@iBotPeaches
Owner
➜  Bug1389 apktool d titanim.apk 
I: Using Apktool 2.2.2-58ab04-SNAPSHOT on titanim.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: /home/ibotpeaches/.local/share/apktool/framework/1.apk
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Baksmaling classes.dex...
I: Copying assets and libs...
I: Copying unknown files...
I: Copying original files...
➜  Bug1389 apktool b titanim
I: Using Apktool 2.2.2-58ab04-SNAPSHOT
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
I: Checking whether resources has changed...
I: Building resources...
W: /home/ibotpeaches/Downloads/Apktool/Bug1389/titanim/AndroidManifest.xml:34: Tag <application> attribute name has invalid character '�'. Ignoring...
W: /home/ibotpeaches/Downloads/Apktool/Bug1389/titanim/AndroidManifest.xml:42: Tag <activity> attribute name has invalid character '�'. Ignoring...
W: /home/ibotpeaches/Downloads/Apktool/Bug1389/titanim/AndroidManifest.xml:43: Tag <activity> attribute name has invalid character '�'. Ignoring...
W: /home/ibotpeaches/Downloads/Apktool/Bug1389/titanim/AndroidManifest.xml:44: Tag <activity> attribute name has invalid character ';'. Ignoring...
W: /home/ibotpeaches/Downloads/Apktool/Bug1389/titanim/AndroidManifest.xml:45: Tag <activity> attribute name has invalid character ''. Ignoring...
W: /home/ibotpeaches/Downloads/Apktool/Bug1389/titanim/AndroidManifest.xml:46: Tag <activity> attribute name has invalid character '('. Ignoring...
W: /home/ibotpeaches/Downloads/Apktool/Bug1389/titanim/AndroidManifest.xml:57: Tag <activity> attribute name has invalid character '�'. Ignoring...
W: /home/ibotpeaches/Downloads/Apktool/Bug1389/titanim/AndroidManifest.xml:58: Tag <activity> attribute name has invalid character '9'. Ignoring...
W: /home/ibotpeaches/Downloads/Apktool/Bug1389/titanim/AndroidManifest.xml:59: Tag <activity> attribute name has invalid character '�'. Ignoring...
W: /home/ibotpeaches/Downloads/Apktool/Bug1389/titanim/AndroidManifest.xml:61: Tag <activity> attribute name has invalid character '0'. Ignoring...
W: /home/ibotpeaches/Downloads/Apktool/Bug1389/titanim/AndroidManifest.xml:62: Tag <activity> attribute name has invalid character '�'. Ignoring...
W: /home/ibotpeaches/Downloads/Apktool/Bug1389/titanim/AndroidManifest.xml:63: Tag <activity> attribute name has invalid character '�'. Ignoring...
W: /home/ibotpeaches/Downloads/Apktool/Bug1389/titanim/AndroidManifest.xml:64: Tag <activity> attribute name has invalid character '='. Ignoring...
W: /home/ibotpeaches/Downloads/Apktool/Bug1389/titanim/AndroidManifest.xml:65: Tag <activity> attribute name has invalid character 'u'. Ignoring...
W: /home/ibotpeaches/Downloads/Apktool/Bug1389/titanim/AndroidManifest.xml:66: Tag <activity> attribute name has invalid character '{'. Ignoring...
W: /home/ibotpeaches/Downloads/Apktool/Bug1389/titanim/AndroidManifest.xml:67: Tag <activity> attribute name has invalid character '�'. Ignoring...
W: /home/ibotpeaches/Downloads/Apktool/Bug1389/titanim/AndroidManifest.xml:118: Tag <activity> attribute name has invalid character 'v'. Ignoring...
W: /home/ibotpeaches/Downloads/Apktool/Bug1389/titanim/AndroidManifest.xml:119: Tag <activity> attribute name has invalid character '�'. Ignoring...
W: /home/ibotpeaches/Downloads/Apktool/Bug1389/titanim/AndroidManifest.xml:158: Tag <service> attribute name has invalid character 'x'. Ignoring...
I: Copying libs... (/lib)
I: Building apk file...
I: Copying unknown files/dir...
➜  Bug1389 

Seems to be working well.

@iBotPeaches iBotPeaches closed this in #1390 Dec 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment