mirror of
https://github.com/revanced/Apktool.git
synced 2025-01-21 01:07:34 +01:00
ResAttr::convertToResXmlFormat() : now it returns null if it can't convert a value.
Since now this method was calling toResXmlFormat() on an unconvertable value and was always returning a string. But because of that calling object couldn't know, whether returned value is converted one or not.
This commit is contained in:
parent
fc814c50d8
commit
b3866d034d
@ -38,7 +38,7 @@ public class ResAttr extends ResBagValue implements ResValuesXmlSerializable {
|
||||
|
||||
public String convertToResXmlFormat(ResScalarValue value)
|
||||
throws AndrolibException {
|
||||
return value.toResXmlFormat();
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -51,6 +51,10 @@ public class ResStyleValue extends ResBagValue implements ResValuesXmlSerializab
|
||||
ResAttr attr = (ResAttr) spec.getDefaultResource().getValue();
|
||||
String value = attr.convertToResXmlFormat(mItems[i].m2);
|
||||
|
||||
if (value == null) {
|
||||
value = mItems[i].m2.toResXmlFormat();
|
||||
}
|
||||
|
||||
if (value == null) {
|
||||
continue;
|
||||
}
|
||||
|
@ -29,12 +29,15 @@ public class ResAttrDecoder {
|
||||
throws AndrolibException {
|
||||
ResScalarValue resValue = mCurrentPackage.getValueFactory()
|
||||
.factory(type, value, rawValue);
|
||||
if (attrResId == 0) {
|
||||
return resValue.toResXmlFormat();
|
||||
}
|
||||
|
||||
String decoded = null;
|
||||
if (attrResId != 0) {
|
||||
ResAttr attr = (ResAttr) getCurrentPackage().getResTable()
|
||||
.getResSpec(attrResId).getDefaultResource().getValue();
|
||||
return attr.convertToResXmlFormat(resValue);
|
||||
decoded = attr.convertToResXmlFormat(resValue);
|
||||
}
|
||||
|
||||
return decoded != null ? decoded : resValue.toResXmlFormat();
|
||||
}
|
||||
|
||||
public ResPackage getCurrentPackage() throws AndrolibException {
|
||||
|
Loading…
x
Reference in New Issue
Block a user