fix: fix zip filename encoding issue

fix https://github.com/MaaAssistantArknights/MaaAssistantArknights/issues/9840
This commit is contained in:
Horror Proton
2024-07-27 01:31:20 +08:00
parent 5b3186e464
commit f8bf92bf59
2 changed files with 2 additions and 2 deletions

View File

@@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -e
zipinfo -O GB2312 -v $1 \
zipinfo -O utf8 -v $1 \
| sed -n -e '/^Central directory entry/,+3p' -e '/32-bit CRC value (hex):/p' | grep '^ ' \
| sed -e 's/^ //g' | sed -z 's/\n32-bit CRC value (hex):\s*/\t/g' \
| awk '{last = $NF; $NF=""; print last,$0}'

View File

@@ -25,6 +25,6 @@ tmpdir=$(mktemp -d /tmp/zipota-files.XXX)
comm -23 <(echo "$from_fn") <(echo "$to_fn") > "$tmpdir"/removelist.txt
echo "$to_fn" > "$tmpdir"/filelist.txt
zip -r -j "$out_zip" "$tmpdir"/removelist.txt "$tmpdir"/filelist.txt
zip -X -r -j "$out_zip" "$tmpdir"/removelist.txt "$tmpdir"/filelist.txt
rm -rf $tmpdir