mirror of
https://github.com/revanced/Apktool.git
synced 2025-05-02 15:04:24 +02:00
parent
bada6441ec
commit
00abedfa06
@ -17,6 +17,7 @@
|
|||||||
package brut.androlib.res.data.value;
|
package brut.androlib.res.data.value;
|
||||||
|
|
||||||
import brut.androlib.AndrolibException;
|
import brut.androlib.AndrolibException;
|
||||||
|
import brut.androlib.err.UndefinedResObject;
|
||||||
import brut.androlib.res.data.ResPackage;
|
import brut.androlib.res.data.ResPackage;
|
||||||
import brut.androlib.res.data.ResResSpec;
|
import brut.androlib.res.data.ResResSpec;
|
||||||
|
|
||||||
@ -45,6 +46,9 @@ public class ResReferenceValue extends ResIntValue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ResResSpec spec = getReferent();
|
ResResSpec spec = getReferent();
|
||||||
|
if (spec == null) {
|
||||||
|
return "@null";
|
||||||
|
}
|
||||||
boolean newId = spec.hasDefaultResource() && spec.getDefaultResource().getValue() instanceof ResIdValue;
|
boolean newId = spec.hasDefaultResource() && spec.getDefaultResource().getValue() instanceof ResIdValue;
|
||||||
|
|
||||||
// generate the beginning to fix @android
|
// generate the beginning to fix @android
|
||||||
@ -54,10 +58,18 @@ public class ResReferenceValue extends ResIntValue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public ResResSpec getReferent() throws AndrolibException {
|
public ResResSpec getReferent() throws AndrolibException {
|
||||||
return mPackage.getResTable().getResSpec(getValue());
|
try {
|
||||||
|
return mPackage.getResTable().getResSpec(getValue());
|
||||||
|
} catch (UndefinedResObject ex) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isNull() {
|
public boolean isNull() {
|
||||||
return mValue == 0;
|
return mValue == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean referentIsNull() throws AndrolibException {
|
||||||
|
return getReferent() == null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -45,7 +45,7 @@ public class ResStyleValue extends ResBagValue implements
|
|||||||
ResResource res) throws IOException, AndrolibException {
|
ResResource res) throws IOException, AndrolibException {
|
||||||
serializer.startTag(null, "style");
|
serializer.startTag(null, "style");
|
||||||
serializer.attribute(null, "name", res.getResSpec().getName());
|
serializer.attribute(null, "name", res.getResSpec().getName());
|
||||||
if (!mParent.isNull()) {
|
if (!mParent.isNull() && !mParent.referentIsNull()) {
|
||||||
serializer.attribute(null, "parent", mParent.encodeAsResXmlAttr());
|
serializer.attribute(null, "parent", mParent.encodeAsResXmlAttr());
|
||||||
} else if (res.getResSpec().getName().indexOf('.') != -1) {
|
} else if (res.getResSpec().getName().indexOf('.') != -1) {
|
||||||
serializer.attribute(null, "parent", "");
|
serializer.attribute(null, "parent", "");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user