diff --git a/install b/install index 6dd3fdc..199f3e8 100755 --- a/install +++ b/install @@ -118,11 +118,11 @@ fi echo "Checking adb." if ! command -v adb &> /dev/null; then - if [ $OSTYPE == "mac" ]; then + if [ "$OSTYPE" == "mac" ]; then brew cask install android-platform-tools fi - if [ $OSTYPE == "linux" ]; then + if [ "$OSTYPE" == "linux" ]; then echo "-> Please wait while we attempt to install missing 'adb' package. (requires sudo)" sudo apt install android-tools-adb 2> /dev/null fi @@ -140,11 +140,11 @@ fi echo "Checking aapt." if ! command -v aapt &> /dev/null; then - if [ $OSTYPE == "linux" ]; then + if [ "$OSTYPE" == "linux" ]; then echo "-> Please wait while we attempt to install missing 'aapt' package. (requires sudo)" sudo apt install android-sdk-build-tools fi - if [ $OSTYPE == "mac" ]; then + if [ "$OSTYPE" == "mac" ]; then echo "-> Please wait while we attempt to install missing 'aapt' package. (requires sudo)" curl -s https://raw.githubusercontent.com/whitewhidow/quest-sideloader-linux/main/mac_aapt_lib/aapt -o aapt #https://dl.androidaapt.com/aapt-macos.zip diff --git a/sideload b/sideload index 016a58f..1ab89b4 100755 --- a/sideload +++ b/sideload @@ -196,7 +196,13 @@ printf "\n" info "(Re)Installing $PACKAGENAME, (please wait)" -[ -z $CI ] && [ -z $LOCAL ] && $ADB uninstall "$PACKAGENAME" > /dev/null +dialog --title "Remove save and cache data?" --yesno "Should we also clear any possible cache and savedata for this package?" 0 0 +if [ "$?" == 0 ]; then + [ -z $CI ] && [ -z $LOCAL ] && $ADB uninstall "$PACKAGENAME" > /dev/null +else + [ -z $CI ] && [ -z $LOCAL ] && $ADB uninstall -k "$PACKAGENAME" > /dev/null +fi + [ -z $CI ] && [ -z $LOCAL ] && $ADB install -g -d "$APKNAME" > /dev/null ok "(Re)Installed $PACKAGENAME" #uninstall and install