mirror of
https://github.com/revanced/Apktool.git
synced 2025-01-07 10:35:52 +01:00
Merge pull request #1601 from xpirt/master
fix potential class cast exceptions
This commit is contained in:
commit
78a80d14b0
@ -63,17 +63,15 @@ public class ResStyleValue extends ResBagValue implements
|
|||||||
String name = null;
|
String name = null;
|
||||||
String value = null;
|
String value = null;
|
||||||
|
|
||||||
String resource = spec.getDefaultResource().getValue().toString();
|
ResValue resource = spec.getDefaultResource().getValue();
|
||||||
// hacky-fix remove bad ReferenceVars
|
if (resource instanceof ResReferenceValue) {
|
||||||
if (resource.contains("ResReferenceValue@")) {
|
|
||||||
continue;
|
continue;
|
||||||
} else if (resource.contains("ResStringValue@") || resource.contains("ResStyleValue@") ||
|
} else if (resource instanceof ResAttr) {
|
||||||
resource.contains("ResBoolValue@")) {
|
ResAttr attr = (ResAttr) resource;
|
||||||
name = "@" + spec.getFullName(res.getResSpec().getPackage(), false);
|
|
||||||
} else {
|
|
||||||
ResAttr attr = (ResAttr) spec.getDefaultResource().getValue();
|
|
||||||
value = attr.convertToResXmlFormat(mItems[i].m2);
|
value = attr.convertToResXmlFormat(mItems[i].m2);
|
||||||
name = spec.getFullName(res.getResSpec().getPackage(), true);
|
name = spec.getFullName(res.getResSpec().getPackage(), true);
|
||||||
|
} else {
|
||||||
|
name = "@" + spec.getFullName(res.getResSpec().getPackage(), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (value == null) {
|
if (value == null) {
|
||||||
|
Loading…
Reference in New Issue
Block a user