Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #5 from lissyx/bug1176285
Browse files Browse the repository at this point in the history
Bug 1176285 - Add download script for Sony blobs r=mwu
  • Loading branch information
lissyx committed Jul 21, 2015
2 parents 8b5ffa9 + 8200b38 commit 8ea2648
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
1 change: 1 addition & 0 deletions blobs-sha1.txt
@@ -0,0 +1 @@
5da8f9e92204b2e1b4a07a12e3b5675508742363 SW_binaries_for_Xperia_AOSP_L_MR1_v9.zip
36 changes: 36 additions & 0 deletions download-sony-blobs.sh
@@ -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}
6 changes: 6 additions & 0 deletions extract-files.sh
Expand Up @@ -24,6 +24,12 @@ if [ -z "${MANUFACTURER}" ]; then
exit 1
fi;

if [ ! -f "vendor/${MANUFACTURER}/${DEVICE}/${DEVICE}-partial.mk" ]; then
pushd ../../../
device/${MANUFACTURER}/shinano/download-sony-blobs.sh || exit 1
popd
fi;

if [[ -z "${ANDROIDFS_DIR}" ]]; then
ANDROIDFS_DIR=../../../backup-${DEVICE}
fi
Expand Down

0 comments on commit 8ea2648

Please sign in to comment.