diff --git a/backup_settings.conf b/backup_settings.conf index c4d1f73..e7f1df6 100644 --- a/backup_settings.conf +++ b/backup_settings.conf @@ -16,7 +16,7 @@ Splist=0 Backup_user_data=1 #是否備份外部數據 即比如原神的數據包(1備份0不備份) -Backup_obb_data=0 +Backup_obb_data=1 #是否在應用數據備份好後備份自定義目錄 backup_media=0 diff --git a/tools/bin/appinfo.dex b/tools/bin/appinfo.dex index 702d229..8fe598c 100644 Binary files a/tools/bin/appinfo.dex and b/tools/bin/appinfo.dex differ diff --git a/tools/bin/bin.sh b/tools/bin/bin.sh index 50b30f2..5ccae4d 100644 --- a/tools/bin/bin.sh +++ b/tools/bin/bin.sh @@ -18,7 +18,7 @@ if [[ -d $(magisk --path 2>/dev/null) ]]; then else echo "Magisk busybox Path does not exist" fi ; export PATH="$PATH" -backup_version="V11.3 2021/11/6-20:00" +backup_version="V11.4 2021/11/8-22:30" #設置二進制命令目錄位置 [[ $bin_path = "" ]] && echo "未正確指定bin.sh位置" && exit 2 #bin_path="${bin_path/'/storage/emulated/'/'/data/media/'}" diff --git a/tools/script/restore b/tools/script/restore index 5772a77..a5b291c 100644 --- a/tools/script/restore +++ b/tools/script/restore @@ -57,6 +57,11 @@ Release_data() { esac echo_log "$FILE_NAME 解壓縮($FILE_NAME2)" if [[ $result = 0 ]]; then + if [[ $A != "" ]]; then + app_details="$Backup_folder2/app_details" + [[ -f $app_details ]] && echoRgb "解壓路徑:$(cat "$app_details" | awk "/${FILE_NAME2}path/"'{print $1}' | cut -f2 -d '=' | tail -n1 | sed 's/\"//g')" || echoRgb "已經成功解壓縮 但是解壓路徑獲取失敗" "0" + fi + [[ $datapath != "" ]] && echoRgb "解壓縮路徑:$datapath" if [[ $FILE_NAME2 = user ]]; then if [[ -d $X ]]; then if [[ -f /config/sdcardfs/$name2/appid ]]; then @@ -171,9 +176,10 @@ while [[ $i -le $r ]]; do B="$(find "$Backup_folder2" -maxdepth 1 -name "*.tar*" -type f | wc -l)" if [[ $branch = true ]]; then find "$Backup_folder2" -maxdepth 1 -name "*.tar*" -type f | while read; do + starttime2="$(date -u "+%s")" echoRgb "恢復第$A/$B個壓縮包 剩下$((B-A))個" Release_data "$REPLY" - echoRgb "完成$((A*100/B))%" && let A++ + endtime 2 "恢複" && echoRgb "完成$((A*100/B))%" && echoRgb "____________________________________" "3" && let A++ done endtime 1 "自定義恢復" fi diff --git a/tools/script/restore3 b/tools/script/restore3 index 7851fba..403b296 100644 --- a/tools/script/restore3 +++ b/tools/script/restore3 @@ -1,5 +1,6 @@ #!/system/bin/sh MODDIR="${0%/*}" +app_details="$MODDIR/app_details" bin_path="${MODDIR%/*}/tools/bin" [[ ! -d $bin_path ]] && echo "$bin_path目錄遺失" && exit 1 . "$bin_path/bin.sh" @@ -24,13 +25,15 @@ Release_data() { *) (echoRgb "$FILE_NAME 壓縮包不支持解壓縮" "0" ; Set_back) esac echo_log "$FILE_NAME 解壓縮($FILE_NAME2)" + [[ $result = 0 ]] && [[ -f $app_details ]] && echoRgb "解壓路徑:$(cat "$app_details" | awk "/${FILE_NAME2}path/"'{print $1}' | cut -f2 -d '=' | tail -n1 | sed 's/\"//g')" } starttime1="$(date -u "+%s")" A=1 B="$(find "$MODDIR" -maxdepth 1 -name "*.tar*" -type f | wc -l)" find "$MODDIR" -maxdepth 1 -name "*.tar*" -type f | while read; do + starttime2="$(date -u "+%s")" echoRgb "恢復第$A/$B個壓縮包 剩下$((B-A))個" Release_data "$REPLY" - echoRgb "完成$((A*100/B))%" && let A++ + endtime 2 "恢複" && echoRgb "完成$((A*100/B))%" && echoRgb "____________________________________" "3" && let A++ done endtime 1 "恢複結束" \ No newline at end of file diff --git a/備份應用.sh b/備份應用.sh index 3f0e0fe..574cec4 100644 --- a/備份應用.sh +++ b/備份應用.sh @@ -66,14 +66,12 @@ if [[ $PU != "" ]]; then data="/dev/block/vold/$PU" hx="USB" else - if [[ $USBdefault = false ]]; then - echoRgb "檢測到隨身碟 是否在隨身碟備份\n -音量上是,音量下不是" - get_version "選擇了隨身碟備份" "選擇了本地備份" - if $branch = true ]]; then - Backup="$PT/Backup_$Compression_method" - data="/dev/block/vold/$PU" - hx="USB" - fi + echoRgb "檢測到隨身碟 是否在隨身碟備份\n -音量上是,音量下不是" + get_version "選擇了隨身碟備份" "選擇了本地備份" + if $branch = true ]]; then + Backup="$PT/Backup_$Compression_method" + data="/dev/block/vold/$PU" + hx="USB" fi fi fi @@ -174,6 +172,7 @@ Backup_data() { if [[ $result = 0 ]]; then if [[ $zsize != "" ]]; then echo "#$1Size=\"$(du -ks "$data_path" | awk '{print $1}')\"" >>"$app_details" + [[ $2 != $(cat "$app_details" | awk "/$1path/"'{print $1}' | cut -f2 -d '=' | tail -n1 | sed 's/\"//g') ]] && echo "#$1path=\"$2\"" >>"$app_details" else echo "$1Size=\"$(du -ks "$data_path" | awk '{print $1}')\"" >>"$app_details" fi @@ -275,8 +274,9 @@ while [[ $i -le $r ]]; do [[ -f $app_details ]] && . "$app_details" echo "$Custom_path" | grep -v "#" | sed -e '/^$/d' | while read; do echoRgb "備份第$A/$B個資料夾 剩下$((B-A))個" + starttime2="$(date -u "+%s")" Backup_data "${REPLY##*/}" "$REPLY" - echoRgb "完成$((A*100/B))% $hx$(df -h "$data" | awk 'END{print "剩餘:"$3"使用率:"$4}')" && let A++ + endtime 2 "${REPLY##*/}備份" && echoRgb "完成$((A*100/B))% $hx$(df -h "$data" | awk 'END{print "剩餘:"$3"使用率:"$4}')" && echoRgb "____________________________________" "3" && let A++ done endtime 1 "自定義備份" else