This commit is contained in:
YAWAsau
2021-11-20 13:14:24 +08:00
parent 4980dead33
commit 963abac1e5
10 changed files with 18 additions and 8 deletions

View File

@@ -18,7 +18,7 @@ if [[ -d $(magisk --path 2>/dev/null) ]]; then
else else
echo "Magisk busybox Path does not exist" echo "Magisk busybox Path does not exist"
fi ; export PATH="$PATH" 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 = "" ]] && echo "未正確指定bin.sh位置" && exit 2
#bin_path="${bin_path/'/storage/emulated/'/'/data/media/'}" #bin_path="${bin_path/'/storage/emulated/'/'/data/media/'}"
@@ -30,6 +30,7 @@ busybox2="$bin_path/busybox"
#排除自身 #排除自身
exclude=" exclude="
busybox_path busybox_path
tag
bin.sh" bin.sh"
if [[ ! -d $filepath ]]; then if [[ ! -d $filepath ]]; then
mkdir -p "$filepath" mkdir -p "$filepath"

BIN
tools/bin/curl Normal file

Binary file not shown.

2
tools/bin/down Normal file
View File

@@ -0,0 +1,2 @@
export CLASSPATH="${0%/*}/down.dex"
exec app_process /system/bin --nice-name=down Han.download.Down "$@"

BIN
tools/bin/down.dex Normal file

Binary file not shown.

BIN
tools/bin/jq Normal file

Binary file not shown.

1
tools/bin/tag Normal file
View File

@@ -0,0 +1 @@
V11.4

View File

@@ -127,7 +127,7 @@ while [[ $i -le $r ]]; do
case $(find "$TMPDIR" -maxdepth 1 -name "*.apk" -type f 2>/dev/null | wc -l) in case $(find "$TMPDIR" -maxdepth 1 -name "*.apk" -type f 2>/dev/null | wc -l) in
1) 1)
echoRgb "恢復普通apk" 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安裝" echo_log "Apk安裝"
;; ;;
0) 0)
@@ -135,9 +135,9 @@ while [[ $i -le $r ]]; do
;; ;;
*) *)
echoRgb "恢復split apk" 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 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安裝" echo_log "nmsl.apk安裝"
fi fi
find "$TMPDIR" -maxdepth 1 -name "*.apk" -type f | grep -v 'nmsl.apk' | while read; do find "$TMPDIR" -maxdepth 1 -name "*.apk" -type f | grep -v 'nmsl.apk' | while read; do

View File

@@ -43,7 +43,7 @@ if [[ $(pm path "$name") = "" ]]; then
case $(find "$TMPDIR" -maxdepth 1 -name "*.apk" -type f 2>/dev/null | wc -l) in case $(find "$TMPDIR" -maxdepth 1 -name "*.apk" -type f 2>/dev/null | wc -l) in
1) 1)
echoRgb "恢復普通apk" 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安裝" echo_log "Apk安裝"
;; ;;
0) 0)
@@ -51,7 +51,7 @@ if [[ $(pm path "$name") = "" ]]; then
;; ;;
*) *)
echoRgb "恢復split apk" 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 if [[ -f $TMPDIR/nmsl.apk ]]; then
pm install --user 0 -r "$TMPDIR/nmsl.apk" >/dev/null 2>&1 pm install --user 0 -r "$TMPDIR/nmsl.apk" >/dev/null 2>&1
echo_log "nmsl.apk安裝" echo_log "nmsl.apk安裝"

View File

@@ -5,6 +5,12 @@ bin_path="$tools_path/bin"
[[ $(echo "$MODDIR" | grep -v 'mt') = "" ]] && echo "我他媽骨灰給你揚了撒了TM不解壓縮用毛線 憨批" && exit 1 [[ $(echo "$MODDIR" | grep -v 'mt') = "" ]] && echo "我他媽骨灰給你揚了撒了TM不解壓縮用毛線 憨批" && exit 1
[[ ! -d $tools_path ]] && echo " $tools_path目錄遺失" && exit 1 [[ ! -d $tools_path ]] && echo " $tools_path目錄遺失" && exit 1
. "$bin_path/bin.sh" . "$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 if [[ $(find "$MODDIR" -maxdepth 1 -name "*.zip" -type f) = "" ]]; then
echoRgb "警告 未找到任何zip 請將下載的備份腳本.zip\n -放入當前目錄中\n -當前路徑$MODDIR" "0" echoRgb "警告 未找到任何zip 請將下載的備份腳本.zip\n -放入當前目錄中\n -當前路徑$MODDIR" "0"
else else
@@ -57,3 +63,4 @@ find "$MODDIR" -maxdepth 1 -name "*.zip" -type f | while read; do
echoRgb "${REPLY##*/}並非指定的備份zip" "0" echoRgb "${REPLY##*/}並非指定的備份zip" "0"
fi fi
done done
find "$MODDIR" -maxdepth 1 -name "*.zip" -type f -exec rm -rf {} \;

View File

@@ -10,7 +10,6 @@ bin_path="$tools_path/bin"
. "$MODDIR/backup_settings.conf" . "$MODDIR/backup_settings.conf"
system=" system="
com.google.android.apps.messaging com.google.android.apps.messaging
com.digibites.accubattery
com.google.android.inputmethod.latin com.google.android.inputmethod.latin
com.android.chrome" com.android.chrome"
# 获取默认桌面 # 获取默认桌面