[Android Software Development] NCandiano:
Decompile Bug

Hello,

Let me first say thank you for taking this work back up. 1.4.10 is a dream in linux. However, there is a bug in decompile that I've been dealing with for a while in 4.1.1 builds, and with both Windows 7 and Ubuntu.

OS: Ubuntu 12.04/Windows 7

ApkTool: 1.4.10, patched aapt, requisite dependencies(linux/windows)(Also present in 1.4.3 and 1.4.9)

Bugs Present When: Decompiling/Recompiling Phone.apk

Input/Output:

ncandiano@ncandiano-HP-Pavilion-g6-Notebook-PC:~$ cd ~/Android

ncandiano@ncandiano-HP-Pavilion-g6-Notebook-PC:~/Android$ adb pull system/app/Phone.apk

4016 KB/s (2149676 bytes in 0.522s)

ncandiano@ncandiano-HP-Pavilion-g6-Notebook-PC:~/Android$ adb pull system/app/SystemUI.apk

3047 KB/s (1229804 bytes in 0.394s)

ncandiano@ncandiano-HP-Pavilion-g6-Notebook-PC:~/Android$ adb pull system/framework/framework-res.apk

4524 KB/s (9680663 bytes in 2.089s)

ncandiano@ncandiano-HP-Pavilion-g6-Notebook-PC:~/Android$ apktool if framework-res.apk

I: Framework installed to: /home/ncandiano/apktool/framework/1.apk

ncandiano@ncandiano-HP-Pavilion-g6-Notebook-PC:~/Android$ apktool if SystemUI.apk

I: Framework installed to: /home/ncandiano/apktool/framework/127.apk

ncandiano@ncandiano-HP-Pavilion-g6-Notebook-PC:~/Android$ apktool d -f Phone.apkI: Baksmaling...

I: Loading resource table...

W: Skipping "android" package group

I: Loaded.

I: Decoding AndroidManifest.xml with resources...

I: Loading resource table from file: /home/ncandiano/apktool/framework/1.apk

I: Loaded.

I: Decoding file-resources...

I: Decoding values*/* XMLs...

I: Done.

I: Copying assets and libs...

ncandiano@ncandiano-HP-Pavilion-g6-Notebook-PC:~/Android$ apktool b Phone

I: Checking whether sources has changed...

I: Smaling...

I: Checking whether resources has changed...

I: Building resources...

/home/ncandiano/Android/Phone/res/values-de/strings.xml:170: error: Multiple substitutions specified in non-positional format; did you mean to add the formatted="false" attribute?

/home/ncandiano/Android/Phone/res/values-de/strings.xml:171: error: Unexpected end tag string

/home/ncandiano/Android/Phone/res/values-es/strings.xml:170: error: Multiple substitutions specified in non-positional format; did you mean to add the formatted="false" attribute?

/home/ncandiano/Android/Phone/res/values-es/strings.xml:171: error: Unexpected end tag string

/home/ncandiano/Android/Phone/res/values-es-rUS/strings.xml:173: error: Multiple substitutions specified in non-positional format; did you mean to add the formatted="false" attribute?

/home/ncandiano/Android/Phone/res/values-es-rUS/strings.xml:174: error: Unexpected end tag string

/home/ncandiano/Android/Phone/res/values-it/strings.xml:170: error: Multiple substitutions specified in non-positional format; did you mean to add the formatted="false" attribute?

/home/ncandiano/Android/Phone/res/values-it/strings.xml:171: error: Unexpected end tag string

Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, -F, /tmp/APKTOOL5436931491893818727.tmp, -I, /home/ncandiano/apktool/framework/1.apk, -S, /home/ncandiano/Android/Phone/res, -M, /home/ncandiano/Android/Phone/AndroidManifest.xml]

at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:251)

at brut.androlib.Androlib.buildResourcesFull(Androlib.java:324)

at brut.androlib.Androlib.buildResources(Androlib.java:269)

at brut.androlib.Androlib.build(Androlib.java:192)

at brut.androlib.Androlib.build(Androlib.java:174)

at brut.apktool.Main.cmdBuild(Main.java:185)

at brut.apktool.Main.main(Main.java:70)

Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F, /tmp/APKTOOL5436931491893818727.tmp, -I, /home/ncandiano/apktool/framework/1.apk, -S, /home/ncandiano/Android/Phone/res, -M, /home/ncandiano/Android/Phone/AndroidManifest.xml]

at brut.util.OS.exec(OS.java:83)

at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:249)

... 6 more

Notes: The bug only occurs with THIS apk and THESE language specific packs. Deleting the packs allows me to recompile cleanly, but I figured I'd report the bug anyway. As I said I've duplicated the error across 3 builds and 2 OS's. Thank You again for all your hard work on this project!