diff --git a/AAP.sh b/AAP.sh index 64d9270..0055dde 100755 --- a/AAP.sh +++ b/AAP.sh @@ -3,6 +3,11 @@ #2024-06-03 Rewrite #shellcheck disable=SC2059,SC2086,SC2166 +if [ ${APTOOLDEBUG} -eq 1 ]; then + printf "[\033[1;33mWARN] $(date "+%H:%M:%S"): Debug mode is on.\033[0m\n" + set -x +fi + # 特殊变量 RED="\033[1;31m" # RED YELLOW="\033[1;33m" # YELLOW @@ -54,7 +59,6 @@ Current DIR: $(pwd) -s \"STRING\", specify a superkey. Use STRING as superkey. -S, Install to another slot (for OTA). -E [ARGS], Add args [ARGS] to kptools when patching. --V, verbose mode. " exit 0 } @@ -78,10 +82,6 @@ while getopts ":hvi:k:IVs:SE:" OPT; do SAVEROOT="true" msg_info "The -S parameter was received. The patched image will be flashed into another slot if this is a ab partition device." ;; - V) - set -x - msg_warn "DEBUG MODE IS ON." - ;; I) if [ "${OS}" = "android" ]; then INSTALL="true" @@ -116,12 +116,12 @@ while getopts ":hvi:k:IVs:SE:" OPT; do done # 镜像路径检测(For Linux) if [ "${OS}" = "linux" -a -z "${BOOTPATH}" ]; then - msg_fatal "You are using ${OS}, but there is no image specified by you. Exited." + msg_fatal "You are using ${OS}, but there is no image specified by you. Aborted." exit 1 fi # 无 ROOT 并且未指定 BOOT 镜像路径则退出 if [ -z "${BOOTPATH}" -a ${ROOT} ]; then - msg_fatal "No root and no boot image is specified. Exited." + msg_fatal "No root and no boot image is specified. Aborted." exit 1 fi # 设置工作文件夹 diff --git a/AAPFunction b/AAPFunction index 733ede7..5dbe8a3 100755 --- a/AAPFunction +++ b/AAPFunction @@ -1,5 +1,6 @@ #!/bin/sh #rewrited +#shellcheck disable=SC2086 get_device_boot() { msg_info "Getting boot image..." if [ -z "${BOOTPATH}" ]; then @@ -124,7 +125,7 @@ flash_boot() { rm -rf ${WORKDIR} msg_info "Done." else - msg_fatal "No root. Unable to continue. Exited." + msg_fatal "No root. Unable to continue. Aborted." exit 1 fi else @@ -138,7 +139,7 @@ print_superkey() { #################################### - YOUR SUPERKEY IS "$(printf "${BLUE}${SUPERKEY}${RESET}")" + YOUR SUPERKEY IS "$(printf "${BLUE}%s${RESET}" "${SUPERKEY}")" DON'T FORGET IT!!