berkus / android-apktool

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

Exception in thread "main" brut.androlib.AndrolibException #228

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. For some apks, while I try to decompile using the command apktool d <name of 
apk", I am getting this error.
2. I tried apktool on so many apks and success rate is around 60%. Is there any 
known limitation for apktool?
3.

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

Expected out is a folder with Manifest file, res folder and smali files. Now we 
get a blank folder with the following error message

apktool d a.apk 
Exception in thread "main" brut.androlib.AndrolibException: 
brut.directory.DirectoryException: java.util.zip.ZipException: error in opening 
zip file
    at brut.androlib.ApkDecoder.hasSources(ApkDecoder.java:158)
    at brut.androlib.ApkDecoder.decode(ApkDecoder.java:79)
    at brut.apktool.Main.cmdDecode(Main.java:120)
    at brut.apktool.Main.main(Main.java:57)
Caused by: brut.directory.DirectoryException: java.util.zip.ZipException: error 
in opening zip file
    at brut.directory.ZipRODirectory.<init>(ZipRODirectory.java:55)
    at brut.directory.ZipRODirectory.<init>(ZipRODirectory.java:38)
    at brut.androlib.res.util.ExtFile.getDirectory(ExtFile.java:55)
    at brut.androlib.ApkDecoder.hasSources(ApkDecoder.java:156)
    ... 3 more
Caused by: java.util.zip.ZipException: error in opening zip file
    at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.<init>(ZipFile.java:127)
    at java.util.zip.ZipFile.<init>(ZipFile.java:144)
    at brut.directory.ZipRODirectory.<init>(ZipRODirectory.java:53)
    ... 6 more

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

v1.4.2.269870b

Please provide any additional information below.

I am trying some of the apk's I downloaded from app store.

Original issue reported on code.google.com by iamnan...@gmail.com on 13 Oct 2011 at 9:31

GoogleCodeExporter commented 9 years ago
Could you upload any of such .apk files?

Original comment by Brut.alll on 5 Nov 2011 at 11:35

GoogleCodeExporter commented 9 years ago
Hi,

Thanks for responding to my question. I was able to resolve this particular 
issue. The failed apks were not zip-aligned. When I manually zip-aligned and 
tried, it worked fine.

Original comment by iamnan...@gmail.com on 8 Nov 2011 at 5:15

GoogleCodeExporter commented 9 years ago
I also have same Problem with these two files:

apktool if a.apk out
Exception in thread "main" brut.androlib.AndrolibException: 
java.util.zip.ZipException: error in opening zip file
    at brut.androlib.res.AndrolibResources.installFramework(AndrolibResources.java:404)
    at brut.androlib.Androlib.installFramework(Androlib.java:365)
    at brut.apktool.Main.cmdInstallFramework(Main.java:193)
    at brut.apktool.Main.main(Main.java:69)
Caused by: java.util.zip.ZipException: error in opening zip file
    at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.<init>(ZipFile.java:131)
    at java.util.zip.ZipFile.<init>(ZipFile.java:148)
    at brut.androlib.res.AndrolibResources.installFramework(AndrolibResources.java:374)
    ... 3 more

Original comment by uhaya...@gmail.com on 13 Jul 2012 at 3:14

Attachments:

GoogleCodeExporter commented 9 years ago
I can't even open those APKs in 7zip. That ZIP is just corrupted. 

Original comment by connor.tumbleson on 30 Dec 2012 at 3:30

GoogleCodeExporter commented 9 years ago
I also have same Problem with these two files:

Original comment by 7i7i...@gmail.com on 3 Aug 2013 at 5:45

Attachments:

GoogleCodeExporter commented 9 years ago
hello 

how to make apks zip-aligned?

Original comment by pengg...@gmail.com on 2 Dec 2013 at 3:52

GoogleCodeExporter commented 9 years ago
i try to "install" framework-res.apk and the it occour. the newest version of 
apktool windows 7 64bit CN

Original comment by cxycxy1...@gmail.com on 25 Mar 2014 at 1:45

GoogleCodeExporter commented 9 years ago
Exception in thread "main" brut.androlib.AndrolibException: 
brut.androlib.AndrolibException: brut.common.BrutException: could not exec 
command: [aapt, p, --min-sdk-version, 11, --target-sdk-version, 18, -F, 
/tmp/APKTOOL6774976142188952594.tmp, -0, arsc, -I, 
/root/apktool/framework/1.apk, -S, /usr/local/bin/1/res, -M, 
/usr/local/bin/1/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, 11, --target-sdk-version, 18, 
-F, /tmp/APKTOOL6774976142188952594.tmp, -0, arsc, -I, 
/root/apktool/framework/1.apk, -S, /usr/local/bin/1/res, -M, 
/usr/local/bin/1/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, 11, --target-sdk-version, 18, -F, 
/tmp/APKTOOL6774976142188952594.tmp, -0, arsc, -I, 
/root/apktool/framework/1.apk, -S, /usr/local/bin/1/res, -M, 
/usr/local/bin/1/AndroidManifest.xml]
        at brut.util.OS.exec(OS.java:93)
        at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:355)
        ... 6 more
Caused by: java.io.IOException: Cannot run program "aapt": java.io.IOException: 
error=2, No such file or directory
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:470)
        at java.lang.Runtime.exec(Runtime.java:593)
        at java.lang.Runtime.exec(Runtime.java:466)
        at brut.util.OS.exec(OS.java:84)
        ... 7 more
Caused by: java.io.IOException: java.io.IOException: error=2, No such file or 
directory
        at java.lang.UNIXProcess.<init>(UNIXProcess.java:148)
        at java.lang.ProcessImpl.start(ProcessImpl.java:65)
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:452)
        ... 10 more

Original comment by qitib...@gmail.com on 16 Jun 2014 at 9:33