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

EOF Exception on a "proper" (usable) AXML File #8

Closed
strazzere opened this issue Dec 28, 2018 · 4 comments
Closed

EOF Exception on a "proper" (usable) AXML File #8

strazzere opened this issue Dec 28, 2018 · 4 comments
Assignees
Labels

Comments

@strazzere
Copy link
Member

[53%]tstrazzere@mil0:[~/repo/unpackme/contents] $ axmlprinter AndroidManifest.xml 
java.io.EOFException
	at android.content.res.IntReader.readInt(IntReader.java:104)
	at android.content.res.IntReader.readShort(IntReader.java:69)
	at android.content.res.chunk.sections.StringSection.readPool(StringSection.java:108)
	at android.content.res.chunk.sections.StringSection.readSection(StringSection.java:71)
	at android.content.res.chunk.sections.GenericChunkSection.<init>(GenericChunkSection.java:37)
	at android.content.res.chunk.sections.StringSection.<init>(StringSection.java:48)
	at android.content.res.chunk.ChunkUtil.createChunk(ChunkUtil.java:52)
	at android.content.res.AXMLResource.read(AXMLResource.java:92)
	at diff.rednaga.AXMLPrinter.main(AXMLPrinter.java:69)
<?xml version="1.0" encoding="utf-8"?>

Likely related to qihoo360 / jiagu protector

Sample : e15f2b96e52d78f317de97295e22f0c3ace38961

@strazzere strazzere added the bug label Dec 28, 2018
@strazzere strazzere self-assigned this Dec 28, 2018
strazzere added a commit that referenced this issue Dec 28, 2018
Pretending to be a real dev and do TDD "in the right way". Commiting the failing
testing using the sample from Issue #8 - will get the fix in asap.
@Tinhone
Copy link

Tinhone commented Aug 2, 2024

Same problem, this is the program log:

java.io.EOFException
        at android.content.res.IntReader.readInt(IntReader.java:104)
        at android.content.res.IntReader.readShort(IntReader.java:69)
        at android.content.res.chunk.sections.StringSection.readPool(StringSection.java:108)
        at android.content.res.chunk.sections.StringSection.readSection(StringSection.java:71)
        at android.content.res.chunk.sections.GenericChunkSection.<init>(GenericChunkSection.java:37)
        at android.content.res.chunk.sections.StringSection.<init>(StringSection.java:48)
        at android.content.res.chunk.ChunkUtil.createChunk(ChunkUtil.java:52)
        at android.content.res.AXMLResource.read(AXMLResource.java:90)
        at diff.rednaga.AXMLPrinter.main(AXMLPrinter.java:72)
java.lang.NullPointerException: Cannot invoke "String.equals(Object)" because the return value of "android.content.res.chunk.PoolItem.getString()" is null
        at android.content.res.chunk.sections.StringSection.getStringIndex(StringSection.java:120)
        at android.content.res.chunk.types.Attribute.<init>(Attribute.java:48)
        at diff.rednaga.AXMLPrinter.main(AXMLPrinter.java:78)

Result:

<?xml version="1.0" encoding="utf-8"?>

AndroidManifest.zip

@strazzere
Copy link
Member Author

Should be fixed now;

java -jar build/libs/axmlprinter-0.1.7.jar AndroidManifest.xml | head
<?xml version="1.0" encoding="utf-8"?>
<manifest
	xmlns:android="http://schemas.android.com/apk/res/android"
	manifest:versionCode="9001030"
	manifest:versionName="9.1.30"
	manifest:installLocation="0"
	manifest:compileSdkVersion="34"
	manifest:compileSdkVersionCodename="14"
	platformBuildVersionName="14"
	platformBuildVersionCode="34"

@strazzere
Copy link
Member Author

This is mostly fixed, however there is still some oddness on some packers which could still be fixed. See the unit test for this issue and it's clear what needs to be fixed.

However, the axml will get printed out now, mostly correct.

strazzere added a commit that referenced this issue Aug 6, 2024
All tests passing. Properly recover from a
mangled start tag. Allow injection correctly.
@strazzere
Copy link
Member Author

This is actually fully fixed now, it won't be "mostly" correct but actually fully correct now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants