diff --git a/backup_settings.conf b/backup_settings.conf index 572148c..826dde3 100644 --- a/backup_settings.conf +++ b/backup_settings.conf @@ -13,7 +13,7 @@ Output_path= toast_info=1 #腳本檢測更新後進行跳轉瀏覽器或是複製連結? -update=1 +update=1 #檢測到更新後的行為(1跳轉瀏覽器 0不跳轉瀏覽器,但是複製連結到剪裁版) update_behavior=1 @@ -24,6 +24,9 @@ USBdefault=0 #選擇是否只備份split apk(分割apk檔,1備份split apk 0混合備份) Splist=0 +#使用者 +user= + #是否備份使用者數據 (1備份0不備份) Backup_user_data=1 diff --git a/tools/bin/bin.sh b/tools/bin/bin.sh index 41571e4..cbe83c2 100644 --- a/tools/bin/bin.sh +++ b/tools/bin/bin.sh @@ -48,7 +48,7 @@ else echo "Magisk busybox Path does not exist" fi export PATH="$PATH" -backup_version="V15.3" +backup_version="V15.5" #設置二進制命令目錄位置 if [[ $bin_path = "" ]]; then echoRgb "未正確指定bin.sh位置" "0" @@ -234,6 +234,7 @@ update_script() { mv "$MODDIR/tools" "${MODDIR%/*}" echoRgb "更新當前${MODDIR##*/}目錄下恢復相關腳本+外部tools目錄與腳本" cp -r "$tools_path/script/Get_DirName" "${MODDIR%/*}/重新生成應用列表.sh" + cp -r "$tools_path/script/convert" "${MODDIR%/*}/轉換資料夾名稱.sh" cp -r "$tools_path/script/restore" "${MODDIR%/*}/恢復備份.sh" cp -r "$MODDIR/終止腳本.sh" "${MODDIR%/*}/終止腳本.sh" [[ -d ${MODDIR%/*}/Media ]] && cp -r "$tools_path/script/restore3" "${MODDIR%/*}/恢復自定義資料夾.sh" @@ -263,6 +264,7 @@ update_script() { else echoRgb "更新當前${MODDIR##*/}目錄下恢復相關腳本+tools目錄" cp -r "$tools_path/script/Get_DirName" "$MODDIR/重新生成應用列表.sh" + cp -r "$tools_path/script/convert" "$MODDIR/轉換資料夾名稱.sh" cp -r "$tools_path/script/restore" "$MODDIR/恢復備份.sh" [[ -d $MODDIR/Media ]] && cp -r "$tools_path/script/restore3" "$MODDIR/恢復自定義資料夾.sh" find "$MODDIR" -maxdepth 1 -type d | sort | while read; do @@ -299,6 +301,7 @@ update_script() { cp -r "$tools_path" "$backup_path" && rm -rf "$backup_path/tools/bin/zip" "$backup_path/tools/script" cp -r "$tools_path/script/restore" "$backup_path/恢復備份.sh" cp -r "$tools_path/script/Get_DirName" "$backup_path/重新生成應用列表.sh" + cp -r "$tools_path/script/convert" "$backup_path/轉換資料夾名稱.sh" cp -r "$MODDIR/終止腳本.sh" "$backup_path/終止腳本.sh" [[ -d $backup_path/Media ]] && cp -r "$tools_path/script/restore3" "$backup_path/恢復自定義資料夾.sh" find "$MODDIR" -maxdepth 2 -type d | sort | while read; do diff --git a/tools/bin/bindfs b/tools/bin/bindfs new file mode 100644 index 0000000..4c1bd10 Binary files /dev/null and b/tools/bin/bindfs differ diff --git a/tools/bin/tools.sh b/tools/bin/tools.sh index ec3c31f..4384bfa 100644 --- a/tools/bin/tools.sh +++ b/tools/bin/tools.sh @@ -46,7 +46,7 @@ if [[ $toast_info = true ]]; then pm enable "ice.message" &>/dev/null if [[ $(pm path --user "$user" ice.message 2>/dev/null) = "" ]]; then echoRgb "未安裝toast 開始安裝" "0" - cp -r "${bin_path%/*}/apk"/*.apk "$TMPDIR" && pm install --user 0 -r -t "$TMPDIR"/*.apk &>/dev/null && rm -rf "$TMPDIR"/* + cp -r "${bin_path%/*}/apk"/*.apk "$TMPDIR" && pm install --user "$user" -r -t "$TMPDIR"/*.apk &>/dev/null && rm -rf "$TMPDIR"/* [[ $? = 0 ]] && echoRgb "安裝toast成功" "1" || echoRgb "安裝toast失敗" "0" fi else @@ -158,10 +158,10 @@ fi backup_path() { if [[ $Output_path != "" ]]; then [[ ${Output_path: -1} = / ]] && Output_path="${Output_path%?}" - Backup="$Output_path/Backup_$Compression_method" + Backup="$Output_path/Backup_${Compression_method}_$user" outshow="使用自定義目錄" else - Backup="$MODDIR/Backup_$Compression_method" + Backup="$MODDIR/Backup_${Compression_method}_$user" outshow="使用當前路徑作為備份目錄" fi PU="$(ls /dev/block/vold 2>/dev/null | grep public)" @@ -176,7 +176,7 @@ backup_path() { [[ $branch = true ]] && hx="USB" fi if [[ $hx = USB ]]; then - Backup="$PT/Backup_$Compression_method" + Backup="$PT/Backup_${Compression_method}_$user" data="/dev/block/vold/$PU" mountinfo="$(df -T "${Backup%/*}" | sed -n 's|% /.*|%|p' | awk '{print $(NF-4)}')" case $mountinfo in @@ -417,7 +417,7 @@ Release_data() { if [[ $G != "" ]]; then echoRgb "路徑:$X" Path_details="$(stat -c "%A/%a %U/%G" "$X")" - chown -hR "$G:$G" "$X/" + [[ $user = 0 ]] && chown -hR "$G:$G" "$X/" || chown -hR "$user$G:$user$G" "$X/" echo_log "設置用戶組:$(echo "$Path_details" | awk '{print $2}')" restorecon -RFD "$X/" 2>/dev/null echo_log "selinux上下文設置" diff --git a/tools/bin/zstd b/tools/bin/zstd index 204adf0..f559464 100644 Binary files a/tools/bin/zstd and b/tools/bin/zstd differ diff --git a/tools/script/convert b/tools/script/convert new file mode 100644 index 0000000..9d240a4 --- /dev/null +++ b/tools/script/convert @@ -0,0 +1,7 @@ +if [ -f "${0%/*}/tools/bin/tools.sh" ]; then + MODDIR="${0%/*}" + operate="convert" + . "${0%/*}/tools/bin/tools.sh" +else + echo "${0%/*}/tools/bin/tools.sh遺失" +fi \ No newline at end of file