解決AndroidKiller APK 反編譯失敗,無法繼續下一步源碼反編譯!


報錯背景

今天使用AndroidKiller V1.3.1,反編譯一個APK,遇到如下報錯:

當前 Apktool 使用版本:Android Killer Default APKTOOL
正在反編譯 APK,請稍等...
>I: 使用 ShakaApktool 2.0.0-20150914
>I: 正在加載資源列表...
>I: 反編譯 AndroidManifest.xml 與資源...
>I: 正在從框架文件加載資源列表: C:\Users\lijie01\apktool\framework\1.apk
>I: 常規資源列表...
>I: 反編譯資源文件...
>I: 反編譯 values */* XMLs...
>Exception in thread "main" b.a.a.e: resource spec: 0x01010571
>	at b.a.d.a.p.a(Unknown Source)
>	at b.a.d.a.q.a(Unknown Source)
>	at org.c.b.b.c.a(Unknown Source)
>	at com.rover12421.shaka.a.b.p.a(Unknown Source)
>	at b.a.d.a.p.b(Unknown Source)
>	at b.a.d.a.w.a(Unknown Source)
>	at b.a.d.a.w.a(Unknown Source)
>	at b.a.d.a.a.t.d(Unknown Source)
>	at b.a.d.a.a.t.a(Unknown Source)
>	at b.a.d.a.a.u.h(Unknown Source)
>	at b.a.d.a.a.w.a(Unknown Source)
>	at b.a.d.a.a.w.a(Unknown Source)
>	at b.a.d.a.a(Unknown Source)
>	at b.a.d.a.c(Unknown Source)
>	at b.a.a.b(Unknown Source)
>	at b.a.E.a(Unknown Source)
>	at b.b.a.a(Unknown Source)
>	at b.b.a.a(Unknown Source)
>	at com.rover12421.shaka.cli.Main.main(Unknown Source)
APK 反編譯失敗,無法繼續下一步源碼反編譯!

解決

參考這位大佬的博客:https://blog.csdn.net/u012400885/article/details/80409689 進行解決:

下載新版本的Apktool地址:https://down.52pojie.cn/Tools/Android_Tools/

然后打開AndroidKiller_v1.3.1路徑,進行替換,注意名字要改成和原來一樣的名字。

更換好之后,重新運行AndroidKiller:

當前 Apktool 使用版本:Android Killer Default APKTOOL
正在反編譯 APK,請稍等...
>I: 使用 ShakaApktool 3.0.0-20170503
>I: 正在加載資源列表...
>I: 反編譯 AndroidManifest.xml 與資源...
>I: 正在從框架文件加載資源列表: C:\Users\lijie01\AppData\Local\apktool\framework\1.apk
>I: 常規資源列表...
>I: 反編譯資源文件...
>I: 反編譯 values */* XMLs...
>java.lang.NullPointerException
>	at b.a.d.a.a.x.a(Unknown Source)
>	at b.a.d.a.a.x.a(Unknown Source)
>	at b.a.d.a.a(Unknown Source)
>	at b.a.d.a.c(Unknown Source)
>	at b.a.a.b(Unknown Source)
>	at b.a.C.a(Unknown Source)
>	at b.b.a.a(Unknown Source)
>	at b.b.a.a(Unknown Source)
>	at com.rover12421.shaka.cli.Main.main(Unknown Source)
>Exception in thread "main" java.lang.IllegalArgumentException: expected element name 'style' and not 'resources'
>	at org.e.a.a.c(Unknown Source)
>	at b.a.d.a.a(Unknown Source)
>	at b.a.d.a.c(Unknown Source)
>	at b.a.a.b(Unknown Source)
>	at b.a.C.a(Unknown Source)
>	at b.b.a.a(Unknown Source)
>	at b.b.a.a(Unknown Source)
>	at com.rover12421.shaka.cli.Main.main(Unknown Source)
APK 反編譯失敗,無法繼續下一步源碼反編譯!

雖然還是報錯,但是注意看報錯信息,已經報不同錯了,
>Exception in thread "main" java.lang.IllegalArgumentException: expected element name 'style' and not 'resources'

繼續搜索這個錯誤,然后根據這個大佬的文章進行如下步驟:https://www.bilibili.com/read/cv1785046/

使用AndroidKillerPlugin

下載

下載地址:https://github.com/supperlitt/AndroidKillerPlugin/releases

修改配置

注意,一定要修改正確這個路徑,不然AndroidKillerPlugin解壓的文件不會解壓到你本地的AndroidKiller路徑下,還是會失敗的。

使用

基本上都是報解壓文件失敗,這個時候自己手動壓解一下就好。

手動壓解過程:

在重新執行AndroidKillerPlugin,

解壓成功,

如果項目比較大,那么這個過程就會稍微耗時長。

反編譯成功

在歷史工程中重新打開一下,

反編譯成功。

總結

學好使用原生apktool、dex2jar很重要,這樣能更好理解Android反編譯,並且遇到問題自己也能解決,不會像上面那樣 工具報錯了,自己沒有排錯的能力,只能查搜索引擎。

后面會寫文章介紹apktool、dex2jar的原理,喜歡可以給我留言、關注、點贊這樣我就會有更大的動力,更快的出文章。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM