mirror of
https://github.com/revanced/Apktool.git
synced 2025-01-06 10:05:54 +01:00
Catch attr lookup on internal attributes
Internal attributes will fail the AttrDecoder. Catch the errors and simply return the undecoded value which will be correct. Fixes #913
This commit is contained in:
parent
48285bde03
commit
9cb3df85d8
@ -17,6 +17,7 @@
|
||||
package brut.androlib.res.decoder;
|
||||
|
||||
import brut.androlib.AndrolibException;
|
||||
import brut.androlib.err.UndefinedResObject;
|
||||
import brut.androlib.res.data.ResPackage;
|
||||
import brut.androlib.res.data.ResResSpec;
|
||||
import brut.androlib.res.data.value.ResAttr;
|
||||
@ -32,10 +33,15 @@ public class ResAttrDecoder {
|
||||
type, value, rawValue);
|
||||
|
||||
String decoded = null;
|
||||
if (attrResId != 0) {
|
||||
ResAttr attr = (ResAttr) getCurrentPackage().getResTable()
|
||||
.getResSpec(attrResId).getDefaultResource().getValue();
|
||||
decoded = attr.convertToResXmlFormat(resValue);
|
||||
if (attrResId > 0) {
|
||||
try {
|
||||
ResAttr attr = (ResAttr) getCurrentPackage().getResTable()
|
||||
.getResSpec(attrResId).getDefaultResource().getValue();
|
||||
|
||||
decoded = attr.convertToResXmlFormat(resValue);
|
||||
} catch (UndefinedResObject ex) {
|
||||
// ignored
|
||||
}
|
||||
}
|
||||
|
||||
return decoded != null ? decoded : resValue.encodeAsResXmlAttr();
|
||||
|
Loading…
Reference in New Issue
Block a user