mirror of
https://github.com/revanced/Apktool.git
synced 2024-08-28 10:05:51 +02:00
fix: correct npe if null is returned from attribute value (#2889)
This commit is contained in:
parent
eb105fb26d
commit
fc1e21e9ed
@ -37,6 +37,9 @@ public class AndroidManifestResourceParser extends AXmlResourceParser {
|
||||
@Override
|
||||
public String getAttributeValue(int index) {
|
||||
String value = super.getAttributeValue(index);
|
||||
if (value == null) {
|
||||
return "";
|
||||
}
|
||||
|
||||
if (!isNumericStringMetadataAttributeValue(index, value)) {
|
||||
return value;
|
||||
@ -46,7 +49,7 @@ public class AndroidManifestResourceParser extends AXmlResourceParser {
|
||||
// Otherwise, when the decoded app is rebuilt, aapt will incorrectly encode
|
||||
// the value as an int or float (depending on aapt version), breaking the original
|
||||
// app functionality.
|
||||
return "\\ " + super.getAttributeValue(index).trim();
|
||||
return "\\ " + value.trim();
|
||||
}
|
||||
|
||||
private boolean isNumericStringMetadataAttributeValue(int index, String value) {
|
||||
|
Loading…
Reference in New Issue
Block a user