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 |
| 9 | SIZE="$HEIGHT" |
| 10 | else |
| 11 | SIZE="$WIDTH" |
| 12 | fi |
| 13 | |
| 14 | if [ "$HALF_RES" = "true" ]; then |
| 15 | IMAGESIZE=$(expr $SIZE / 2) |
| 16 | else |
| 17 | IMAGESIZE="$SIZE" |
| 18 | fi |
| 19 | |
| 20 | RESOLUTION=""$IMAGESIZE"x"$IMAGESIZE"" |
| 21 | |
| 22 | for part_cnt in 0 1 2 |
| 23 | do |
| 24 | mkdir -p $ANDROID_PRODUCT_OUT/obj/BOOTANIMATION/bootanimation/part$part_cnt |
| 25 | done |
| 26 | tar xfp "vendor/cm/bootanimation/bootanimation.tar" --to-command="convert - -resize '$RESOLUTION' \"png8:$OUT/bootanimation/\$TAR_FILENAME\"" |
| 27 | |
| 28 | # Create desc.txt |
| 29 | echo "$SIZE" "$SIZE" 30 > "$OUT/bootanimation/desc.txt" |
| 30 | cat "vendor/cm/bootanimation/desc.txt" >> "$OUT/bootanimation/desc.txt" |
| 31 | |
| 32 | # Create bootanimation.zip |
| 33 | cd "$OUT/bootanimation" |
| 34 | |
| 35 | zip -qr0 "$OUT/bootanimation.zip" . |