blob: 20f5f9cbdc0ffb18de7c03c829d967b03504681a [file] [log] [blame]
Dark Eyes93765822015-12-13 23:07:44 -05001#!/bin/bash
2#
3# Squish a CM otapackage for distribution
4# cyanogen
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 ${red}"ERROR: unknown/unsupported host OS!"${txtrst}
19 exit 1
20fi
21
22if [ -z "$OUT" -o ! -d "$OUT" ]; then
23 echo -e ${red}"ERROR: $0 only works with a full build environment. $OUT should exist."${txtrst}
24 exit 1
25fi
26
27OPTICHARGER=$ANDROID_BUILD_TOP/vendor/bliss/tools/opticharger
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/ vendor/app/ -name \*.apk -print | $XARGS $OPTICHARGER; )
33
34exit 0