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

Failed to parse '.arsc' file: IOException: Config size < 28 #1663

Closed
jpstotz opened this issue Sep 3, 2022 · 1 comment · Fixed by #1664
Closed

Failed to parse '.arsc' file: IOException: Config size < 28 #1663

jpstotz opened this issue Sep 3, 2022 · 1 comment · Fixed by #1664

Comments

@jpstotz
Copy link
Collaborator

jpstotz commented Sep 3, 2022

Log level: Error
Version: 1.4.4
Binary: jadx-gui-1.4.4-no-jre-win.exe
File causing the error: resources.arsc.zip
Java VM:

openjdk version "18.0.1.1" 2022-04-22
OpenJDK Runtime Environment (build 18.0.1.1+2-6)
OpenJDK 64-Bit Server VM (build 18.0.1.1+2-6, mixed mode, sharing)

jadx Error:

ERROR: Failed to parse '.arsc' file
jadx.core.utils.exceptions.JadxException: Error decode: D:\download\browser\resources.arsc
	at jadx.api.ResourcesLoader.decodeStream(ResourcesLoader.java:78)
	at jadx.core.dex.nodes.RootNode.loadResources(RootNode.java:173)
	at jadx.api.JadxDecompiler.load(JadxDecompiler.java:122)
	at jadx.gui.JadxWrapper.open(JadxWrapper.java:65)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.io.IOException: Config size < 28
	at jadx.core.xmlgen.ResTableParser.parseConfig(ResTableParser.java:373)
	at jadx.core.xmlgen.ResTableParser.parseTypeChunk(ResTableParser.java:221)
	at jadx.core.xmlgen.ResTableParser.parsePackage(ResTableParser.java:162)
	at jadx.core.xmlgen.ResTableParser.decodeTableChunk(ResTableParser.java:110)
	at jadx.core.xmlgen.ResTableParser.decode(ResTableParser.java:86)
	at jadx.core.xmlgen.ResDecoder.decode(ResDecoder.java:28)
	at jadx.core.dex.nodes.RootNode.lambda$loadResources$7(RootNode.java:173)
	at jadx.api.ResourcesLoader.decodeStream(ResourcesLoader.java:61)
	... 6 common frames omitted

Originally posted by @oxou in #178 (comment)

@jpstotz jpstotz changed the title Log level: Error Failed to parse '.arsc' file: IOException: Config size < 28 Sep 3, 2022
@jpstotz
Copy link
Collaborator Author

jpstotz commented Sep 3, 2022

@oxou Thanks for the sample.

Jadx currently has two problems with this sample:

  1. Our ResTableParser.parsePackage reads a very large size that can not be correct for the package chunk. Apktool seems to ignore the size and simple reads until it encounters a chunk of an unknown type.

  2. Modifying Jadx to read the chunks the same way as apktool does we run into a chunk of type 0x0203 = TYPE_LIBRARY (called Header.XML_TYPE_LIBRARYin apktool). We don't have any code yet for loading such a chunk.

skylot pushed a commit that referenced this issue Sep 10, 2022
…#1664)

* core: Implemented parsing RES_TABLE_TYPE_LIBRARY chunks

* skip unknown data at the end of type chunk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant