Skip to content
This repository has been archived by the owner on Dec 12, 2023. It is now read-only.

Commit

Permalink
Update OTA json manually instead
Browse files Browse the repository at this point in the history
  • Loading branch information
ponces committed Feb 26, 2022
1 parent 942c0f0 commit 87cf9f5
Showing 1 changed file with 3 additions and 25 deletions.
28 changes: 3 additions & 25 deletions build.sh
Expand Up @@ -21,7 +21,6 @@ BUILD_DATE="$(date +%Y%m%d)"
WITHOUT_CHECK_API=true
BL=$PWD/treble_build_pe
BD=$HOME/builds
VERSION="v401"

if [ ! -d .repo ]
then
Expand Down Expand Up @@ -67,7 +66,7 @@ buildTrebleApp() {
cd ..
}

buildRegularVariant() {
buildVariant() {
lunch treble_arm64_bvS-userdebug
make installclean
make -j$(nproc --all) systemimage
Expand All @@ -79,8 +78,8 @@ buildSlimVariant() {
wget https://gist.github.com/ponces/891139a70ee4fdaf1b1c3aed3a59534e/raw/slim.patch -O /tmp/slim.patch
(cd vendor/gapps && git am /tmp/slim.patch)
make -j$(nproc --all) systemimage
mv $OUT/system.img $BD/system-treble_arm64_bvS-slim.img
(cd vendor/gapps && git reset --hard HEAD~1)
mv $OUT/system.img $BD/system-treble_arm64_bvS-slim.img
}

buildVndkliteVariant() {
Expand All @@ -98,29 +97,8 @@ generatePackages() {
rm -rf $BD/system-*.img
}

generateOtaJson() {
prefix="PixelExperience_"
suffix="-12.0-$BUILD_DATE-UNOFFICIAL.img.xz"
json="{\"version\": \"$VERSION\",\"date\": \"$(date +%s -d '-8hours')\",\"variants\": ["
find $BD -name "*.img.xz" | {
while read file; do
packageVariant=$(echo $(basename $file) | sed -e s/^$prefix// -e s/$suffix$//)
case $packageVariant in
"arm64-ab") name="treble_arm64_bvS";;
"arm64-ab-vndklite") name="treble_arm64_bvS-vndklite";;
"arm64-ab-slim") name="treble_arm64_bvS-slim";;
esac
size=$(wc -c $file | awk '{print $1}')
url="https://github.com/ponces/treble_build_pe/releases/download/$VERSION/$(basename $file)"
json="${json} {\"name\": \"$name\",\"size\": \"$size\",\"url\": \"$url\"},"
done
json="${json%?}]}"
echo "$json" | jq . > $BL/ota.json
}
}

buildTrebleApp
buildRegularVariant
buildVariant
buildSlimVariant
buildVndkliteVariant
generatePackages
Expand Down

0 comments on commit 87cf9f5

Please sign in to comment.