Commit Graph

193 Commits

Author SHA1 Message Date
Jake McGinty
a88fbba49f use Loader when conversation is updated instead of requery
// FREEBIE
2014-12-03 04:47:38 +00:00
Jake McGinty
f3f173f653 support mms basic auth
// FREEBIE
2014-12-02 08:59:43 +00:00
Moxie Marlinspike
d72a3ec669 Do thread trimming as JobManager job rather than AsyncTask.
// FREEBIE
2014-11-24 22:50:32 -08:00
Moxie Marlinspike
a85dbce041 Correctly handle PKWM via SMS. 2014-11-12 15:42:43 -08:00
Moxie Marlinspike
baaa3514d4 Fix delivery receipts in group messages.
Fixes #2056
Fixes #2067
Fixes #2087
2014-11-12 15:42:43 -08:00
Moxie Marlinspike
fb31319e52 Put everything under either internal or api. 2014-11-12 15:42:43 -08:00
Moxie Marlinspike
08ed90c5ec Split out Util functions. 2014-11-12 15:42:43 -08:00
Moxie Marlinspike
0d102f76cc Move ListenableFutureTask up to parent. 2014-11-12 15:38:23 -08:00
Moxie Marlinspike
601e233d47 Add account management interface to libtextsecure api 2014-11-12 15:28:08 -08:00
Moxie Marlinspike
cafe03a70a Transition the outbound pipeline to JobManager jobs. 2014-11-12 15:26:25 -08:00
Moxie Marlinspike
99f42e2ee1 Move API around. 2014-11-12 15:21:32 -08:00
Moxie Marlinspike
a3f1d9cdfd Beginning of libtextsecure refactor.
1) Break out appropriate components.

2) Switch the incoming pipeline from SendReceiveService to
   the JobManager.
2014-11-12 15:21:32 -08:00
Jake McGinty
ff2ac8a66e refactor ListenableFutureTask and make saves async
// FREEBIE
2014-10-28 02:25:41 -05:00
Jake McGinty
53da1f849a in-app image media preview
// FREEBIE
2014-10-28 00:50:01 -05:00
Moxie Marlinspike
9768de2d5e Short circuit self-send.
// FREEBIE
2014-10-22 18:28:03 -07:00
Moxie Marlinspike
b568ce70b2 Make delivery receipts work correctly for groups. 2014-10-20 21:06:34 -07:00
Moxie Marlinspike
73d896f378 Index shouldn't be unique. 2014-10-20 19:02:42 -07:00
Moxie Marlinspike
36ec1d84a1 Implement delivery receipts.
1) Support a "receipt" push message type.

2) Identify messages by timestamp.

3) Introduce a JobManager to handle the queue for network
   dependent jobs.
2014-10-20 19:02:42 -07:00
Moxie Marlinspike
819982af7b Rearrange decrypt API.
1) Change SessionBuilder to only establish sessions via
   KeyExchangeMessage and PreKeyBundles.

2) Change SessionCipher to decrypt either WhisperMessage
   or PreKeyWhisperMessage items, automatically building
   a session for the latter.

3) Change SessionCipher to tear down new sessions built
   with PreKeyWhisperMessages if the embedded WhsiperMessage
   fails to decrypt.
2014-10-20 12:25:38 -07:00
Moxie Marlinspike
14b8f97de2 Reorganize session store load/store operations. 2014-10-20 12:14:17 -07:00
Moxie Marlinspike
d902c12941 Break core ratchet out into libaxolotol.
1) Break the core cryptography functions out into libaxolotol.

2) The objective for this code is a Java library that isn't
   dependent on any Android functions.  However, while the
   code has been separated from any Android functionality,
   it is still an 'android library project' because of the
   JNI.
2014-10-20 12:10:02 -07:00
Jake McGinty
b5941fb3fd actually fallback when mms local params unset
// FREEBIE
2014-10-15 17:14:12 -07:00
Jake McGinty
89fb80fcc5 MmsConnection refactor
- Use Apache HttpClient v4.x, only library that seems to like HTTP proxies
- Remove custom redirect logic in favor of library's

Fixes #1904
// FREEBIE
2014-10-13 12:26:38 -07:00
Jake McGinty
7316f17674 don't crash if we can't get an mccmnc
Fixes #1916
// FREEBIE
2014-09-14 17:46:07 -07:00
Jake McGinty
a0842f329f disable localized collators in ApnDB
// FREEBIE
2014-08-20 13:41:59 -07:00
Jake McGinty
9b495d8c83 prevent another cursor leak
// FREEBIE
2014-08-20 12:29:40 -07:00
Moxie Marlinspike
5264ebed67 Avoid leaking cursor.
// FREEBIE

