blob: b5d8f198f9a5a77b4b5d6562f82375a60a730865 [file] [log] [blame]
Dan Pasanen24a1cc92016-12-28 22:59:21 -06001#!/bin/bash
2
3WIDTH="$1"
4HEIGHT="$2"
5HALF_RES="$3"
6OUT="$ANDROID_PRODUCT_OUT/obj/BOOTANIMATION"
7
8if [ "$HEIGHT" -lt "$WIDTH" ]; then
9 SIZE="$HEIGHT"
10else
11 SIZE="$WIDTH"
12fi
13
14if [ "$HALF_RES" = "true" ]; then
15 IMAGESIZE=$(expr $SIZE / 2)
16else
17 IMAGESIZE="$SIZE"
18fi
19
20RESOLUTION=""$IMAGESIZE"x"$IMAGESIZE""
21
22for part_cnt in 0 1 2
23do
24 mkdir -p $ANDROID_PRODUCT_OUT/obj/BOOTANIMATION/bootanimation/part$part_cnt
25done
26tar xfp "vendor/cm/bootanimation/bootanimation.tar" --to-command="convert - -resize '$RESOLUTION' \"png8:$OUT/bootanimation/\$TAR_FILENAME\""
27
28# Create desc.txt
29echo "$SIZE" "$SIZE" 30 > "$OUT/bootanimation/desc.txt"
30cat "vendor/cm/bootanimation/desc.txt" >> "$OUT/bootanimation/desc.txt"
31
32# Create bootanimation.zip
33cd "$OUT/bootanimation"
34
35zip -qr0 "$OUT/bootanimation.zip" .