mirror of
https://github.com/revanced/Apktool.git
synced 2024-12-05 02:22:55 +01:00
ResBagValue.serializeToXml(): serializing as style, array or plurals value depending on type of ResResource.
This commit is contained in:
parent
c9f298fdea
commit
6ce6d76484
@ -19,8 +19,8 @@ package brut.androlib.res.data.value;
|
||||
|
||||
import brut.androlib.AndrolibException;
|
||||
import brut.androlib.res.data.ResResource;
|
||||
import brut.util.Duo;
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
import org.xmlpull.v1.XmlSerializer;
|
||||
|
||||
/**
|
||||
@ -35,9 +35,25 @@ public class ResBagValue extends ResValue implements ResXmlSerializable {
|
||||
|
||||
public void serializeToXml(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);
|
||||
return;
|
||||
}
|
||||
if ("array".equals(type)) {
|
||||
new ResArrayValue(mParent, new Duo[0])
|
||||
.serializeToXml(serializer, res);
|
||||
return;
|
||||
}
|
||||
if ("plurals".equals(type)) {
|
||||
new ResPluralsValue(mParent, new Duo[0])
|
||||
.serializeToXml(serializer, res);
|
||||
return;
|
||||
}
|
||||
|
||||
serializer.startTag(null, "item");
|
||||
serializer.attribute(null, "type",
|
||||
res.getResSpec().getType().getName());
|
||||
serializer.attribute(null, "type", type);
|
||||
serializer.attribute(null, "name", res.getResSpec().getName());
|
||||
serializer.endTag(null, "item");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user