An update

This commit is contained in:
LukeZGD 2022-10-15 18:50:03 +08:00
parent 6da11b92e9
commit e8e4cabd7a
3 changed files with 20 additions and 21 deletions

View File

@ -288,7 +288,7 @@ EnterPwnDFU() {
elif [[ $pwnDFUDevice == 0 ]]; then
Log "Device in pwnDFU mode detected."
else
Log "Warning - Failed to detect device in pwnDFU mode."
Log "WARNING - Failed to detect device in pwnDFU mode."
Echo "* If the device entered pwnDFU mode successfully, you may continue"
Echo "* If entering pwnDFU failed, you may have to force restart your device and start over"
Input "Press Enter/Return to continue (or press Ctrl+C to cancel)"

View File

@ -116,7 +116,7 @@ DowngradeOther() {
if [[ $(cat tmp/index.html | grep -c "$BuildVer") != 1 ]]; then
curl -L https://api.m1sta.xyz/wikiproxy/$ProductType/$BuildVer -o tmp/index.html
if [[ $(cat tmp/index.html | grep -c "$BuildVer") != 1 ]]; then
Log "Warning - Failed to download firmware keys."
Log "WARNING - Failed to download firmware keys."
NoMove=1
fi
fi

View File

@ -81,24 +81,6 @@ Main() {
Error "resources folder cannot be found. Replace resources folder and try again." \
"If resources folder is present try removing spaces from path/folder name"
fi
if [[ -d .git ]]; then
if [[ $platform == "macos" ]]; then
CurrentVersion="$(date -r $(git log -1 --format="%at") +%Y-%m-%d)-$(git rev-parse HEAD | cut -c -7)"
else
CurrentVersion="$(date -d @$(git log -1 --format="%at") --rfc-3339=date)-$(git rev-parse HEAD | cut -c -7)"
fi
Echo "Version: $CurrentVersion"
elif [[ -e resources/git_hash ]]; then
CurrentVersion="$(cat resources/git_hash)"
Echo "Version: $CurrentVersion"
else
Echo "Version: Unknown"
if [[ $NoVersionCheck != 1 ]]; then
Error "git_hash or .git not found. Your copy of iOS-OTA-Downgrader is downloaded incorrectly." \
"Please download iOS-OTA-Downgrader from the GitHub releases page or using git clone."
fi
fi
SetToolPaths
if [[ $? != 0 ]]; then
@ -109,6 +91,23 @@ Main() {
Error "Platform unknown/not supported."
fi
if [[ -d .git ]]; then
if [[ $platform == "macos" ]]; then
CurrentVersion="$(date -r $(git log -1 --format="%at") +%Y-%m-%d)-$(git rev-parse HEAD | cut -c -7)"
else
CurrentVersion="$(date -d @$(git log -1 --format="%at") --rfc-3339=date)-$(git rev-parse HEAD | cut -c -7)"
fi
elif [[ -e resources/git_hash ]]; then
CurrentVersion="$(cat resources/git_hash)"
else
Echo "* Version: Unknown"
if [[ $NoVersionCheck != 1 ]]; then
Error "git_hash or .git not found. Your copy of iOS-OTA-Downgrader is downloaded incorrectly." \
"Please download iOS-OTA-Downgrader from the GitHub releases page or using git clone."
fi
fi
[[ -n $CurrentVersion ]] && Echo "* Version: $CurrentVersion"
chmod +x ./resources/*.sh ./resources/tools/*
if [[ $? != 0 ]]; then
Error "A problem with file permissions has been detected, cannot proceed."
@ -134,7 +133,7 @@ Main() {
Echo "* A newer version of iOS-OTA-Downgrader is available."
Echo "* Current version: $CurrentVersion"
Echo "* Latest version: $LatestVersion"
Echo "* Please download the latest version before continuing."
Echo "* Please download/pull the latest version before continuing."
ExitWin 0
fi
fi