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

[core] arsc decode error #1806

Closed
Ylarod opened this issue Mar 23, 2023 · 2 comments · Fixed by #1807
Closed

[core] arsc decode error #1806

Ylarod opened this issue Mar 23, 2023 · 2 comments · Fixed by #1807
Assignees
Labels
bug Core Issues in jadx-core module resources
Milestone

Comments

@Ylarod
Copy link

Ylarod commented Mar 23, 2023

INFO  - output directory: framework-res-14
INFO  - loading ...
INFO  - Loaded classes: 0, methods: 0, instructions: 0
ERROR - Failed to parse '.arsc' file
jadx.core.utils.exceptions.JadxException: Error decode: 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:117)
	at jadx.gui.JadxWrapper.open(JadxWrapper.java:65)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.io.IOException: type chunk, res0, expected: 0x0, actual: 0x1, offset: 0xb0b196
	at jadx.core.xmlgen.ParserStream.throwException(ParserStream.java:118)
	at jadx.core.xmlgen.ParserStream.checkInt8(ParserStream.java:103)
	at jadx.core.xmlgen.ResTableParser.parseTypeChunk(ResTableParser.java:253)
	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:73)
	... 6 common frames omitted

According to aosp13 ResourceTypes.h, these two fields should be flags and reserved instead of res0 and res1

Apk can be found -> framework-res-14.apk

@Ylarod Ylarod added bug Core Issues in jadx-core module labels Mar 23, 2023
@jpstotz
Copy link
Collaborator

jpstotz commented Mar 23, 2023

@Ylarod Thank you very much for this sample. It contains multiple structures we not yet support in Jadx. I will update our resource parsing code to support it.

@jpstotz
Copy link
Collaborator

jpstotz commented Mar 23, 2023

That sample is indeed interesting. It has the flag set to 1 which means it uses sparse entries which needs a little bit different way of reading.

And afterwards I discovered that it contains a TYPE_STAGED_ALIAS chunk, so the search for a sample file of #1803 is finally over.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Core Issues in jadx-core module resources
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants