mirror of
https://github.com/revanced/Apktool.git
synced 2024-12-12 05:47:46 +01:00
ResXmlSerializable -> ResValuesXmlSerializable, serializeToXml() -> serializeToResValuesXml().
This commit is contained in:
parent
a5a9693de9
commit
e3b53d4f04
@ -19,7 +19,7 @@ package brut.androlib.res;
|
||||
import brut.androlib.AndrolibException;
|
||||
import brut.androlib.err.CantFindFrameworkResException;
|
||||
import brut.androlib.res.data.*;
|
||||
import brut.androlib.res.data.value.ResXmlSerializable;
|
||||
import brut.androlib.res.data.value.ResValuesXmlSerializable;
|
||||
import brut.androlib.res.decoder.*;
|
||||
import brut.androlib.res.decoder.ARSCDecoder.ARSCData;
|
||||
import brut.androlib.res.decoder.ARSCDecoder.FlagsOffset;
|
||||
@ -262,8 +262,8 @@ final public class AndrolibResources {
|
||||
if (valuesFile.isSynthesized(res)) {
|
||||
continue;
|
||||
}
|
||||
((ResXmlSerializable) res.getValue())
|
||||
.serializeToXml(serial, res);
|
||||
((ResValuesXmlSerializable) res.getValue())
|
||||
.serializeToResValuesXml(serial, res);
|
||||
}
|
||||
|
||||
serial.endTag(null, "resources");
|
||||
|
@ -21,7 +21,7 @@ import brut.androlib.AndrolibException;
|
||||
import brut.androlib.res.data.value.ResFileValue;
|
||||
import brut.androlib.res.data.value.ResValue;
|
||||
import brut.androlib.res.data.value.ResValueFactory;
|
||||
import brut.androlib.res.data.value.ResXmlSerializable;
|
||||
import brut.androlib.res.data.value.ResValuesXmlSerializable;
|
||||
import brut.util.Duo;
|
||||
import java.util.*;
|
||||
|
||||
@ -123,7 +123,7 @@ public class ResPackage {
|
||||
new HashMap<Duo<ResType, ResConfig>, ResValuesFile>();
|
||||
for (ResResSpec spec : mResSpecs.values()) {
|
||||
for (ResResource res : spec.listResources()) {
|
||||
if (res.getValue() instanceof ResXmlSerializable) {
|
||||
if (res.getValue() instanceof ResValuesXmlSerializable) {
|
||||
ResType type = res.getResSpec().getType();
|
||||
ResConfig config = res.getConfig();
|
||||
Duo<ResType, ResConfig> key =
|
||||
|
@ -25,7 +25,7 @@ import org.xmlpull.v1.XmlSerializer;
|
||||
/**
|
||||
* @author Ryszard Wiśniewski <brut.alll@gmail.com>
|
||||
*/
|
||||
public class ResArrayValue extends ResBagValue implements ResXmlSerializable {
|
||||
public class ResArrayValue extends ResBagValue implements ResValuesXmlSerializable {
|
||||
ResArrayValue(ResReferenceValue parent,
|
||||
Duo<Integer, ResScalarValue>[] items) {
|
||||
super(parent);
|
||||
@ -42,7 +42,7 @@ public class ResArrayValue extends ResBagValue implements ResXmlSerializable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serializeToXml(XmlSerializer serializer, ResResource res)
|
||||
public void serializeToResValuesXml(XmlSerializer serializer, ResResource res)
|
||||
throws IOException, AndrolibException {
|
||||
String type = getType();
|
||||
type = (type == null ? "" : type + "-") + "array";
|
||||
|
@ -26,7 +26,7 @@ import org.xmlpull.v1.XmlSerializer;
|
||||
/**
|
||||
* @author Ryszard Wiśniewski <brut.alll@gmail.com>
|
||||
*/
|
||||
public class ResAttr extends ResBagValue implements ResXmlSerializable {
|
||||
public class ResAttr extends ResBagValue implements ResValuesXmlSerializable {
|
||||
ResAttr(ResReferenceValue parentVal, int type, Integer min, Integer max,
|
||||
Boolean l10n) {
|
||||
super(parentVal);
|
||||
@ -42,7 +42,7 @@ public class ResAttr extends ResBagValue implements ResXmlSerializable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serializeToXml(XmlSerializer serializer, ResResource res)
|
||||
public void serializeToResValuesXml(XmlSerializer serializer, ResResource res)
|
||||
throws IOException, AndrolibException {
|
||||
String type = getTypeAsString();
|
||||
|
||||
|
@ -25,29 +25,29 @@ import org.xmlpull.v1.XmlSerializer;
|
||||
/**
|
||||
* @author Ryszard Wiśniewski <brut.alll@gmail.com>
|
||||
*/
|
||||
public class ResBagValue extends ResValue implements ResXmlSerializable {
|
||||
public class ResBagValue extends ResValue implements ResValuesXmlSerializable {
|
||||
protected final ResReferenceValue mParent;
|
||||
|
||||
public ResBagValue(ResReferenceValue parent) {
|
||||
this.mParent = parent;
|
||||
}
|
||||
|
||||
public void serializeToXml(XmlSerializer serializer, ResResource res)
|
||||
public void serializeToResValuesXml(XmlSerializer serializer, ResResource res)
|
||||
throws IOException, AndrolibException {
|
||||
String type = res.getResSpec().getType().getName();
|
||||
if ("style".equals(type)) {
|
||||
new ResStyleValue(mParent, new Duo[0], null)
|
||||
.serializeToXml(serializer, res);
|
||||
.serializeToResValuesXml(serializer, res);
|
||||
return;
|
||||
}
|
||||
if ("array".equals(type)) {
|
||||
new ResArrayValue(mParent, new Duo[0])
|
||||
.serializeToXml(serializer, res);
|
||||
.serializeToResValuesXml(serializer, res);
|
||||
return;
|
||||
}
|
||||
if ("plurals".equals(type)) {
|
||||
new ResPluralsValue(mParent, new Duo[0])
|
||||
.serializeToXml(serializer, res);
|
||||
.serializeToResValuesXml(serializer, res);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,7 @@ package brut.androlib.res.data.value;
|
||||
/**
|
||||
* @author Ryszard Wiśniewski <brut.alll@gmail.com>
|
||||
*/
|
||||
public class ResBoolValue extends ResScalarValue implements ResXmlSerializable {
|
||||
public class ResBoolValue extends ResScalarValue implements ResValuesXmlSerializable {
|
||||
private final boolean mValue;
|
||||
|
||||
public ResBoolValue(boolean value) {
|
||||
|
@ -24,8 +24,8 @@ import org.xmlpull.v1.XmlSerializer;
|
||||
/**
|
||||
* @author Ryszard Wiśniewski <brut.alll@gmail.com>
|
||||
*/
|
||||
public class ResIdValue extends ResValue implements ResXmlSerializable {
|
||||
public void serializeToXml(XmlSerializer serializer, ResResource res) throws IOException, AndrolibException {
|
||||
public class ResIdValue extends ResValue implements ResValuesXmlSerializable {
|
||||
public void serializeToResValuesXml(XmlSerializer serializer, ResResource res) throws IOException, AndrolibException {
|
||||
serializer.startTag(null, "item");
|
||||
serializer.attribute(null, "type", res.getResSpec().getType().getName());
|
||||
serializer.attribute(null, "name", res.getResSpec().getName());
|
||||
|
@ -21,7 +21,7 @@ import brut.androlib.AndrolibException;
|
||||
/**
|
||||
* @author Ryszard Wiśniewski <brut.alll@gmail.com>
|
||||
*/
|
||||
public class ResIntValue extends ResScalarValue implements ResXmlSerializable {
|
||||
public class ResIntValue extends ResScalarValue implements ResValuesXmlSerializable {
|
||||
protected final int mValue;
|
||||
|
||||
public ResIntValue(int value) {
|
||||
|
@ -25,7 +25,7 @@ import org.xmlpull.v1.XmlSerializer;
|
||||
/**
|
||||
* @author Ryszard Wiśniewski <brut.alll@gmail.com>
|
||||
*/
|
||||
public class ResPluralsValue extends ResBagValue implements ResXmlSerializable {
|
||||
public class ResPluralsValue extends ResBagValue implements ResValuesXmlSerializable {
|
||||
ResPluralsValue(ResReferenceValue parent,
|
||||
Duo<Integer, ResScalarValue>[] items) {
|
||||
super(parent);
|
||||
@ -43,7 +43,7 @@ public class ResPluralsValue extends ResBagValue implements ResXmlSerializable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serializeToXml(XmlSerializer serializer, ResResource res)
|
||||
public void serializeToResValuesXml(XmlSerializer serializer, ResResource res)
|
||||
throws IOException, AndrolibException {
|
||||
serializer.startTag(null, "plurals");
|
||||
serializer.attribute(null, "name", res.getResSpec().getName());
|
||||
|
@ -25,7 +25,7 @@ import org.xmlpull.v1.XmlSerializer;
|
||||
* @author Ryszard Wiśniewski <brut.alll@gmail.com>
|
||||
*/
|
||||
public abstract class ResScalarValue extends ResValue
|
||||
implements ResXmlPrintable, ResXmlSerializable {
|
||||
implements ResXmlPrintable, ResValuesXmlSerializable {
|
||||
protected final String mType;
|
||||
|
||||
protected ResScalarValue(String type) {
|
||||
@ -34,7 +34,7 @@ public abstract class ResScalarValue extends ResValue
|
||||
|
||||
public abstract String toResXmlFormat() throws AndrolibException;
|
||||
|
||||
public void serializeToXml(XmlSerializer serializer, ResResource res)
|
||||
public void serializeToResValuesXml(XmlSerializer serializer, ResResource res)
|
||||
throws IOException, AndrolibException {
|
||||
String type = res.getResSpec().getType().getName();
|
||||
boolean item = ! "reference".equals(mType) && ! type.equals(mType);
|
||||
|
@ -22,7 +22,7 @@ import brut.androlib.res.AndrolibResources;
|
||||
* @author Ryszard Wiśniewski <brut.alll@gmail.com>
|
||||
*/
|
||||
public class ResStringValue extends ResScalarValue
|
||||
implements ResXmlSerializable {
|
||||
implements ResValuesXmlSerializable {
|
||||
private final String mValue;
|
||||
|
||||
public ResStringValue(String value) {
|
||||
|
@ -26,7 +26,7 @@ import org.xmlpull.v1.XmlSerializer;
|
||||
/**
|
||||
* @author Ryszard Wiśniewski <brut.alll@gmail.com>
|
||||
*/
|
||||
public class ResStyleValue extends ResBagValue implements ResXmlSerializable {
|
||||
public class ResStyleValue extends ResBagValue implements ResValuesXmlSerializable {
|
||||
ResStyleValue(ResReferenceValue parent,
|
||||
Duo<Integer, ResScalarValue>[] items, ResValueFactory factory) {
|
||||
super(parent);
|
||||
@ -39,7 +39,7 @@ public class ResStyleValue extends ResBagValue implements ResXmlSerializable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serializeToXml(XmlSerializer serializer, ResResource res)
|
||||
public void serializeToResValuesXml(XmlSerializer serializer, ResResource res)
|
||||
throws IOException, AndrolibException {
|
||||
serializer.startTag(null, "style");
|
||||
serializer.attribute(null, "name", res.getResSpec().getName());
|
||||
|
@ -24,7 +24,7 @@ import org.xmlpull.v1.XmlSerializer;
|
||||
/**
|
||||
* @author Ryszard Wiśniewski <brut.alll@gmail.com>
|
||||
*/
|
||||
public interface ResXmlSerializable {
|
||||
public void serializeToXml(XmlSerializer serializer, ResResource res)
|
||||
public interface ResValuesXmlSerializable {
|
||||
public void serializeToResValuesXml(XmlSerializer serializer, ResResource res)
|
||||
throws IOException, AndrolibException;
|
||||
}
|
Loading…
Reference in New Issue
Block a user