Skip to content

Commit ff8802d

Browse files
committed
优化 apktool 回编译脚本代码的写法
1 parent 3e2f20f commit ff8802d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

shell/reverse-tools/apktool/RecompileApk.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,15 @@ waitUserInputParameter() {
3636
outputApkFilePath="${sourceDirPath%/}.apk"
3737
fi
3838

39-
recompileApkNameSuffix="-recompile-$(date "+%Y%m%d%H%M%S").apk"
39+
recompileApkNameSuffix="-recompile-$(date "+%Y%m%d%H%M%S")"
4040
if [[ -f "${outputApkFilePath}" ]]; then
4141
echo "该文件已经存在,是否覆盖原有内容?(y/n)"
4242
while true; do
4343
read -r rewriteConfirm
4444
if [[ "${rewriteConfirm}" =~ ^[yY]$ ]]; then
4545
break
4646
elif [[ "${rewriteConfirm}" =~ ^[nN]$ ]]; then
47-
outputApkFilePath="${outputApkFilePath%.*}${recompileApkNameSuffix}"
47+
outputApkFilePath="${outputApkFilePath%.*}${recompileApkNameSuffix}.apk"
4848
break
4949
else
5050
echo "👻 输入不正确,请输入正确的选项(y/n)"
@@ -53,7 +53,7 @@ waitUserInputParameter() {
5353
done
5454
elif [[ -d "${outputApkFilePath}" ]]; then
5555
if [[ "$(find "${outputApkFilePath}" -mindepth 1 | head -1)" ]]; then
56-
outputApkFilePath="${outputApkFilePath%.*}${recompileApkNameSuffix}"
56+
outputApkFilePath="${outputApkFilePath%.*}${recompileApkNameSuffix}.apk"
5757
else
5858
rmdir "${outputApkFilePath}"
5959
fi

0 commit comments

Comments
 (0)