From a269025b6c74fe1b8ced83b43a0ec7d23e5f028c Mon Sep 17 00:00:00 2001 From: Sunny Luo Date: Tue, 5 Mar 2024 22:42:10 +0800 Subject: [PATCH] Update binary.js --- lib/xml-parser/binary.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/xml-parser/binary.js b/lib/xml-parser/binary.js index 9071943..b9a61d6 100644 --- a/lib/xml-parser/binary.js +++ b/lib/xml-parser/binary.js @@ -545,7 +545,9 @@ and is supposed to end at offset ${end}. Ignoring the rest of the value.`) if (valueRef > 0) { // some apk have versionName with special characters if (attr.name === 'versionName') { - this.strings[valueRef] = this.strings[valueRef].replace(/[^\d\w-.]/g, '') + // only keep printable characters + // https://www.ascii-code.com/characters/printable-characters + this.strings[valueRef] = this.strings[valueRef].replace(/[^\x21-\x7E]/g, '') } attr.value = this.strings[valueRef] }