2016-10-07 23:16:06 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
WIDTH="$1"
|
|
|
|
HEIGHT="$2"
|
|
|
|
HALF_RES="$3"
|
|
|
|
OUT="$ANDROID_PRODUCT_OUT/obj/BOOTANIMATION"
|
|
|
|
|
|
|
|
if [ "$HEIGHT" -lt "$WIDTH" ]; then
|
2017-01-17 03:52:24 +00:00
|
|
|
IMAGEWIDTH="$HEIGHT"
|
2016-10-07 23:16:06 +00:00
|
|
|
else
|
2017-01-17 03:52:24 +00:00
|
|
|
IMAGEWIDTH="$WIDTH"
|
2016-10-07 23:16:06 +00:00
|
|
|
fi
|
|
|
|
|
2017-01-17 03:52:24 +00:00
|
|
|
IMAGESCALEWIDTH="$IMAGEWIDTH"
|
|
|
|
IMAGESCALEHEIGHT=$(expr $IMAGESCALEWIDTH / 3)
|
|
|
|
|
2016-10-07 23:16:06 +00:00
|
|
|
if [ "$HALF_RES" = "true" ]; then
|
2017-01-17 03:52:24 +00:00
|
|
|
IMAGEWIDTH=$(expr $IMAGEWIDTH / 2)
|
2016-10-07 23:16:06 +00:00
|
|
|
fi
|
|
|
|
|
2017-01-17 03:52:24 +00:00
|
|
|
IMAGEHEIGHT=$(expr $IMAGEWIDTH / 3)
|
|
|
|
|
|
|
|
RESOLUTION=""$IMAGEWIDTH"x"$IMAGEHEIGHT""
|
2016-10-07 23:16:06 +00:00
|
|
|
|
2017-01-19 20:01:59 +00:00
|
|
|
for part_cnt in 0 1 2 3 4
|
2016-12-03 04:06:47 +00:00
|
|
|
do
|
|
|
|
mkdir -p $ANDROID_PRODUCT_OUT/obj/BOOTANIMATION/bootanimation/part$part_cnt
|
|
|
|
done
|
2016-10-07 23:16:06 +00:00
|
|
|
tar xfp "vendor/cm/bootanimation/bootanimation.tar" --to-command="convert - -resize '$RESOLUTION' \"png8:$OUT/bootanimation/\$TAR_FILENAME\""
|
|
|
|
|
|
|
|
# Create desc.txt
|
2017-01-17 03:52:24 +00:00
|
|
|
echo "$IMAGESCALEWIDTH $IMAGESCALEHEIGHT" 60 > "$OUT/bootanimation/desc.txt"
|
2016-10-07 23:16:06 +00:00
|
|
|
cat "vendor/cm/bootanimation/desc.txt" >> "$OUT/bootanimation/desc.txt"
|
|
|
|
|
|
|
|
# Create bootanimation.zip
|
|
|
|
cd "$OUT/bootanimation"
|
|
|
|
|
|
|
|
zip -qr0 "$OUT/bootanimation.zip" .
|