Ticket #13246: android-version1.patch

File android-version1.patch, 1.4 KB (added by gigem, 19 months ago)
  • android/mythbuild.sh

    diff --git a/android/mythbuild.sh b/android/mythbuild.sh
    index c1e7374..578b056 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        # Calculate a reasonable versionCode here.
     265        VERSIONCODE=300000
     266
     267        # Setup the real Android versionName and versionCode..
     268        sed -e "s/\(android:versionName\)=\"1.0\"/\1=\"$VERSIONNAME\"/" \
     269            -e "s/\(android:versionCode\)=\"1\"/\1=\"$VERSIONCODE\"/" \
     270            ../../android-package-source/AndroidManifest.xml.in \
     271            >../../android-package-source/AndroidManifest.xml
     272
    263273        $QTBASE/bin/androiddeployqt \
    264274                --gradle \
    265275                --output $INSTALLROOT \
    function bundle_apk() { 
    271281        if [ $? -ne 0 ]; then
    272282                echo "Error androiddeployqt result is $?"
    273283        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 ***"
     284                echo "*** copy apk to $BASE/mythfrontend-$VERSIONNAME.apk ***"
    276285                for apk in $TARGETAPKPREFIX*.apk; do
    277                         cp $apk $BASE/mythfrontend-$TARGETVERSION.apk
     286                        cp $apk $BASE/mythfrontend-$VERSIONNAME.apk
    278287                done
    279288        fi
    280289}