Closes #1838
2014-08-20 10:36:39 -07:00
Jake McGinty
7f51f9fd5b apntool and ApnDatabase
// FREEBIE
2014-08-20 10:36:39 -07:00
McLoo
acc7c4c1c6 Null check for cipher text to prevent NPE on decryption
Fixes #1703
Closes #1728
// FREEBIE
2014-07-26 23:02:11 -07:00
Moxie Marlinspike
40698212bb Create a Curve25519 asymmetric master secret for users without.
Fixes #1701
2014-07-18 22:16:12 -07:00
Jake McGinty
f6e04d0f89 use latest android number as recipient number
Fixes #791
// FREEBIE
2014-07-14 16:22:15 -07:00
McLoo
d429f9113b Replace XML serializer in plaintext export
Fixes #342

- using regex pattern/matcher to escape chars below 0x0020 and
  above 0xd7ff
- using String.Replace to escape XML entities
- changed XmlPullParser from Xml.newPullParser() to
  XmlPullParserFactory parser to fix import on GB
2014-06-24 13:02:36 -07:00
Jake McGinty
34e147838a use apply for preferences instead of commit
// FREEBIE
2014-06-12 14:45:51 -07:00
Moxie Marlinspike
d51adab76b Use "date sent" as timestamp for push, "date received" for SMS.
The "sent time" is not reliable on SMS messages.  This switches
to using "sent time" by default for push messages, but "received
time" for SMS messages.
2014-06-12 08:59:54 -07:00
Moxie Marlinspike
c719a48a2c Move media attachment long-click event to context menu.
Long-click on a media attachment will now bring up the normal
context menu for a ConversationItem long-click, but with the
addition of a "save attachment" option.

This allows users to long-click on messages with media in them
and still see the other contextual menu options.

// FREEBIE
2014-06-11 18:04:14 -07:00
Moxie Marlinspike
68747142d6 Add correct contextual menu options on 'Send' button.
[Send TextSecure message | Send unencrypted SMS | Send encrypted SMS]

// FREEBIE
2014-06-11 15:34:01 -07:00
Moxie Marlinspike
0574ec170a Display legacy message error when V1 message is received. 2014-04-16 11:47:51 -07:00
Moxie Marlinspike
1d07ca3e6f Remove V1 code. 2014-04-16 11:47:51 -07:00
Jake McGinty
b715debefc mark auto-fallback to sms as forcedSms
// FREEBIE
2014-04-10 10:50:35 -07:00
Jake McGinty
832763f695 UX for unencrypted fallback case 2014-04-02 22:10:51 -07:00
Moxie Marlinspike
fd1a18d2d0 Don't display duplicate push messages. 2014-04-02 22:10:50 -07:00
Moxie Marlinspike
b860aeff85 Minor ConversationList scrolling optimization. 2014-03-16 14:36:21 -07:00
Jake McGinty
d827ab1b36 more precise sms controls
// FREEBIE
2014-03-13 20:59:20 -07:00
Pat McLaughlin
d229a4274c Also check cc for duplicates 2014-03-12 20:49:55 -04:00
Moxie Marlinspike
0b4fe84a41 Format-neutral compare numbers in MMS group with local device.
Closes #1018
2014-03-07 13:05:35 -08:00
Moxie Marlinspike
3b25b87aa8 Fix for NPE 2014-02-26 12:42:16 -08:00
Moxie Marlinspike
43c1576aab Fix for bad database migration. 2014-02-24 17:00:52 -08:00
Moxie Marlinspike
5000957b99 Listen for group updates, fix group updates, and Recipient marshing 2014-02-24 00:19:54 -08:00
Jake McGinty
86b3de2a93 group updates do things
// FREEBIE
2014-02-23 21:18:08 -08:00
Moxie Marlinspike
315cf2d8e4 Eliminate concept of group 'owner'. 2014-02-22 11:29:28 -08:00
Moxie Marlinspike
da57a689c1 Fill in some strings.
// FREEBIE
2014-02-22 11:10:30 -08:00
Moxie Marlinspike
9c9866e7ee Add 'leave group' functionality. Includes other bug fixes. 2014-02-22 10:54:43 -08:00
Moxie Marlinspike
a6e1d56cde Refactor group messaging protocol.
// FREEBIE
2014-02-21 17:51:52 -08:00
Jake McGinty
7beab36c6a updates to conversation menu, and updating of group info
// FREEBIE
2014-02-21 11:33:31 -08:00
Moxie Marlinspike
ccd1691b22 Make 'push' status a type bit on both incoming and outgoing msgs. 2014-02-20 23:00:38 -08:00
Moxie Marlinspike
3ca25de034 Fix for MMS decoding when no SIM is available. 2014-02-20 17:32:01 -08:00
Moxie Marlinspike
ff238a1ce9 Indicate a message was delivered via push in its delivery status. 2014-02-20 16:14:58 -08:00
Moxie Marlinspike
9614dc9055 Refactor group database model and flow.
1) Use existing DB types instead of adding new columns.

