From 429d1c1972a44d272aab732cc83acd2fc3fbf509 Mon Sep 17 00:00:00 2001 From: Eric House Date: Tue, 7 Apr 2015 20:20:40 -0700 Subject: [PATCH 1/5] fix crash sorting tiles when there are fewer to sort than there is space to the left of the divider, i.e. when the game's nearly over. --- xwords4/common/model.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/xwords4/common/model.c b/xwords4/common/model.c index a9fa450a2..7a9cb8059 100644 --- a/xwords4/common/model.c +++ b/xwords4/common/model.c @@ -1864,19 +1864,18 @@ model_assignPlayerTiles( ModelCtxt* model, XP_S16 turn, void model_sortTiles( ModelCtxt* model, XP_S16 turn ) { - XP_S16 nTiles; - - TrayTileSet sorted; - const TrayTileSet* curTiles = model_getPlayerTiles( model, turn ); XP_U16 dividerLoc = model_getDividerLoc( model, turn ); - sortTiles( &sorted, curTiles, dividerLoc ); + const TrayTileSet* curTiles = model_getPlayerTiles( model, turn ); + if ( curTiles->nTiles >= dividerLoc) { /* any to sort? */ + TrayTileSet sorted; + sortTiles( &sorted, curTiles, dividerLoc ); - nTiles = sorted.nTiles; - while ( nTiles > 0 ) { - removePlayerTile( model, turn, --nTiles ); + for ( XP_S16 nTiles = sorted.nTiles; nTiles > 0; ) { + removePlayerTile( model, turn, --nTiles ); + } + + assignPlayerTiles( model, turn, &sorted ); } - - assignPlayerTiles( model, turn, &sorted ); } /* model_sortTiles */ XP_U16 From 07615ff9d7c65fdf1e0b58f6b449b677d411a5d6 Mon Sep 17 00:00:00 2001 From: Eric House Date: Tue, 7 Apr 2015 07:31:41 -0700 Subject: [PATCH 2/5] Remove name property to silence warning. This didn't work with earlier version of ant but I'll hope it's ok for everybody now. --- xwords4/android/scripts/common_targets.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xwords4/android/scripts/common_targets.xml b/xwords4/android/scripts/common_targets.xml index 14be18b4d..e6a2b5ee9 100644 --- a/xwords4/android/scripts/common_targets.xml +++ b/xwords4/android/scripts/common_targets.xml @@ -1,6 +1,6 @@ - + Date: Tue, 7 Apr 2015 07:20:48 -0700 Subject: [PATCH 3/5] remove warning about not using checked-in debug keystore from release builds that won't use it regardless --- xwords4/android/scripts/common_targets.xml | 9 +++++--- xwords4/android/scripts/key-setup.sh | 27 ++++++++++++---------- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/xwords4/android/scripts/common_targets.xml b/xwords4/android/scripts/common_targets.xml index e6a2b5ee9..d72bb01f2 100644 --- a/xwords4/android/scripts/common_targets.xml +++ b/xwords4/android/scripts/common_targets.xml @@ -16,9 +16,12 @@ - + + + + + diff --git a/xwords4/android/scripts/key-setup.sh b/xwords4/android/scripts/key-setup.sh index 25d323b01..9fc3affde 100755 --- a/xwords4/android/scripts/key-setup.sh +++ b/xwords4/android/scripts/key-setup.sh @@ -2,16 +2,17 @@ set -e -u -HOMELOC=~/.android/debug.keystore -HERELOC=$(pwd)/$(dirname $0)/debug.keystore -# SCRIPTS= +if [ $1 = 'debug' ]; then -if [ -L $HOMELOC ]; then - if cmp $(readlink $HOMELOC) $HERELOC; then - exit 0 - fi -elif [ -e $HOMELOC ]; then - cat << EOF + HOMELOC=~/.android/debug.keystore + HERELOC=$(pwd)/$(dirname $0)/debug.keystore + + if [ -L $HOMELOC ]; then + if cmp $(readlink $HOMELOC) $HERELOC; then + exit 0 + fi + elif [ -e $HOMELOC ]; then + cat << EOF * You are using a different keystore from what's part of this project. * You won't be able to install this over something built from a * different machine. If that's not ok, remove it (i.e. run this on a @@ -19,7 +20,9 @@ elif [ -e $HOMELOC ]; then rm $HOMELOC * and rerun ant to use the built-in keystore. EOF -else - echo "$0: creating link at $HOMELOC" - ln -sf $HERELOC $HOMELOC + else + echo "$0: creating link at $HOMELOC" + ln -sf $HERELOC $HOMELOC + fi + fi From 6721f52ae9467f73f7cb365e03e779fbfa4c6494 Mon Sep 17 00:00:00 2001 From: Eric House Date: Tue, 7 Apr 2015 07:07:24 -0700 Subject: [PATCH 4/5] fix to use ANDROID_NDK instead of NDK_ROOT, following fdroid's convention, but also not to require either if ndk-build is on PATH. --- xwords4/android/scripts/ndkbuild.sh | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/xwords4/android/scripts/ndkbuild.sh b/xwords4/android/scripts/ndkbuild.sh index b4ef80783..62156fc75 100755 --- a/xwords4/android/scripts/ndkbuild.sh +++ b/xwords4/android/scripts/ndkbuild.sh @@ -2,17 +2,23 @@ set -e -u +ANDROID_NDK=${ANDROID_NDK:-''} + if [ ! -e build.xml ]; then echo "no build.xml; please run from root of source tree" exit 1 fi -if [ -z "$NDK_ROOT" ]; then - echo -n "NDK_ROOT not set... " - echo "NDK not found; install and set NDK_ROOT to point to it" - exit 1 +if [ -z "$ANDROID_NDK" ]; then + if which ndk-build >/dev/null; then + ANDROID_NDK=$(dirname $(which ndk-build)) + else + echo -n "ANDROID_NDK not set... " + echo "NDK not found; install and set ANDROID_NDK to point to it" + exit 1 + fi fi -${NDK_ROOT}/ndk-build $* +${ANDROID_NDK}/ndk-build $* echo "$0 done" From fe9b70b7e11ca5003d9918ce9acbfc30bc0f66f7 Mon Sep 17 00:00:00 2001 From: Eric House Date: Tue, 7 Apr 2015 20:45:45 -0700 Subject: [PATCH 5/5] up strings for release --- xwords4/android/XWords4/AndroidManifest.xml | 2 +- xwords4/android/XWords4/assets/changes.html | 21 ++++++++++++------- .../android/XWords4/res/values/app_name.xml | 2 +- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/xwords4/android/XWords4/AndroidManifest.xml b/xwords4/android/XWords4/AndroidManifest.xml index 488674b55..85f64d80c 100644 --- a/xwords4/android/XWords4/AndroidManifest.xml +++ b/xwords4/android/XWords4/AndroidManifest.xml @@ -22,7 +22,7 @@ to come from a domain that you own or have control over. --> diff --git a/xwords4/android/XWords4/assets/changes.html b/xwords4/android/XWords4/assets/changes.html index 1fff1f222..aa1cb2aca 100644 --- a/xwords4/android/XWords4/assets/changes.html +++ b/xwords4/android/XWords4/assets/changes.html @@ -13,9 +13,9 @@ -

Crosswords 4.4 beta 95 release

+

Crosswords 4.4 beta 96 release

-

This is a quick bug fix release.

+

Another quick bug fix release

Please take @@ -25,21 +25,28 @@

New with this release

    -
  • Don't crash copying games
  • +
  • Don't crash after assigning tiles when there's empty + space to the left of the tray divider (thanks DS!)
  • +
  • Tweaks to make it easier to build for f-droid.org's + "store"

(The full changelog is here.)

-

Next up

+

Next up (and very nearly done!)

  • Finish fixing things so you don't have to specify how two devices will communicate: Bluetooth, Relay, SMS - shouldn't be something you have to pick. I should just - use what works at the time. (This is coming along, but - still weeks out.)
  • + use what works at the time. + +
  • Full French localization!
  • +
-
  • Offer "Rematch" when game's over (easy if I get +

    After that...

    +
      +
    • Offer "Rematch" when game's over (easy if I get the above right)
    diff --git a/xwords4/android/XWords4/res/values/app_name.xml b/xwords4/android/XWords4/res/values/app_name.xml index 8159558d0..aae943e38 100644 --- a/xwords4/android/XWords4/res/values/app_name.xml +++ b/xwords4/android/XWords4/res/values/app_name.xml @@ -1,5 +1,5 @@ - 4.4 beta 95 + 4.4 beta 96