From 58584b4950d0e1e516ad0182c27bfcb434ca8eac Mon Sep 17 00:00:00 2001 From: YAWAsau <229953100a@gmail.com> Date: Sat, 6 Nov 2021 15:01:14 +0800 Subject: [PATCH] bug fix --- tools/bin/bin.sh | 16 ++++++++-------- tools/script/Get_DirName | 2 +- 備份應用.sh | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tools/bin/bin.sh b/tools/bin/bin.sh index 8d0ea9b..6e709ee 100644 --- a/tools/bin/bin.sh +++ b/tools/bin/bin.sh @@ -44,10 +44,10 @@ fi find -L "$filepath" -maxdepth 1 -type l -exec rm -rf {} \; if [[ -d $bin_path ]]; then if [[ -f $busybox && -f $busybox2 ]]; then - filemd5="$(md5sum "$busybox" | cut -d" " -f1)" - filemd5_1="$(md5sum "$busybox2" | cut -d" " -f1)" - if [[ $filemd5 != $filemd5_1 ]]; then - echo "busybox md5不一致 重新創立環境中" + filesha256="$(sha256sum "$busybox" | cut -d" " -f1)" + filesha256_1="$(sha256sum "$busybox2" | cut -d" " -f1)" + if [[ $filesha256 != $filesha256_1 ]]; then + echo "busybox sha256不一致 重新創立環境中" rm -rf "$filepath"/* fi fi @@ -58,10 +58,10 @@ if [[ -d $bin_path ]]; then chmod 0777 "$filepath/$File_name" echo "$File_name > $filepath/$File_name" else - filemd5="$(md5sum "$filepath/$File_name" | cut -d" " -f1)" - filemd5_1="$(md5sum "$bin_path/$File_name" | cut -d" " -f1)" - if [[ $filemd5 != $filemd5_1 ]]; then - echo "$File_name md5不一致 重新創建" + filesha256="$(sha256sum "$filepath/$File_name" | cut -d" " -f1)" + filesha256_1="$(sha256sum "$bin_path/$File_name" | cut -d" " -f1)" + if [[ $filesha256 != $filesha256_1 ]]; then + echo "$File_name sha256不一致 重新創建" cp -r "$REPLY" "$filepath" chmod 0777 "$filepath/$File_name" echo "$File_name > $filepath/$File_name" diff --git a/tools/script/Get_DirName b/tools/script/Get_DirName index 6b2b039..eab6f09 100644 --- a/tools/script/Get_DirName +++ b/tools/script/Get_DirName @@ -5,7 +5,7 @@ bin_path="$MODDIR/tools/bin" txt="$MODDIR/應用列表.txt" . "$bin_path/bin.sh" echo "#不需要恢復還原的應用請在開頭注釋# 比如#xxxxxxxx 酷安">"$txt" -find "$MODDIR" -maxdepth 1 -type d | sort | sed 's/\[/ /g ; s/\]//g' | while read; do +find "$MODDIR" -maxdepth 1 -type d | sort | while read; do if [[ -f $REPLY/app_details ]]; then unset PackageName . "$REPLY/app_details" diff --git a/備份應用.sh b/備份應用.sh index 6edb9e0..0349bd2 100644 --- a/備份應用.sh +++ b/備份應用.sh @@ -94,7 +94,7 @@ Quantity=0 Backup_apk() { #創建APP備份文件夾 [[ ! -d $Backup_folder ]] && mkdir -p "$Backup_folder" - [[ $(cat "$Backup/應用列表.txt" | grep -v "#" | sed -e '/^$/d' | awk '{print $2}' | grep -w "^${name2}$" | head -1) = "" ]] && echo "$name1 $name2" >>"$Backup/應用列表.txt" + [[ $(cat "$Backup/應用列表.txt" | grep -v "#" | sed -e '/^$/d' | awk '{print $2}' | grep -w "^${name2}$" | head -1) = "" ]] && echo "${Backup_folder##*/} $name2" >>"$Backup/應用列表.txt" if [[ $apk_version = $(dumpsys package "$name2" | awk '/versionName=/{print $1}' | cut -f2 -d '=' | head -1) ]]; then unset xb ; result=0 echoRgb "Apk版本無更新 跳過備份"