Apktool: Decompiling error: Invalid chunk type

Created on 11 Dec 2019  Â·  14Comments  Â·  Source: iBotPeaches/Apktool

Information

  1. Apktool Version (apktool -version) - 2.4.0/2.4.1
  2. Operating System (Mac, Linux, Windows) - Windows
  3. APK From? (Playstore, ROM, Other) - Other (website)

Stacktrace/Logcat

PS C:\Users\User\Documents\android\apktool> ./apktool d 1415.apk
I: Using Apktool 2.4.1 on 1415.apk
I: Loading resource table...
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)
Press any key to continue . . .

APK

https://apkpure.com/tiktok-musically/com.zhiliaoapp.musically

Question

Is there any solution to the problem? Can I manually patch an APK file to avoid this error?

Most helpful comment

Same issue with this old task.
Is this tool still maintained?
@iBotPeaches

Yes.

All 14 comments

Hmm, 0x203 is LIBRARY if my memory is right. I thought our ARSC parser was smart enough to just read chunk, identify chunk, parse chunk. So this should not be happening.

Hi @iBotPeaches,
we are facing exactly the same error with another APK:

Exception in thread "main" brut.androlib.AndrolibException: Invalid chunk type: expected=0x00000200, got=0x00000203

➜  test java -jar apktool_2.4.1.jar -f d prod.apk  -m -s -o output/prod
I: Using Apktool 2.4.1 on prod.apk
I: Loading resource table...
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)

Do you have any update?
Thank you in adavance,
C.

Have you fixed this? @iBotPeaches

@1azunna not yet.

same here

Same issue with this old task.
Is this tool still maintained?
@iBotPeaches

Same issue with this old task.
Is this tool still maintained?
@iBotPeaches

Yes.

Great to hear @iBotPeaches 😎

Same with mobile legends, they just applied same protection. I wonder if it's related to Andresguard protection because i heard about it

https://apkcombo.com/en-dk/mobile-legends-bang-bang/com.mobile.legends/download/apk

Same with mobile legends, they just applied same protection. I wonder if it's related to Andresguard protection because i heard about it

https://apkcombo.com/en-dk/mobile-legends-bang-bang/com.mobile.legends/download/apk

hope author will add this on his fix list. thank you

Same with mobile legends, they just applied same protection. I wonder if it's related to Andresguard protection because i heard about it
https://apkcombo.com/en-dk/mobile-legends-bang-bang/com.mobile.legends/download/apk

hope author will add this on his fix list. thank you

Added into my local folder for bug 2099.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

eriklu picture eriklu  Â·  3Comments

Ibuprophen picture Ibuprophen  Â·  3Comments

alexeikh picture alexeikh  Â·  3Comments

raulsiles picture raulsiles  Â·  4Comments

trandua picture trandua  Â·  3Comments