rubenv / node-apk-parser

Extract Android Manifest info from an APK file.
MIT License
79 stars 25 forks source link

Cannot parse APK with multiple Namespaces #9

Open boulaycote opened 9 years ago

boulaycote commented 9 years ago
N: amazon=http://schemas.amazon.com/apk/res/android
  N: android=http://schemas.android.com/apk/res/android
    E: manifest (line=1)
      A: android:versionCode(0x0101021b)=(type 0x10)0x97ebef
...

I figure the indent is broken.

Something like

if (line.match(/^( +)?N:/)) {
    namespaces += 1;
    continue;
}

if (namespaces > 1) {
    indentLength -= namespaces;
}

Should fix the issue.