blob: 04c777a9fb6450570749a1a8a296b427346f51ed [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
Asher Simondse035b9a2017-01-16 21:52:24 -06009 IMAGEWIDTH="$HEIGHT"
Dan Pasanen24a1cc92016-12-28 22:59:21 -060010else
Asher Simondse035b9a2017-01-16 21:52:24 -060011 IMAGEWIDTH="$WIDTH"
Dan Pasanen24a1cc92016-12-28 22:59:21 -060012fi
13
Harry Youd430f5692017-04-02 20:01:18 +010014RESOLUTION=""$WIDTH"x"$HEIGHT""
Asher Simondse035b9a2017-01-16 21:52:24 -060015
Harry Youd430f5692017-04-02 20:01:18 +010016mkdir -p $ANDROID_PRODUCT_OUT/obj/BOOTANIMATION/bootanimation/part0
Christopher N. Hesse70658802017-02-05 21:19:25 +010017tar xfp "vendor/cm/bootanimation/bootanimation.tar" -C "$OUT/bootanimation/"
Harry Youd430f5692017-04-02 20:01:18 +010018mogrify -resize $RESOLUTION -colors 250 -background white -gravity center -extent $RESOLUTION "$OUT/bootanimation/"*"/"*".png"
Dan Pasanen24a1cc92016-12-28 22:59:21 -060019
20# Create desc.txt
Harry Youd430f5692017-04-02 20:01:18 +010021echo "$WIDTH $HEIGHT" 60 > "$OUT/bootanimation/desc.txt"
Dan Pasanen24a1cc92016-12-28 22:59:21 -060022cat "vendor/cm/bootanimation/desc.txt" >> "$OUT/bootanimation/desc.txt"
23
24# Create bootanimation.zip
25cd "$OUT/bootanimation"
26
27zip -qr0 "$OUT/bootanimation.zip" .