From 65f4b5570108b9aa829ed16b9f62172c944f3f6d Mon Sep 17 00:00:00 2001 From: powenn Date: Wed, 26 Jan 2022 20:50:10 +0800 Subject: [PATCH] Add update notification --- AltServer-aarch64/run.sh | 14 ++++++++++++++ AltServer-aarch64/version | 2 +- AltServer-armv7/run.sh | 14 ++++++++++++++ AltServer-armv7/version | 2 +- AltServer-x64/run.sh | 14 ++++++++++++++ AltServer-x64/version | 2 +- Test/run.sh | 14 ++++++++++++++ Test/update.sh | 13 ++++++------- run.sh | 14 ++++++++++++++ update.sh | 13 ++++++------- 10 files changed, 85 insertions(+), 17 deletions(-) diff --git a/AltServer-aarch64/run.sh b/AltServer-aarch64/run.sh index acf5208..5d322ad 100755 --- a/AltServer-aarch64/run.sh +++ b/AltServer-aarch64/run.sh @@ -21,6 +21,8 @@ fi HasExistAccount=$(cat saved.txt) UDID=$(lsusb -v 2> /dev/null | grep -e "Apple Inc" -A 2 | grep iSerial | awk '{print $3}') HasExistipa=$(ls ipa) +LocalVersion=$(sed -n 1p version) +LatestVersion=$(curl -Lsk 'https://github.com/powenn/AltServer-Linux-ShellScript/raw/main/version') # Instruction @@ -148,9 +150,21 @@ SaveAcccount() { esac } +# Show update avaliable message +UpdateNotification() { +if [[ $LatestVersion > $LocalVersion ]] ; then +cat << EOF + +-------<< UPDATE AVALIABLE >>------- + +EOF +fi +} + # Start script AltServerIcon cat help.txt +UpdateNotification echo "Please connect to your device and press Enter to continue" read key idevicepair pair > /dev/null diff --git a/AltServer-aarch64/version b/AltServer-aarch64/version index 26e0001..425bac3 100644 --- a/AltServer-aarch64/version +++ b/AltServer-aarch64/version @@ -1,2 +1,2 @@ -0.2.1 +0.2.2 aarch64 \ No newline at end of file diff --git a/AltServer-armv7/run.sh b/AltServer-armv7/run.sh index acf5208..5d322ad 100755 --- a/AltServer-armv7/run.sh +++ b/AltServer-armv7/run.sh @@ -21,6 +21,8 @@ fi HasExistAccount=$(cat saved.txt) UDID=$(lsusb -v 2> /dev/null | grep -e "Apple Inc" -A 2 | grep iSerial | awk '{print $3}') HasExistipa=$(ls ipa) +LocalVersion=$(sed -n 1p version) +LatestVersion=$(curl -Lsk 'https://github.com/powenn/AltServer-Linux-ShellScript/raw/main/version') # Instruction @@ -148,9 +150,21 @@ SaveAcccount() { esac } +# Show update avaliable message +UpdateNotification() { +if [[ $LatestVersion > $LocalVersion ]] ; then +cat << EOF + +-------<< UPDATE AVALIABLE >>------- + +EOF +fi +} + # Start script AltServerIcon cat help.txt +UpdateNotification echo "Please connect to your device and press Enter to continue" read key idevicepair pair > /dev/null diff --git a/AltServer-armv7/version b/AltServer-armv7/version index eb9ce9f..05e911c 100644 --- a/AltServer-armv7/version +++ b/AltServer-armv7/version @@ -1,2 +1,2 @@ -0.2.1 +0.2.2 armv7 \ No newline at end of file diff --git a/AltServer-x64/run.sh b/AltServer-x64/run.sh index 2d73bd0..be202bc 100755 --- a/AltServer-x64/run.sh +++ b/AltServer-x64/run.sh @@ -24,6 +24,8 @@ fi HasExistAccount=$(cat saved.txt) UDID=$(lsusb -v 2> /dev/null | grep -e "Apple Inc" -A 2 | grep iSerial | awk '{print $3}') HasExistipa=$(ls ipa) +LocalVersion=$(sed -n 1p version) +LatestVersion=$(curl -Lsk 'https://github.com/powenn/AltServer-Linux-ShellScript/raw/main/version') # Instruction @@ -151,9 +153,21 @@ SaveAcccount() { esac } +# Show update avaliable message +UpdateNotification() { +if [[ $LatestVersion > $LocalVersion ]] ; then +cat << EOF + +-------<< UPDATE AVALIABLE >>------- + +EOF +fi +} + # Start script AltServerIcon cat help.txt +UpdateNotification echo "Please connect to your device and press Enter to continue" read key idevicepair pair > /dev/null diff --git a/AltServer-x64/version b/AltServer-x64/version index efe1aea..1934427 100644 --- a/AltServer-x64/version +++ b/AltServer-x64/version @@ -1,2 +1,2 @@ -0.2.1 +0.2.2 x64 \ No newline at end of file diff --git a/Test/run.sh b/Test/run.sh index acf5208..5d322ad 100755 --- a/Test/run.sh +++ b/Test/run.sh @@ -21,6 +21,8 @@ fi HasExistAccount=$(cat saved.txt) UDID=$(lsusb -v 2> /dev/null | grep -e "Apple Inc" -A 2 | grep iSerial | awk '{print $3}') HasExistipa=$(ls ipa) +LocalVersion=$(sed -n 1p version) +LatestVersion=$(curl -Lsk 'https://github.com/powenn/AltServer-Linux-ShellScript/raw/main/version') # Instruction @@ -148,9 +150,21 @@ SaveAcccount() { esac } +# Show update avaliable message +UpdateNotification() { +if [[ $LatestVersion > $LocalVersion ]] ; then +cat << EOF + +-------<< UPDATE AVALIABLE >>------- + +EOF +fi +} + # Start script AltServerIcon cat help.txt +UpdateNotification echo "Please connect to your device and press Enter to continue" read key idevicepair pair > /dev/null diff --git a/Test/update.sh b/Test/update.sh index 719c88b..47514ca 100755 --- a/Test/update.sh +++ b/Test/update.sh @@ -6,7 +6,7 @@ LocalVersion=$(sed -n 1p version) LatestVersion=$(curl -Lsk 'https://github.com/powenn/AltServer-Linux-ShellScript/raw/main/version') Arch=$(sed -n 2p version) DIR=$(pwd) -if [[ $LatestVersion != $LocalVersion ]] ; then +if [[ $LatestVersion > $LocalVersion ]] ; then rm -rf AltStore.ipa wget https://github.com/powenn/AltServer-Linux-ShellScript/raw/main/AltStore.ipa wget https://github.com/powenn/AltServer-Linux-ShellScript/releases/download/$LatestVersion/AltServer-$Arch.zip @@ -14,14 +14,13 @@ if [[ $LatestVersion != $LocalVersion ]] ; then cp -R ./AltServer-$Arch/* $DIR rm -rf AltServer-$Arch.zip AltServer-$Arch echo "Done" -elif [[ $LatestVersion = $LocalVersion ]] ; then - echo "you are using the latest release" -fi - cat << EOF What updated in version $LatestVersion ? Script: - - Added update option - - daemon mode improved + - Added update notification + - Improved update option EOF +elif [[ $LatestVersion = $LocalVersion ]] ; then + echo "you are using the latest release" +fi diff --git a/run.sh b/run.sh index acf5208..5d322ad 100755 --- a/run.sh +++ b/run.sh @@ -21,6 +21,8 @@ fi HasExistAccount=$(cat saved.txt) UDID=$(lsusb -v 2> /dev/null | grep -e "Apple Inc" -A 2 | grep iSerial | awk '{print $3}') HasExistipa=$(ls ipa) +LocalVersion=$(sed -n 1p version) +LatestVersion=$(curl -Lsk 'https://github.com/powenn/AltServer-Linux-ShellScript/raw/main/version') # Instruction @@ -148,9 +150,21 @@ SaveAcccount() { esac } +# Show update avaliable message +UpdateNotification() { +if [[ $LatestVersion > $LocalVersion ]] ; then +cat << EOF + +-------<< UPDATE AVALIABLE >>------- + +EOF +fi +} + # Start script AltServerIcon cat help.txt +UpdateNotification echo "Please connect to your device and press Enter to continue" read key idevicepair pair > /dev/null diff --git a/update.sh b/update.sh index 719c88b..47514ca 100755 --- a/update.sh +++ b/update.sh @@ -6,7 +6,7 @@ LocalVersion=$(sed -n 1p version) LatestVersion=$(curl -Lsk 'https://github.com/powenn/AltServer-Linux-ShellScript/raw/main/version') Arch=$(sed -n 2p version) DIR=$(pwd) -if [[ $LatestVersion != $LocalVersion ]] ; then +if [[ $LatestVersion > $LocalVersion ]] ; then rm -rf AltStore.ipa wget https://github.com/powenn/AltServer-Linux-ShellScript/raw/main/AltStore.ipa wget https://github.com/powenn/AltServer-Linux-ShellScript/releases/download/$LatestVersion/AltServer-$Arch.zip @@ -14,14 +14,13 @@ if [[ $LatestVersion != $LocalVersion ]] ; then cp -R ./AltServer-$Arch/* $DIR rm -rf AltServer-$Arch.zip AltServer-$Arch echo "Done" -elif [[ $LatestVersion = $LocalVersion ]] ; then - echo "you are using the latest release" -fi - cat << EOF What updated in version $LatestVersion ? Script: - - Added update option - - daemon mode improved + - Added update notification + - Improved update option EOF +elif [[ $LatestVersion = $LocalVersion ]] ; then + echo "you are using the latest release" +fi