2) Store group attributes in message body, like everything else.
2014-02-19 21:07:47 -08:00
Moxie Marlinspike
19dddd7adf Support for an 'end session' protocol message.
1) On the push side, this message is a flag in PushMessageContent.
   Any secure message with that flag will terminate the current
   sessin.

2) On the SMS side, there is an "end session" wire type and
   the convention that a message with this wire type must be
   secure and contain the string "TERMINATE."
2014-02-19 13:50:32 -08:00
Jake McGinty
e15ff6193f unbreak group insertion for new installs 2014-02-17 20:10:37 -08:00
Moxie Marlinspike
b9f4fba98a Handle identity key mismatch on outgoing group messages.
Additionally, make the group creation process asynchronous.
2014-02-17 11:43:37 -08:00
Moxie Marlinspike
e7e5bc0884 Verify identity keys on outgoing messages.
If PreKeyEntity identity key doesn't match local DB, fail
outgoing message and queue "incoming" identity key update
message for manual user approval.
2014-02-16 15:23:49 -08:00
Moxie Marlinspike
4e703d5a00 Correct retry logic for SMS JB+ and for push groups. 2014-02-15 18:31:25 -08:00
Moxie Marlinspike
a305bb80e6 Correctly display group members 2014-02-15 11:30:20 -08:00
Moxie Marlinspike
2f98622948 Fix group migration. 2014-02-14 16:18:18 -08:00
Moxie Marlinspike
067799be06 Display group actions and correctly handle group delivery. 2014-02-14 15:59:57 -08:00
Moxie Marlinspike
7c46f3cbf8 Fill in group creation actions 2014-02-13 17:10:20 -08:00
Moxie Marlinspike
0ace469d74 Support for multi-device.
1) In addition to the Recipient interface, there is now
   RecipientDevice.  A Recipient can have multiple corresponding
   RecipientDevices.  All addressing is done to a Recipient, but
   crypto sessions and transport delivery are done to
   RecipientDevice.

2) The Push transport handles the discovery and session setup
   of additional Recipient devices.

3) Some internal rejiggering of Groups.
2014-02-02 19:38:06 -08:00
Moxie Marlinspike
49daa45dca wip 2014-01-14 00:26:43 -08:00
Jake McGinty
28c1c5006b icon, contact list and conversation redesign 2014-01-09 19:06:41 -10:00
Moxie Marlinspike
dde2d2564a Fix rebase errors 2014-01-06 19:49:35 -08:00
Moxie Marlinspike
44092a3eff Support for Axolotl protocol.
1) Split code into v1 and v2 message paths.

2) Do the Axolotl protocol for v2.

3) Switch all v2 entities to protobuf.
2014-01-06 14:37:52 -08:00
Moxie Marlinspike
4380b46a35 Correctly update MMS security status. 2014-01-06 14:37:51 -08:00
Moxie Marlinspike
fde8d32848 Subtle rebase conflicts... 2014-01-06 14:37:51 -08:00
Moxie Marlinspike
dadabdfaa8 Make UI responsive to UniversalTransport upgrades. 2014-01-06 14:36:23 -08:00
Moxie Marlinspike
c38a8aa699 Migrate to Curve25519.
1) Generate a Curve25519 identity key.

2) Use Curve25519 ephemerals and identities for v2 3DHE agreements.

3) Initiate v2 key exchange messages.

4) Accept v1 key exchange messages.

5) TOFU Curve25519 identities.
2014-01-06 14:36:22 -08:00
Moxie Marlinspike
073b1f69e3 Rollbacks, v2 sms-transport key exchanges, push identity conflicts.
1) Stop protocol rollbacks.

2) Handle v2 version key exchange messages.

3) Handle identity key conflicts on prekeybundle messages.
2014-01-06 14:35:53 -08:00
Moxie Marlinspike
5e6d39beea Move classes into library 2014-01-06 14:35:53 -08:00
Moxie Marlinspike
8f6590b738 Handle notifications and receiving push when locked. 2014-01-06 14:35:53 -08:00
Moxie Marlinspike
0dd36c64a4 Basic support for encrypted push-based attachments.
1) Move the attachment structures into the encrypted message body.

2) Encrypt attachments with symmetric keys transmitted in the
   encryptd attachment pointer structure.

3) Correctly handle asynchronous decryption and categorization of
   encrypted push messages.

