Ticket #13246: android-version2b.patch

File android-version2b.patch, 1.7 KB (added by gigem, 18 months ago)
  • android/mythbuild.sh

    diff --git a/android/mythbuild.sh b/android/mythbuild.sh
    index c1e7374..1f7c6e1 100755
    a b function bundle_apk() { 
    260260        for i in $MYTHINSTALLROOT/lib/libmythfilter*.so ; do
    261261                cp "$i" "$MYTHINSTALLROOT/libs/$ANDROID_TARGET_ARCH/"
    262262        done
     263        VERSIONNAME=$(date +"%F" | tr -d '-')-$BUNDLE_NAME-$(grep "define MYTH_SOURCE_VERSION" libs/libmythbase/version.h | cut -d' ' -f 3 | tr -d '"')
     264        VERSIONCODE=$(grep "define MYTH_ANDROID_VERSION_CODE" libs/libmythbase/mythversion.h | cut -d' ' -f 3)
     265
     266        # Setup the real Android versionName and versionCode..
     267        sed -e "s/\(android:versionName\)=\"1.0\"/\1=\"$VERSIONNAME\"/" \
     268            -e "s/\(android:versionCode\)=\"1\"/\1=\"$VERSIONCODE\"/" \
     269            ../../AndroidManifest.xml.in \
     270            >../../android-package-source/AndroidManifest.xml
     271
    263272        $QTBASE/bin/androiddeployqt \
    264273                --gradle \
    265274                --output $INSTALLROOT \
    function bundle_apk() { 
    271280        if [ $? -ne 0 ]; then
    272281                echo "Error androiddeployqt result is $?"
    273282        else
    274                 TARGETVERSION=`date +"%F" | tr -d '-'`-$BUNDLE_NAME-`grep "define MYTH_SOURCE_VERSION" libs/libmythbase/version.h | cut -d' ' -f 3 | tr -d '"'`
    275                 echo "*** copy apk to $BASE/mythfrontend-$TARGETVERSION.apk ***"
     283                echo "*** copy apk to $BASE/mythfrontend-$VERSIONNAME.apk ***"
    276284                for apk in $TARGETAPKPREFIX*.apk; do
    277                         cp $apk $BASE/mythfrontend-$TARGETVERSION.apk
     285                        cp $apk $BASE/mythfrontend-$VERSIONNAME.apk
    278286                done
    279287        fi
    280288}
    else 
    299307                touch $MYMYTHBUILDBASEPATH/mythtv/stamp_shadow_android
    300308        fi
    301309        pushd $MYMYTHBUILDPATH
    302         rm EXPORTED_VERSION
     310        rm EXPORTED_VERSION VERSION
    303311        echo "Format" > EXPORTED_VERSION
    304312        echo "SOURCE_VERSION=\"$SOURCE_VERSION\"" > VERSION
    305313        echo "BRANCH=\"$BRANCH\"" >> VERSION