Commit Graph

2154 Commits

Author SHA1 Message Date
akwizgran
8630f6f24f Don't allow 'this' to escape the constructor. 2016-04-26 10:03:28 +01:00
akwizgran
141d6497ef Removed unused layout code and imports. 2016-04-26 09:34:48 +01:00
akwizgran
11a4ca6b9c Merge branch '271-port-splash-and-create-forum' into 'master'
Converts the splash screen to XML format

Removes all programatic calls that modify the layout and uses the XML
resource instead.

See merge request !123
2016-04-26 08:13:29 +00:00
akwizgran
5a13739ca8 Merge branch '292-reuse-contact-selector' into 'master'
Refactor `ContactListAdapter` to be used for Introductions and Forum Sharing

This MR introduces an abstract `BaseContactListAdapter` which provides
most of the adapter logic. The original `ContactListAdapter` extends it to
show date and online status of the contacts.

The new `ContactChooserAdapter` which is used for introductions extends
the `ContactListAdapter` and adds logic for graying out contacts from
different identities than the currently used one.

A new `ContactSelectorAdapter` extends the `BaseContactListAdapter` and
allows to select multiple contacts. It offers a method to return a
collection of all selected `ContactId`s.

Closes #292

See merge request !151
2016-04-25 16:55:12 +00:00
Torsten Grote
9ea7113423 Refactor ContactListAdapter to be reusable for other use cases.
This commit introduces an abstract `BaseContactListAdapter` which provides
most of the adapter logic. The original `ContactListAdapter` extends it to
show date and online status of the contacts.

The new `ContactChooserAdapter` which is used for introductions extends
the `ContactListAdapter` and adds logic for graying out contacts from
different identities than the currently used one.

A new `ContactSelectorAdapter` extends the `BaseContactListAdapter` and
allows to select multiple contacts. It offers a method to return a
collection of all selected `ContactId`s.

This commit also sneaks in an animation when the 'Share Forum' button
is clicked.

Closes #292
2016-04-25 13:50:31 -03:00
Santiago Torres
e535be6d18 WIP: Converts the splash screen to XML format
Removes all programatic calls that modify the layout and uses the XML
resource instead.
2016-04-25 12:19:48 -04:00
akwizgran
e9f77ecd37 Use assertEquals() for more informative failure messages. 2016-04-25 17:05:22 +01:00
akwizgran
b17575bfa4 Merge branch 'inactive-contacts' into 'master'
Don't connect to inactive contacts

Two changes:

1. Don't use remote transport properties for contacts that are in the process of being introduced - this avoids wasted connection attempts, as we can't create stream contexts for such contacts.

2. Don't activate contacts when receiving incoming streams - doing so was meant as a workaround for newly introduced contacts having inconsistent views of their introduction status if the introducer was offline. But it just shifted the inconsistency elsewhee, so this change removes the workaround.


See merge request !153
2016-04-25 15:22:51 +00:00
akwizgran
9918e93cc4 Merge branch '296-dialog-styling' into 'master'
Use consistent styling for dialogs. #296

Converted all dialogs to use the support library and the Briar theme, so they have a consistent Material Design appearance across all Android versions.

See merge request !152
2016-04-25 15:20:28 +00:00
akwizgran
d414e12fb5 Don't return transport properties for inactive contacts.
This avoids wasted connection attempts to contacts that are in the process of being introduced.
2016-04-25 16:12:24 +01:00
akwizgran
2fddec85dd Don't activate contacts on incoming streams.
This leaves the contact and the introduction session in inconsistent states.
2016-04-25 16:11:15 +01:00
akwizgran
3200a9f8f8 Merge branch '313-move-forum-buttons-to-toolbar' into 'master'
Move create forum post and share forum buttons in action bar

According to the designs in #305, the 'create forum post' and 'share forum' buttons will go into the in action bar.

In the spirit of keeping MRs small and to avoid conflicts with #306, I did this first and independently of future work.

This also introduces constants for the `GROUP_ID`, `FORUM_NAME` and `MIN_TIMESTAMP` as they were used for the two buttons.

Closes #313

See merge request !150
2016-04-25 13:57:14 +00:00
akwizgran
41c9916e8e Merge branch '293-remove-avatar-from-conversation' into 'master'
Remove avatar code and layout from ConversationActivity and ConversationAdapter

