Skip to content

Commit 6bd3670

Browse files
committed
add a bit of manufacturing date check
- this can actually be more specific (week number) but meh - partially to prepare for touch 4 ios 7
1 parent 7969a9a commit 6bd3670

File tree

1 file changed

+48
-6
lines changed

1 file changed

+48
-6
lines changed

restore.sh

Lines changed: 48 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -265,11 +265,7 @@ select_yesno() {
265265
if [[ -n $1 ]]; then
266266
msg="$1"
267267
fi
268-
if [[ $2 == 1 ]]; then
269-
msg+=" (Y/n): "
270-
else
271-
msg+=" (y/N): "
272-
fi
268+
[[ $2 == 1 ]] && msg+=" (Y/n): " || msg+=" (y/N): "
273269

274270
if [[ $menu_old == 1 ]]; then
275271
local opt
@@ -977,7 +973,7 @@ device_get_name() {
977973
}
978974

979975
device_manufacturing() {
980-
if [[ $device_type != "iPhone2,1" && $device_type != "iPod2,1" ]] || [[ $device_argmode == "none" ]]; then
976+
if (( device_proc > 10 )) || [[ $device_proc != 1 && $device_argmode == "none" ]]; then
981977
return
982978
fi
983979
if [[ $device_type == "iPhone2,1" && $device_mode != "DFU" ]]; then
@@ -1000,6 +996,39 @@ device_manufacturing() {
1000996
device_newbr=2
1001997
print "* Cannot check $device_name bootrom model in Recovery mode. Enter DFU mode to get bootrom model"
1002998
return
999+
elif [[ $device_type != "iPhone2,1" && $device_type != "iPod2,1" ]]; then
1000+
if [[ $device_type == "DFU" ]]; then
1001+
print "* Cannot check for manufacturing date in DFU mode"
1002+
return
1003+
fi
1004+
local fourth="${device_serial:1:1}"
1005+
local year_half
1006+
case $fourth in
1007+
C ) year_half="1st half 2010";;
1008+
D ) year_half="2nd half 2010";;
1009+
F ) year_half="1st half 2011";;
1010+
G ) year_half="2nd half 2011";;
1011+
H ) year_half="1st half 2012";;
1012+
J ) year_half="2nd half 2012";;
1013+
K ) year_half="1st half 2013";;
1014+
L ) year_half="2nd half 2013";;
1015+
M ) year_half="1st half 2014";;
1016+
N ) year_half="2nd half 2014";;
1017+
P ) year_half="1st half 2015";;
1018+
Q ) year_half="2nd half 2015";;
1019+
R ) year_half="1st half 2016";;
1020+
S ) year_half="2nd half 2016";;
1021+
T ) year_half="1st half 2017";;
1022+
V ) year_half="2nd half 2017";;
1023+
W ) year_half="1st half 2018";;
1024+
X ) year_half="2nd half 2018";;
1025+
Y ) year_half="1st half 2019";;
1026+
Z ) year_half="2nd half 2019";;
1027+
esac
1028+
if [[ -n $year_half ]]; then
1029+
print "* Manufactured in $year_half"
1030+
[[ $year_half == *"2012" ]] && device_is2012=1
1031+
fi
10031032
fi
10041033
case $device_newbr in
10051034
0 ) print "* This $device_name is an old bootrom model";;
@@ -1165,6 +1194,9 @@ device_get_info() {
11651194
device_ecid=$($ideviceinfo -s -k UniqueChipID)
11661195
device_model=$($ideviceinfo -s -k HardwareModel)
11671196
fi
1197+
if [[ $device_model == "N81AP" ]]; then
1198+
device_type="iPod4,1" # this is needed since touch 4 devices on ios 7 show as iphone3,1/3,3
1199+
fi
11681200
if [[ $main_argmode != "device_enter_ramdisk"* ]]; then
11691201
device_vers=$($ideviceinfo -s -k ProductVersion)
11701202
device_det=$(echo "$device_vers" | cut -d. -f1)
@@ -7831,6 +7863,9 @@ menu_restore() {
78317863
if (( device_proc < 7 )) || [[ $platform == "linux" ]]; then
78327864
menu_items+=("Latest iOS ($device_latest_vers)")
78337865
fi
7866+
# if [[ $device_type == "iPod4,1" ]]; then
7867+
# menu_items+=("iOS 7.1.2")
7868+
# fi
78347869
if [[ $device_canpowder == 1 && $device_proc != 4 ]]; then
78357870
local text2="7.1.x"
78367871
case $device_type in
@@ -7889,6 +7924,13 @@ menu_restore() {
78897924
"DFU IPSW" ) device_dfuipsw_confirm $1;;
78907925
"More versions" ) menu_restore_more "$1";;
78917926
"IPSW Downloader" ) menu_ipsw_downloader "$1";;
7927+
"iOS 7.1.2" )
7928+
if [[ -z $device_is2012 ]]; then
7929+
select_yesno "Select Y if your device is a 2012/16GB model, select N if not" 1
7930+
device_is2012=$?
7931+
fi
7932+
menu_ipsw "$selected" "$1"
7933+
;;
78927934
* ) menu_ipsw "$selected" "$1";;
78937935
esac
78947936
done

0 commit comments

Comments
 (0)