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] AndroidManifest.xml is not decoded #1013

Closed
bagipro opened this issue Nov 11, 2020 · 7 comments
Closed

[core] AndroidManifest.xml is not decoded #1013

bagipro opened this issue Nov 11, 2020 · 7 comments
Labels
bug Core Issues in jadx-core module

Comments

@bagipro
Copy link
Collaborator

bagipro commented Nov 11, 2020

Hey, AndroidManifest.xml isn't decoded because of error

Error decode manifest
java.io.IOException: Decode error: attrValSize != 0x08 not supported, position: 0x4d06
	at jadx.core.xmlgen.CommonBinaryParser.die(CommonBinaryParser.java:92)
	at jadx.core.xmlgen.BinaryXMLParser.parseAttribute(BinaryXMLParser.java:285)
	at jadx.core.xmlgen.BinaryXMLParser.parseElement(BinaryXMLParser.java:275)
	at jadx.core.xmlgen.BinaryXMLParser.decode(BinaryXMLParser.java:135)
	at jadx.core.xmlgen.BinaryXMLParser.parse(BinaryXMLParser.java:94)

This error is occurred for the first time among all APKs I tested. But I looked on apktool, it doesn't have such problem. Moreover, it doesn't verify all those values to be equal to e.g. 0x08 https://github.com/iBotPeaches/Apktool/blob/b4493a51bbc5582175e1f6a93a71ae7c58428818/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/decoder/AXmlResourceParser.java#L931

When I removed

		if (attrValSize != 0x08) {
			die("attrValSize != 0x08 not supported");
		}

the file was decompiled correctly. Is there a reason why jadx checks those values?

@bagipro bagipro added bug Core Issues in jadx-core module labels Nov 11, 2020
@jpstotz
Copy link
Collaborator

jpstotz commented Nov 11, 2020

@bagipro Can you please provide the APK file that causes this error?

@bagipro
Copy link
Collaborator Author

bagipro commented Nov 11, 2020

@jpstotz
Copy link
Collaborator

jpstotz commented Nov 11, 2020

@bagipro Sorry but the file can not be downloaded. I am getting an error message that the file is not accessible due to a Google Drive usage violation.

@bagipro
Copy link
Collaborator Author

bagipro commented Nov 11, 2020

@jpstotz
Have no idea. I see only

Sorry, this file is infected with a virus
fce07034-209a-4375-babd-27fab8294f46.apk (18M) may harm your computer. Only download this file if you understand the risks.

But I can download it

@skylot
Copy link
Owner

skylot commented Nov 11, 2020

@bagipro I also can't download file. Can you share just AndroidManifest.xml file?

Is there a reason why jadx checks those values?

Here attrValSize is a size of data struct we are trying to parse. If it changed it is better to fail fast instead read garbage data.
But maybe here value was tampered. And as soon Android can also ignore this field, we may remove such checks.
Anyway, I will try to check Android sources to confirm this.

@bagipro
Copy link
Collaborator Author

bagipro commented Nov 11, 2020

@skylot
Copy link
Owner

skylot commented Nov 11, 2020

Ok. I just removed these checks, it looks safe enough.

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
Projects
None yet
Development

No branches or pull requests

3 participants