Skip to content
This repository has been archived by the owner on Sep 21, 2020. It is now read-only.

Commit

Permalink
fix end xml tag namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
dongliu committed Jun 19, 2018
1 parent 82829e8 commit bdab2f0
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Get apk-parser from maven central repo:
<dependency>
<groupId>net.dongliu</groupId>
<artifactId>apk-parser</artifactId>
<version>2.6.0</version>
<version>2.6.1</version>
</dependency>
```
From version 2.0, apk-parser requires java7. The last version support java6 is 1.7.4.
Expand Down
12 changes: 6 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
<artifactId>apk-parser</artifactId>
<name>apk-parser</name>
<packaging>jar</packaging>
<version>2.6.0</version>
<url>https://github.com/xiaxiaocao/apk-parser</url>
<version>2.6.1</version>
<url>https://github.com/hsiafan/apk-parser</url>
<developers>
<developer>
<id>xiaxiaocao</id>
Expand All @@ -38,15 +38,15 @@
<licenses>
<license>
<name>The BSD 2-Clause License</name>
<url>https://github.com/xiaxiaocao/apk-parser/blob/master/LICENSE.txt</url>
<url>https://github.com/hsiafan/apk-parser/blob/master/LICENSE.txt</url>
<distribution>repo</distribution>
</license>
</licenses>

<scm>
<connection>scm:git:[email protected]:xiaxiaocao/apk-parser.git</connection>
<url>https://github.com/xiaxiaocao/apk-parser</url>
<developerConnection>scm:git:[email protected]:xiaxiaocao/apk-parser.git</developerConnection>
<connection>scm:git:[email protected]:hsiafan/apk-parser.git</connection>
<url>https://github.com/hsiafan/apk-parser</url>
<developerConnection>scm:git:[email protected]:hsiafan/apk-parser.git</developerConnection>
<tag>HEAD</tag>
</scm>

Expand Down
7 changes: 2 additions & 5 deletions src/main/java/net/dongliu/apk/parser/Main.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package net.dongliu.apk.parser;

import net.dongliu.apk.parser.bean.IconFace;

import java.io.IOException;
import java.util.List;

/**
* Main method for parser apk
Expand All @@ -13,8 +10,8 @@
public class Main {
public static void main(String[] args) throws IOException {
try (ApkFile apkFile = new ApkFile(args[0])) {
List<IconFace> allIcons = apkFile.getAllIcons();
System.out.println(allIcons);
String xml = apkFile.getManifestXml();
System.out.println(xml);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,11 @@ public void onEndTag(XmlNodeEndTag xmlNodeEndTag) {
appendShift(shift);
sb.append("</");
if (xmlNodeEndTag.getNamespace() != null) {
sb.append(xmlNodeEndTag.getNamespace()).append(":");
String namespace = this.namespaces.getPrefixViaUri(xmlNodeEndTag.getNamespace());
if (namespace == null) {
namespace = xmlNodeEndTag.getNamespace();
}
sb.append(namespace).append(":");
}
sb.append(xmlNodeEndTag.getName());
sb.append(">\n");
Expand Down

0 comments on commit bdab2f0

Please sign in to comment.