-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cleaned for lineage 21.0 releases
- Loading branch information
0 parents
commit b1ee5ca
Showing
3 changed files
with
60 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,5 @@ | ||
Highlights & Device Specific Changes: | ||
Build type: Unofficial | ||
Device: Redmi Note 7 (lavender) | ||
Device maintainer: 0xsharkboy | ||
|
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,13 @@ | ||
{ | ||
"response": [ | ||
{ | ||
"datetime": "", | ||
"filename": "", | ||
"id": "", | ||
"romtype": "", | ||
"size": "", | ||
"url": "", | ||
"version": "" | ||
} | ||
] | ||
} |
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,42 @@ | ||
#!/bin/bash | ||
|
||
if [ -z "$1" ] ; then | ||
echo "Usage: $0 <ota zip>" | ||
exit 1 | ||
fi | ||
|
||
ROM="$1" | ||
|
||
METADATA=$(unzip -p "$ROM" META-INF/com/android/metadata) | ||
SDK_LEVEL=$(echo "$METADATA" | grep post-sdk-level | cut -f2 -d '=') | ||
TIMESTAMP=$(echo "$METADATA" | grep post-timestamp | cut -f2 -d '=') | ||
|
||
FILENAME=$(basename $ROM) | ||
DEVICE=$(echo $FILENAME | cut -f5 -d '-' | cut -f1 -d".") | ||
ROMTYPE=$(echo $FILENAME | cut -f4 -d '-') | ||
DATE=$(echo $FILENAME | cut -f3 -d '-') | ||
ID=$(echo ${TIMESTAMP}${DEVICE}${SDK_LEVEL} | sha256sum | cut -f 1 -d ' ') | ||
SIZE=$(du -b $ROM | cut -f1 -d ' ') | ||
TYPE=$(echo $FILENAME | cut -f4 -d '-') | ||
VERSION=$(echo $FILENAME | cut -f2 -d '-') | ||
RELASE_TAG=${DEVICE}_lineage-${VERSION}_${TIMESTAMP} | ||
|
||
URL="https://github.com/0xsharkboy/Lineage_OTA/releases/download/${RELASE_TAG}/${FILENAME}" | ||
|
||
response=$(jq -n --arg datetime $TIMESTAMP \ | ||
--arg filename $FILENAME \ | ||
--arg id $ID \ | ||
--arg romtype $ROMTYPE \ | ||
--arg size $SIZE \ | ||
--arg url $URL \ | ||
--arg version $VERSION \ | ||
'$ARGS.named' | ||
) | ||
wrapped_response=$(jq -n --argjson response "[$response]" '$ARGS.named') | ||
|
||
echo "$wrapped_response" > $DEVICE.json | ||
git add $DEVICE.json | ||
git commit -m "Update autogenerated json for $DEVICE $VERSION ${DATE}/${TIMESTAMP}" | ||
git push | ||
|
||
gh release create $RELASE_TAG $ROM --notes "Automated release for $DEVICE $VERSION ${DATE}/${TIMESTAMP}" |