diff --git a/tools/bin/bin.sh b/tools/bin/bin.sh index b689908..ea21c81 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.5 2021/11/15-23:30" +backup_version="V11.5" #設置二進制命令目錄位置 [[ $bin_path = "" ]] && echo "未正確指定bin.sh位置" && exit 2 #bin_path="${bin_path/'/storage/emulated/'/'/data/media/'}" @@ -30,6 +30,7 @@ busybox2="$bin_path/busybox" #排除自身 exclude=" busybox_path +tag bin.sh" if [[ ! -d $filepath ]]; then mkdir -p "$filepath" diff --git a/tools/bin/curl b/tools/bin/curl new file mode 100644 index 0000000..d2df0a0 Binary files /dev/null and b/tools/bin/curl differ diff --git a/tools/bin/down b/tools/bin/down new file mode 100644 index 0000000..935fc1e --- /dev/null +++ b/tools/bin/down @@ -0,0 +1,2 @@ +export CLASSPATH="${0%/*}/down.dex" +exec app_process /system/bin --nice-name=down Han.download.Down "$@" diff --git a/tools/bin/down.dex b/tools/bin/down.dex new file mode 100644 index 0000000..0f5c265 Binary files /dev/null and b/tools/bin/down.dex differ diff --git a/tools/bin/jq b/tools/bin/jq new file mode 100644 index 0000000..e61cfb4 Binary files /dev/null and b/tools/bin/jq differ diff --git a/tools/bin/tag b/tools/bin/tag new file mode 100644 index 0000000..7cbd2b1 --- /dev/null +++ b/tools/bin/tag @@ -0,0 +1 @@ +V11.4 diff --git a/tools/script/restore b/tools/script/restore index 79e6c8b..837c348 100644 --- a/tools/script/restore +++ b/tools/script/restore @@ -127,7 +127,7 @@ while [[ $i -le $r ]]; do case $(find "$TMPDIR" -maxdepth 1 -name "*.apk" -type f 2>/dev/null | wc -l) in 1) echoRgb "恢復普通apk" - pm install --user 0 -r "$TMPDIR"/*.apk >/dev/null 2>&1 + pm install -i com.android.vending --user 0 -r "$TMPDIR"/*.apk >/dev/null 2>&1 echo_log "Apk安裝" ;; 0) @@ -135,9 +135,9 @@ while [[ $i -le $r ]]; do ;; *) echoRgb "恢復split apk" - b="$(pm install-create --user 0 | grep -E -o '[0-9]+')" + b="$(pm install-create -i -i com.android.vending --user 0 | grep -E -o '[0-9]+')" if [[ -f $TMPDIR/nmsl.apk ]]; then - pm install --user 0 -r "$TMPDIR/nmsl.apk" >/dev/null 2>&1 + pm install -i com.android.vending --user 0 -r "$TMPDIR/nmsl.apk" >/dev/null 2>&1 echo_log "nmsl.apk安裝" fi find "$TMPDIR" -maxdepth 1 -name "*.apk" -type f | grep -v 'nmsl.apk' | while read; do diff --git a/tools/script/restore2 b/tools/script/restore2 index 368ed56..48975d8 100644 --- a/tools/script/restore2 +++ b/tools/script/restore2 @@ -43,7 +43,7 @@ if [[ $(pm path "$name") = "" ]]; then case $(find "$TMPDIR" -maxdepth 1 -name "*.apk" -type f 2>/dev/null | wc -l) in 1) echoRgb "恢復普通apk" - pm install --user 0 -r "$TMPDIR"/*.apk >/dev/null 2>&1 + pm install -i com.android.vending --user 0 -r "$TMPDIR"/*.apk >/dev/null 2>&1 echo_log "Apk安裝" ;; 0) @@ -51,7 +51,7 @@ if [[ $(pm path "$name") = "" ]]; then ;; *) echoRgb "恢復split apk" - b="$(pm install-create --user 0 | grep -Eo '[0-9]+')" + b="$(pm install-create -i com.android.vending --user 0 | grep -Eo '[0-9]+')" if [[ -f $TMPDIR/nmsl.apk ]]; then pm install --user 0 -r "$TMPDIR/nmsl.apk" >/dev/null 2>&1 echo_log "nmsl.apk安裝" diff --git a/本地一鍵更新腳本.sh b/更新腳本.sh similarity index 83% rename from 本地一鍵更新腳本.sh rename to 更新腳本.sh index 63f107d..adbd7bc 100644 --- a/本地一鍵更新腳本.sh +++ b/更新腳本.sh @@ -5,6 +5,12 @@ bin_path="$tools_path/bin" [[ $(echo "$MODDIR" | grep -v 'mt') = "" ]] && echo "我他媽骨灰給你揚了撒了TM不解壓縮?用毛線 憨批" && exit 1 [[ ! -d $tools_path ]] && echo " $tools_path目錄遺失" && exit 1 . "$bin_path/bin.sh" +find "$MODDIR" -maxdepth 1 -name "*.zip" -type f -exec rm -rf {} \; +if [[ $backup_version != $(down -s -A s "https://api.github.com/repos/YAWAsau/backup_script/releases/latest" | jq -r '.tag_name') ]]; then + down -s -A s "https://api.github.com/repos/YAWAsau/backup_script/releases/latest" | jq -r '.tag_name'>"$bin_path/tag" ; tag="$(cat "$bin_path/tag")" + down -L -o "$MODDIR/$tag.zip" "$(down -s -A s "https://api.github.com/repos/YAWAsau/backup_script/releases/latest" | sed -r -n 's/.*"browser_download_url": *"(.*.zip)".*/\1/p')" + echo_log "下載$tag.zip" +fi if [[ $(find "$MODDIR" -maxdepth 1 -name "*.zip" -type f) = "" ]]; then echoRgb "警告 未找到任何zip 請將下載的備份腳本.zip\n -放入當前目錄中\n -當前路徑$MODDIR" "0" else @@ -56,4 +62,5 @@ find "$MODDIR" -maxdepth 1 -name "*.zip" -type f | while read; do else echoRgb "${REPLY##*/}並非指定的備份zip" "0" fi -done \ No newline at end of file +done +find "$MODDIR" -maxdepth 1 -name "*.zip" -type f -exec rm -rf {} \; \ No newline at end of file diff --git a/生成應用列表.sh b/生成應用列表.sh index 5c91d06..1eca1f5 100644 --- a/生成應用列表.sh +++ b/生成應用列表.sh @@ -10,7 +10,6 @@ bin_path="$tools_path/bin" . "$MODDIR/backup_settings.conf" system=" com.google.android.apps.messaging -com.digibites.accubattery com.google.android.inputmethod.latin com.android.chrome" # 获取默认桌面