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

转自: 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 参考网址

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值