This repository has been archived by the owner on Nov 3, 2021. It is now read-only.
forked from sonyxperiadev/device-sony-shinano
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from lissyx/bug1176285
Bug 1176285 - Add download script for Sony blobs r=mwu
- Loading branch information
Showing
3 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
5da8f9e92204b2e1b4a07a12e3b5675508742363 SW_binaries_for_Xperia_AOSP_L_MR1_v9.zip |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/sh | ||
|
||
ZIP_FILE="SW_binaries_for_Xperia_AOSP_L_MR1_v9.zip" | ||
URL_BASE="http://dl-developer.sonymobile.com/eula" | ||
EULA_URL="${URL_BASE}/SW_binaries_for_Xperia_AOSP_Lollipop_MR1_v9_EULA.html" | ||
|
||
NOW=$(($(date +"%s") * 1000)) | ||
TOMORROW=$((${NOW} + 1000 * 60 * 60 * 24 * 1)) | ||
|
||
DIR=download-shinano | ||
|
||
if [ ! -x "$(which w3m)" ]; then | ||
echo "No W3M. Please either install W3M or download Sony blobs from ${EULA_URL}" | ||
echo "and place the ${ZIP_FILE} file at ${PWD}/${DIR}/" | ||
exit 1 | ||
fi; | ||
|
||
mkdir -p ${DIR} && (cd ${DIR} && sha1sum --status -c ../device/sony/shinano/blobs-sha1.txt) || | ||
( | ||
SDK_URL="${URL_BASE}/$(curl -s ${EULA_URL} | grep 'var sdk' | cut -d"'" -f2)${TOMORROW}" | ||
|
||
REPLY="" | ||
|
||
w3m -o display_charset=UTF-8 ${EULA_URL} | head -n-15; echo "TO DOWNLOAD SONY BLOBS, PLEASE TYPE: I ACCEPT THE LICENSE" && read REPLY | ||
|
||
if [ "${REPLY}" != "I ACCEPT THE LICENSE" ]; then | ||
echo "LICENSE NOT ACCEPTED, NOT DOWNLOADING BLOBS." | ||
exit 1 | ||
fi; | ||
|
||
echo "Downloading to ${ZIP_FILE} ..." | ||
|
||
curl -s --cookie "dw_accepted=true" ${SDK_URL} -o ${DIR}/${ZIP_FILE} | ||
) | ||
|
||
unzip -u ${DIR}/${ZIP_FILE} |
This file contains 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