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

Exception in thread "main" org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to create or change an object in a way which is incorrect with regard to namespaces. #112

Open
mSharif10 opened this issue Mar 24, 2022 · 1 comment

Comments

@mSharif10
Copy link

mSharif10 commented Mar 24, 2022

Tried to run the diffuse but it returns the above error.

the command used

java -jar diffuse.jar diff "apk1" "apk2"

the apk in question can be found here

the error trace here:
at com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.checkNamespaceWF(CoreDocumentImpl.java:2535) at com.sun.org.apache.xerces.internal.dom.AttrNSImpl.setName(AttrNSImpl.java:93) at com.sun.org.apache.xerces.internal.dom.AttrNSImpl.<init>(AttrNSImpl.java:78) at com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.createAttributeNS(CoreDocumentImpl.java:2164) at com.sun.org.apache.xerces.internal.dom.ElementImpl.setAttributeNS(ElementImpl.java:659) at com.jakewharton.diffuse.Manifest$Companion.toManifest$diffuse(Manifest.kt:974) at com.jakewharton.diffuse.Apk$Companion.parse(Apk.kt:124) at com.jakewharton.diffuse.DiffCommand.run(diffuse.kt:117) at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:5266) at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:5274) at com.github.ajalt.clikt.core.CliktCommand.parse$default(CliktCommand.kt:281) at com.jakewharton.diffuse.Diffuse.main(diffuse.kt:23324)
although I am not sure it is about the xml naming issue? How can I solve this?

@mateuszkwiecinski
Copy link
Contributor

mateuszkwiecinski commented Apr 24, 2022

@mSharif10 I tried to parse your apk and none of the online parsers nor AndroidStudio was able to parse it correctly 🤔

I'm getting either

error: trying to add resource 'com.safarifone.waafi:anim/' with ID 0x7f010001 but resource already has ID 0x7f010000.

or in AS:
image

Moreover, manually parsing your apk with aapt produces AndroidManifest.xml that contains an invalid entry android:="true" which also isn't valid xml:

image

I might have generated a corrupted apk, but it produces exactly the same stack trace. Diffuse fails to obtain attribute namespace here:

val attributeNamespace = attribute.namespace().takeIf(String::isNotEmpty)

Goooler pushed a commit to Goooler/diffuse that referenced this issue Sep 10, 2022
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

No branches or pull requests

2 participants