mirror of
https://github.com/revanced/Apktool.git
synced 2025-01-05 17:45:52 +01:00
ExtXmlSerializer: added possibility to disable escaping of attr values.
This commit is contained in:
parent
888c9082ce
commit
90f789ff01
@ -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;
|
||||
}
|
||||
|
@ -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";
|
||||
|
Loading…
Reference in New Issue
Block a user