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