Files
vendor_strix/bootanimation/generate-bootanimation.sh
Harry Youd 430f569db3 YOLO
Change-Id: If1605830592dd6cfccd0a06d94736f4e5e09eb7d
2017-04-02 20:03:11 +01:00

28 lines
732 B
Bash
Executable File

#!/bin/bash
WIDTH="$1"
HEIGHT="$2"
HALF_RES="$3"
OUT="$ANDROID_PRODUCT_OUT/obj/BOOTANIMATION"
if [ "$HEIGHT" -lt "$WIDTH" ]; then
IMAGEWIDTH="$HEIGHT"
else
IMAGEWIDTH="$WIDTH"
fi
RESOLUTION=""$WIDTH"x"$HEIGHT""
mkdir -p $ANDROID_PRODUCT_OUT/obj/BOOTANIMATION/bootanimation/part0
tar xfp "vendor/cm/bootanimation/bootanimation.tar" -C "$OUT/bootanimation/"
mogrify -resize $RESOLUTION -colors 250 -background white -gravity center -extent $RESOLUTION "$OUT/bootanimation/"*"/"*".png"
# Create desc.txt
echo "$WIDTH $HEIGHT" 60 > "$OUT/bootanimation/desc.txt"
cat "vendor/cm/bootanimation/desc.txt" >> "$OUT/bootanimation/desc.txt"
# Create bootanimation.zip
cd "$OUT/bootanimation"
zip -qr0 "$OUT/bootanimation.zip" .