From 429e18ac253069ea8fbf6eece74644aad1321f25 Mon Sep 17 00:00:00 2001 From: Connor Tumbleson Date: Mon, 8 May 2017 08:33:49 -0400 Subject: [PATCH] Move MXSerializer to unique namespace - prevents dependency version from loading - patch MXSerializer to skip duplicate namespaces at same depth --- .../main/java/brut/androlib/res/util/ExtMXSerializer.java | 2 +- .../xmlpull/{mxp1_serializer => renamed}/MXSerializer.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) rename brut.apktool/apktool-lib/src/main/java/org/xmlpull/{mxp1_serializer => renamed}/MXSerializer.java (99%) diff --git a/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/util/ExtMXSerializer.java b/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/util/ExtMXSerializer.java index 5e15985f..8efa5bb7 100644 --- a/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/util/ExtMXSerializer.java +++ b/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/util/ExtMXSerializer.java @@ -17,7 +17,7 @@ package brut.androlib.res.util; import java.io.*; -import org.xmlpull.mxp1_serializer.MXSerializer; +import org.xmlpull.renamed.MXSerializer; /** * @author Ryszard Wiśniewski diff --git a/brut.apktool/apktool-lib/src/main/java/org/xmlpull/mxp1_serializer/MXSerializer.java b/brut.apktool/apktool-lib/src/main/java/org/xmlpull/renamed/MXSerializer.java similarity index 99% rename from brut.apktool/apktool-lib/src/main/java/org/xmlpull/mxp1_serializer/MXSerializer.java rename to brut.apktool/apktool-lib/src/main/java/org/xmlpull/renamed/MXSerializer.java index 66c69574..1adc9436 100644 --- a/brut.apktool/apktool-lib/src/main/java/org/xmlpull/mxp1_serializer/MXSerializer.java +++ b/brut.apktool/apktool-lib/src/main/java/org/xmlpull/renamed/MXSerializer.java @@ -1,4 +1,4 @@ -package org.xmlpull.mxp1_serializer; +package org.xmlpull.renamed; import java.io.IOException; import java.io.OutputStream; @@ -440,8 +440,8 @@ public class MXSerializer implements XmlSerializer { // check that prefix is not duplicated ... for (int i = elNamespaceCount[depth]; i < namespaceEnd; i++) { if (prefix == namespacePrefix[i]) { - throw new IllegalStateException("duplicated prefix " - + printable(prefix) + getLocation()); + // Toss out extra namespaces at same depth to fix #1456 + return; } }