Commit Graph

1986 Commits

Author SHA1 Message Date
akwizgran
640f5484e0 Moved PrivateGroupFactory to clients package. 2016-02-29 14:25:29 +00:00
akwizgran
2e7df53dba Added helper class so clients can use less boilerplate. 2016-02-29 14:23:50 +00:00
akwizgran
9e0add7d4c Renamed BdfWriter methods, added support for NULL_VALUE. 2016-02-29 14:23:49 +00:00
akwizgran
3ce62818aa Renamed BdfReader methods, added convenience methods. 2016-02-29 14:23:49 +00:00
Torsten Grote
9dec498e7e Merge branch 'add-contact-transaction' into 'master'
Add contact and transport keys in the same transaction

This avoids a potential problem where the app crashes after adding the contact but before adding the transport keys, leaving the contact unusable.

See merge request !112
2016-02-29 14:07:33 +00:00
akwizgran
e3374b7584 Rename BDF methods. 2016-02-29 11:57:42 +00:00
akwizgran
46e7a52c22 Merge branch 'bdf-type-conversion' into 'master'
Convert BDF types in lists and dictionaries



See merge request !111
2016-02-29 11:55:08 +00:00
akwizgran
5045b58e01 Explicitly check array lengths. 2016-02-29 11:51:16 +00:00
akwizgran
e28dc17881 Helper methods and unit tests for BdfList/Dictionary. 2016-02-26 16:27:24 +00:00
akwizgran
4e0990d865 Removed unused dependencies from invitation classes. 2016-02-26 11:12:31 +00:00
akwizgran
1d89c6cebc Add contact and transport keys in the same transaction.
This avoids a potential problem where the app crashes after adding the contact but before adding the transport keys, leaving the contact unusable.
2016-02-26 10:57:32 +00:00
akwizgran
76e6b7cfa9 Convert BDF types in lists and dictionaries. 2016-02-26 10:30:50 +00:00
str4d
8c8b2a5358 Merge branch '250-tor-polling' into 'master'
New polling logic for Tor. #250

Poll for outgoing connections each time the network is enabled, then disable polling once our hidden service descriptor has been published. If our contacts do the same, any contacts that are offline when we poll will connect to us when they come online.

This should reduce bandwidth and battery usage. The idea comes from Ricochet:

https://github.com/ricochet-im/ricochet/issues/68

Fixes #250.

See merge request !103
2016-02-25 14:54:49 +00:00
akwizgran
d8079b1841 Fixed race condition in descriptor publication.
If two contacts publish their descriptors simultaneously, they may both stop polling without retrieving each other's descriptors. Continue polling for 2 intervals after publishing the descriptor.
2016-02-25 10:10:57 +00:00
akwizgran
066285b86a New polling logic for Tor. #250
Poll for outgoing connections each time the network is enabled, then disable polling once our hidden service descriptor has been published.
2016-02-25 10:10:57 +00:00
akwizgran
fee4beae63 Merge branch '252-lan-polling' into 'master'
New polling logic for LAN. #252

Same approach as !104. Modified the poller to cancel any scheduled poll when pollNow() is called and randomise the next polling interval so plugins that call pollNow() at the same time don't end up polling in sync.

Depends on !104. Fixes #252.

See merge request !105
2016-02-24 20:11:54 +00:00
akwizgran
d829d4711b Merge branch '251-bluetooth-polling' into 'master'
New polling logic for Bluetooth. #251

Increase the polling interval exponentially each time polling is unsuccessful, up to a maximum of 60 minutes. The interval is reset to 2 minutes whenever a connection is made and whenever Bluetooth is re-enabled.

This should reduce battery usage when there are no contacts nearby.

Fixes #251.

See merge request !104
2016-02-24 20:08:05 +00:00
akwizgran
441b12d936 Merge branch '225-bluetooth-address' into 'master'
Try to use the real Bluetooth address on Android 6. #225

Fixes #225 until Google breaks the Settings.Secure workaround.

See merge request !109
2016-02-24 20:07:05 +00:00
akwizgran
000936b7a2 Return the empty string instead of the fake address. 2016-02-24 20:03:04 +00:00
akwizgran
9789c0ff52 Try to use the real Bluetooth address on Android 6. #225 2016-02-23 11:53:54 +00:00
akwizgran
6b802c2ea0 Merge branch '254-key-rotation-crash' into 'master'
Don't reschedule the same TimerTask. #254

