@@ -75,27 +75,26 @@ function restore_func() {
7575 # Apps containing their own directories may contain split APKs, which need to be installed using adb install-multiple.
7676 # Those without directories were created by past versions of this script and need to be imported the traditional way.
7777
78+ # Determine OS and set a command to install apks
79+ if [[ " $( uname -r | sed -n ' s/.*\( *Microsoft *\).*/\1/ip' ) " ]]; then
80+ cecho " Windows/WSL detected"
81+ install_cmd=" timeout 900 ./windows-dependencies/adb/adb.exe install-multiple"
82+ elif [[ " $( uname) " == " Darwin" ]]; then
83+ cecho " macOS detected"
84+ install_cmd=" gtimeout 900 adb install-multiple"
85+ else
86+ cecho " Linux detected"
87+ install_cmd=" timeout 900 adb install-multiple"
88+ fi
7889 # Handle split APKs
7990 # Find directories in the Apps directory
8091 apk_dirs=$( find ./backup-tmp/Apps -mindepth 1 -maxdepth 1 -type d)
8192 for apk_dir in $apk_dirs ; do
8293 # Install all APKs in the directory
8394 # the APK files are sorted to ensure that base.apk is installed before split APKs
8495 apk_files=$( find " $apk_dir " -type f -name " *.apk" | sort | tr ' \n' ' ' )
85- if [[ " $( uname -r | sed -n ' s/.*\( *Microsoft *\).*/\1/ip' ) " ]]; then
86- cecho " Windows/WSL detected"
87- # shellcheck disable=SC2086
88- timeout 900 ./windows-dependencies/adb/adb.exe install-multiple $apk_files
89- else
90- cecho " macOS/Linux detected"
91- if [[ " $( uname) " == " Darwin" ]]; then
92- timeout_cmd=" gtimeout"
93- else
94- timeout_cmd=" timeout"
95- fi
96- # shellcheck disable=SC2086
97- $timeout_cmd 900 adb install-multiple $apk_files
98- fi
96+ # shellcheck disable=SC2086
97+ $install_cmd $apk_files
9998 done
10099
101100 # Now all that's left is ensuring backwards compatibility with old backups
0 commit comments