Skip to content

Commit

Permalink
small update
Browse files Browse the repository at this point in the history
  • Loading branch information
AkinaAcct committed Jun 25, 2024
1 parent 3053843 commit fe6f6ca
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
14 changes: 7 additions & 7 deletions AAP.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}
Expand All @@ -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"
Expand Down Expand Up @@ -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
# 设置工作文件夹
Expand Down
5 changes: 3 additions & 2 deletions AAPFunction
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/sh
#rewrited
#shellcheck disable=SC2086
get_device_boot() {
msg_info "Getting boot image..."
if [ -z "${BOOTPATH}" ]; then
Expand Down Expand Up @@ -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
Expand All @@ -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!!
Expand Down

0 comments on commit fe6f6ca

Please sign in to comment.