简体   繁体   English

Mac上的Apktool错误

[英]Apktool error on mac

When I try to run the apktool to decompile my apk it gives off an error: 当我尝试运行apktool来反编译我的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: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 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? 我是否缺少一些需要操作的文件?

I checked all the other solution but now I found i was using jdk1.6 which was preinstalled on my machine. 我检查了所有其他解决方案,但现在发现我使用的是预装在机器上的jdk1.6。 Maybe a java update might solve this problem. 也许Java更新可能会解决此问题。 The apktool documentation explicitly mentions that it needs minimum of jdk 1.7. apktool文档明确提到它至少需要jdk 1.7。 More info here: https://code.google.com/p/android-apktool/ 此处提供更多信息: https : //code.google.com/p/android-apktool/

try unzip your apk file first 尝试先解压缩您的apk文件

apk is a zipfile the message said it cannot unzip the apk first apk是一个zipfile消息说它不能先解压缩apk

so try your self to unzip the apk file to find whether it is a real apk 因此,请尝试自行解压缩apk文件以查找它是否是真正的apk

This error means Apktool cannot open the Zipfile to read the files it wants ( classes.dex in this case). 此错误意味着Apktool无法打开Zipfile读取所需的文件(在这种情况下为classes.dex )。 Try using a regular Zip program (Like 7zip or Winrar ) and try and unzip the apk. 尝试使用常规的Zip程序(例如7zipWinrar ),然后尝试解压缩apk。 If this works, then apktool is at fault and you should report a bug. 如果可行,则apktool出现故障,您应该报告一个错误。 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. Apk利用了“通用访问位”黑客,该黑客不再在Android上运行,因此apktool删除了对此的支持。
  2. Apk has a password on it. Apk上面有一个密码。
  3. Apk was improperly downloaded, thus not complete Apk下载不正确,因此不完整

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM