未验证 提交 ea8b9ce4 编写于 作者: J Jan S 提交者: GitHub

fix(xml): reversed XML attribute name decoding priority (#1208)(PR #1214)

上级 b5720bd1
......@@ -335,19 +335,25 @@ public class BinaryXMLParser extends CommonBinaryParser {
}
private String getAttributeName(int id) {
String str = getString(id);
if (str == null || str.isEmpty()) {
// As the outcome of https://github.com/skylot/jadx/issues/1208
// Android seems to favor entries from AndroidResMap and only if
// there is no entry uses the values form the XML string pool
if (0 <= id && id < resourceIds.length) {
int resId = resourceIds[id];
str = ValuesParser.getAndroidResMap().get(resId);
if (str == null) {
return "NOT_FOUND_0x" + Integer.toHexString(id);
}
// cut type before /
int typeEnd = str.indexOf('/');
if (typeEnd != -1) {
return str.substring(typeEnd + 1);
String str = ValuesParser.getAndroidResMap().get(resId);
if (str != null) {
// cut type before /
int typeEnd = str.indexOf('/');
if (typeEnd != -1) {
return str.substring(typeEnd + 1);
}
return str;
}
return str;
}
String str = getString(id);
if (str == null || str.isEmpty()) {
return "NOT_FOUND_0x" + Integer.toHexString(id);
}
return str;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册