-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcheck.sh
More file actions
executable file
·30 lines (22 loc) · 806 Bytes
/
check.sh
File metadata and controls
executable file
·30 lines (22 loc) · 806 Bytes
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
#!/bin/sh
ORI_BUILD="8901.2.A.0105.20191217"
ORI_INCREMENTAL="12171325"
ORI_DATE="2019-12-05"
URL="https://android.googleapis.com/checkin"
POST_DATA="post_data.gz"
OUT="output"
[ -f ${OUT} ] && rm ${OUT}
echo "Getting OTA URL from BUILD ${ORI_BUILD}/${ORI_INCREMENTAL} (${ORI_DATE})"
curl -H "Content-type: application/x-protobuffer" \
-H "Content-encoding: gzip" \
-H "Accept-Encoding: gzip, deflate" \
-H "User-Agent: Dalvik/2.1.0 (Linux; U; Android 9; FP3 Build/${ORI_BUILD})" \
-H "Expect:" \
-X POST \
--data-binary "@${POST_DATA}" \
--ignore-content-length \
--output "${OUT}.gz" \
-s "$URL" || exit 1
gzip -d ${OUT}.gz
strings ${OUT} | grep -A1 update_title | tail -n1
strings ${OUT} | grep -A1 "update_url" | tail -n1 | sed 's/^.\(.*\)..$/\1/g'