diff --git a/gta4xl.json b/gta4xl.json new file mode 100644 index 00000000..b96e5538 --- /dev/null +++ b/gta4xl.json @@ -0,0 +1,13 @@ +{ + "response": [ + { + "datetime": "1611400176", + "filename": "lineage-18.1-20210123-UNOFFICIAL-gta4xl.zip", + "id": "84103ea3dbad0b33f4d837c23112f6e88a2ab1208a830c20410562d2dfad75d9", + "romtype": "UNOFFICIAL", + "size": "746254446", + "url": "https://github.com/Linux4/lineage_OTA/releases/download/20210123/lineage-18.1-20210123-UNOFFICIAL-gta4xl.zip", + "version": "18.1" + } + ] +} diff --git a/gta4xlwifi.json b/gta4xlwifi.json new file mode 100644 index 00000000..b1933762 --- /dev/null +++ b/gta4xlwifi.json @@ -0,0 +1,13 @@ +{ + "response": [ + { + "datetime": "1611396947", + "filename": "lineage-18.1-20210123-UNOFFICIAL-gta4xlwifi.zip", + "id": "a48e7fc9b25e6d25bac656fe5e20a721a959614d61d72667c38cbb982d393c8e", + "romtype": "UNOFFICIAL", + "size": "726039326", + "url": "https://github.com/Linux4/lineage_OTA/releases/download/20210123/lineage-18.1-20210123-UNOFFICIAL-gta4xlwifi.zip", + "version": "18.1" + } + ] +} diff --git a/otainfo.sh b/otainfo.sh new file mode 100755 index 00000000..fa956278 --- /dev/null +++ b/otainfo.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +if [ -z "$1" ]; then + echo "Usage: $0 " + exit 1 +fi + +ZIP="$1" + +METADATA=$(unzip -p "$ZIP" META-INF/com/android/metadata) + +DEVICE=$(echo "$METADATA" | grep pre-device | cut -f2 -d '=' | cut -f1 -d ',') +SDK_LEVEL=$(echo "$METADATA" | grep post-sdk-level | cut -f2 -d '=') +TIMESTAMP=$(echo "$METADATA" | grep post-timestamp | cut -f2 -d '=') + +FILENAME=$(basename $ZIP) +DATE=$(echo $FILENAME | cut -f3 -d '-') +ID=$(echo ${TIMESTAMP}${DEVICE}${SDK_LEVEL} | sha256sum | cut -f 1 -d ' ') +SIZE=$(du -b $ZIP | cut -f1 -d ' ') +TYPE=$(echo $FILENAME | cut -f4 -d '-') +VERSION=$(echo $FILENAME | cut -f2 -d '-') + +URL="https://github.com/Linux4/lineage_OTA/releases/download/${DATE}/${FILENAME}" + +echo "{" +echo " \"response\": [" +echo " {" +echo " \"datetime\": \"$TIMESTAMP\"," +echo " \"filename\": \"$FILENAME\"," +echo " \"id\": \"$ID\"," +echo " \"romtype\": \"$TYPE\"," +echo " \"size\": \"$SIZE\"," +echo " \"url\": \"$URL\"," +echo " \"version\": \"$VERSION\"" +echo " }" +echo " ]" +echo "}"