使用apktool反编译失败解决版本

来源:互联网 发布:淘宝店铺基本运营分析 编辑:程序博客网 时间:2024/05/17 03:03

FROM:http://blog.csdn.net/whorus1/article/details/50427533

尝试使用apktool对apk进行反编译,遇到如下问题:

[html] view plain copy
  1. I: Baksmaling...  
  2. I: Loading resource table...  
  3. Exception in thread "main" brut.androlib.AndrolibException: Could not decode arsc file  
  4.         at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:56)  
  5.         at brut.androlib.res.AndrolibResources.getResPackagesFromApk(AndrolibResources.java:491)  
  6.         at brut.androlib.res.AndrolibResources.loadMainPkg(AndrolibResources.java:74)  
  7.         at brut.androlib.res.AndrolibResources.getResTable(AndrolibResources.java:66)  
  8.         at brut.androlib.Androlib.getResTable(Androlib.java:50)  
  9.         at brut.androlib.ApkDecoder.getResTable(ApkDecoder.java:189)  
  10.         at brut.androlib.ApkDecoder.decode(ApkDecoder.java:114)  
  11.         at brut.apktool.Main.cmdDecode(Main.java:146)  
  12.         at brut.apktool.Main.main(Main.java:77)  
  13. Caused by: java.io.IOException: Expected: 0x001c0001, got: 0x00000000  
  14.         at brut.util.ExtDataInput.skipCheckInt(ExtDataInput.java:48)  
  15.         at brut.androlib.res.decoder.StringBlock.read(StringBlock.java:44)  
  16.         at brut.androlib.res.decoder.ARSCDecoder.readPackage(ARSCDecoder.java:102)  
  17.         at brut.androlib.res.decoder.ARSCDecoder.readTable(ARSCDecoder.java:83)  
  18.         at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:49)  
  19.         ... 8 more  

经检查后发现是由于apktool版本太老了导致,jdk1.7以后都需要使用1.5.2以上版本才行。

  • Apktool 2.x (Versions after 1.5.2)
    1. Is Java 1.7 installed?
    2. Does executing java -version on command line / command prompt return 1.7?
    3. If not, please install Java 7 and make it the default.
所以我们下载最新的apktool即可。

下载地址:http://ibotpeaches.github.io/Apktool/ 

(此网址有最新的apktool下载链接

apk tool v2.2.2 的下载地址:https://connortumbleson.com/2017/01/23/apktool-v2-2-2-released/

)

更新后反编译成功:


使用方法:

$ apktool d test.apkI: Using Apktool 2.0.2 on test.apkI: Loading resource table...I: Decoding AndroidManifest.xml with resources...I: Loading resource table from file: 1.apkI: Regular manifest package...I: Decoding file-resources...I: Decoding values */* XMLs...I: Baksmaling classes.dex...I: Copying assets and libs...I: Copying unknown files...I: Copying original files...$ apktool b testI: Using Apktool 2.0.2 on testI: Checking whether sources has changed...I: Smaling smali folder into classes.dex...I: Checking whether resources has changed...I: Building resources...I: Building apk file...I: Copying unknown files/dir...$


原创粉丝点击