Please note that I have not been able to test this MR on an actual device as I have none at the moment :(

Closes #293

See merge request !148
2016-04-25 12:40:42 +00:00
akwizgran
3b8689f892 Tweaked introduction wording, use Collections.emptyList(). 2016-04-25 13:14:22 +01:00
akwizgran
7779319f9a Merge branch '295-show-declined-introductions' into 'master'
Show relevant introduction decline responses in the conversation

* If the user has already declined, we don't show that the other
  introducee has declined as well. The backend doesn't have that information, so
  this is compatible with the principle of showing what we know.
* If the user has already accepted or hasn't yet responded, we now show the
  decline response in the private conversation with the introducer. If
  the user hasn't yet responded, we hide the accept/decline buttons
  in the introduction request message.

Please note that I do not have three devices at the moment to test this MR in its entirety in practice. I created another test which is hopefully sufficient to ensure that the modifications are correct.

Closes #295 

See merge request !149
2016-04-25 12:07:13 +00:00
akwizgran
b5fc7cf724 Use consistent styling for dialogs. #296 2016-04-25 12:52:28 +01:00
akwizgran
1b08720200 Merge branch '123-encrypted-crash-reports' into 'master'
Encrypted crash reports

Part of #123.

See merge request !128
2016-04-25 10:17:53 +00:00
akwizgran
9b5d3ecb7a Added public key and placeholder onion address. 2016-04-21 16:07:51 +01:00
Torsten Grote
44b3d4c14f Move create forum post and share forum buttons in action bar
This also introduces constants for the GROUP_ID, FORUM_NAME and
MIN_TIMESTAMP as they were used for the two buttons.

Closes #313
2016-04-21 12:06:42 -03:00
Torsten Grote
11e6d64e4d Show relevant decline responses in the conversation
* If the user has already declined, we don't show that the other
  introducee has declined as well. The backend doesn't have that information, so
  this is compatible with the principle of showing what we know.
* If the user has already accepted or hasn't yet responded, we show the
  decline response in the private conversation with the introducer. If
  the user hasn't yet responded, we hide the accept/decline buttons
  in the introduction request message.

Messages an introducee receives in a `FINISHED` state are now being
ignored and deleted.

Closes #295
2016-04-21 11:08:15 -03:00
akwizgran
5457588dbd Placeholder test was causing tests to fail in AS 2.0. 2016-04-21 12:20:26 +01:00
akwizgran
24987336fd Merge branch '203-remove-tor-binaries' into 'master'
Remove Tor binaries from repo. #203

This patch removes the Tor binaries from the repo - the binaries will be downloaded at build time and verified using SHA-256 hashes included in the repo.

After this branch has been merged I plan to reduce the size of the repo by rewriting the commit history to delete the Tor binaries (and various other cruft that used to live in the repo, such as fonts).

After the history has been rewritten, everyone will need to delete their local repo and clone a fresh copy. I'll send out some warnings beforehand.

See merge request !147
2016-04-21 09:53:41 +00:00
str4d
5c2f56549b Refactor MessageEncrypter interface to use PublicKey and PrivateKey 2016-04-21 01:08:39 +00:00
str4d
d545aaa892 Encrypt and save crash reports, send them the next time TorPlugin start
Will currently fail at runtime; requires a public key and a server onion.
2016-04-20 23:42:46 +00:00
akwizgran
28086cd359 ECIES encryption for feedback and crash reports. 2016-04-21 11:38:46 +12:00
akwizgran
94cca59249 Use Bouncy Castle for encoding public keys. 2016-04-21 11:38:46 +12:00
akwizgran
698f3470f4 Merge branch '276-introduction-integration-tests' into 'master'
Introduction Integration Tests

This introduces these integration tests for the introduction client:
* normal session where both introducees accept
* normal session where the first introducee declines
* normal session where the second introducee declines
* one session where a contact is introduced to herself
* one session where two identities of the same contact are introduced to each other

I managed to get rid of the non-determinism missing validator problem by properly injecting the eager singletons.

Attention: This is based on !143 which addresses a corner case that is already tested here.

See merge request !139
2016-04-20 15:59:02 +00:00
akwizgran
2d23ecea8c Merge branch '284-force-introduction-decline-when-identities' into 'master'
Addresses two Introduction Corner Cases

* force decline when two of our own identities are introduced to each
  other
* throw away introduction requests to the same identity
  (impossible to trigger from UI)

Closes #284
Closes #294

See merge request !143
2016-04-20 15:29:55 +00:00
Torsten Grote
db9734044d Remove avatar code and layout from ConversationActivity and ConversationAdapter
Closes #293
2016-04-20 12:22:43 -03:00
Torsten Grote
36ef536e82 Integration Tests for Introduction Client
* normal session where both introducees accept
* normal session where the first introducee declines
* normal session where the second introducee declines
* one session where a contact is introduced to herself
* one session where two identities of the same contact
  are introduced to each other

This introduces a new IntroductionAbortedEvent to signal when the
protocol was aborted. It is not yet used in the UI.

It closes #276
2016-04-20 11:35:51 -03:00
Torsten Grote
d0036deaf7 This addresses two types of introduction corner cases:
* force decline when two of our own identities are introduced to each
  other
* throw away introduction requests to the same identity
  (impossible to trigger from UI)

Closes #284
2016-04-20 11:31:54 -03:00
akwizgran
9f4cacd81c Merge branch '286-progress-wheels' into 'master'
Don't use inverse style for progress bars. #286

Fixes the appearance of progress bars on Gingerbread, no difference on other platforms. Thanks to @str4d for finding the source of the problem.

See merge request !145
2016-04-19 10:17:05 +00:00
akwizgran
53eb67b153 Removed Tor binaries from repo. #203 2016-04-18 12:50:34 +01:00
Ernir Erlingsson
87635c7654 Merge branch '297-flickering-contacts' into 'master'
Fix flicker when loading contact list

Fixes #297.

See merge request !144
2016-04-18 08:57:54 +00:00
Ernir Erlingsson
48f8460793 Merge branch '298-qr-code-crash' into 'master'
Catch runtime exceptions from QR code decoder. #298



See merge request !146
2016-04-18 08:57:15 +00:00
akwizgran
0927bd5b01 Moved zxing dependency to briar-android. 2016-04-15 17:51:22 +01:00
akwizgran
6197f5a44c Catch runtime exceptions from QR code decoder. #298 2016-04-15 17:06:05 +01:00
akwizgran
98b6b1f471 Don't use inverse style for progress bars. #286 2016-04-15 15:20:32 +01:00
akwizgran
f1a83139cf Fixed flicker when loading contact list. #297 2016-04-15 11:05:02 +01:00
akwizgran
076f7d411e Merge branch '276-introduction-tests' into 'master'
Unit Tests for the Introduction Client

Please note that I based this MR is on top of the introduction UI in !122, because I needed to do some more refactoring on top of the other refactoring ;) The refactoring and the tests are in two separate commits.

