From cea9e8da1f1fa4462207f3d042c7bb45b4344832 Mon Sep 17 00:00:00 2001 From: Yawasau <229953100a@gmail.com> Date: Wed, 26 Jun 2024 06:37:12 +0800 Subject: [PATCH] bugfix --- tools/tools.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tools/tools.sh b/tools/tools.sh index 0a9fe55..a364e6a 100644 --- a/tools/tools.sh +++ b/tools/tools.sh @@ -2054,8 +2054,15 @@ Restore|Restore2) [[ $en -ge 229 ]] && en=118 if [[ $operate = Restore ]]; then echoRgb "恢復第$i/$r個應用 剩下$((r - i))個" "3" - name1="$(grep -v "#" "$txt" 2>/dev/null | sed -e '/^$/d' | sed -n "${i}p" | awk '{print $1}')" - name2="$(grep -v "#" "$txt" 2>/dev/null | sed -e '/^$/d' | sed -n "${i}p" | awk '{print $2}')" + if [[ ! -f $txt ]]; then + [[ $(echo "$txt") != "" ]] && { + name1="$(echo "$txt" | sed -e '/^$/d' | sed -n "${i}p" | awk '{print $1}')" + name2="$(echo "$txt" | sed -e '/^$/d' | sed -n "${i}p" | awk '{print $2}')" + } + else + name1="$(grep -v "#" "$txt" 2>/dev/null | sed -e '/^$/d' | sed -n "${i}p" | awk '{print $1}')" + name2="$(grep -v "#" "$txt" 2>/dev/null | sed -e '/^$/d' | sed -n "${i}p" | awk '{print $2}')" + fi notification --tag="105" --title="App恢復" --text="恢復 $name1 \"$name2\"" unset No_backupdata apk_version Permissions if [[ $name1 = *! || $name1 = *! ]]; then