|
|
|
|
@@ -65,7 +65,7 @@ else
|
|
|
|
|
echo "Magisk busybox Path does not exist"
|
|
|
|
|
fi
|
|
|
|
|
export PATH="$PATH"
|
|
|
|
|
backup_version="V15.8.0"
|
|
|
|
|
backup_version="V15.8.1"
|
|
|
|
|
#tools_path="${tools_path/'/storage/emulated/'/'/data/media/'}"
|
|
|
|
|
filepath="/data/backup_tools"
|
|
|
|
|
busybox="$filepath/busybox"
|
|
|
|
|
@@ -118,6 +118,7 @@ if [[ -f $busybox ]]; then
|
|
|
|
|
fi
|
|
|
|
|
done
|
|
|
|
|
fi
|
|
|
|
|
[[ ! -f $filepath/zstd ]] && echoRgb "$filepath缺少zstd" && exit 2
|
|
|
|
|
export PATH="$filepath:$PATH"
|
|
|
|
|
export TZ=Asia/Taipei
|
|
|
|
|
export CLASSPATH="$tools_path/classes.dex:$tools_path/Control.dex"
|
|
|
|
|
@@ -149,7 +150,6 @@ case $LANG in
|
|
|
|
|
*)
|
|
|
|
|
alias ts="app_process /system/bin --nice-name=appinfo han.core.order.ChineseConverter -t $@" ;;
|
|
|
|
|
esac
|
|
|
|
|
alias zstd="zstd --ultra -$Compression_rate -T0 -q --priority=rt"
|
|
|
|
|
alias LS="toybox ls -Zd"
|
|
|
|
|
alias lz4="zstd --ultra -$Compression_rate -T0 -q --priority=rt --format=lz4"
|
|
|
|
|
#[[ $1 = --help ]] && appinfo --help
|
|
|
|
|
@@ -683,7 +683,7 @@ partition_info() {
|
|
|
|
|
}
|
|
|
|
|
kill_app() {
|
|
|
|
|
[[ $Pause_Freeze = "" ]] && Pause_Freeze="0"
|
|
|
|
|
if [[ $name2 != $Open_apps2 ]]; then
|
|
|
|
|
if [[ $name2 != bin.mt.plus && $name2 != com.termux ]]; then
|
|
|
|
|
if [[ $Pause_Freeze = 0 ]]; then
|
|
|
|
|
if [[ $(dumpsys activity processes | grep "packageList" | cut -d '{' -f2 | cut -d '}' -f1 | egrep -w "^$name2$" | sed -n '1p') = $name2 ]]; then
|
|
|
|
|
killall -9 "$name2" &>/dev/null
|
|
|
|
|
@@ -753,8 +753,8 @@ Backup_apk() {
|
|
|
|
|
cd "$apk_path2"
|
|
|
|
|
case $Compression_method in
|
|
|
|
|
tar | TAR | Tar) tar --checkpoint-action="ttyout=%T\r" -cf "$Backup_folder/apk.tar" *.apk ;;
|
|
|
|
|
lz4 | LZ4 | Lz4) tar --checkpoint-action="ttyout=%T\r" -cf - *.apk | lz4>"$Backup_folder/apk.tar.lz4" ;;
|
|
|
|
|
zstd | Zstd | ZSTD) tar --checkpoint-action="ttyout=%T\r" -cf - *.apk | zstd>"$Backup_folder/apk.tar.zst" ;;
|
|
|
|
|
lz4 | LZ4 | Lz4) tar --checkpoint-action="ttyout=%T\r" -cf - *.apk | lz4 >"$Backup_folder/apk.tar.lz4" ;;
|
|
|
|
|
zstd | Zstd | ZSTD) tar --checkpoint-action="ttyout=%T\r" --ultra -"$Compression_rate" -T0 -q --priority=rt -cf - *.apk | zstd>"$Backup_folder/apk.tar.zst" ;;
|
|
|
|
|
esac
|
|
|
|
|
)
|
|
|
|
|
echo_log "備份$apk_number個Apk"
|
|
|
|
|
@@ -813,7 +813,7 @@ Backup_data() {
|
|
|
|
|
mediapath="$(get_variables "$1mediapath" "$app_details")"
|
|
|
|
|
fi
|
|
|
|
|
data_path="$2"
|
|
|
|
|
if [[ $1 != storage-isolation && $1 != thanox && $1 != adb ]]; then
|
|
|
|
|
if [[ $1 != storage-isolation && $1 != thanox ]]; then
|
|
|
|
|
Compression_method1="$Compression_method"
|
|
|
|
|
Compression_method=tar
|
|
|
|
|
fi
|
|
|
|
|
@@ -822,7 +822,7 @@ Backup_data() {
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
if [[ -d $data_path ]]; then
|
|
|
|
|
unset Filesize m_size k_size
|
|
|
|
|
unset Filesize m_size k_size get_size
|
|
|
|
|
Filesize="$(du -s "$data_path" | awk '{print $1}')"
|
|
|
|
|
k_size="$(awk 'BEGIN{printf "%.2f\n", "'$Filesize'"'*1024'/'1024'}')"
|
|
|
|
|
m_size="$(awk 'BEGIN{printf "%.2f\n", "'$k_size'"/'1024'}')"
|
|
|
|
|
@@ -842,15 +842,15 @@ Backup_data() {
|
|
|
|
|
user)
|
|
|
|
|
case $Compression_method in
|
|
|
|
|
tar | Tar | TAR) tar --checkpoint-action="ttyout=%T\r" --exclude="${data_path##*/}/.ota" --exclude="${data_path##*/}/cache" --exclude="${data_path##*/}/lib" --exclude="${data_path##*/}/code_cache" --exclude="${data_path##*/}/no_backup" --warning=no-file-changed -cpf "$Backup_folder/$1.tar" -C "${data_path%/*}" "${data_path##*/}" 2>/dev/null ;;
|
|
|
|
|
zstd | Zstd | ZSTD) tar --checkpoint-action="ttyout=%T\r" --exclude="${data_path##*/}/.ota" --exclude="${data_path##*/}/cache" --exclude="${data_path##*/}/lib" --exclude="${data_path##*/}/code_cache" --exclude="${data_path##*/}/no_backup" --warning=no-file-changed -cpf - -C "${data_path%/*}" "${data_path##*/}" | zstd>"$Backup_folder/$1.tar.zst" 2>/dev/null ;;
|
|
|
|
|
lz4 | Lz4 | LZ4) tar --checkpoint-action="ttyout=%T\r" --exclude="${data_path##*/}/.ota" --exclude="${data_path##*/}/cache" --exclude="${data_path##*/}/lib" --exclude="${data_path##*/}/code_cache" --exclude="${data_path##*/}/no_backup" --warning=no-file-changed -cpf - -C "${data_path%/*}" "${data_path##*/}" | lz4>"$Backup_folder/$1.tar.lz4" 2>/dev/null ;;
|
|
|
|
|
zstd | Zstd | ZSTD) tar --checkpoint-action="ttyout=%T\r" --exclude="${data_path##*/}/.ota" --exclude="${data_path##*/}/cache" --exclude="${data_path##*/}/lib" --exclude="${data_path##*/}/code_cache" --exclude="${data_path##*/}/no_backup" --warning=no-file-changed --ultra -"$Compression_rate" -T0 -q --priority=rt -cpf - -C "${data_path%/*}" "${data_path##*/}" | zstd>"$Backup_folder/$1.tar.zst" 2>/dev/null ;;
|
|
|
|
|
lz4 | Lz4 | LZ4) tar --checkpoint-action="ttyout=%T\r" --exclude="${data_path##*/}/.ota" --exclude="${data_path##*/}/cache" --exclude="${data_path##*/}/lib" --exclude="${data_path##*/}/code_cache" --exclude="${data_path##*/}/no_backup" --warning=no-file-changed -cpf - -C "${data_path%/*}" "${data_path##*/}" | lz4 >"$Backup_folder/$1.tar.lz4" 2>/dev/null ;;
|
|
|
|
|
esac
|
|
|
|
|
;;
|
|
|
|
|
*)
|
|
|
|
|
case $Compression_method in
|
|
|
|
|
tar | Tar | TAR) tar --checkpoint-action="ttyout=%T\r" --exclude="Backup_"* --exclude="${data_path##*/}/cache" --exclude="${data_path##*/}"/.* --warning=no-file-changed -cpf "$Backup_folder/$1.tar" -C "${data_path%/*}" "${data_path##*/}" ;;
|
|
|
|
|
zstd | Zstd | ZSTD) tar --checkpoint-action="ttyout=%T\r" --exclude="Backup_"* --exclude="${data_path##*/}/cache" --exclude="${data_path##*/}"/.* --warning=no-file-changed -cpf - -C "${data_path%/*}" "${data_path##*/}" | zstd>"$Backup_folder/$1.tar.zst" ;;
|
|
|
|
|
lz4 | Lz4 | LZ4) tar --checkpoint-action="ttyout=%T\r" --exclude="Backup_"* --exclude="${data_path##*/}/cache" --exclude="${data_path##*/}"/.* --warning=no-file-changed -cpf - -C "${data_path%/*}" "${data_path##*/}" | lz4>"$Backup_folder/$1.tar.lz4" 2>/dev/null ;;
|
|
|
|
|
zstd | Zstd | ZSTD) tar --checkpoint-action="ttyout=%T\r" --exclude="Backup_"* --exclude="${data_path##*/}/cache" --exclude="${data_path##*/}"/.* --warning=no-file-changed --ultra -"$Compression_rate" -T0 -q --priority=rt -cpf - -C "${data_path%/*}" "${data_path##*/}" | zstd>"$Backup_folder/$1.tar.zst" ;;
|
|
|
|
|
lz4 | Lz4 | LZ4) tar --checkpoint-action="ttyout=%T\r" --exclude="Backup_"* --exclude="${data_path##*/}/cache" --exclude="${data_path##*/}"/.* --warning=no-file-changed -cpf - -C "${data_path%/*}" "${data_path##*/}" | lz4 >"$Backup_folder/$1.tar.lz4" 2>/dev/null ;;
|
|
|
|
|
esac
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
@@ -1417,7 +1417,7 @@ backup)
|
|
|
|
|
[[ -f $app_details ]] && . "$app_details" &>/dev/null || touch "$app_details"
|
|
|
|
|
mediatxt="$Backup/mediaList.txt"
|
|
|
|
|
[[ ! -f $mediatxt ]] && echo "#不需要恢復的資料夾請在開頭注釋# 比如#媒體" > "$mediatxt"
|
|
|
|
|
echo "$Custom_path" | grep -v "#" | sed -e '/^$/d' | while read; do
|
|
|
|
|
echo "$Custom_path" | grep -v "#" | sed -e '/^$/d' | sed 's/\/$//' | while read; do
|
|
|
|
|
echoRgb "備份第$A/$B個資料夾 剩下$((B - A))個" "3"
|
|
|
|
|
starttime2="$(date -u "+%s")"
|
|
|
|
|
Backup_data "${REPLY##*/}" "$REPLY"
|
|
|
|
|
@@ -1829,10 +1829,9 @@ backup_media)
|
|
|
|
|
echo "$script">"$TMPDIR/scriptTMP"
|
|
|
|
|
Set_screen_pause_seconds on
|
|
|
|
|
{
|
|
|
|
|
echo "$Custom_path" | grep -v "#" | sed -e '/^$/d' | while read; do
|
|
|
|
|
echo "$Custom_path" | grep -v "#" | sed -e '/^$/d' | sed 's/\/$//' | while read; do
|
|
|
|
|
echoRgb "備份第$A/$B個資料夾 剩下$((B - A))個" "3"
|
|
|
|
|
starttime2="$(date -u "+%s")"
|
|
|
|
|
[[ ${REPLY: -1} = / ]] && REPLY="${REPLY%?}"
|
|
|
|
|
Backup_data "${REPLY##*/}" "$REPLY"
|
|
|
|
|
endtime 2 "${REPLY##*/}備份" "1"
|
|
|
|
|
echoRgb "完成$((A * 100 / B))% $hx$(echo "$Occupation_status" | awk 'END{print "剩餘:"$1"使用率:"$2}')" "2" && echoRgb "____________________________________" && let A++
|
|
|
|
|
@@ -1867,7 +1866,6 @@ Device_List)
|
|
|
|
|
OnePlus) Brand_URL="$URL/oneplus.html" ;;
|
|
|
|
|
Sony) Brand_URL="$URL/sony_cn.html" ;;
|
|
|
|
|
esac
|
|
|
|
|
Brand_URL="$URL/xiaomi.html"
|
|
|
|
|
down -s -L "$Brand_URL" | sed -n 's/.*<code class="language-plaintext highlighter-rouge">\([^<]*\)<\/code>: \(.*\)<\/p>.*/\1\n\2/p' | sed 's/\(.*\)/"\1"/' | sed 'N;s/\n/ /'>>"$tools_path/Device_List"
|
|
|
|
|
done
|
|
|
|
|
if [[ -e $tools_path/Device_List ]]; then
|
|
|
|
|
|