mirror of
https://github.com/revanced/Apktool.git
synced 2025-01-05 17:45: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 value = null;
|
||||
|
||||
String resource = spec.getDefaultResource().getValue().toString();
|
||||
// hacky-fix remove bad ReferenceVars
|
||||
if (resource.contains("ResReferenceValue@")) {
|
||||
ResValue resource = spec.getDefaultResource().getValue();
|
||||
if (resource instanceof ResReferenceValue) {
|
||||
continue;
|
||||
} else if (resource.contains("ResStringValue@") || resource.contains("ResStyleValue@") ||
|
||||
resource.contains("ResBoolValue@")) {
|
||||
name = "@" + spec.getFullName(res.getResSpec().getPackage(), false);
|
||||
} else {
|
||||
ResAttr attr = (ResAttr) spec.getDefaultResource().getValue();
|
||||
} else if (resource instanceof ResAttr) {
|
||||
ResAttr attr = (ResAttr) resource;
|
||||
value = attr.convertToResXmlFormat(mItems[i].m2);
|
||||
name = spec.getFullName(res.getResSpec().getPackage(), true);
|
||||
} else {
|
||||
name = "@" + spec.getFullName(res.getResSpec().getPackage(), false);
|
||||
}
|
||||
|
||||
if (value == null) {
|
||||
|
Loading…
Reference in New Issue
Block a user