File tree 2 files changed +9
-4
lines changed
brut.apktool/apktool-lib/src/main/java/brut/androlib/res/decoder 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -387,7 +387,14 @@ public String getAttributeValue(int index) {
387
387
if (mAttrDecoder != null ) {
388
388
try {
389
389
String stringBlockValue = valueRaw == -1 ? null : ResXmlEncoders .escapeXmlChars (mStringBlock .getString (valueRaw ));
390
- String resourceMapValue = mAttrDecoder .decodeFromResourceId (valueData );
390
+ String resourceMapValue = null ;
391
+
392
+ // Ensure we only track down obfuscated values for reference/attribute type values. Otherwise we might
393
+ // spam lookups against resource table for invalid ids.
394
+ if (valueType == TypedValue .TYPE_REFERENCE || valueType == TypedValue .TYPE_DYNAMIC_REFERENCE ||
395
+ valueType == TypedValue .TYPE_ATTRIBUTE || valueType == TypedValue .TYPE_DYNAMIC_ATTRIBUTE ) {
396
+ resourceMapValue = mAttrDecoder .decodeFromResourceId (valueData );
397
+ }
391
398
String value = stringBlockValue ;
392
399
393
400
if (stringBlockValue != null && resourceMapValue != null ) {
Original file line number Diff line number Diff line change @@ -46,10 +46,8 @@ public String decodeFromResourceId(int attrResId)
46
46
throws AndrolibException {
47
47
48
48
if (attrResId != 0 ) {
49
- ResID resId = new ResID (attrResId );
50
-
51
49
try {
52
- ResResSpec resResSpec = mResTable .getResSpec (resId );
50
+ ResResSpec resResSpec = mResTable .getResSpec (attrResId );
53
51
if (resResSpec != null ) {
54
52
return resResSpec .getName ();
55
53
}
You can’t perform that action at this time.
0 commit comments