Dan Pasanen | 24a1cc9 | 2016-12-28 22:59:21 -0600 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | WIDTH="$1" |
| 4 | HEIGHT="$2" |
| 5 | HALF_RES="$3" |
| 6 | OUT="$ANDROID_PRODUCT_OUT/obj/BOOTANIMATION" |
| 7 | |
| 8 | if [ "$HEIGHT" -lt "$WIDTH" ]; then |
Asher Simonds | e035b9a | 2017-01-16 21:52:24 -0600 | [diff] [blame] | 9 | IMAGEWIDTH="$HEIGHT" |
Dan Pasanen | 24a1cc9 | 2016-12-28 22:59:21 -0600 | [diff] [blame] | 10 | else |
Asher Simonds | e035b9a | 2017-01-16 21:52:24 -0600 | [diff] [blame] | 11 | IMAGEWIDTH="$WIDTH" |
Dan Pasanen | 24a1cc9 | 2016-12-28 22:59:21 -0600 | [diff] [blame] | 12 | fi |
| 13 | |
Harry Youd | 430f569 | 2017-04-02 20:01:18 +0100 | [diff] [blame] | 14 | RESOLUTION=""$WIDTH"x"$HEIGHT"" |
Asher Simonds | e035b9a | 2017-01-16 21:52:24 -0600 | [diff] [blame] | 15 | |
Harry Youd | 430f569 | 2017-04-02 20:01:18 +0100 | [diff] [blame] | 16 | mkdir -p $ANDROID_PRODUCT_OUT/obj/BOOTANIMATION/bootanimation/part0 |
Christopher N. Hesse | 7065880 | 2017-02-05 21:19:25 +0100 | [diff] [blame] | 17 | tar xfp "vendor/cm/bootanimation/bootanimation.tar" -C "$OUT/bootanimation/" |
Harry Youd | 430f569 | 2017-04-02 20:01:18 +0100 | [diff] [blame] | 18 | mogrify -resize $RESOLUTION -colors 250 -background white -gravity center -extent $RESOLUTION "$OUT/bootanimation/"*"/"*".png" |
Dan Pasanen | 24a1cc9 | 2016-12-28 22:59:21 -0600 | [diff] [blame] | 19 | |
| 20 | # Create desc.txt |
Harry Youd | 430f569 | 2017-04-02 20:01:18 +0100 | [diff] [blame] | 21 | echo "$WIDTH $HEIGHT" 60 > "$OUT/bootanimation/desc.txt" |
Dan Pasanen | 24a1cc9 | 2016-12-28 22:59:21 -0600 | [diff] [blame] | 22 | cat "vendor/cm/bootanimation/desc.txt" >> "$OUT/bootanimation/desc.txt" |
| 23 | |
| 24 | # Create bootanimation.zip |
| 25 | cd "$OUT/bootanimation" |
| 26 | |
| 27 | zip -qr0 "$OUT/bootanimation.zip" . |