Commit graph

10179 commits

Author SHA1 Message Date
Eric House
64014944f3 finish: using java's base64 en/decoder from java
Added a wrapper function since for compatibility with the jni's encoding
the flags matter and need to be the same everywhere. Or at least there
should be no chance of their getting changed.
2017-07-13 07:40:28 -07:00
Eric House
94dca807ef use a singlton rather than one Time per object
De-serializing a Time formatter wasn't going well post-proguard, but it
was a dumb way to do it anyway when only one object is needed.
2017-07-13 07:20:24 -07:00
Eric House
fb91ba8608 fix (by inspection) store-reported NPE 2017-07-12 08:14:42 -07:00
Eric House
4f989c7a3e start using built-in base64 stuff
As a first step, use mine and android's and assert results are the
same. Note using built-in Base64 class requires moving the min android
version from 7 to 8.
2017-07-12 08:02:52 -07:00
Eric House
589929b3b2 enable proguard for debug builds
Copy config file into the right place, turn it on for debug builds, and
fix compile-time complaints by adding -keep clauses. Resulting builds
seem to work (after a few minutes in emulator only) except that net
status icon taps crash at first (eventually recovering somehow) likely
because of problems with base64 en/decoding which goes through jni.
2017-07-12 07:16:57 -07:00
Eric House
75488aefc0 use same SMS resend backoff for debug as release 2017-07-10 06:51:45 -07:00
Eric House
c8beefaafe tweak network status icon
Get rid of black background of center icon, instead running the green or
red all the way to the middle. For better contrast make the green and
red darker and the non-active arrows white.
2017-07-10 06:49:02 -07:00
Eric House
924dc1b37f remove assert
Looks like my theory was right. Logging is more than enough.
2017-07-05 07:53:41 -07:00
Eric House
15f50dc82a fix game config for rotation and connvia changes
The debug-only settings for disabling individual conn types weren't
kept in sync with which types were enabled, and that set of types was
lost on rotation. Fixed (including keeping the disableds across rotations.)
2017-06-30 06:34:24 -07:00
Eric House
b9d6b05d87 tweak logging 2017-06-29 07:28:15 -07:00
Eric House
d6bbccb773 let caller deal with result of message resend
Use a new interface to let caller of resendAllIf() know how many
messages were resent. If none, a new timer might not be called for.
2017-06-28 08:24:33 -07:00
Eric House
bdc1f5ff51 when game full drop message but don't assert
I'm seeing assertions when a game gets into a state I don't fully
understand: host receives messages that need a channelNo assigned but
the game's full. With luck they're duplicates and can be ignored,
because that's all I can do.
2017-06-28 07:04:15 -07:00
Eric House
33838e6a14 don't crash when crashlytics didn't get built in correctly 2017-06-27 07:34:04 -07:00
Eric House
d454ffb3e8 up changelog/strings for release 2017-06-22 07:12:51 -07:00
Eric House
4e101862a6 get rid of old standin for missing contact name
Since it's now possible to add a name for an SMS contact added manually,
don't assuming a missing name means it was added manually. Just leave
blank if not provided.
2017-06-21 07:59:22 -07:00
Eric House
e3e7add5a9 fix (I hope) script for harvesting jni sigs
I made these changes a while ago then stashed them. They worked when I
needed them then, and seem to work now, but I haven't verified now so
don't trust 'em too far. :-)
2017-06-20 22:05:39 -07:00
Eric House
a16cc8e648 replace Crittercism with Crashlytics, suckily
Crittercism is dropping free support of FOSS apps, so I'm dropping
it. Unfortunatly integration isn't as clean: so far at least I haven't
figured out how to make it possible for others to build the 'd' variant,
which includes Crashlytics, without their having a Fabric API key.
2017-06-20 21:48:40 -07:00
Eric House
6de5d307b3 add name field to manual sms contacts entry 2017-06-20 19:35:38 -07:00
Eric House
b33df6b222 reset SMSResend timer on new data only
Resetting it on every ACK etc meant it happened forever at the most
frequent interval, at least on devices that have both sides of a game,
which is my usual test setup.
2017-06-20 19:19:03 -07:00
Eric House
e6454070a6 remove an oft-firing assert
It's definitely happening, and disruptive though debug-only. So remove
to be tracked down eventually.
2017-06-20 19:17:23 -07:00
Eric House
e3a8bef3cb add new param
It's not the case that forcing send and showing UI go together.
2017-06-20 07:49:01 -07:00
Eric House
0b2920102b tweak chat layout; use better timestamp format 2017-06-20 07:47:32 -07:00
Eric House
3aefa3a566 don't make sound/notify on standalone game moves
I'm finding the robot move beeps annoying. If others aren't maybe a
preference would be better. We'll see.
2017-06-16 19:24:04 -07:00
Eric House
7f48267397 save non-destructive changes on "Play game" button
In game config, when the play game button's hit and the changes pending don't
"matter" (require reset), apply them. The motiviation is to allow
setting the "disableds" and immediately launching a game via the button,
but I think it's the right thing to do anyway. Needs testing.
2017-06-16 19:18:30 -07:00
Eric House
7bae112077 add timer to resend sms data messages
Deal with occasional droppage of SMS data messages by running a
timer (via AlarmManager) with backoff that resends any pending moves for
games connected via SMS. Successful receipt of SMS data resets the backoff.
2017-06-16 18:56:22 -07:00
Eric House
0b0a50bd5c add timestamp to chat messages, db and display
On send, add current seconds to message. Store and display in android
code. Display layout needs work.
2017-06-10 11:36:45 -07:00
Eric House
6f0fb66a0d fix three-year-old huuuuge memory leak
Hadn't run Valgrind in a while. There's another too, but much smaller
and harder to track down.
2017-06-07 08:07:42 -07:00
Eric House
f06e7bdd98 don't drop duplicate reconnect
When Android client is backgrounded with a game playing (BoardActivity
on top) then brought to front again it fails to reconnect to relay
because it didn't disconnect and the relay thinks it's still there. The
right fix is in making the java code do the right thing (complete
disconnect), but it seems harmless to just honor the reconnect in this
case. Doesn't even cause leaks, per valgrind.
2017-06-06 06:27:58 -07:00
Eric House
59285aa9f4 cleanup 2017-06-06 05:46:27 -07:00
Eric House
f85f7c41be add cmdline options to generate single-abi .so
Part of getting split builds going. I think.
2017-06-06 05:45:31 -07:00
Eric House
41683f95a7 improve activity lifecycle logging 2017-06-05 07:36:47 -07:00
Eric House
5c893127de remove constants from build.gradle
cleanup, iterating over built-in data rather than my hard-coded VARIANTS
and BUILDS arrays, which now go away. Renamed obj- and libs- directories
to better fit the variables the system provides.
2017-06-01 07:41:51 -07:00
Eric House
f49aac71cf get rid of <a> -- sucks in webview 2017-05-31 20:22:13 -07:00
Eric House
c53616fd82 wrap code in if(DEBUG) 2017-05-27 13:26:57 -07:00
Eric House
9644f40659 add ui for disabling comms send and receive
Add DEBUG-builds-only UI at the bottom of GameConfig for turning on the
comms feature dropping outgoing or incoming messages. The idea's to use
this to reproduce and fix stalls. There's a noticable slowdown opening
the GameConfig fragment, but it should all be no-op in a release build.
2017-05-26 07:49:38 -07:00
Eric House
95ec573169 save disabled booleans in comms state
I want them persisted since the GTK UI doesn't make sense and they
should effect background sends and receives too.
2017-05-26 07:30:42 -07:00
Eric House
a815c466c9 up strings for new release 2017-05-25 20:13:00 -07:00
Eric House
7164ab92f6 make FirstRunDialog a DialogFragment
It was disappearing when the device rotated. Using the same
XWDialogFragment mechanism as everything else fixes that.
2017-05-25 19:58:04 -07:00
Eric House
b6665a15c4 double-check to avoid crash (by observation)
Chasing a rare play-store-reported JNI crash: test for a null ptr in C
and assert/test in Java.
2017-05-25 07:10:49 -07:00
Eric House
d584c30a43 fix (by inspection) three Play store crashes
One race condition between BT threads; two edge cases around dialog
fragments, where I've left DEBUG build asserts in place.
2017-05-24 21:27:18 -07:00
Eric House
935932f440 don't try to upgrade fdroid builds
Add BuildConfig boolean that's true when a gradle property is passed in
from the fdroid metadata/build file. Test when putting together upgrade
state and omit app info when it's true, same as if from Play store.
2017-05-24 20:16:07 -07:00
Eric House
d58c601bf3 include git revision in assets/ dir (.gitignore it)
Makes it easier to see what's been built into an apk if the file's name
has changed.
2017-05-24 07:09:11 -07:00
Eric House
340a559eb7 don't report fdroid builds as dirty
F-droid build system modifies git-controlled files so no build will ever
be clean. So look for a -P property and if that's set don't use the
--dirty flag when capturing the git revision. Requires a change to the
fdroid metadata to pass that property.
2017-05-24 06:49:09 -07:00
Eric House
222655ba58 get rid of background for expander buttons
In the gameslist view the expander buttons had a visible rectangular
background. Now that's transparent so they look like the rest.
2017-05-23 19:03:29 -07:00
Eric House
3c650ce762 fix xw4d build (shortening more xw4dbg) 2017-05-23 19:03:29 -07:00
Eric House
acf7097fda sign release apks outside of gradle
My sign-inside-gradle is an uncommon trick and unnecessary. Better to
follow the old convention of using jarsigner and zipalign.
2017-05-23 19:03:19 -07:00
Eric House
ef2da21bbe xw4dbg -> xw4d: tired of typing the extra letters
Rename the debug variant and make it work. appID stays the same and so
no longer matches. Gradle allows that.
2017-05-23 06:37:31 -07:00
Eric House
4ad7e171f6 keep db open throughout
Years back what I read said you opened and closed the database around
every query. Now I'm reading differently, that the OS will close it for
you on app shutdown and that it's ok to just leave it open. Trying
that after a few minutes on one device looks ok. Will need to test the
heck out of it, especially on older OS versions, before ship.
2017-05-18 21:20:21 -07:00
Eric House
8a4563e8ee up version strings 2017-05-18 06:53:03 -07:00
Eric House
a834a8170a catch IllegalStateException
Play store reports crashes but stack crawl doesn't tell me where
from. So try catching the exception and on debug builds logging what
dialog is responsible.
2017-05-18 06:37:58 -07:00