cm: cleanup
- remove SpareParts: it's disabled and broken, the options it provides are either useless/broken or available in development settings - remove modelid_cfg.sh: no devices are using this any more - remove opticharger: it's not used any more Change-Id: I68c86b2407486c4b40998288cf1f70b7cb8170f4
This commit is contained in:
parent
c43127d299
commit
e59a416504
@ -95,10 +95,7 @@ PRODUCT_COPY_FILES += \
|
||||
vendor/cm/prebuilt/common/bin/compcache:system/bin/compcache \
|
||||
vendor/cm/prebuilt/common/bin/handle_compcache:system/bin/handle_compcache
|
||||
|
||||
# Nam configuration script
|
||||
PRODUCT_COPY_FILES += \
|
||||
vendor/cm/prebuilt/common/bin/modelid_cfg.sh:system/bin/modelid_cfg.sh
|
||||
|
||||
# Terminal Emulator
|
||||
PRODUCT_COPY_FILES += \
|
||||
vendor/cm/proprietary/Term.apk:system/app/Term.apk \
|
||||
vendor/cm/proprietary/lib/armeabi/libjackpal-androidterm4.so:system/lib/libjackpal-androidterm4.so
|
||||
@ -128,7 +125,6 @@ PRODUCT_PACKAGES += \
|
||||
Camera \
|
||||
Development \
|
||||
LatinIME \
|
||||
SpareParts \
|
||||
Superuser \
|
||||
su
|
||||
|
||||
|
@ -1,59 +0,0 @@
|
||||
#!/sbin/sh
|
||||
#
|
||||
|
||||
# Remove KINETO on incorrect models.
|
||||
#
|
||||
# Valid:
|
||||
# VISION TMUS MODELID PC1010000
|
||||
# MAHIMAHI TMUS MODELID PB9910000
|
||||
# GLACIER TMUS MODELID PD1510000
|
||||
# Espresso TMUS MODELID PB6510000
|
||||
#
|
||||
|
||||
kineto=/system/app/MS-HTCEMR-KNT20-02-A0-GB-02.apk
|
||||
rm_kineto=y
|
||||
|
||||
cat /proc/cmdline|egrep -q '(PC1010000)|(PB9910000)|(PD1510000)|(PB6510000)'
|
||||
if [ $? = 0 ];
|
||||
then
|
||||
rm_kineto=n
|
||||
fi
|
||||
|
||||
if [ "$rm_kineto" = "y" ];
|
||||
then
|
||||
if [ -f $kineto ];
|
||||
then
|
||||
rm -f /system/app/MS-HTCEMR-KNT20-02-A0-GB-02.apk
|
||||
rm -f /system/lib/libkineto.so
|
||||
rm -f /system/lib/libganril.so
|
||||
rm -f /system/lib/librilswitch.so
|
||||
sed 's/librilswitch.so/libhtc_ril.so/' /system/build.prop > /tmp/build.tmp
|
||||
sed '/rilswitch/d' /tmp/build.tmp > /system/build.prop
|
||||
chmod 644 /system/build.prop
|
||||
rm /tmp/build*
|
||||
fi
|
||||
fi
|
||||
|
||||
#
|
||||
# Check for spade; if NAM model update DSP and GPS config
|
||||
#
|
||||
# NAM Models:
|
||||
# DHD AT&T MODELID PD9812000
|
||||
# DHD TELUS MODELID PD9814000
|
||||
#
|
||||
|
||||
cat /proc/cmdline | grep -q spade
|
||||
if [ $? = 0 ];
|
||||
then
|
||||
cat /proc/cmdline | egrep -q '(PD9812000)|(PD9814000)'
|
||||
if [ $? = 0 ];
|
||||
then
|
||||
mv /system/etc/nam/default* /system/etc/firmware/
|
||||
mv /system/etc/nam/CodecDSPID_MCLK.txt /system/etc
|
||||
mv /system/etc/nam/*MCLK.txt /system/etc/soundimage/
|
||||
mv /system/etc/nam/AdieHWCodec.csv /system/etc
|
||||
mv /system/etc/nam/AIC3254_REG_DualMic_MCLK.csv /system/etc
|
||||
mv /system/etc/nam/gps.conf /system/etc
|
||||
fi
|
||||
rm -R /system/etc/nam
|
||||
fi
|
@ -1,151 +0,0 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Super-mega opticharger of doom
|
||||
# Shrinks apks by running pngcrush or optipng or pngout on png images
|
||||
#
|
||||
# Point APKCERTS at the full path to a generated apkcerts.txt file, such as:
|
||||
# /home/shade/dev/sources/android-cm-eclair/out/target/product/dream_sapphire/obj/PACKAGING/target_files_intermediates/cyanogen_dream_sapphire-target_files-eng.shade/META/apkcerts.txt
|
||||
#
|
||||
# cyanogen - shade@chemlab.org
|
||||
# ChrisSoyars - me@ctso.me
|
||||
|
||||
set -e
|
||||
QUIET=1
|
||||
BASE=`pwd`
|
||||
BRUTECRUSH="-brute"
|
||||
TMPDIR=/tmp/opticharge-$$
|
||||
|
||||
. $ANDROID_BUILD_TOP/vendor/cm/tools/functions
|
||||
|
||||
if [ -z "$BRUTE_PNGCRUSH" ]
|
||||
then
|
||||
BRUTECRUSH=""
|
||||
fi
|
||||
|
||||
if [ "$APKCERTS" = "" ];
|
||||
then
|
||||
if [ "$TARGET_BUILD_VARIANT" = "userdebug" ]; then
|
||||
TARGET_BUILD_VARIANT="eng"
|
||||
elif [ "$TARGET_BUILD_VARIANT" = "user" ]; then
|
||||
TARGET_BUILD_VARIANT="eng"
|
||||
fi
|
||||
|
||||
APKCERTS=$OUT/obj/PACKAGING/target_files_intermediates/$TARGET_PRODUCT-target_files-$TARGET_BUILD_VARIANT.$USER/META/apkcerts.txt
|
||||
if [ ! -f "$APKCERTS" ];
|
||||
then
|
||||
echo -e $CL_RED"Set APKCERTS to the path to your apkcerts.txt file"$CL_RST
|
||||
exit 1;
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! -f "$APKCERTS" ];
|
||||
then
|
||||
echo -e $CL_RED"Invalid path to apkcerts.txt, set APKCERTS to the correct path."$CL_RST
|
||||
fi
|
||||
|
||||
if [ "$(which pngcrush)" != "" ];
|
||||
then
|
||||
optimize_png () {
|
||||
pngcrush -q ${BRUTECRUSH} $1 ${1}.out 1> /dev/null 2> /dev/null
|
||||
mv ${1}.out ${1} 2> /dev/null
|
||||
}
|
||||
elif [ "$(which optipng)" != "" ];
|
||||
then
|
||||
optimize_png () {
|
||||
optipng -o7 -quiet $1 1> /dev/null 2> /dev/null
|
||||
}
|
||||
elif [ "$(which pngout-static)" != "" ];
|
||||
then
|
||||
optimize_png () {
|
||||
pngout-static $1
|
||||
}
|
||||
elif [ "$(which pngout)" != "" ];
|
||||
then
|
||||
optimize_png () {
|
||||
pngout $1
|
||||
}
|
||||
else
|
||||
echo -e $CL_RED"Please install pngcrush, optipng, or pngout"$CL_RST
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
if [ "`which aapt`" = "" ];
|
||||
then
|
||||
echo -e $CL_RED"Please ensure aapt is in your \$PATH"$CL_RST
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
if [ "`which zipalign`" = "" ];
|
||||
then
|
||||
echo -e $CL_RED"Please ensure zipalign is in your \$PATH"$CL_RST
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
if [ -e "$1" ];
|
||||
then
|
||||
NAME=`basename $1`;
|
||||
echo -e $CL_YLW"Optimize:"$CL_RST" $NAME..";
|
||||
|
||||
if [ "$2" != "" ];
|
||||
then
|
||||
CERT=build/target/product/security/$2.x509.pem
|
||||
KEY=build/target/product/security/$2.pk8
|
||||
if [ ! -f "$ANDROID_BUILD_TOP/$CERT" ];
|
||||
then
|
||||
echo -e $CL_RED"$CERT does not exist!"$CL_RST;
|
||||
exit 1;
|
||||
fi
|
||||
else
|
||||
APKINFO=`grep "name=\"$NAME\"" $APKCERTS`;
|
||||
[ $QUIET ] || echo "APKINFO: $APKINFO";
|
||||
if [ "$APKINFO" = "" ];
|
||||
then
|
||||
echo -e $CL_RED"No apk info for $NAME"$CL_RST;
|
||||
exit 1;
|
||||
fi
|
||||
CERT=`echo $APKINFO | awk {'print $2'} | cut -f 2 -d "=" | tr -d "\""`;
|
||||
KEY=`echo $APKINFO | awk {'print $3'} | cut -f 2 -d "=" | tr -d "\""`;
|
||||
if [ "$CERT" = "" ];
|
||||
then
|
||||
echo -e $CL_RED"Unable to find certificate for $NAME"$CL_RST
|
||||
exit 1;
|
||||
fi
|
||||
if [ "$CERT" = "PRESIGNED" ];
|
||||
then
|
||||
echo -e $CL_YLW"$NAME is presigned, skipping"$CL_RST
|
||||
exit 1;
|
||||
fi
|
||||
fi
|
||||
|
||||
[ $QUIET ] || echo -e $CL_YLW"Certificate:"$CL_RST" $CERT";
|
||||
|
||||
[ -d $TMPDIR/$NAME ] && rm -rf $TMPDIR/$NAME
|
||||
mkdir -p $TMPDIR/$NAME
|
||||
trap "rm -rf $TMPDIR; exit" INT TERM EXIT
|
||||
cd $TMPDIR/$NAME
|
||||
unzip -q $BASE/$1
|
||||
for x in `find . -name "*.png" | grep -v "\.9.png$" | tr "\n" " "`
|
||||
do
|
||||
[ $QUIET ] || echo -e $CL_YLW"Crushing $x"$CL_RST
|
||||
optimize_png $x
|
||||
done
|
||||
cp $BASE/$1 $BASE/$1.old
|
||||
|
||||
[ $QUIET ] || echo -e $CL_YLW"Repacking apk.."$CL_RST
|
||||
aapt p -0 .dat -0 .dict -0 .arsc -F $NAME .
|
||||
|
||||
[ $QUIET ] || echo -e $CL_YLW"Resigning with cert: `echo $CERT`"$CL_RST
|
||||
|
||||
[ $QUIET ] || echo java -jar $ANDROID_HOST_OUT/framework/signapk.jar $ANDROID_BUILD_TOP/$CERT $ANDROID_BUILD_TOP/$KEY $NAME signed_$NAME
|
||||
java -jar $ANDROID_HOST_OUT/framework/signapk.jar $ANDROID_BUILD_TOP/$CERT $ANDROID_BUILD_TOP/$KEY $NAME signed_$NAME
|
||||
[ $QUIET ] || echo -e $CL_YLW"Zipaligning.."$CL_RST
|
||||
zipalign -f 4 signed_$NAME $BASE/$1
|
||||
if [ ! $QUIET ]; then
|
||||
ls -l $BASE/$1.old
|
||||
ls -l $BASE/$1
|
||||
fi
|
||||
rm $BASE/$1.old
|
||||
else
|
||||
echo "Usage: $0 [apk file]"
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user