-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Closed
Milestone
Description
Information
- Apktool Version (
apktool -version) - 2.11.1 - Operating System (Mac, Linux, Windows) - Windows
- APK From? (Playstore, ROM, Other) - build by myself
- Java Version (
java --version) - 1.8
Stacktrace/Logcat
Include stacktrace here
Steps to Reproduce
apktool dapktool b
Frameworks
If this APK is from an OEM ROM (Samsung, HTC, LG). Please attach framework files
(.apks that live in /system/framework or /system/priv-app)
APK
If this APK can be freely shared, please upload/attach a link to it.
Questions to ask before submission
- Have you tried
apktool d,apktool bwithout changing anything? yes - If you are trying to install a modified apk, did you resign it? yes
- Are you using the latest apktool version? yes
In the class 'AndroidManifestResourceParser', there are some codes:
public String getAttributeValue(int index) {
String value = super.getAttributeValue(index);
if (value == null) {
return "";
}
if (!isNumericStringMetadataAttributeValue(index, value)) {
return value;
}
// Patch the numeric string value by prefixing it with an escaped space.
// 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 "\\ " + value.trim();
}
private boolean isNumericStringMetadataAttributeValue(int index, String value) {
return "meta-data".equals(super.getName())
&& "value".equals(super.getAttributeName(index))
&& super.getAttributeValueType(index) == TypedValue.TYPE_STRING
&& PATTERN_NUMERIC_STRING.matcher(value).matches();
}
but,when i rebuild the apk,the value is incorrect with a space.
this is the meta-data value before decoding

this is the meta-data value after rebuilding.

Is this code still necessary?
return "\\ " + value.trim();
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels