APKTool Decompile issue -
Facing below exception form apktool while running the script:
Exception in thread "main" brut.androlib.AndrolibException: Invalid chunk type: expected=0x00000200, got=0x00000203
at brut.androlib.res.decoder.ARSCDecoder.checkChunkType(ARSCDecoder.java:542)
at brut.androlib.res.decoder.ARSCDecoder.readTablePackage(ARSCDecoder.java:88)
at brut.androlib.res.decoder.ARSCDecoder.readTableHeader(ARSCDecoder.java:82)
at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:48)
at brut.androlib.res.AndrolibResources.getResPackagesFromApk(AndrolibResources.java:786)
at brut.androlib.res.AndrolibResources.loadMainPkg(AndrolibResources.java:67)
at brut.androlib.res.AndrolibResources.getResTable(AndrolibResources.java:59)
at brut.androlib.Androlib.getResTable(Androlib.java:66)
at brut.androlib.ApkDecoder.setTargetSdkVersion(ApkDecoder.java:236)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:118)
at brut.apktool.Main.cmdDecode(Main.java:170)
at brut.apktool.Main.main(Main.java:76)
P.S. This is an ongoing issue with APKTool!! We need to look for an alternative of APKTool as without that this Utility would be inefficient.
Can you share the apk you are using and got this exception ? I would like to take a closer look
I basically have .aab file from which I make universal apk using bundletool and I'm using that apk. Is this supposed to work that way?
No it's not. You would need an apk. aab might contain 2 or more apks. So what you would need is the run the process manually on the main apk. Then manually sign them both with the same debug key
Actually (as mentioned above) I'm not directly using .aab file but instead a universal apk file, refer this link. And I'm providing the same universal.apk file to this script, but it somehow doesn't work.
Correct, If you look at the folder that the apk was extracted to under /tmp/ you will see that there are few apk files that need to be handled.
Bottom line I still need to write something to handle split apks.
This is happening for example with this apk https://www.apkmirror.com/apk/google-inc/chrome/chrome-83-0-4103-106-release/google-chrome-fast-secure-83-0-4103-106-11-android-apk-download/ but indeed an APKTool issue.
So this apk is packed in a different way indeed.. probably the reason why the apktool can't open it Any reason why you would want to do it with this apk? I think chrome traffic is open anyways
Closing issue due to inactivity