This repository has been archived by the owner on Feb 5, 2019. It is now read-only.
forked from tihmstar/tsschecker
-
Notifications
You must be signed in to change notification settings - Fork 10
/
saveblobs.sh
65 lines (58 loc) · 1.93 KB
/
saveblobs.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/bin/bash
cd /var/shsh
declare -a DIRS=("shsh" "shsh_ota" "shsh_beta_ota")
for dir in "${DIRS[@]}"
do
mkdir $dir 2>/dev/null
done
rm /tmp/ota.json 2>/dev/null
rm /tmp/firmware.json 2>/dev/null
rm /tmp/bbgcid.json 2>/dev/null
while read device; do
if [ -z "$device" ]; then
continue
fi
modelWithBoard=$(echo $device | cut -d ' ' -f 1)
model=$(echo $modelWithBoard | cut -d '-' -f 1)
board=$(echo $modelWithBoard | cut -d '-' -f 2)
ecid=$(echo $device | cut -d ' ' -f 2)
i=2
ap=""
sp=""
hw=""
if [ "$board" != "$model" ] && [ -n "$board" ]; then
hw="--boardconfig $board"
fi
cnt="true";
while [ "$cnt" == "true" ];
do
cnt="false"
apnonce=$(echo $device | cut -d ':' -f $i)
apn=""
sp=""
if [ "$apnonce" != "$device" ] && [ -n "$apnonce" ]; then
apn=$apnonce
sp="/$apnonce"
ap="--apnonce $apnonce"
i=$(($i+1))
mkdir "shsh$sp" 2>/dev/null
cnt="true"
fi
echo saving blobs for $modelWithBoard $ecid $apn
echo -n "saving normal blob ... "
ret=$(tsschecker -d $model -e $ecid -s --save-path "shsh$sp" -l $ap $hw);code=$?
echo "$ret" >>/tmp/tsschecker_saveblobs_fullog.log
echo -n $(echo $ret | grep -o "iOS .* for device" | rev | cut -c 12- | rev )
if [ $code -eq 0 ]; then echo " ok"; else echo " failed"; echo $ret;fi
done
echo -n "saving ota blob ... "
ret=$(tsschecker -d $model -e $ecid -s --save-path shsh_ota -l -o $hw);code=$?
echo "$ret" >>/tmp/tsschecker_saveblobs_fullog.log
echo -n $(echo $ret | grep -o "iOS .* for device" | rev | cut -c 12- | rev )
if [ $code -eq 0 ]; then echo " ok"; else echo " failed"; echo $ret;fi
echo -n "saving beta ota blob ... "
ret=$(tsschecker -d $model -e $ecid -s --save-path shsh_beta_ota -l -o --beta $hw);code=$?
echo "$ret" >>/tmp/tsschecker_saveblobs_fullog.log
echo -n $(echo $ret | grep -o "iOS .* for device" | rev | cut -c 12- | rev )
if [ $code -eq 0 ]; then echo " ok"; else echo " failed"; echo $ret;fi
done <devices.txt