#!/bin/sh
#
# 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-$$

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 "Set APKCERTS to the path to your apkcerts.txt file"
        exit 1;
    fi
fi

if [ ! -f "$APKCERTS" ];
then
    echo "Invalid path to apkcerts.txt, set APKCERTS to the correct path."
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 "Please install pngcrush, optipng, or pngout"
    exit 1;
fi

if [ "`which aapt`" = "" ];
then
    echo "Please ensure aapt is in your \$PATH"
    exit 1;
fi

if [ "`which zipalign`" = "" ];
then
    echo "Please ensure zipalign is in your \$PATH"
    exit 1;
fi

if [ -e "$1" ];
then
    NAME=`basename $1`;
    echo "Optimizing $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 "$CERT does not exist!";
            exit 1;
        fi
    else
        APKINFO=`grep "name=\"$NAME\"" $APKCERTS`;
        [ $QUIET ] || echo "APKINFO: $APKINFO";
        if [ "$APKINFO" = "" ];
        then
            echo "No apk info for $NAME";
            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 "Unable to find certificate for $NAME"
            exit 1;
        fi
        if [ "$CERT" = "PRESIGNED" ];
        then
            echo "$NAME is presigned, skipping"
            exit 1;
        fi
    fi

    [ $QUIET ] || echo "Certificate: $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 "Crushing $x"
        optimize_png $x
    done
    cp $BASE/$1 $BASE/$1.old

    [ $QUIET ] || echo "Repacking apk.."
    aapt p -0 .dat -0 .dict -0 .arsc -F $NAME .
    
    [ $QUIET ] || echo "Resigning with cert: `echo $CERT`"

    [ $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 "Zipalign.."
    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

