Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid chunk type error #48

Closed
VitorBlog opened this issue Mar 31, 2021 · 3 comments
Closed

Invalid chunk type error #48

VitorBlog opened this issue Mar 31, 2021 · 3 comments
Labels
apktool Issues caused by or related to Apktool

Comments

@VitorBlog
Copy link

VitorBlog commented Mar 31, 2021

For some reason some APKS give this error, all I know is that the APK has some kind of obfuscation. IDK if this can be bypassed.

@edit i will try to fork and bypass it later.

vitor@vitor:~/bugbounty/projects/toketiko$ sudo apk-mitm TikTok\ Lite_v18.0.3_apkpure.com.apk 

  ╭ apk-mitm v0.12.0
  ├ apktool v2.5.0
  ╰ uber-apk-signer v1.2.1
  
  Using temporary directory:
  /tmp/apk-mitm-2a8ca65845dd7e990dda2c7babdafe45

  ✔ Downloading tools
  ✖ Decoding APK file
    → I: Loading resource table...
    Applying patches
    Encoding patched APK file
    Signing patched APK file

   Failed!  An error occurred:

I: Using Apktool 2.5.0 on TikTok Lite_v18.0.3_apkpure.com.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:544)
	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:790)
	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:179)
	at brut.apktool.Main.main(Main.java:82)
@shroudedcode
Copy link
Owner

This is an issue with Apktool that has already been fixed, but that hasn't been released yet (which is why apk-mitm doesn't ship it yet). What you can do is build Apktool yourself and then run apk-mitm with the --apktool <path-to-jar> flag to make it use the custom version.

@shroudedcode shroudedcode added the apktool Issues caused by or related to Apktool label Apr 1, 2021
@VitorBlog
Copy link
Author

Solved, thx.

@VitorBlog
Copy link
Author

For the lazy people, here is my build: apktool-cli-all.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apktool Issues caused by or related to Apktool
Projects
None yet
Development

No branches or pull requests

2 participants