Also added some unit tests for TransportKeyManager (part of #205). Fixes #254.

See merge request !108
2016-02-23 10:36:47 +00:00
akwizgran
681ec080e1 Randomise next polling interval after pollNow(). 2016-02-22 13:25:07 +00:00
akwizgran
5ce8927477 New polling logic for LAN (and WAN). #252
Same exponential backoff approach as Bluetooth.
2016-02-22 13:25:07 +00:00
akwizgran
c081c08ff5 New polling logic for Bluetooth. #251
The polling interval increases exponentially each time polling is unsuccessful, up to a maximum of 60 minutes. The interval is reset to 2 minutes whenever a connection is made and whenever Bluetooth is re-enabled.
2016-02-22 13:21:05 +00:00
akwizgran
247ee7eba0 Unit tests for TransportKeyManager. 2016-02-19 13:22:04 +00:00
akwizgran
8d03496068 Don't reschedule the same TimerTask. #254 2016-02-19 13:22:03 +00:00
akwizgran
a774b3419a Merge branch '117-bytes-comparator' into 'master'
Move UniqueId comparator to Bytes for reuse



See merge request !107
2016-02-19 12:19:35 +00:00
akwizgran
8a20f330be Broadcast status event when active contact is added. 2016-02-19 12:10:44 +00:00
akwizgran
9ad41ea28b Check UTF-8 length of transport ID. 2016-02-19 11:55:40 +00:00
str4d
5a6ab9bb96 Made UniqueId a subclass of Bytes. 2016-02-19 11:55:31 +00:00
akwizgran
0f1dc554bd Merge branch 'embargo-inactive-contacts' into 'master'
Don't communicate with inactive contacts

When we're introduced to a new contact, we need to store the transport keys and start key rotation before activating the contact. During this period we shouldn't use the transport keys for outgoing streams until either the introduction protocol is complete or we receive an incoming stream from the contact, indicating that they've also started key rotation.

See merge request !106
2016-02-18 15:58:05 +00:00
akwizgran
682355fc37 Don't allow outgoing streams to inactive contacts. 2016-02-18 10:29:46 +00:00
akwizgran
b7dc13ab53 Added unit test for setting contact active. 2016-02-18 10:10:12 +00:00
Torsten Grote
81e2d04de6 Merge branch 'message-status-cleanup' into 'master'
Database efficiency improvements

Some tweaks to the DB schema to improve efficiency:

* Only keep status rows for messages that are visible - this saves space and avoids the need to join the groupVisibilities table when selecting messages to offer or send
* Use adjacent columns for the composite primary key on the settings table

This MR depends on !101.

See merge request !102
2016-02-17 19:49:48 +00:00
akwizgran
a6baa5821e Added active flag to contacts. 2016-02-17 18:10:52 +00:00
akwizgran
6b76b75d08 More efficient database joins.
Don't keep message status rows for groups that are invisible to the contact - this avoids the need to join the groupVisibilities table when selecting messages to offer or send. Add or remove status rows when group visibility changes.
2016-02-17 17:24:44 +00:00
akwizgran
e979f17e45 Execute test tasks in a deterministic order. 2016-02-17 17:24:43 +00:00
akwizgran
42c00fb86e Merge branch 'client-transactions' into 'master'
Transactions for clients

This patch moves transactions out of the database component, allowing clients to perform multiple database calls in a single transaction. This should improve efficiency and reliability, at the cost of increased boilerplate for database calls.

Operations that allow hooks, such as adding and removing contacts, pass their transactions to their hooks. This ensures the whole operation is atomic and isolated, so StorageStatus is no longer needed, hooks don't need to be idempotent, and locks can be removed from clients that were using them for isolation.

This merge request is marked WIP because it will conflict with !74.

See merge request !101
2016-02-17 17:24:18 +00:00
akwizgran
00e59613c0 Call validation hooks after storing message & metadata. 2016-02-17 16:51:44 +00:00
akwizgran
f43f79eb5c Merge branch 'identicon-contrast' into 'master'
Increase contrast between identicons and background

Identicons currently have a dark or light background depending on the V component of the foreground colour. But V isn't a great measure of brightness - cyan looks much brighter than blue with the same V, for example. This leads to some identicons having low contrast between the foreground and background.

This patch scales the R, G and B components of the foreground colour to 3/4 of the full range and sets the background to white, so there's always good contrast between the foreground and background. The patch also adds a 1dp outline around identicons and adds some padding to the identity selection dropdown.

Before:
![device-2016-02-10-150200](/uploads/2456ff047d4d33b4537f3489c9018679/device-2016-02-10-150200.png)

After:
![device-2016-02-10-154634](/uploads/758c71e3c160e0f9fc50a507323daa7f/device-2016-02-10-154634.png)


See merge request !100
2016-02-16 10:36:24 +00:00
akwizgran
0a7823e7f5 Changed background colour to FAFAFA.
Psycho killer, qu'est-ce que c'est?
2016-02-16 10:31:57 +00:00
akwizgran
b50dce1c8d Removed an unused method. 2016-02-16 10:25:32 +00:00
akwizgran
9f8baab60f Code cleanup. 2016-02-11 16:26:23 +00:00
akwizgran
074892b677 StorageStatus is no longer needed. 2016-02-11 16:26:23 +00:00
akwizgran
6505db58e6 Contact and identity managers don't need to be services. 2016-02-11 16:26:22 +00:00
akwizgran
146dac056d Broadcast events after committing transactions. 2016-02-11 16:26:22 +00:00
akwizgran
de8cc50fb4 Moved transactions out of database component. 2016-02-11 16:26:19 +00:00
akwizgran
ef2b2b9710 Removed unneeded visibility methods. 2016-02-11 16:21:53 +00:00
akwizgran
3fa1bbe33e Expose transactions through DatabaseComponent interface. 2016-02-11 16:21:53 +00:00
akwizgran
2460e1feb0 Moved author classes to identity package. 2016-02-11 16:21:52 +00:00