question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is Android Namespace aware?

See original GitHub issue

Some Manifest files seem to have a broken attribute name. See for example this file: https://github.com/androguard/androguard/blob/8de05b03af2b363b436cfa7646ab1bbfd4ddb13a/examples/axml/AndroidManifest_NamespaceInAttributeName.xml

they wrote the namespace string into the attribute and have the URI == -1:

Name 'android:versionName' starts with 'android:' prefix! The Manifest seems to be broken? Removing prefix.
Name 'android:minSdkVersion' starts with 'android:' prefix! The Manifest seems to be broken? Removing prefix.
Name 'android:targetSdkVersion' starts with 'android:' prefix! The Manifest seems to be broken? Removing prefix.
Name 'android:name' starts with 'android:' prefix! The Manifest seems to be broken? Removing prefix.
Name 'android:name' starts with 'android:' prefix! The Manifest seems to be broken? Removing prefix.
Name 'android:name' starts with 'android:' prefix! The Manifest seems to be broken? Removing prefix.
Name 'android:name' starts with 'android:' prefix! The Manifest seems to be broken? Removing prefix.
[...]

I thought this would not be correctly read by Android, but it does. On a Android 8 phone, all listed permissions are granted to the application on installation. How does this work? Does the Android parser not check the attribute names? In this case, we would need to check if the name is a compound of ns prefix and attribute name, then split it and check if there is a correct namespace mapping for this prefix.

Anyone has details how the Manifest Parsing works on android?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
reoxcommented, Feb 12, 2019

@subho007 ah, nevermind… you can still use tag.get() if you require the exact match!

0reactions
eighthavecommented, Apr 18, 2019

Here’s a test case, a valid APK from Google Play: com.car2go_129215.apk.zip

Read more comments on GitHub >

github_iconTop Results From Across the Web

NamespaceContext - Android Developers
When requesting a Namespace URI by prefix, the following table describes the returned Namespace URI value for all possible prefix values: ...
Read more >
XML Namespaces in Android - GeeksforGeeks
In an XML file, namespaces are used to provide elements and attributes with distinctive names. Names for elements or attributes in an XML ......
Read more >
What is the 'app' Android XML namespace? - Stack Overflow
The app namespace is not specific to a library, but it is used for all attributes defined in your app, whether by your...
Read more >
Android.Net.Wifi.Aware Namespace - Microsoft Learn
Explore all classes and interfaces of the Android.Net.Wifi.Aware namespace.
Read more >
MissingPrefix: Missing Android XML namespace
Most Android views have attributes in the Android namespace. When referencing these attributes you must include the namespace prefix, or your attribute will ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found