Commit Graph

345 Commits

Author SHA1 Message Date
akwizgran
a17349e015 Replaced redundant SocketReceiver classes with a generic class. 2013-06-13 12:40:19 +01:00
akwizgran
3833eac4e2 Made two private classes static. 2013-06-13 11:50:01 +01:00
akwizgran
4431e502f7 Symmetric invitation protocol for the Droidtooth plugin. 2013-06-06 15:17:35 +01:00
akwizgran
4170e8a08b Symmetric invitation protocol for the LAN plugin.
See issue #development-tasks/20: some devices can send but not receive
multicast packets.
2013-06-06 15:17:11 +01:00
akwizgran
08b11412fb Allow plugins to use different maximum frame lengths. 2013-06-05 14:16:44 +01:00
akwizgran
90c323e82b Set H2's write delay to 0 and flush data to disk after every commit.
This should improve durability in the case of a crash (see
http://www.h2database.com/html/advanced.html#durability_problems). The
performance penalty for H2DatabaseTest is roughly 10%.
2013-05-31 15:31:15 +01:00
akwizgran
cb2d8b50d2 Upgraded H2 to version 1.3.172. 2013-05-31 15:27:32 +01:00
akwizgran
4c480912a8 Removed unnecessary calls to Connection.setAutoCommit().
We always use transactions so auto-commit can always be false.
2013-05-30 17:35:32 +01:00
akwizgran
12192aea43 Patched jtorctl so a control connection can be used by multiple threads.
Various thread safety fixes, saner use of exceptions, and code
reformatting. The Tor plugin now creates a single control connection at
startup and closes it at shutdown. Fixes issue #3611962.
2013-05-16 20:02:48 +01:00
akwizgran
c3e9ada0d9 Escaped a dot in the regex used to validate onion hostnames. 2013-05-16 15:44:56 +01:00
akwizgran
1692e5a695 Invitation protocol was proceeding after confirmation timed out.
Both sides now close the connection after exchanging confirmation
results unless both results are positive.
2013-05-16 15:10:16 +01:00
akwizgran
91ccdfd8d7 Created Android-specific LAN TCP plugin in order to enable multicast.
Some Android devices require a lock to be held while using multicast, to
disable the packet filter that normally filters out multicast packets.
2013-05-16 13:48:42 +01:00
akwizgran
635973c845 Provide earlier feedback in the UI when connecting to a new contact.
Partially addresses issue #3611924.
2013-05-15 18:22:04 +01:00
akwizgran
fd5dcd4893 Removed override annotations from overridden abstract methods. 2013-05-15 12:38:43 +01:00
akwizgran
630cfde81e Executors and Services register themselves with the LifecycleManager.
Fixes issue #3612607.
2013-05-15 12:26:56 +01:00
akwizgran
dddd15cd10 Fixed a race conditon when adding a transport and then an endpoint.
To fix issue #3611966, KeyManagerImpl's handling of TransportAddedEvent
was made asynchronous. This made it possible for a thread to call
KeyManager.endpointAdded() before the KeyManager had asynchronously
handled the TransportAddedEvent from a previous call to
DatabaseComponent.addTransport().
2013-05-14 20:54:23 +01:00
akwizgran
673d7fa0c3 Moved lifecycle management into briar-core and reconfigured executors.
CryptoExecutor and DatabaseExecutor now use bounded thread pools with
unbounded queues, since running too many tasks in parallel is likely to
harm performance; IncomingConnectionExecutor, PluginExecutor and
ReliabilityExecutor use unbounded thread pools with direct handoff,
since their tasks may run indefinitely. There are no longer any bounded
executors, and all executors discard tasks when shutting down, which
fixes issue #3612189.

Responsibility for starting and stopping services has been moved from
BriarService in briar-android to LifecycleManagerImpl in briar-core.
However, BriarService is still responsible for stopping the
Android-specific executors, which is ugly. It would be better if
executors registered themselves with LifecycleManager.
2013-05-04 01:26:11 +01:00
akwizgran
48396262d7 Reuse invitation connections as BTP connections. Fixes issue #3611916. 2013-05-01 14:59:31 +01:00
akwizgran
5179e2fde1 Turn off Bluetooth at shutdown if we turned it on at startup.
Also, turn on Bluetooth if necessary before polling. Fixes issue
#3611935
2013-05-01 11:39:10 +01:00
akwizgran
d5720c085f Removed bundle encryption.
Android doesn't currently store bundles persistently, so it's premature
to protect against accidental information leaks through persistent
bundle storage. Protecting against deliberate information leaks by the
OS is probably futile, so there's currently no need for bundle
encryption.
2013-04-30 15:05:23 +01:00
akwizgran
2da873aa01 Moved synchronisation out of event handler. Fixes issue #3611966. 2013-04-29 13:28:25 +01:00
akwizgran
ae76a7935c Moved a couple of annotations from API to core. 2013-04-29 13:15:17 +01:00
akwizgran
458258f2ff Moved blocking call out of event handler. Fixes issue #3611961. 2013-04-29 12:56:58 +01:00
akwizgran
f8d9170a25 Removed override annotation from abstract method. 2013-04-29 12:46:39 +01:00
akwizgran
2c9ce014a5 Renamed a method and expanded the javadoc to be clear that it blocks. 2013-04-26 18:15:51 +01:00
akwizgran
9cf1486778 Added a comment about a potential deadlock. 2013-04-26 18:01:44 +01:00
akwizgran
239e532f23 A ScheduledExecutorService is overkill for one task; use a Thread. 2013-04-26 13:39:56 +01:00
akwizgran
80ac368cab Start and stop plugins in parallel for faster startup and shutdown. 2013-04-25 19:34:46 +01:00
akwizgran
ee641db600 Record the PID of the Tor process so we can make sure it gets killed. 2013-04-25 18:46:05 +01:00
akwizgran
6f206bf270 Use a shutdown hook to kill the Tor process if the plugin isn't stopped. 2013-04-25 15:37:20 +01:00
akwizgran
1f8c9cc977 Don't create lots of temporary File objects. 2013-04-25 15:18:36 +01:00
akwizgran
6c4c0926c5 Randomise initial polling intervals to spread out connection attempts. 2013-04-25 14:57:32 +01:00
akwizgran
db475577c8 Validate onion hostnames, only try to launch Tor on ARM, added comments. 2013-04-25 14:56:51 +01:00
akwizgran
3939ae6d60 Tor plugin for Android using native Tor binary, jtorctl and jsocks.
Only the ARM binary is included at present. Better control of the Tor
process is needed - it's possible for it to be left running when Briar
exits, and if the cookie file is deleted it's no longer possible to stop
the process.
2013-04-25 05:09:25 +01:00
akwizgran
1e5e78cc44 Use Integer.parseInt(String) to get a primitive int. 2013-04-25 05:07:26 +01:00
akwizgran
178c486a4a Put Android plugins and Java SE plugins in separate modules. 2013-04-24 21:09:38 +01:00
akwizgran
9c61e4e01c Cleaned up Bluetooth reflection code. 2013-04-24 11:33:21 +01:00
akwizgran
9e17db5db1 Added activities for managing blog and group subscriptions. 2013-04-18 21:28:04 +01:00
akwizgran
374bff2fb6 UI for setting and entering the password that encrypts the database key. 2013-04-16 14:49:14 +01:00
akwizgran
e343c9f4bb Added PBKDF2 to crypto component. 2013-04-16 12:04:23 +01:00
akwizgran
24ff4b61c3 Create a fresh server socket for each binding attempt. 2013-04-15 14:55:07 +01:00
akwizgran
c5fa3d1841 Removed last connection time from Contact class, tightened up layouts. 2013-04-15 14:51:59 +01:00
akwizgran
2ef06f8564 Inlined constant values in SQL statements to improve readability. 2013-04-15 13:45:21 +01:00
akwizgran
42fd02d0b9 Messages in restricted groups should propagate without moderation.
If the group's owner is spamming, unsubscribe.
2013-04-15 12:22:12 +01:00
akwizgran
5a365f6ce9 Storing a new secret can cause more than one old secret to expire.
This depends on the (unspecified) order in which new secrets are stored.
For example, if the secrets for periods 0 - 2 are loaded in period 3,
the secrets for periods 3 and 4 will be stored; the secrets for periods
0 and 1 may expire separately if the secret for period 3 is stored
before the secret for period 4, or together if the secret for period 4
is stored before the secret for period 3.
2013-04-15 11:20:59 +01:00
akwizgran
da7657ff4d Include author and rating in private message headers. 2013-04-14 21:15:23 +01:00
akwizgran
077efbbea1 Removed an unused database method. 2013-04-14 19:34:50 +01:00
akwizgran
e83f6bbbc0 Don't use exponential backoff between multicast packets. 2013-04-14 15:37:57 +01:00
akwizgran
3c677a8599 Give positive ratings to own pseudonyms and contacts' known pseudonyms. 2013-04-14 15:17:11 +01:00
akwizgran
8e9517ced0 Don't broadcast events for obsolete updates. 2013-04-14 15:16:18 +01:00