Commit graph

10600 commits

Author SHA1 Message Date
Eric House
2d8ac995b7 add test case where (fake) sms messages never arrive 2018-07-14 15:43:42 -07:00
Eric House
352d87a327 use stream to take apart untrusted message safely
add new stream getters that return false if reach EOS and use them to
exit early and safely if incoming SMS msg is misformatted. I'm getting
random garbage meant for other apps perhaps.
2018-07-13 22:41:52 -07:00
Eric House
019cc628e4 fix crash figuring md5sum of null bytes
Just return null String
2018-07-13 22:35:44 -07:00
Eric House
89ec7987e6 move test to after db's inited to avoid crash 2018-07-13 18:20:56 -07:00
Eric House
5d6c743087 fix (I hope) null jni array dereference 2018-07-13 18:20:05 -07:00
Eric House
669acdcd19 log checksum of messages into smsproto 2018-07-13 07:39:11 -07:00
Eric House
c45c9cd809 read format spec outside assert
since the read inside goes away in release builds!
2018-07-13 06:59:57 -07:00
Eric House
b8c2cd1dd5 don't assert when a stray message wanders in 2018-07-12 20:20:04 -07:00
Eric House
df8558e071 delete partial messages when count mismatches
Had an assert fire when a message ID was reused with a different count.
It was likely because of messages crossing between two variants, but
still, fix: delete what's been saved so far when a new count shows up.
2018-07-12 08:13:32 -07:00
Eric House
9ccfae3de4 don't email about build successes 2018-07-11 20:10:45 -07:00
Eric House
bd1cc4276b cleanup and variable rename (no code changes) 2018-07-11 07:33:36 -07:00
Eric House
3477bcf7b6 fix release-build scripts for new gradle output paths 2018-07-11 06:48:42 -07:00
Eric House
af0ddaa0f7 up version code and strings 2018-07-11 06:41:36 -07:00
Eric House
6bab91803d fix release builds
(broken since 091299c 2 months ago)
2018-07-11 06:38:54 -07:00
Eric House
95ac66370c fix off-by-one preventing delayed messages from sending 2018-07-10 07:08:57 -07:00
Eric House
9c2a722cc5 change two method names 2018-07-10 07:07:30 -07:00
Eric House
8c14ccc0d2 add new dutil to store by ptr; use for smsproto msgID 2018-07-10 06:36:34 -07:00
Eric House
08c41ddd3e add debug preference controlling new smsproto format
Don't use the message-combining feature for sends unless this is
set. After a release the default value will switch to true.
2018-07-10 06:19:16 -07:00
Eric House
a9769efe1c implement load/store on android 2018-07-09 07:11:54 -07:00
Eric House
e898dc509c plug leaks 2018-07-07 23:03:26 -07:00
Eric House
13cc6c79f1 add save/restore of partial messages
Handles case where the app receives only a subset of the SMS messages
into which a larger game-level message has been broken. Now when it
restarts and the remaining parts come in the whole can be reassembled.
2018-07-07 22:56:32 -07:00
Eric House
1c58ab3d99 clean up linux db usage
For load/store I'll need more flexibility to store large values.
2018-07-06 08:04:53 -07:00
Eric House
1941642607 add load and store to dutils, and implement with stubs 2018-07-06 06:56:54 -07:00
Eric House
3437ae2ebc use smsproto in Android 2018-07-06 06:48:56 -07:00
Eric House
2e9fbb8204 add common implementation of the SMS proto stuff
And use in linux client. Goal here is to reproduce then improve the
Android SMS pre- and post-processing stuff with a common/ implementation
that can be tested on linux and used wherever.
2018-07-05 21:40:56 -07:00
Eric House
87418d63d1 fix linux "sms" and modify script to test it
My linux sms hack used inotify and didn't check for messages that were
there when the app launched. Replace inotify with a simple glib periodic
timer. A bit of latency mimics SMS better anyway. Update test script to
support SMS, and add params to and otherwise fix linux client so
everything works.
2018-07-05 21:22:20 -07:00
Eric House
ed90c9c16d implement util->dutil split for Android
So now all jni code uses a single dutil context, but also a single
mempool and jniutil instance instead of new instances of the latter two
per game and dict-iteration.
2018-07-05 08:32:19 -07:00
Eric House
d4436b7706 Break part of util into dutil
Trying to separate what's game-specific from what can be app/device
specific (i.e. with a long lifespan, and available when a game isn't
open.)

