mirror of
https://github.com/revanced/Apktool.git
synced 2025-04-30 22:24:25 +02:00
fix: prevent NPE during decode app with no matching resId for resource
This commit is contained in:
parent
cd7405d31b
commit
b896b4491a
@ -21,6 +21,7 @@ import android.util.TypedValue;
|
|||||||
import brut.androlib.AndrolibException;
|
import brut.androlib.AndrolibException;
|
||||||
import brut.androlib.res.data.ResID;
|
import brut.androlib.res.data.ResID;
|
||||||
import brut.androlib.res.xml.ResXmlEncoders;
|
import brut.androlib.res.xml.ResXmlEncoders;
|
||||||
|
import brut.common.BrutException;
|
||||||
import brut.util.ExtDataInput;
|
import brut.util.ExtDataInput;
|
||||||
import com.google.common.io.LittleEndianDataInputStream;
|
import com.google.common.io.LittleEndianDataInputStream;
|
||||||
import java.io.DataInput;
|
import java.io.DataInput;
|
||||||
@ -339,15 +340,15 @@ public class AXmlResourceParser implements XmlResourceParser {
|
|||||||
|
|
||||||
// some attributes will return "", we must rely on the resource_id and refer to the frameworks
|
// some attributes will return "", we must rely on the resource_id and refer to the frameworks
|
||||||
// to match the resource id to the name. ex: 0x101021C = versionName
|
// to match the resource id to the name. ex: 0x101021C = versionName
|
||||||
if (value.length() != 0 && !android_ns.equals(getAttributeNamespace(index))) {
|
if (value.length() == 0 || android_ns.equals(getAttributeNamespace(index))) {
|
||||||
return value;
|
|
||||||
} else {
|
|
||||||
try {
|
try {
|
||||||
value = mAttrDecoder.decodeManifestAttr(getAttributeNameResource(index));
|
int resourceId = getAttributeNameResource(index);
|
||||||
} catch (AndrolibException e) {
|
if (resourceId != 0) {
|
||||||
}
|
value = mAttrDecoder.decodeManifestAttr(getAttributeNameResource(index));
|
||||||
return value;
|
}
|
||||||
|
} catch (AndrolibException | NullPointerException e) { }
|
||||||
}
|
}
|
||||||
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
x
Reference in New Issue
Block a user