TODO: Correct notification process and network/interruption
      retries.
2014-01-06 14:35:53 -08:00
Moxie Marlinspike
7f642666dd Basic support for prekeybundle message delivery and receipt. 2014-01-06 14:35:52 -08:00
Moxie Marlinspike
b8f663b69c Move common crypto classes into TextSecureLibrary.
1) Move all the crypto classes from securesms.crypto.

2) Move all the crypto storage from securesms.database.keys

3) Replace the old imported BC code with spongycastle.
2014-01-06 14:35:51 -08:00
Moxie Marlinspike
2042ca6cb7 Generate "prekeys" at push registration time.
This generates a large number of key exchange messages and
registers them with the server during signup.
2014-01-06 14:34:47 -08:00
Moxie Marlinspike
9287d413ac Support for incoming attachments.
1) Refactored MMS layer to use abstracted types.

2) Added support for retrieving attachment IDs.
2014-01-06 14:33:52 -08:00
Moxie Marlinspike
fd045f2354 Refactor MMS send/download to be synchronous.
1) Make the radio change a synchronous action with a timeout.

2) Move the send logic into an MmsTransport, in preparation for
   UniversalTransport composition.

3) Move the download logic into a synchronous receiver.
2014-01-06 14:33:52 -08:00
Moxie Marlinspike
1ac06312a0 Move directory and push service socket into library. 2014-01-06 14:21:50 -08:00
Moxie Marlinspike
a200d29514 Move most of Util into library 2014-01-06 14:21:50 -08:00
Moxie Marlinspike
21eee19380 Split into library project and add shared preferences layer of indirection. 2014-01-06 14:20:59 -08:00
Moxie Marlinspike
7489f3463a Change the way notifications work for non-default KitKat.
Messages that are not "secure" (encrypted or key exchange) are
automatically marked as read if TextSecure isn't the default
KitKat SMS app.

This change in functionality allows people who aren't using
TextSecure as a default SMS app on KitKat to still receive
notifications when they get incoming encrypted messages.
2013-12-07 11:03:25 -08:00
rhodey
2c2a03e5e2 Enhanced MMS configuration prompts and processing.
1) Added a new message status to MmsDatabase to
   signify a pending MMS download which requires
   APN settings.

2) Added a database method to query MMS messages
   based on status.

3) Added login to SendReceiveService for processing
   of MMS pending APN information.

4) Moved all APN/MMS settings into ApnPreferencesActivity
   and transformed PromptApnActivity into a simple
   informational activity.

5) Added logic to check for APN settings on send and
   receive of all MMS (media, group, email) and direct
   user to PromptApnActivity then ApnPreferencesActivity
   if necessary.

6) Vocab/grammar adjustments.
2013-10-20 16:56:34 -07:00
Ruben Pollan
04eafd5fab Allow to resend a failed message
Add an option to the context menu of the message to resend it if it has
failed.
2013-10-13 15:39:15 +02:00
Moxie Marlinspike
aa25f94291 Enhanced import/export support.
1) Allow imports from the stock SMS database at any time.

2) Provide plaintext export support, in a format compatible with
   the "SMS Backup And Restore" app.

3) Fix the DB weirdness on encrypted restore that previously
   required killing the app.
2013-06-24 21:02:30 -07:00
Moxie Marlinspike
0534f9d95a Fix for NPE on null FROM in MMS header. 2013-05-30 20:29:13 -07:00
Moxie Marlinspike
24fc93e9ae Switch to a more heavily TOFU model for identity keys.
1) There is no longer a concept of "verified" or "unverified."
   Only "what we saw last time" and "different from last time."

2) Let's eliminate "verify session," since we're all about
   identity keys now.

3) Mark manually processed key exchanges as processed.
2013-05-23 16:36:24 -07:00
Moxie Marlinspike
e080449383 Fix for NPE on import 2013-05-21 13:25:44 -07:00
Moxie Marlinspike
3df67a1643 Properly return unknown recipient from SMS db on empty. 2013-05-21 10:23:27 -07:00
Moxie Marlinspike
be34f30719 Lower maximum size of cursor window on DB upgrade.
On some systems, the DB upgrade was failing because there were
too many rows for the cursor window.  This moves some looping
operations into single update statements by using the substr()
command, and chunks the rest using a series of LIMITs.
2013-05-16 13:16:42 -07:00
Moxie Marlinspike
ad6760b62c Correctly handle deferred processing of key exchange message when locked. 2013-05-15 14:09:13 -07:00
Moxie Marlinspike
ef554ed265 Remove leaky logging. 2013-05-10 09:01:33 -07:00
Moxie Marlinspike
1aa84b145f Add 'mark all as read' option 2013-05-06 13:59:40 -07:00