Skip to content

Commit c7dd741

Browse files
committed
bugfix
1 parent c016118 commit c7dd741

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

tools/tools.sh

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ MODDIR="$MODDIR"
99
MODDIR_NAME="${MODDIR##*/}"
1010
tools_path="$MODDIR/tools"
1111
script="${0##*/}"
12-
backup_version="202504241535"
12+
backup_version="202504260051"
1313
[[ $SHELL = *mt* ]] && echo "請勿使用MT管理器拓展包環境執行,請更換系統環境" && exit 2
1414
update_backup_settings_conf() {
1515
echo "#0關閉音量鍵選擇 (如選項未設置,則強制使用音量鍵選擇)
@@ -254,6 +254,7 @@ arm64*)
254254
exit 1
255255
;;
256256
esac
257+
get_mv="$(which mv)"
257258
PATH="/data/adb/ksu/bin:/sbin/.magisk/busybox:/sbin/.magisk:/sbin:/data/adb/ksu/bin:/system_ext/bin:/system/bin:/system/xbin:/vendor/bin:/vendor/xbin:/data/data/com.omarea.vtools/files/toolkit:/data/user/0/com.termux/files/usr/bin"
258259
if [[ -d $(magisk --path 2>/dev/null) ]]; then
259260
PATH="$(magisk --path 2>/dev/null)/.magisk/busybox:$PATH"
@@ -374,6 +375,7 @@ case $LANG in
374375
alias ts="app_process /system/bin com.xayah.dex.CCUtil s2t $@" ;;
375376
esac
376377
alias LS="toybox ls -Zd"
378+
alias mv="$get_mv"
377379
Set_back_0() {
378380
return 0
379381
}
@@ -757,6 +759,7 @@ update_script() {
757759
echoRgb "$zipFile更新"
758760
if [[ -d $path_hierarchy/tools ]]; then
759761
mv "$path_hierarchy/tools" "$TMPDIR"
762+
[[ -d $TMPDIR/tools ]] && {
760763
unzip -o "$zipFile" tools/* -d "$path_hierarchy" | sed 's/inflating/釋放/g ; s/creating/創建/g ; s/Archive/解壓縮/g'
761764
echo_log "解壓縮${zipFile##*/}"
762765
if [[ $result = 0 ]]; then
@@ -796,6 +799,7 @@ update_script() {
796799
rm -rf "$TMPDIR"/* "$zipFile" "$MODDIR/tools.sh"
797800
echoRgb "更新完成 請重新執行腳本" "2"
798801
exit
802+
} || echoRgb "tools移動到TMPDIR失敗" "0"
799803
fi
800804
else
801805
echoRgb "${zipFile##*/}版本低於當前版本,自動刪除" "0"
@@ -907,7 +911,7 @@ if [[ $json != "" ]]; then
907911
download="$(jq -r '.assets[].browser_download_url'<<< "$json")"
908912
case $cdn in
909913
1) zip_url="http://huge.cf/download/?huge-url=$download" ;;
910-
2) zip_url="https://mirror.ghproxy.com/$download" ;;
914+
2) zip_url="https://github.moeyy.xyz/$download" ;;
911915
3) zip_url="https://gh.api.99988866.xyz/$download" ;;
912916
4) zip_url="https://github.lx164.workers.dev/$download" ;;
913917
5) zip_url="https://shrill-pond-3e81.hunsh.workers.dev/$download" ;;
@@ -1234,12 +1238,10 @@ Backup_data() {
12341238
esac
12351239
;;
12361240
*)
1237-
if [[ $ksu = "" ]]; then
1238-
case $Compression_method in
1239-
tar | Tar | TAR) tar --checkpoint-action="ttyout=%T\r" --exclude="Backup_"* --exclude="${data_path##*/}/cache" --exclude="${data_path##*/}/QQ" --exclude="${data_path##*/}/Telegram" --exclude="${data_path##*/}"/.* --warning=no-file-changed -cpf "$Backup_folder/$1.tar" -C "${data_path%/*}" "${data_path##*/}" ;;
1240-
zstd | Zstd | ZSTD) tar --checkpoint-action="ttyout=%T\r" --exclude="Backup_"* --exclude="${data_path##*/}/cache" --exclude="${data_path##*/}/QQ" --exclude="${data_path##*/}/Telegram" --exclude="${data_path##*/}"/.* --warning=no-file-changed -cpf - -C "${data_path%/*}" "${data_path##*/}" | zstd --ultra -3 -T0 -q --priority=rt >"$Backup_folder/$1.tar.zst" ;;
1241-
esac
1242-
fi
1241+
case $Compression_method in
1242+
tar | Tar | TAR) tar --checkpoint-action="ttyout=%T\r" --exclude="Backup_"* --exclude="${data_path##*/}/cache" --exclude="${data_path##*/}/QQ" --exclude="${data_path##*/}/Telegram" --exclude="${data_path##*/}"/.* --warning=no-file-changed -cpf "$Backup_folder/$1.tar" -C "${data_path%/*}" "${data_path##*/}" ;;
1243+
zstd | Zstd | ZSTD) tar --checkpoint-action="ttyout=%T\r" --exclude="Backup_"* --exclude="${data_path##*/}/cache" --exclude="${data_path##*/}/QQ" --exclude="${data_path##*/}/Telegram" --exclude="${data_path##*/}"/.* --warning=no-file-changed -cpf - -C "${data_path%/*}" "${data_path##*/}" | zstd --ultra -3 -T0 -q --priority=rt >"$Backup_folder/$1.tar.zst" ;;
1244+
esac
12431245
;;
12441246
esac
12451247
echo_log "備份$1數據"
@@ -2624,7 +2626,7 @@ Getlist)
26242626
if [[ $(cat "$nametxt" | cut -f2 -d ' ' | egrep -w "^${app_1[1]}$") != ${app_1[1]} ]]; then
26252627
[[ $REPLY2 = "" ]] && add_entry "${app_1[2]}" "${app_1[1]}" "$(cat "$nametxt" | grep -w "${app_1[2]}")" || add_entry "${app_1[2]}" "${app_1[1]}" "$REPLY2"
26262628
case ${app_1[1]} in
2627-
*oneplus*|*miui*|*xiaomi*|*oppo*|*flyme*|*meizu*|com.android.soundrecorder|com.mfashiongallery.emag|com.mi.health|*coloros*|com.android.soundrecorder|com.duokan.phone.remotecontroller|com.android.calendar|com.android.deskclock|com.android.calendar|com.android.deskclock)
2629+
*oneplus*|*miui*|*xiaomi*|*oppo*|*flyme*|*meizu*|com.android.soundrecorder|com.mfashiongallery.emag|com.mi.health|*coloros*|com.android.soundrecorder|com.duokan.phone.remotecontroller|com.android.calendar|com.android.deskclock|com.android.calendar|com.android.deskclock|com.google.android.safetycore|com.google.android.contactkeys)
26282630
if [[ $(echo "$xposed_name" | egrep -w "${app_1[1]}$") = ${app_1[1]} ]]; then
26292631
echoRgb "$app_name為Xposed模塊 進行添加" "0"
26302632
if [[ $REPLY2 = "" ]]; then

0 commit comments

Comments
 (0)