mirror of
https://github.com/revanced/Apktool.git
synced 2025-02-01 14:47:56 +01: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
|
@Override
|
||||||
public String getAttributeValue(int index) {
|
public String getAttributeValue(int index) {
|
||||||
String value = super.getAttributeValue(index);
|
String value = super.getAttributeValue(index);
|
||||||
|
if (value == null) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
if (!isNumericStringMetadataAttributeValue(index, value)) {
|
if (!isNumericStringMetadataAttributeValue(index, value)) {
|
||||||
return value;
|
return value;
|
||||||
@ -46,7 +49,7 @@ public class AndroidManifestResourceParser extends AXmlResourceParser {
|
|||||||
// Otherwise, when the decoded app is rebuilt, aapt will incorrectly encode
|
// 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
|
// the value as an int or float (depending on aapt version), breaking the original
|
||||||
// app functionality.
|
// app functionality.
|
||||||
return "\\ " + super.getAttributeValue(index).trim();
|
return "\\ " + value.trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isNumericStringMetadataAttributeValue(int index, String value) {
|
private boolean isNumericStringMetadataAttributeValue(int index, String value) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user