2

When I try to run the apktool to decompile my apk it gives off an error:

 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:199)
        at brut.androlib.ApkDecoder.decode(ApkDecoder.java:83)
        at brut.apktool.Main.cmdDecode(Main.java:146)
        at brut.apktool.Main.main(Main.java:77)
    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:197)
        ... 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:128)
        at java.util.zip.ZipFile.<init>(ZipFile.java:145)
        at brut.directory.ZipRODirectory.<init>(ZipRODirectory.java:53)
        ... 6 more

I followed this guide. http://www.adventuresofanentrepreneur.net/creating-a-mobile-appsgames-company/how-to-unpack-pack-an-apk-file

Am I missing some files it needs to operate?

3 Answers3

0

I checked all the other solution but now I found i was using jdk1.6 which was preinstalled on my machine. Maybe a java update might solve this problem. The apktool documentation explicitly mentions that it needs minimum of jdk 1.7. More info here:https://code.google.com/p/android-apktool/

kandelvijaya
  • 1,545
  • 12
  • 20
0

try unzip your apk file first

apk is a zipfile the message said it cannot unzip the apk first

so try your self to unzip the apk file to find whether it is a real apk

Liu Dapeng
  • 71
  • 5
0

This error means Apktool cannot open the Zipfile to read the files it wants (classes.dex in this case). Try using a regular Zip program (Like 7zip or Winrar) and try and unzip the apk. If this works, then apktool is at fault and you should report a bug. However, I believe it will fail, in which case you need to figure out why that is. It could be any of the following reasons:

  1. Apk utilizes the "general access bit" hack, which no longer runs on Android, thus apktool removed support for it.
  2. Apk has a password on it.
  3. Apk was improperly downloaded, thus not complete
Connor Tumbleson
  • 3,270
  • 2
  • 25
  • 37