2371d23f28
Change-Id: Iff2087eb97aee5e586eecf3898f0066d99bc885c
39 lines
933 B
Bash
Executable File
39 lines
933 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
|
|
|
|
IMAGESCALEWIDTH="$IMAGEWIDTH"
|
|
IMAGESCALEHEIGHT=$(expr $IMAGESCALEWIDTH / 3)
|
|
|
|
if [ "$HALF_RES" = "true" ]; then
|
|
IMAGEWIDTH=$(expr $IMAGEWIDTH / 2)
|
|
fi
|
|
|
|
IMAGEHEIGHT=$(expr $IMAGEWIDTH / 3)
|
|
|
|
RESOLUTION=""$IMAGEWIDTH"x"$IMAGEHEIGHT""
|
|
|
|
for part_cnt in 0 1 2
|
|
do
|
|
mkdir -p $ANDROID_PRODUCT_OUT/obj/BOOTANIMATION/bootanimation/part$part_cnt
|
|
done
|
|
tar xfp "vendor/cm/bootanimation/bootanimation.tar" --to-command="convert - -resize '$RESOLUTION' \"png8:$OUT/bootanimation/\$TAR_FILENAME\""
|
|
|
|
# Create desc.txt
|
|
echo "$IMAGESCALEWIDTH $IMAGESCALEHEIGHT" 30 > "$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" .
|