An integration test will be added as a separate MR.

This addresses part of #276.

See merge request !136
2016-04-14 16:24:50 +00:00
Torsten Grote
823b95f7d6 Add tests for IntroductionManager and Validator 2016-04-14 12:53:23 -03:00
Torsten Grote
d205f3b0d8 Refactor the Introduction Client to avoid circular dependencies
This injects the IntroducerManager and the IntroduceeManger for easier testing
2016-04-14 12:53:22 -03:00
akwizgran
0f9338f5e9 Message queue manager should be a singleton. 2016-04-14 12:00:08 +01:00
akwizgran
20c8cacda2 Merge branch '253-introduction-ui' into 'master'
Introduction UI

This is the user interface for the new introduction feature as specified by @Megalox in #253.

This will close #253 

See merge request !122
2016-04-13 16:54:04 +00:00
Torsten Grote
f7340caec4 restructure conversation item classes 2016-04-12 17:04:52 -03:00
Torsten Grote
c5bfea2155 address issues found in final review
(except refactoring of conversation item classes)
2016-04-12 17:04:52 -03:00
Torsten Grote
90d984ee52 Ensure responses shown after requests, clarify wording, reuse transactions
When devices' clocks are out of sync, it is possible that a response is
shown before the request. This commit makes sure that the timestamp of
responses is always later than the last message in the conversation.

Some wording could be misunderstood to thing introductions were
successful even though they were not. That has been clarified.

A new database transaction was created when getting contacts and local
transport properties. This has been changed to re-use the existing
transaction.

Also addresses minor issues found in review.
2016-04-12 17:04:52 -03:00
Torsten Grote
4b7a32a5ee Find correct session state in case the same one is used twice.
The code made the assumption that a session state can be identified by
the unique session ID. However, when multiple identities from the same
device are involved, there are two sessions with the same ID running on
the device.

Hence, a second identifying criteria has to be used to uniquely identify
the correct session. Here, the ID of the group was chosen.
Unfortunately, the session state can not be cached easily anymore
leading to a small performance penalty when getting all messages for the
UI.
2016-04-12 17:04:52 -03:00
Torsten Grote
5ea7ff2857 UI for introducing two contacts to each other
Show system notification for successful introductions
2016-04-12 17:04:52 -03:00
Torsten Grote
7c687736df Merge branch '287-local-identities-as-contacts' into 'master'
Don't allow local identities to be added as contacts

Fixes #287

See merge request !137
2016-04-12 20:04:16 +00:00