mirror of
https://github.com/revanced/Apktool.git
synced 2025-01-07 18:45:58 +01:00
fix for ResValue cast to ResAttr exception (not really, just bypass)
This commit is contained in:
parent
0673c1e2dc
commit
efd8349aa5
@ -50,12 +50,25 @@ public class ResStyleValue extends ResBagValue implements ResValuesXmlSerializab
|
|||||||
for (int i = 0; i < mItems.length; i++) {
|
for (int i = 0; i < mItems.length; i++) {
|
||||||
ResResSpec spec = mItems[i].m1.getReferent();
|
ResResSpec spec = mItems[i].m1.getReferent();
|
||||||
|
|
||||||
// hacky-fix remove bad ReferenceVars
|
// fix for ClassCastException by Alsan Wong <alsan.wong@gmail.com> at 2013/01/18 15:08
|
||||||
if (spec.getDefaultResource().getValue().toString().contains("ResReferenceValue@")) {
|
ResAttr attr = null;
|
||||||
continue;
|
String value = null;
|
||||||
}
|
|
||||||
ResAttr attr = (ResAttr) spec.getDefaultResource().getValue();
|
try {
|
||||||
String value = attr.convertToResXmlFormat(mItems[i].m2);
|
// hacky-fix remove bad ReferenceVars
|
||||||
|
ResValue attrValue = spec.getDefaultResource().getValue();
|
||||||
|
value = attrValue.toString(); // I know, this is not good, but I don't want another variable just for exception handling
|
||||||
|
|
||||||
|
if(true == value.contains("ResReferenceValue@")) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
attr = (ResAttr)attrValue;
|
||||||
|
value = attr.convertToResXmlFormat(mItems[i].m2);
|
||||||
|
} catch(ClassCastException e) {
|
||||||
|
System.out.println("ClassCastException: " + e.getMessage());
|
||||||
|
System.out.println(value);
|
||||||
|
}
|
||||||
|
|
||||||
if (value == null) {
|
if (value == null) {
|
||||||
value = mItems[i].m2.encodeAsResXmlValue();
|
value = mItems[i].m2.encodeAsResXmlValue();
|
||||||
|
Loading…
Reference in New Issue
Block a user