Sable / axml

The axml components for reading binary Android XML files in Soot
Apache License 2.0
70 stars 17 forks source link

NullPointerException. #12

Open Aunali321 opened 2 years ago

Aunali321 commented 2 years ago

https://github.com/Sable/axml/blob/e7771fd82790ce6449816365e174b76f46327899/src/pxb/android/StringItems.java#L90

java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference at pxb.android.StringItems.prepare(StringItems.java:90) at pxb.android.axml.AxmlWriter.prepare(AxmlWriter.java:344) at pxb.android.axml.AxmlWriter.toByteArray(AxmlWriter.java:356)

StevenArzt commented 2 years ago

Should be fixed now. I don't have an app to test with, so please give the updated code a try and close the issue if the problem has been resolved.

Aunali321 commented 2 years ago

@StevenArzt whats the maven for develop branch?

Vendicated commented 2 years ago

I haven't tested it, but it is likely still broken. Just a few lines lower you access it again without a null check https://github.com/Sable/axml/blob/97656d702e3bd72f6a36fdaa5fc26740ee9b6c66/src/pxb/android/StringItems.java#L101

StevenArzt commented 2 years ago

I don't see the problem. My assumption was that item.data is null, not item itself. That's also what my first check is about. If the variable stringData holds null, that should be fine.

rushiiMachine commented 2 years ago

https://github.com/Sable/axml/blob/97656d702e3bd72f6a36fdaa5fc26740ee9b6c66/src/pxb/android/StringItems.java#L109-L110

Here is it again being referenced and causing an NPE

StevenArzt commented 2 years ago

OK, I got it. Fix has been committed.