diff --git a/apktool-lib/src/main/java/brut/androlib/res/util/ExtMXSerializer.java b/apktool-lib/src/main/java/brut/androlib/res/util/ExtMXSerializer.java index 2c55de34..3beed1f6 100644 --- a/apktool-lib/src/main/java/brut/androlib/res/util/ExtMXSerializer.java +++ b/apktool-lib/src/main/java/brut/androlib/res/util/ExtMXSerializer.java @@ -16,8 +16,7 @@ package brut.androlib.res.util; -import java.io.IOException; -import java.io.OutputStream; +import java.io.*; import org.xmlpull.mxp1_serializer.MXSerializer; /** @@ -32,6 +31,16 @@ public class ExtMXSerializer extends MXSerializer implements ExtXmlSerializer { this.newLine(); } + @Override + protected void writeAttributeValue(String value, Writer out) + throws IOException { + if (mIsDisabledAttrEscape) { + out.write(value); + return; + } + super.writeAttributeValue(value, out); + } + @Override public void setOutput(OutputStream os, String encoding) throws IOException { super.setOutput(os, encoding != null ? encoding : mDefaultEncoding); @@ -60,5 +69,10 @@ public class ExtMXSerializer extends MXSerializer implements ExtXmlSerializer { return this; } + public void setDisabledAttrEscape(boolean disabled) { + mIsDisabledAttrEscape = disabled; + } + private String mDefaultEncoding; + private boolean mIsDisabledAttrEscape = false; } diff --git a/apktool-lib/src/main/java/brut/androlib/res/util/ExtXmlSerializer.java b/apktool-lib/src/main/java/brut/androlib/res/util/ExtXmlSerializer.java index 859b08b9..3c8ffed6 100644 --- a/apktool-lib/src/main/java/brut/androlib/res/util/ExtXmlSerializer.java +++ b/apktool-lib/src/main/java/brut/androlib/res/util/ExtXmlSerializer.java @@ -25,6 +25,7 @@ import org.xmlpull.v1.XmlSerializer; public interface ExtXmlSerializer extends XmlSerializer { public ExtXmlSerializer newLine() throws IOException; + public void setDisabledAttrEscape(boolean disabled); public static final String PROPERTY_SERIALIZER_INDENTATION = "http://xmlpull.org/v1/doc/properties.html#serializer-indentation";