Commit Graph

2040 Commits

Author SHA1 Message Date
akwizgran
c2a1cc1e4e Merge branch '247-dagger-2' into 'master'
247 dagger 2

This MR in a nutshell replaces Guice and Roboguice with Dagger 2, which offers a lot more possibilities than is implemented in this branch, such as using lazy injections for performance purposes. With Dagger 2 all the magic happens at compile time, so no need to worry about unfulfilled injections at runtime, but due to restrictions I was forced to put injected test code into an Android module. We therefore have a new test module, `android-test`.

A consequence of using Dagger 2 is that we no longer have a view injector and I therefore had to replace those with manual references. 

Closes #247 

See merge request !118
2016-03-15 20:02:14 +00:00
Ernir Erlingsson
11bfa212cc minor tweaks 2016-03-14 21:02:51 +01:00
Ernir Erlingsson
85c66417b5 branch cleanup 2016-03-14 21:02:51 +01:00
Ernir Erlingsson
686729b045 refactor with master and fixed files that were accidentally clobbered 2016-03-14 21:02:51 +01:00
Ernir Erlingsson
4da63b3800 Modified the project structure, removed module extension and went instead for a non-complete core dependency graph 2016-03-14 21:02:51 +01:00
Ernir Erlingsson
7670bc48ea Removed unecessary module 2016-03-14 21:02:51 +01:00
Ernir Erlingsson
6f233070fe Semi-encapsulated the core/api dependency graphs and created a proper structure to load eager singletons 2016-03-14 21:02:51 +01:00
Ernir Erlingsson
10764d727b rebased with master 2016-03-14 21:02:51 +01:00
Ernir Erlingsson
9af3ce123a Added eager singletons and made some fixes 2016-03-14 21:02:51 +01:00
Ernir Erlingsson
5aba1d79f1 Fixes after comments, also removed the CryptoComoponent from the IdentIcons 2016-03-14 21:02:51 +01:00
Ernir Erlingsson
95d89553d5 merged with master 2016-03-14 21:02:51 +01:00
Ernir Erlingsson
ac5d68df81 Added dependency verifications and removed Splash header 2016-03-14 21:01:21 +01:00
Ernir Erlingsson
25324697ac cleanup and added missing desktop modules 2016-03-14 21:01:21 +01:00
Ernir Erlingsson
1be400eb84 Switched Roboguice/Guice out for Dagger 2 2016-03-14 21:01:21 +01:00
akwizgran
e5d7038195 Merge branch '206-settings-prefs-alt' into 'master'
Material design settings - alternative

Closes #206.

Alternative to !77 that does not rely on an additional external library. The two alternatives should be compared for backwards-compatibility specifically regarding the ringtone selector.

Includes code from https://github.com/consp1racy/android-support-preference
License: Apache License v2.0

See merge request !78
2016-03-14 16:20:35 +00:00
Torsten Grote
e8ad11210c Merge branch '266-message-queues' into 'master'
Message queues. #266

A message queue is a group shared by two devices that delivers messages from each device to the other in order. The first 64 bits of the message body contain a sequence number that's incremented for each message sent in a given direction. The incoming and outgoing sequence numbers and information about any messages received out of order and waiting to be delivered are stored in the group metadata.

See merge request !121
2016-03-14 14:56:43 +00:00
str4d
770d9ddc5f Migrate settings to PreferenceFragmentCompat
Includes code from https://github.com/consp1racy/android-support-preference
License: Apache License v2.0
2016-03-11 21:06:06 +00:00
akwizgran
02eca8ec38 Unit tests for MessageQueueManagerImpl. 2016-03-11 17:18:10 +00:00
akwizgran
e458853f34 Extra logging to track down Tor connection problems. 2016-03-11 15:21:26 +00:00
akwizgran
4afcf2e4a4 Added logging to track down deletion bug. 2016-03-11 10:13:35 +00:00
akwizgran
c615dd1ed1 Merge branch 'bluetooth-race' into 'master'
Fix race condition when closing redundant Bluetooth sockets

The Bluetooth invitation code has a race condition: if Alice and Bob connect to each other at roughly the same time, they each consider their outgoing socket to be redundant and close it, resulting in both sockets being closed. This can be triggered pretty reliably by using two phones of the same model and pressing 'Continue' at the same time on both phones.

When more than one invitation socket is opened, Alice should pick which one to use and Bob should use whichever one Alice picks, which Bob can detect by trying to read from both sockets.

Hopefully the Bluetooth invitation code will be retired when #117 is merged, but I'm putting this up for review in case we need to keep Bluetooth as a fallback method.

