diff --git a/tools/classes.dex b/tools/classes.dex index 2fa6725..ef14b62 100644 Binary files a/tools/classes.dex and b/tools/classes.dex differ diff --git a/tools/tools.sh b/tools/tools.sh index fb7a417..887f62a 100644 --- a/tools/tools.sh +++ b/tools/tools.sh @@ -9,7 +9,7 @@ MODDIR="$MODDIR" MODDIR_NAME="${MODDIR##*/}" tools_path="$MODDIR/tools" script="${0##*/}" -backup_version="20241228225" +backup_version="202412282251" [[ $SHELL = *mt* ]] && echo "請勿使用MT管理器拓展包環境執行,請更換系統環境" && exit 2 update_backup_settings_conf() { echo "#0關閉音量鍵選擇 (如選項未設置,則強制使用音量鍵選擇) @@ -340,7 +340,7 @@ while read -r file expected_hash; do done <<< "$(cat <"$txt2" [[ -e ${txt%/*}/txt2 ]] && cat "${txt%/*}/txt2">"$txt" && rm -rf "${txt%/*}/txt2" if [[ $backup_media = true && $backup_mode = "" ]]; then @@ -2122,6 +2132,7 @@ backup) B="$(echo "$Custom_path" | egrep -v '#|#' | awk 'NF != 0 { count++ } END { print count }')" if [[ $B != "" ]]; then echoRgb "備份結束,備份多媒體" "1" + notification "102" "Media備份開始" starttime1="$(date -u "+%s")" Backup_folder="$Backup/Media" [[ ! -f $Backup/恢復自定義資料夾.sh ]] && touch_shell "Restore3" "$Backup/恢復自定義資料夾.sh" @@ -2132,6 +2143,7 @@ backup) [[ ! -f $mediatxt ]] && echo "#不需要恢復的資料夾請在開頭使用#注釋 比如:#Download" > "$mediatxt" echo "$Custom_path" | sed -e '/^#/d; /^$/d; s/\/$//' | while read; do echoRgb "備份第$A/$B個資料夾 剩下$((B - A))個" "3" + notification "102" "備份第$A/$B個資料夾 剩下$((B - A))個" starttime2="$(date -u "+%s")" if [[ ${REPLY##*/} = adb ]]; then if [[ $ksu != ksu ]]; then @@ -2152,6 +2164,7 @@ backup) rgb_a="$rgb_d" && let A++ done echoRgb "目錄↓↓↓\n -$Backup_folder" + notification "102" "Media備份完成 $(endtime 1 "自定義備份")" endtime 1 "自定義備份" else echoRgb "自定義路徑為空 無法備份" "0" @@ -2168,6 +2181,7 @@ backup) echoRgb "備份結束時間$(date +"%Y-%m-%d %H:%M:%S")" starttime1="$TIME" endtime 1 "批量備份開始到結束" + notification "105" "備份完成 $(endtime 1 "批量備份開始到結束")" } & wait && exit ;; @@ -2345,11 +2359,14 @@ Restore|Restore2) Set_screen_pause_seconds on en=118 echo "$script">"$TMPDIR/scriptTMP" + notification "105" "開始恢復app" { while [[ $i -le $r ]]; do [[ $en -ge 229 ]] && en=118 if [[ $operate = Restore ]]; then echoRgb "恢復第$i/$r個應用 剩下$((r - i))個" "3" + notification "105" "恢復第$i/$r個應用 剩下$((r - i))個 +恢復 $name1 \"$name2\"" if [[ ! -f $txt ]]; then [[ $(echo "$txt") != "" ]] && { name1="$(echo "$txt" | sed -e '/^$/d' | sed -n "${i}p" | awk '{print $1}')" @@ -2436,7 +2453,9 @@ Restore|Restore2) unset Ssaid done echoRgb "SSAID恢復後必須重新開機套用,否則應用閃退,如果沒有應用恢復ssaid則無須重啟" "0" + notification "107" "SSAID恢復後必須重新開機套用,否則應用閃退,如果沒有應用恢復ssaid則無須重啟" } + notification "105" "app恢復完成 $(endtime 1 "應用恢復" "2")" if [[ $media_recovery = true ]]; then starttime1="$(date -u "+%s")" app_details="$Backup_folder2/app_details.json" @@ -2445,6 +2464,7 @@ Restore|Restore2) A=1 B="$(egrep -v '#|#' "$txt" 2>/dev/null | awk 'NF != 0 { count++ } END { print count }')" [[ $B = "" ]] && echoRgb "mediaList.txt壓縮包名為空或是被注釋了\n -請執行\"重新生成應用列表.sh\"獲取列表再來恢復" "0" && B=0 + notification "106" "Media恢復開始" while [[ $A -le $B ]]; do name1="$(egrep -v '#|#' "$txt" 2>/dev/null | sed -e '/^$/d' | sed -n "${A}p" | awk '{print $1}')" starttime2="$(date -u "+%s")" @@ -2453,11 +2473,13 @@ Restore|Restore2) endtime 2 "$FILE_NAME2恢復" "2" && echoRgb "完成$((A * 100 / B))%" "3" && echoRgb "____________________________________" && let A++ done endtime 1 "自定義恢復" "2" + notification "106" "Media恢復完成 $(endtime 1 "Media恢復" "2")" fi if [[ $modules_recovery = true ]]; then A=1 B="$(find "$Backup_folder3" -maxdepth 1 -name "*.zip*" -type f 2>/dev/null | wc -l)" starttime1="$(date -u "+%s")" + notification "108" "Module恢復開始" find "$Backup_folder3" -maxdepth 1 -name "*.zip*" -type f 2>/dev/null | while read; do starttime2="$(date -u "+%s")" echoRgb "刷入第$A/$B個模塊 剩下$((B - A))個" "3" @@ -2466,6 +2488,8 @@ Restore|Restore2) endtime 2 "${REPLY##*/}刷入" "2" && echoRgb "完成$((A * 100 / B))%" "3" && echoRgb "____________________________________" && let A++ done endtime 1 "刷入模塊" "2" + notification "108" "Module恢復完成 $(endtime 1 "Module恢復" "2")" + fi fi let i++ en++ nskg++ @@ -2474,6 +2498,7 @@ Restore|Restore2) [[ $user != 0 ]] && am stop-user "$user" starttime1="$TIME" echoRgb "$DX完成" && endtime 1 "$DX開始到結束" + notification "109" "恢復完成 $(endtime 1 "$DX開始到結束")" rm -rf "$TMPDIR"/* } & wait && exit @@ -2511,6 +2536,7 @@ Restore3) Set_screen_pause_seconds on [[ $B = "" ]] && echoRgb "mediaList.txt壓縮包名為空或是被注釋了\n -請執行\"重新生成應用列表.sh\"獲取列表再來恢復" "0" && exit 1 echo "$script">"$TMPDIR/scriptTMP" + notification "108" "Media恢復開始" { while [[ $A -le $B ]]; do name1="$(egrep -v '#|#' "$txt" 2>/dev/null | sed -e '/^$/d' | sed -n "${A}p" | awk '{print $1}')" @@ -2521,6 +2547,7 @@ Restore3) done Set_screen_pause_seconds off endtime 1 "恢復結束" + notification "108" "Media恢復完成 $(endtime 1 "Media恢復")" rm -rf "$TMPDIR/scriptTMP" } & ;; @@ -2744,6 +2771,7 @@ backup_media) [[ ! -f $mediatxt ]] && echo "#不需要恢復的資料夾請在開頭使用#注釋 比如:#Download" > "$mediatxt" echo "$script">"$TMPDIR/scriptTMP" Set_screen_pause_seconds on + notification "109" "Media備份開始" { echo "$Custom_path" | sed -e '/^#/d; /^$/d; s/\/$//' | while read; do echoRgb "備份第$A/$B個資料夾 剩下$((B - A))個" "3" @@ -2767,6 +2795,7 @@ backup_media) Calculate_size "$Backup_folder" Set_screen_pause_seconds off endtime 1 "自定義備份" + notification "109" "Media備份完成 $(endtime 1 "自定義備份")" rm -rf "$TMPDIR/scriptTMP" else echoRgb "自定義路徑為空 無法備份" "0"