desword / android-apktool

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

Cannot build com.parrot.mediaplayer.apk with no changes #590

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. apktool d com.parrot.mediaplayer.apk
2. make no changes
3. apktool b com.parrot.mediaplayer

What is the expected output? What do you see instead?
The expected output is a newly built apk. Instead aapt crashes.

What version of the product are you using? On what operating system?
apktool 1.5.2

Please provide any additional information below.
$ apktool b com.parrot.mediaplayer
I: Checking whether sources has changed...
I: Checking whether resources has changed...
I: Building resources...
Exception in thread "main" brut.androlib.AndrolibException: 
brut.androlib.AndrolibException: brut.common.BrutException: could not exec 
command: [aapt, p, --min-sdk-version, 10, --target-sdk-version, 10, -F, 
/var/folders/gd/qy2sgx4s48j4z_p0rmmbtf8w0000gn/T/APKTOOL853435192998045663.tmp, 
-0, arsc, -I, /Users/richard/Library/apktool/framework/1.apk, -S, 
/private/tmp/mp/com.parrot.mediaplayer/res, -M, 
/private/tmp/mp/com.parrot.mediaplayer/AndroidManifest.xml]
    at brut.androlib.Androlib.buildResourcesFull(Androlib.java:358)
    at brut.androlib.Androlib.buildResources(Androlib.java:283)
    at brut.androlib.Androlib.build(Androlib.java:206)
    at brut.androlib.Androlib.build(Androlib.java:176)
    at brut.apktool.Main.cmdBuild(Main.java:228)
    at brut.apktool.Main.main(Main.java:79)
Caused by: brut.androlib.AndrolibException: brut.common.BrutException: could 
not exec command: [aapt, p, --min-sdk-version, 10, --target-sdk-version, 10, 
-F, 
/var/folders/gd/qy2sgx4s48j4z_p0rmmbtf8w0000gn/T/APKTOOL853435192998045663.tmp, 
-0, arsc, -I, /Users/richard/Library/apktool/framework/1.apk, -S, 
/private/tmp/mp/com.parrot.mediaplayer/res, -M, 
/private/tmp/mp/com.parrot.mediaplayer/AndroidManifest.xml]
    at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:357)
    at brut.androlib.Androlib.buildResourcesFull(Androlib.java:336)
    ... 5 more
Caused by: brut.common.BrutException: could not exec command: [aapt, p, 
--min-sdk-version, 10, --target-sdk-version, 10, -F, 
/var/folders/gd/qy2sgx4s48j4z_p0rmmbtf8w0000gn/T/APKTOOL853435192998045663.tmp, 
-0, arsc, -I, /Users/richard/Library/apktool/framework/1.apk, -S, 
/private/tmp/mp/com.parrot.mediaplayer/res, -M, 
/private/tmp/mp/com.parrot.mediaplayer/AndroidManifest.xml]
    at brut.util.OS.exec(OS.java:89)
    at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:355)
    ... 6 more

On OS X 10.9:
$ aapt p --min-sdk-version 10 --target-sdk-version 10 -F 
/var/folders/gd/qy2sgx4s48j4z_p0rmmbtf8w0000gn/T/APKTOOL853435192998045663.tmp 
-0 arsc -I /Users/richard/Library/apktool/framework/1.apk -S 
/tmp/mp/com.parrot.mediaplayer/res -M 
/tmp/mp/com.parrot.mediaplayer/AndroidManifest.xml
Bus error: 10

On Linux:
$ ./aapt p --min-sdk-version 10 --target-sdk-version 10 -F 
/tmp/APKTOOL610652308137494516.tmp -0 arsc -I 
/share/homes/richard/apktool/framework/1.apk -S 
/tmp/mp/com.parrot.mediaplayer/res -M 
/tmp/mp/com.parrot.mediaplayer/AndroidManifest.xml
Segmentation fault

You can download the apk here:
https://www.dropbox.com/s/9zkauihjds4b2z7/com.parrot.mediaplayer.apk

Original issue reported on code.google.com by richard....@gmail.com on 13 Jan 2014 at 8:38

GoogleCodeExporter commented 9 years ago
Damn. You are segfaulting aapt. I haven't seen that in 2 years.

Original comment by connor.tumbleson on 13 Jan 2014 at 11:30

GoogleCodeExporter commented 9 years ago
I'm glad to hear this is rare. However, I really want to modify this apk. Is 
there anything I can do to get this fixed? Would a gdb trace be useful?

Original comment by richard....@gmail.com on 14 Jan 2014 at 2:50

GoogleCodeExporter commented 9 years ago
I am facing same issue. This is application specific. I have successfully 
rebuilt several apks using apktool. But for one specific apk it fails.

Original comment by shahnish...@gmail.com on 22 Jan 2014 at 11:23

GoogleCodeExporter commented 9 years ago
Same issues as in segfaulting apk? 
Or you've confirmed the fact that this apk segfaults aapt? 

The latter is already confirmed, as I duplicated the problem. If you've 
confirmed it as well. You may use the "star" feature on this issue to receive 
notifications about changes to its status. The former doesn't really help 
because there is no apk / stacktrace / log output.

Just because an apk fails to rebuild doesn't mean its this issue. I doubt there 
are two apks in a short period of time that segfault aapt, unless we've 
discovered some new obfuscation technique. 

Either way. I'm making a new aapt from source that has some debug things 
enabled. I'll run this apk through again and see what we are dealing with.

Original comment by connor.tumbleson on 22 Jan 2014 at 1:12

GoogleCodeExporter commented 9 years ago
Thanks for the quick reply. I didn't really used attached media player apk. I 
faced same issue today with a different apk.  It threw same exception on same 
lines. Unfortunately, I won't be able to share apk here.

Original comment by shahnish...@gmail.com on 22 Jan 2014 at 1:51

GoogleCodeExporter commented 9 years ago
I am also seeing the for another APK. Can disassemble and build others fine, 
but just came across an APK this morning where it is failing on the same error 
as you are getting.

Original comment by adamboul...@gmail.com on 8 Apr 2014 at 10:56

GoogleCodeExporter commented 9 years ago
https://github.com/iBotPeaches/Apktool/commit/fb67c0cd1565cc16f6aff26b4e22520d18
8bdedb

I can't duplicate this segfaulting aapt anymore with this updated aapt (shown 
in the above commit)

Original comment by connor.tumbleson on 27 Dec 2014 at 12:39

GoogleCodeExporter commented 9 years ago
I cannot reproduce the segfault with com.parrot.mediaplayer.apk either. Thanks 
a lot for this fix!

Original comment by richard....@gmail.com on 1 Jan 2015 at 2:28