File tree Expand file tree Collapse file tree 2 files changed +28
-5
lines changed
Expand file tree Collapse file tree 2 files changed +28
-5
lines changed Original file line number Diff line number Diff line change @@ -16,9 +16,14 @@ unset scriptDirPath
1616unset originalDirPath
1717
1818waitUserInputParameter () {
19- echo " 请输入要进行签名的 apk 文件或所在目录路径:"
20- read -r sourcePath
21- sourcePath=$( parseComputerFilePath " ${sourcePath} " )
19+ local sourcePath=$1
20+ if [[ -f " ${sourcePath} " ]]; then
21+ sourcePath=$( parseComputerFilePath " ${sourcePath} " )
22+ else
23+ echo " 请输入要进行签名的 apk 文件或所在目录路径:"
24+ read -r sourcePath
25+ sourcePath=$( parseComputerFilePath " ${sourcePath} " )
26+ fi
2227 if [[ -z " ${sourcePath} " ]]; then
2328 echo " ❌ 路径为空,请检查输入是否正确"
2429 exit 1
@@ -264,9 +269,9 @@ signatureApkInParallel() {
264269main () {
265270 printCurrentSystemType
266271 checkJavaEnvironment
267- waitUserInputParameter
272+ waitUserInputParameter " $1 "
268273 signatureApkInParallel
269274}
270275
271276clear
272- main
277+ main " $@ "
Original file line number Diff line number Diff line change @@ -76,11 +76,29 @@ recompileApk() {
7676 echo " ✅ 回编译 apk 完成,输出文件:${outputApkFilePath} "
7777}
7878
79+ signatureApk () {
80+ echo " 是否要对回编译输出的 apk 进行签名?(y/n)"
81+ while true ; do
82+ read -r signConfirm
83+ if [[ " ${signConfirm} " =~ ^[yY]$ ]]; then
84+ selfDir=$( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd)
85+ bash " ${selfDir} /../../package-tools/SignatureApk.sh" " ${outputApkFilePath} "
86+ break
87+ elif [[ " ${signConfirm} " =~ ^[nN]$ ]]; then
88+ break
89+ else
90+ echo " 👻 输入不正确,请输入正确的选项(y/n)"
91+ continue
92+ fi
93+ done
94+ }
95+
7996main () {
8097 printCurrentSystemType
8198 checkJavaEnvironment
8299 waitUserInputParameter
83100 recompileApk
101+ signatureApk
84102}
85103
86104clear
You can’t perform that action at this time.
0 commit comments