blob: ffae32ed1b2e737d7e635d57e5330addb8eff220 [file] [log] [blame]
Joe Maples9d9dc182014-12-03 21:09:44 -05001#!/bin/bash
2#
3# Squish a Bliss otapackage for distribution
4# BlissRoms
5
6. $ANDROID_BUILD_TOP/vendor/bliss/tools/colors
7
8OUT_TARGET_HOST=`uname -s`
9if [ x"$OUT_TARGET_HOST" = x"Linux" ]
10then
11 OUT_TARGET_HOST=linux-x86
12 XARGS="xargs --max-args=1 --max-procs `grep 'processor' /proc/cpuinfo|wc -l`"
13elif [ x"$OUT_TARGET_HOST" = x"Darwin" ]
14then
15 OUT_TARGET_HOST=darwin-x86
16 XARGS="xargs -n 1 -P `sysctl hw.ncpu | awk '{print $2}'`"
17else
18 echo -e ${CL_RED}"ERROR: unknown/unsupported host OS!"${CL_RST}
19 exit 1
20fi
21
22if [ -z "$OUT" -o ! -d "$OUT" ]; then
23 echo -e ${CL_RED}"ERROR: $0 only works with a full build environment. $OUT should exist."${CL_RST}
24 exit 1
25fi
26
27CRUSHER=$ANDROID_BUILD_TOP/vendor/bliss/tools/crusher
28QUIET=-q
29DELETE_BINS="applypatch applypatch_static check_prereq recovery updater"
30
31# Optimize PNG resources in APKs
32( cd $OUT/system; find framework/ app/ priv-app/ -name \*.apk -print | $XARGS $CRUSHER; )
33
34exit 0