mirror of
https://github.com/revanced/Apktool.git
synced 2025-01-22 01:37:34 +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;
|
package brut.androlib.res.util;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.*;
|
||||||
import java.io.OutputStream;
|
|
||||||
import org.xmlpull.mxp1_serializer.MXSerializer;
|
import org.xmlpull.mxp1_serializer.MXSerializer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -32,6 +31,16 @@ public class ExtMXSerializer extends MXSerializer implements ExtXmlSerializer {
|
|||||||
this.newLine();
|
this.newLine();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void writeAttributeValue(String value, Writer out)
|
||||||
|
throws IOException {
|
||||||
|
if (mIsDisabledAttrEscape) {
|
||||||
|
out.write(value);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
super.writeAttributeValue(value, out);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setOutput(OutputStream os, String encoding) throws IOException {
|
public void setOutput(OutputStream os, String encoding) throws IOException {
|
||||||
super.setOutput(os, encoding != null ? encoding : mDefaultEncoding);
|
super.setOutput(os, encoding != null ? encoding : mDefaultEncoding);
|
||||||
@ -60,5 +69,10 @@ public class ExtMXSerializer extends MXSerializer implements ExtXmlSerializer {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setDisabledAttrEscape(boolean disabled) {
|
||||||
|
mIsDisabledAttrEscape = disabled;
|
||||||
|
}
|
||||||
|
|
||||||
private String mDefaultEncoding;
|
private String mDefaultEncoding;
|
||||||
|
private boolean mIsDisabledAttrEscape = false;
|
||||||
}
|
}
|
||||||
|
@ -25,6 +25,7 @@ import org.xmlpull.v1.XmlSerializer;
|
|||||||
public interface ExtXmlSerializer extends XmlSerializer {
|
public interface ExtXmlSerializer extends XmlSerializer {
|
||||||
|
|
||||||
public ExtXmlSerializer newLine() throws IOException;
|
public ExtXmlSerializer newLine() throws IOException;
|
||||||
|
public void setDisabledAttrEscape(boolean disabled);
|
||||||
|
|
||||||
public static final String PROPERTY_SERIALIZER_INDENTATION =
|
public static final String PROPERTY_SERIALIZER_INDENTATION =
|
||||||
"http://xmlpull.org/v1/doc/properties.html#serializer-indentation";
|
"http://xmlpull.org/v1/doc/properties.html#serializer-indentation";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user