Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2ca59a79 authored by David Gasaway's avatar David Gasaway Committed by Gerrit Code Review
Browse files

omnom: eat: push md5 file for zip verification

Works on certain recoveries which perform zip file verification
(namely TWRP, not sure about CWM).

Change-Id: I63248d6f59ed853eccabf41bad831ac486cbcff1
parent 63ae5b20
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -654,6 +654,7 @@ function eat()
        MODVERSION=`sed -n -e'/ro\.cm\.version/s/.*=//p' $OUT/system/build.prop`
        ZIPFILE=cm-$MODVERSION.zip
        ZIPPATH=$OUT/$ZIPFILE
        MD5SUMFILE=$ZIPPATH.md5sum
        if [ ! -f $ZIPPATH ] ; then
            echo "Nothing to eat"
            return 1
@@ -675,10 +676,11 @@ function eat()
        if adb push $ZIPPATH /storage/sdcard0/ ; then
            # Optional path for sdcard0 in recovery
            [ -z "$1" ] && DIR=sdcard || DIR=$1
            MD5FILE=/$DIR/$ZIPFILE.md5
            cat << EOF > /tmp/command
--update_package=/$DIR/$ZIPFILE
EOF
            if adb push /tmp/command /cache/recovery/ ; then
            if adb push /tmp/command /cache/recovery/ && adb push $MD5SUMFILE $MD5FILE; then
                echo "Rebooting into recovery for installation"
                adb reboot recovery
            fi