Android will be broken after this commit and fixed after the next
2018-07-05 07:58:50 -07:00
Eric House
d46a4d13ba use mem_stream_make_raw() where possible in common code 2018-06-27 23:42:50 -07:00
Eric House
d70b089835 use mem_stream_make_raw() where possible in linux code 2018-06-27 23:37:28 -07:00
Eric House
976db7b181 add mem_stream_make_raw 2018-06-27 23:24:45 -07:00
Eric House
9cdd5a7b72 share mpool and vtable in jni calls
A number of jni calls were "stateless", which meant they allocated their
own vtmgr and mpool instances each time invoked. Instead invoke them
with the global jni closure and add to it vtmgr (already has mpool) and
use these instead of allocating/freeing each time. To make sure no race
conditions are introduced (mpool, though debug-only, is probably not
thread-safe), guard these new uses with an in-use flag. If that fires
I'll need a mutex or something.
2018-06-27 21:17:44 -07:00
Eric House
d2ab796fac test script tweaks 2018-06-18 07:11:38 -07:00
Eric House
382718bcb0 init variable
This might have made valgrind happier, though it's been a while. Can't
hurt.
2018-06-13 14:34:31 +03:00
Eric House
80167fb2d9 one more assert 2018-06-01 05:58:04 -07:00
Eric House
b7981cc8da print based on time rather than number of iterations 2018-05-31 23:06:51 -07:00
Eric House
ffaa47f893 fix creation of bogus game
Snapshot can be the first write. Save the rowid if it's new.
2018-05-31 22:19:03 -07:00
Eric House
b24d60e7bf add assert to verify no need for mutex 2018-05-31 21:23:25 -07:00
Eric House
dff130d6c6 ignore log dir 2018-05-31 21:23:10 -07:00
Eric House
d240e30bf4 test script: log and show tiles left in tray
Once the pool count drops to 0, start showing the number of tiles left
in the user's tray. This prevents there being a long time when nothing
seems to be changing *and* the script from exiting early because it
thinks all games are hung.
2018-05-25 21:36:25 -07:00
Eric House
89f4246e83 track and log types of (un-acked) messages 2018-05-24 21:03:25 -07:00
Eric House
39a5ce92ee refactor a bit (no behavior change) 2018-05-23 22:03:16 -07:00
Eric House
1821d197b9 fix to compile on 32-bit system 2018-05-23 19:48:30 -07:00
Eric House
32c93786b3 fix assert when buffer too small
read directly into vector rather than first loading into a fixed-size
buffer that's apparently occasionally not big enough.
2018-05-21 21:19:32 -07:00
Eric House
40ce484a92 fix mistaken and very broken commit
(Fortunately I never ran a relay with this in it!)
2018-05-21 21:19:25 -07:00
Eric House
7fa0cb1b93 rewrite as Thread instead of AsyncTask
I want to be able to use it in contexts where AsyncTask doesn't make
sense, e.g. from timer in background.
2018-05-11 10:23:49 -07:00
Eric House
dd298e4549 fix travis upload: path has changed 2018-05-06 15:09:05 -07:00
Eric House
091299c030 upgrade AS and gradle and with luck travis will work 2018-05-06 14:33:10 -07:00
Eric House
32df1777d3 Merge branch 'android_branch' into android_translate 2018-05-03 06:46:44 -07:00
Eric House
82e6c5495b fix to delete dict even when loc is wrong
Somehow I got a wordlist into a location different from what was
recorded in the DB table and since the delete command matched on
location as well as name it was never deleted (which meant the checksum
was never updated and so upgrading never seemed to succeed.) Removing
the match on location fixed that problem, and since I don't see any harm
in cacheing only one version of a wordlist will simply leave it that
way.

Did a bunch of cleanup as well.
2018-05-01 07:22:59 -07:00