See merge request !120
2016-03-09 10:12:05 +00:00
akwizgran
5bb8e95b26 Pass original message to BDF validators and hooks. 2016-03-08 17:03:22 +00:00
akwizgran
9e40d0be16 Added placeholder for MessageQueueManagerImpl tests. 2016-03-08 16:28:31 +00:00
akwizgran
efa06527c9 Moved validation interfaces into respective managers. 2016-03-08 16:22:09 +00:00
akwizgran
d308a30d05 Added BdfIncomingMessageHook. 2016-03-08 16:07:36 +00:00
akwizgran
ab7cc13014 Added QueueMessage support to BdfMessageValidator. 2016-03-08 16:07:36 +00:00
akwizgran
a4d6de0340 Added message queue manager. 2016-03-08 16:07:29 +00:00
akwizgran
c8fed348f0 Merge branch '263-delete-all-the-things' into 'master'
Delete all app data when deleting account. #263

When deleting the user's account, delete everything in the app's persistent storage directory except the libs directory, which is populated with native libs when the app is installed.

Fixes #263.

See merge request !119
2016-03-08 09:37:24 +00:00
akwizgran
c9276de399 Renamed validation hooks to incoming message hooks. 2016-03-07 18:36:30 +00:00
Torsten Grote
8960644273 Merge branch 'use-client-helper' into 'master'
Use client helper in existing clients

Use the new ClientHelper to reduce boilerplate in existing clients. Add a BdfMessageValidator superclass for clients that format their messages as BDF lists and their metadata as BDF dictionaries (which all existing clients do).

See merge request !115
2016-03-07 14:47:32 +00:00
akwizgran
fe9c3adc64 Raise interrupt flag when catching InterruptedException. 2016-03-07 12:17:00 +00:00
akwizgran
0ac67239e3 Fixed race condition when closing redundant sockets.
When more than one invitation socket is opened, Alice should pick which one to use and Bob should use whichever one Alice picks. This fixes a race condition where each party picked a different socket and closed the other.
2016-03-07 11:50:47 +00:00
akwizgran
88ab694af8 No need to unwrap Bytes before adding to dictionary. 2016-03-04 21:11:25 +00:00
akwizgran
5998412a8a Use ClientHelper in PrivateMessageFactoryImpl. 2016-03-04 21:10:52 +00:00
akwizgran
d342594313 Use ClientHelper in ForumPostFactoryImpl. 2016-03-04 21:10:52 +00:00
akwizgran
cc7ffee28d Superclass for validating messages that are BDF lists. 2016-03-04 21:10:44 +00:00
akwizgran
05ec49e45b Use ClientHelper in TransportPropertyManagerImpl. 2016-03-04 21:07:33 +00:00
akwizgran
9d5924fc24 Use ClientHelper in ForumSharingManagerImpl. 2016-03-04 21:07:33 +00:00
akwizgran
2ccd1dee33 Use ClientHelper in ForumManagerImpl. 2016-03-04 21:07:33 +00:00
akwizgran
8beff5c743 Use ClientHelper in MessagingManagerImpl. 2016-03-04 21:07:33 +00:00
akwizgran
4ddc34ee01 Added new methods to ClientHelper. 2016-03-04 21:07:33 +00:00
akwizgran
5b47d6d3ff Merge branch 'bdf-improvements' into 'master'
BDF improvements

* Change the semantics of the BdfList/Dictionary methods with default values so they return the default value if the value is missing, or throw an exception if it the value's present but has the wrong type - this is more useful for validators, which have to deal with optional values without accepting values of the wrong type
* Reuse BdfReader/Writer for MetadataParser/Encoder so we don't have two implementations of BDF


See merge request !117
2016-03-04 21:06:11 +00:00
akwizgran
db188657ca Reuse BdfReader/Writer for MetadataParser/Encoder. 2016-03-04 21:00:30 +00:00
akwizgran
418798b1f0 Added BdfList/Dictionary getters for optional values. 2016-03-04 21:00:05 +00:00
akwizgran
30c3a33a0a Delete all app data when deleting account. #263 2016-03-03 16:23:10 +00:00
akwizgran
08099714ba Bumped expiry date to 1 April 2016. 2016-03-02 09:58:23 +00:00
akwizgran
10561a2df3 Added new module to roboguice.xml. 2016-02-29 16:38:55 +00:00
akwizgran
cab94360ec Skip message header when parsing body. 2016-02-29 15:47:56 +00:00
akwizgran
154e95a989 Merge branch 'client-helper' into 'master'
Helper class to reduce client boilerplate

* Renamed BdfReader methods for consistency with BdfList/BdfDictionary
* Added readList() and readDictionary() methods to BdfReader
* Added ClientHelper to reduce boilerplate when converting messages and metadata to and from BDF
* Moved PrivateGroupFactory to the same package as ClientHelper


See merge request !114
2016-02-29 14:37:45 +00:00
akwizgran
75d53598b0 Merge branch 'validation-manager-tests' into 'master'
Unit tests for ValidationManagerImpl

Unit test for the validation manager. I also changed the way the validation manager loads unvalidated messages - instead of using a single DB task to load all unvalidated messages, it loads a list of message IDs and then loads each message in a separate task. This prevents the DatabaseExecutor from being blocked by a long-running task if there are lots of messages to validate.

See merge request !113
2016-02-29 14:35:30 +00:00