-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsquisher
executable file
·34 lines (28 loc) · 929 Bytes
/
squisher
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash
#
# Squish a CM otapackage for distribution
# cyanogen
. $ANDROID_BUILD_TOP/pngtools/colors
OUT_TARGET_HOST=`uname -s`
if [ x"$OUT_TARGET_HOST" = x"Linux" ]
then
OUT_TARGET_HOST=linux-x86
XARGS="xargs --max-args=1 --max-procs `grep 'processor' /proc/cpuinfo|wc -l`"
elif [ x"$OUT_TARGET_HOST" = x"Darwin" ]
then
OUT_TARGET_HOST=darwin-x86
XARGS="xargs -n 1 -P `sysctl hw.ncpu | awk '{print $2}'`"
else
echo -e ${CL_RED}"ERROR: unknown/unsupported host OS!"${CL_RST}
exit 1
fi
if [ -z "$OUT" -o ! -d "$OUT" ]; then
echo -e ${CL_RED}"ERROR: $0 only works with a full build environment. $OUT should exist."${CL_RST}
exit 1
fi
OPTICHARGER=$ANDROID_BUILD_TOP/pngtools/opticharger
QUIET=-q
DELETE_BINS="applypatch applypatch_static check_prereq recovery updater"
# Optimize PNG resources in APKs
( cd $OUT/system; find framework/ app/ priv-app/ -name \*.apk -print | $XARGS $OPTICHARGER; )
exit 0