exception in thread "main" brut.androlib.AndrdolibException: Counld not decode arse file

来源:互联网 发布:windows sleep 头文件 编辑:程序博客网 时间:2024/05/22 06:52

转自: http://blog.csdn.net/love_javc_you/article/details/45269463


最近遇到一个很恶心的问题:

       1  错误日志:

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



        2 原本是以为是  apktool.jar   的问题?

        后来子啊stackoverflow 上搜了一下, 


[java] view plain copy
 print?
  1.       
  2. SO THIS IS MY QUESTION :  
  3.   
  4. "What are the building requirements (on Eclypse) to permit an app to be decompiled by Apktool ?"  
  5.   
  6. I did some tests and couldn't find any rules... For example, i built an empty app (i just created it and exported it the project to an apk file), the building options were :  
  7.   
  8. Minimum : API 14, Android 4.0  
  9.   
  10. Targeting : API 14, Android 4.0  
  11.   
  12. Compile With : API 14, Android 4.0  
  13.   
  14. And i couldn't decompiled the apk... Anyway, i can't decompiled ANY of my apps ! What do i have to change in the building options? I did my tests on Apktool 1.4.3 and 2.0.0 Also, proguard isn't activated. This link says that it could have problem for building versions upper than 21.1.1 but that it was fixed in ApkTool 2.0.0... https://code.google.com/p/android-apktool/issues/detail?id=680  

     然后我更新了apktool.jar 还是不可以,但是找到了问题,

     原来是因为,我使用 adbmanager 更新的是后,更新的最新的版本, 5.1.1     API22原来,Eclispe 编译APK  的时候, 自动调用 build-tools/22.0.1 下面的jar包,可能采用了新的加密的方案,导致Apktool.jar  无法编译,

     归根结底,就是Apktool.jar  没有更新的问题。


解决方案:

很简单,就是将22.0.1 删除,因为,Android 以后最新的版本,只支持studio, 不再更新ADT 了。所以,建议以后发开的话,使用studio吧。!



参考网址:

stackoverflow 参考网址

0 0