This commit is contained in:
YAWAsau
2021-11-06 15:01:14 +08:00
parent 09431669bd
commit 58584b4950
3 changed files with 10 additions and 10 deletions

View File

@@ -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"

View File

@@ -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"

View File

@@ -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版本無更新 跳過備份"