mirror of
https://github.com/revanced/Apktool.git
synced 2025-02-01 14:47:56 +01:00
AXmlResourceParser::getAttributeValue(): do not use raw value for references and styles.
This commit is contained in:
parent
855f664d40
commit
76d8aa0abc
@ -306,15 +306,15 @@ public class AXmlResourceParser implements XmlResourceParser {
|
|||||||
|
|
||||||
public String getAttributeValue(int index) {
|
public String getAttributeValue(int index) {
|
||||||
int offset = getAttributeOffset(index);
|
int offset = getAttributeOffset(index);
|
||||||
int valueString = m_attributes[offset + ATTRIBUTE_IX_VALUE_STRING];
|
|
||||||
if (valueString != -1) {
|
|
||||||
return AndrolibResources.escapeTextForResXml(
|
|
||||||
m_strings.getString(valueString));
|
|
||||||
}
|
|
||||||
int valueType = m_attributes[offset + ATTRIBUTE_IX_VALUE_TYPE];
|
int valueType = m_attributes[offset + ATTRIBUTE_IX_VALUE_TYPE];
|
||||||
int valueData = m_attributes[offset + ATTRIBUTE_IX_VALUE_DATA];
|
int valueData = m_attributes[offset + ATTRIBUTE_IX_VALUE_DATA];
|
||||||
|
int valueString = m_attributes[offset + ATTRIBUTE_IX_VALUE_STRING];
|
||||||
|
|
||||||
if (mAttrDecoder != null) {
|
if (mAttrDecoder != null && (
|
||||||
|
valueString == -1
|
||||||
|
|| valueType == TypedValue.TYPE_REFERENCE
|
||||||
|
|| valueType == TypedValue.TYPE_ATTRIBUTE
|
||||||
|
)) {
|
||||||
try {
|
try {
|
||||||
return mAttrDecoder.decode(valueType, valueData,
|
return mAttrDecoder.decode(valueType, valueData,
|
||||||
getAttributeNameResource(index));
|
getAttributeNameResource(index));
|
||||||
@ -329,6 +329,11 @@ public class AXmlResourceParser implements XmlResourceParser {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (valueString != -1) {
|
||||||
|
return AndrolibResources.escapeTextForResXml(
|
||||||
|
m_strings.getString(valueString));
|
||||||
|
}
|
||||||
|
|
||||||
return TypedValue.coerceToString(valueType, valueData);
|
return TypedValue.coerceToString(valueType, valueData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user