Last active
September 2, 2018 18:54
-
-
Save inoahdev/0f32576cfb4dcab96f79aee62919ed06 to your computer and use it in GitHub Desktop.
iOS versions bash array with variables
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export THEOS=~/theos | |
export IPHONE6S_ECID=3B52EBBD82C | |
export IPAD4_ECID=3834C1643B2 | |
export IOS_VERSIONS_ARRAY=( | |
"6.0" "6.0.1" "6.1" "6.1.2" "6.1.3" #5 versions of iOS 6 | |
"7.0" "7.0.2" "7.0.3" "7.0.4" "7.0.6" "7.1" "7.1.1" "7.1.2" #8 versions of iOS 7 | |
"8.0" "8.0.1" "8.0.2" "8.1" "8.1.1" "8.1.2" "8.1.3" "8.2" "8.3" "8.4" "8.4.1" #11 versions of iOS 8 | |
"9.0" "9.0.1" "9.0.2" "9.1" "9.2" "9.2.1" "9.3" "9.3.1" "9.3.2" "9.3.3" "9.3.4" "9.3.5" #12 versions of iOS 9 | |
"10.0.1" "10.0.2" "10.1" "10.1.1" "10.2" "10.2.1" "10.3" "10.3.1" "10.3.2" "10.3.3" #10 versions of iOS 10 | |
"11.0" "11.0.1" "11.0.2" "11.0.3" "11.1" "11.1.1" "11.1.2" "11.2" "11.2.1" "11.2.2" "11.2.5" "11.2.6" #12 versions of iOS 11 | |
) | |
export IOS_VERSIONS_ARRAY_COUNT=${#IOS_VERSIONS_ARRAY[@]} | |
export IOS_VERSIONS_ARRAY_IOS_6_VERSION_INDEX=0 | |
export IOS_VERSIONS_ARRAY_IOS_7_VERSION_INDEX=5 | |
export IOS_VERSIONS_ARRAY_IOS_8_VERSION_INDEX=13 | |
export IOS_VERSIONS_ARRAY_IOS_9_VERSION_INDEX=24 | |
export IOS_VERSIONS_ARRAY_IOS_10_VERSION_INDEX=36 | |
export IOS_VERSIONS_ARRAY_IOS_11_VERSION_INDEX=46 | |
export IOS_VERSIONS_ARRAY_IOS_6_VERSION_END_INDEX=4 | |
export IOS_VERSIONS_ARRAY_IOS_7_VERSION_END_INDEX=12 | |
export IOS_VERSIONS_ARRAY_IOS_8_VERSION_END_INDEX=23 | |
export IOS_VERSIONS_ARRAY_IOS_9_VERSION_END_INDEX=35 | |
export IOS_VERSIONS_ARRAY_IOS_10_VERSION_END_INDEX=45 | |
export IOS_VERSIONS_ARRAY_IOS_11_VERSION_END_INDEX=`expr $IOS_VERSIONS_ARRAY_COUNT - 1` | |
function save_6s_shsh { | |
if [ $# -gt 2 ]; then | |
printf 'Usage: save_6s_shsh ios_version {show_output}\n' | |
return 1 | |
fi | |
show_output=false | |
if [ $# -eq 2 ]; then | |
if [[ $2 = "true" ]]; then | |
show_output=true | |
else | |
if [[ $2 = "false" ]]; then | |
show_output=false | |
else | |
printf 'Unrecognized argument: %s\n' $2 | |
return 1 | |
fi | |
fi | |
fi | |
/Users/administrator/Documents/Important\ Files/tsschecker.sh iPhone8,1 N71AP $1 $IPHONE6S_ECID /Users/administrator/Documents/SHSH/iPhone6S true $show_output | |
return $? | |
} | |
function save_all_6s_shsh { | |
if [ $# -gt 2 ]; then | |
printf 'Usage: save_all_6s_shsh\n' | |
return 1 | |
fi | |
show_output=false | |
if [ $# -eq 1 ]; then | |
if [[ $1 = "true" ]]; then | |
show_output=true | |
else | |
if [[ $1 = "false" ]]; then | |
show_output=false | |
else | |
printf 'Unrecognized argument: %s\n' $1 | |
return 1 | |
fi | |
fi | |
fi | |
for ((i=$IOS_VERSIONS_ARRAY_IOS_9_VERSION_INDEX; i<=$IOS_VERSIONS_ARRAY_IOS_11_VERSION_END_INDEX; i++)); do | |
if [ $show_output = true ]; then | |
echo ${IOS_VERSIONS_ARRAY[$i]} | |
fi | |
/Users/administrator/Documents/Important\ Files/tsschecker.sh iPhone8,1 N71AP ${IOS_VERSIONS_ARRAY[$i]} $IPHONE6S_ECID /Users/administrator/Documents/SHSH/iPhone6S false false | |
done | |
} | |
function save_all_6s_shsh_from_latest { | |
if [ $# -gt 1]; then | |
printf 'Usage: save_all_6s_shsh_from_latest\n' | |
return 1 | |
fi | |
show_output=false | |
if [ $# -eq 1 ]; then | |
if [[ $1 = "true" ]]; then | |
show_output=true | |
else | |
if [[ $1 = "false" ]]; then | |
show_output=false | |
else | |
printf 'Unrecognized argument: %s\n' $1 | |
return 1 | |
fi | |
fi | |
fi | |
for ((i=$IOS_VERSIONS_ARRAY_IOS_11_VERSION_END_INDEX; i>=$IOS_VERSIONS_ARRAY_IOS_9_VERSION_INDEX; i--)); do | |
if [ $show_output = true ]; then | |
echo ${IOS_VERSIONS_ARRAY[$i]} | |
fi | |
/Users/administrator/Documents/Important\ Files/tsschecker.sh iPhone8,1 N71AP ${IOS_VERSIONS_ARRAY[$i]} $IPHONE6S_ECID /Users/administrator/Documents/SHSH/iPhone6S false false | |
done | |
} | |
function save_ipad_4_shsh { | |
if [ $# -gt 2 ]; then | |
printf 'Usage: save_ipad_4_shsh ios_version {show_output}\n' | |
return 1 | |
fi | |
show_output=false | |
if [ $# -eq 2 ]; then | |
if [[ $2 = "true" ]]; then | |
show_output=true | |
else | |
if [[ $2 = "false" ]]; then | |
show_output=false | |
else | |
printf 'Unrecognized argument: %s\n' $2 | |
return 1 | |
fi | |
fi | |
fi | |
/Users/administrator/Documents/Important\ Files/tsschecker.sh iPad3,4 P101AP $1 $IPAD4_ECID /Users/administrator/Documents/SHSH/iPad4 true $show_output | |
return $? | |
} | |
function save_all_ipad_4_shsh { | |
if [ $# -gt 1 ]; then | |
printf 'Usage: save_all_ipad_4_shsh { print-versions-bool }\n' | |
return 1 | |
fi | |
show_output=false | |
if [ $# -eq 1 ]; then | |
if [[ $1 = "true" ]]; then | |
show_output=true | |
else | |
if [[ $1 = "false" ]]; then | |
show_output=false | |
else | |
printf 'Unrecognized argument: %s\n' $1 | |
return 1 | |
fi | |
fi | |
fi | |
for ((i=$IOS_VERSIONS_ARRAY_IOS_6_VERSION_INDEX; i<=$IOS_VERSIONS_ARRAY_IOS_10_VERSION_END_INDEX; i++)); do | |
if [[ $show_output = true ]]; then | |
echo ${IOS_VERSIONS_ARRAY[$i]} | |
fi | |
/Users/administrator/Documents/Important\ Files/tsschecker.sh iPad3,4 P101AP ${IOS_VERSIONS_ARRAY[$i]} $IPAD4_ECID /Users/administrator/Documents/SHSH/iPad4 false false | |
done | |
} | |
function save_all_ipad_4_shsh_from_latest { | |
if [ $# -ne 0 ]; then | |
printf 'Usage: save_all_ipad_4_shsh_from_latest\n' | |
return 1 | |
fi | |
show_output=false | |
if [ $# -eq 1 ]; then | |
if [[ $1 = "true" ]]; then | |
show_output=true | |
else | |
if [[ $1 = "false" ]]; then | |
show_output=false | |
else | |
printf 'Unrecognized argument: %s\n' $1 | |
return 1 | |
fi | |
fi | |
fi | |
for ((i=$IOS_VERSIONS_ARRAY_IOS_10_VERSION_END_INDEX; i>=$IOS_VERSIONS_ARRAY_IOS_6_VERSION_INDEX; i--)); do | |
if [[ $show_output = true ]]; then | |
echo ${IOS_VERSIONS_ARRAY[$i]} | |
fi | |
/Users/administrator/Documents/Important\ Files/tsschecker.sh iPad3,4 P101AP ${IOS_VERSIONS_ARRAY[$i]} $IPAD4_ECID /Users/administrator/Documents/SHSH/iPad4 false false | |
done | |
} | |
export -f save_6s_shsh | |
export -f save_all_6s_shsh | |
export -f save_all_6s_shsh_from_latest | |
export -f save_ipad_4_shsh | |
export -f save_all_ipad_4_shsh | |
export -f save_all_ipad_4_shsh_from_latest |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment