Commit graph

513 commits

Author SHA1 Message Date
Moxie Marlinspike
71664926e9 Better handling for unregistered users on outgoing message. 2014-01-06 14:38:41 -08:00
Moxie Marlinspike
d4188c4a1c SHA256 attachment MACs. 2014-01-06 14:38:14 -08:00
Moxie Marlinspike
f002072f38 New attachment API 2014-01-06 14:38:14 -08:00
Moxie Marlinspike
327ee4ff62 Remove unnecessary classes, up prekey limit to 100 2014-01-06 14:38:14 -08:00
Moxie Marlinspike
1ab4e7e9de Library accepts push connection certificate as argument. 2014-01-06 14:38:14 -08:00
Moxie Marlinspike
ce5f3c5157 Validate phone numbers when formatting. 2014-01-06 14:37:52 -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
dc73bc2a5c Having calling code specify push URL to library. 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
dbc070cd65 Refactor the ciphertext message parsing and building. 2014-01-06 14:36:22 -08:00
Moxie Marlinspike
44d59d0fd1 Correctly store destination SMS state. 2014-01-06 14:36:21 -08:00
Moxie Marlinspike
51b9affe90 Add federation support for attachment retrieval. 2014-01-06 14:36:21 -08:00
Moxie Marlinspike
246cd10454 Bundle e164 and relay into PushDestination 2014-01-06 14:36:21 -08:00
Moxie Marlinspike
ca3c82f581 Simply PushServiceSocket constructor. 2014-01-06 14:36:21 -08:00
Moxie Marlinspike
5b2caa0074 Make relay arguments consistent. 2014-01-06 14:36:21 -08:00
Moxie Marlinspike
fa5ccc3f8a Support for server federation. 2014-01-06 14:35:54 -08:00
Moxie Marlinspike
25a2ad7289 Add directory refreshing at 24hr intervals. 2014-01-06 14:35:54 -08:00
Moxie Marlinspike
eb4cc7f4e5 Add incoming message sources to active token dir. 2014-01-06 14:35:54 -08:00
Moxie Marlinspike
1ac32346c1 Graduate to a rebased and gradle world. 2014-01-06 14:35:54 -08:00
Moxie Marlinspike
2d083208cc Handle negative directory case and unlisted contacts. 2014-01-06 14:35:54 -08:00
Moxie Marlinspike
75cca3add1 Resign ourselves to a less sophisticated contact intersection method. 2014-01-06 14:35:53 -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
cddba2738f Make encoding/decoding more explicit. 2014-01-06 14:35:53 -08:00
Moxie Marlinspike
0cc5837d7f Support encrypted transport, properly handle multiple recipients.
1) Add encryption support for the transport layer.  This obscures
   metadata from the push messaging provider.

2) Better support the direction multiple destination messages is
   headed (one unique message per recipient).
2014-01-06 14:35:53 -08:00
Moxie Marlinspike
68ec0a3727 Add last resort key and signaling key. 2014-01-06 14:35:53 -08:00
Moxie Marlinspike
45e380a5bb move constants into library 2014-01-06 14:35:52 -08:00
Moxie Marlinspike
1bbcedabd4 Added SMS transport support for PreKeyBundle messages.
1) Added SMS transport support.

2) Keep track of whether a PreKeyBundle message has gotten
   a response, and send them as subsequent messages until
   one has been received.
2014-01-06 14:35:52 -08:00
Moxie Marlinspike
c3b8b62d32 Delete pre-key record when establishing agreement. 2014-01-06 14:35:52 -08:00
Moxie Marlinspike
43492b66c4 Rename EncryptedMessage 2014-01-06 14:35:52 -08:00
Moxie Marlinspike
7f642666dd Basic support for prekeybundle message delivery and receipt. 2014-01-06 14:35:52 -08:00
Moxie Marlinspike
1cc2762656 Refactor relationship between SessionCipher and Message. 2014-01-06 14:35:52 -08:00
Moxie Marlinspike
d1969412fb Move PreKey ids to be Mediums, generate in circular buffer. 2014-01-06 14:35:51 -08:00
Moxie Marlinspike
edb89ee3e9 Encode prekey as full JSON rather than protobuf blobs.
1) Split prekey messages out into full JSON.

2) Add support for retrieving prekeys.
2014-01-06 14:35:51 -08:00
Moxie Marlinspike
499de2d2bf Move prekey jsonifcation into the push code, add identity key. 2014-01-06 14:35:51 -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
cfb7b8fcba Consider unregistered if authorization fails.
This should only occur if another device has registered with the
same number, effectively making the current device unregistered.
2014-01-06 14:34:46 -08:00
Moxie Marlinspike
03ff55db97 Actually set the preference to unregistered 2014-01-06 14:33:53 -08:00
Moxie Marlinspike
fb378a6e00 Change attachment retrieval interface 2014-01-06 14:33:53 -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
4bb337a3a0 Revised support for outgoing attachments 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
53803630d4 Enable TextSecure universal transport. 2014-01-06 14:33:52 -08:00
Moxie Marlinspike
d7070e7ecf Inserted the Registration activity into initial setup flow.
1) Added push messaging toggle to preferences.

2) Added push messaging registration screen to setup flow.

3) Migrated rest of SharedPreferences accessors to
   TextSecurePreferences.
2014-01-06 14:30:03 -08:00
Moxie Marlinspike
52e5274a2f Add registration notification support. 2014-01-06 14:21:51 -08:00
Moxie Marlinspike
0ed9da9a2c Strings and slight cleanup 2014-01-06 14:21:50 -08:00
Moxie Marlinspike
26dadfcb7a Move trust store to raw resource from asset. 2014-01-06 14:21:50 -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
0958c30400 Stringify 2014-01-06 14:19:06 -08:00
Moxie Marlinspike
3634ba0b55 Registration with voice verification. 2014-01-06 14:18:30 -08:00
Veeti Paananen
eb1b762a76 Improve password caching notification UI & UX
On Jelly Bean and above:

- Use the standard notification style for a better and consistent visual
  appearance

- Use the JB notification actions API for the locking action

- Use a lower notification priority to prioritize other notifications
  over TextSecure

On ICS:

- Use the existing custom notification layout

Everywhere:

- Allow opening the app itself from the notification

- Simplify strings: don't talk about a "cached passphrase" but about the
  app being "unlocked"/"locked"
2013-12-22 04:48:39 +02:00
nicky g
a0c821f6ac set unread message count in notifications.
was not able to squash commit requesting new pull
2013-12-19 02:44:42 +05:30
Moxie Marlinspike
d260cdcc9f Add giffgaff APN defaults. // FREEBIE 2013-12-17 16:57:40 -08:00
Moxie Marlinspike
496d5e21d2 Add Slovenia APN defaults 2013-12-17 16:53:35 -08:00
Veeti Paananen
6eb094c87e Show LED and ringtone setting values in their summaries
As instructed in the Android design guidelines. Also removed unnatural
capitalization.
2013-12-17 03:13:22 +02:00
Veeti Paananen
f18324e2d6 Add tab swiping in the contact picker 2013-12-16 22:17:52 +02:00
Andy Irving
91b52bed18 Don't stick thread IDs in the Intent extra data. Always mark all threads read from notification. 2013-12-14 16:55:24 +00:00
Moxie Marlinspike
7c2fb74af4 Fix for bug that could drop unencrypted MMS on KitKat. 2013-12-07 11:03:26 -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
Andy Irving
7f44b029fe use PendingIntent.FLAG_UPDATE_CURRENT in calls to PendingIntent.getActivity() to avoid re-using the same extra data on every intent. 2013-12-03 21:48:16 +00:00
Moxie Marlinspike
c2b809c7c6 Fix for long multipart message bug on some ROMs. 2013-12-03 08:21:31 -08:00
Moxie Marlinspike
e0aa7fd359 Let unencrypted messages through. 2013-12-03 08:10:58 -08:00
Veeti Paananen
10580a7f20 Fix crash when no SMS package is set 2013-12-03 09:06:16 +02:00
Moxie Marlinspike
aad82e314d Fix duplicate MMS bug in KitKat.
1) Fix for typo that caused duplicate incoming MMS.

2) Only pay attention to "use for all" properties in < KitKat.
2013-12-02 21:39:09 -08:00
Moxie Marlinspike
fda01796ab Merge pull request #421 from wsot/master
Fix issue #410: DecryptingPartInputStream could return more data than re...
2013-12-02 12:43:23 -08:00
Moxie Marlinspike
b0216e1494 Finish KitKat compatibility details.
1) The system does actually enforce having a BROADCAST_SMS
   permission on the SMS receiver. Break out the "delivered"
   parts of this into a separate Receiver, so the permission
   won't trip up GB devices.

2) The system does actually enforce having "quick response"
   intents.  Add a no-op for now.

3) Add a "make default" prompt.

4) Update settings to reflect what's going on in KitKat.
2013-12-02 12:31:59 -08:00
Gabe Conradi
e81756f443 Proper SMS support for KitKat. 2013-12-02 08:32:34 -08:00
Simeon Morgan
4931d7327b Switch to two-space indentation, remove inline comments. 2013-11-14 17:53:38 +11:00
Simeon Morgan
adfa3c1b10 Optimised use of buffers when decrypting to avoid unnecessary array copying properly. 2013-11-12 13:37:57 +11:00
Simeon Morgan
3cc6344c8b Optimised use of buffers when decrypting to avoid unnecessary array copying 2013-11-12 13:31:30 +11:00
Simeon Morgan
546dd5485c Fix issue #410: DecryptingPartInputStream could return more data than requested, causing segfaults in BitmapFactory on Android 4.4. 2013-11-12 12:57:47 +11:00
Moxie Marlinspike
73bf21602a Move ReceiveKeyActivity back to themed dialog activity. 2013-10-20 19:12:53 -07:00
Moxie Marlinspike
798e3c0656 Merge pull request #384 from meskio/383_batch_selection
Add deselect to batch selection mode
2013-10-20 16:59:41 -07:00
Moxie Marlinspike
891e3aeb97 Merge pull request #381 from meskio/add_contact
New 'add contact info' option on the conversation contextual menu
2013-10-20 16:58:58 -07: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
c7b39eca11 Add deselect to batch selection mode 2013-10-20 18:25:01 +02:00
Ruben Pollan
3d690faff0 New 'add contact info' option on the conversation contextual menu
This option is used to add phone numbers from the contact list on the
messages.
2013-10-17 02:28:36 +02:00
Moxie Marlinspike
f3fdde6040 Merge pull request #376 from meskio/extension_saving_attachment
Set the right extension on saving an attachment
2013-10-15 07:35:14 -07:00
Moxie Marlinspike
f49c62793b Merge pull request #377 from meskio/resend_message_on_fail2
Allow to resend a failed message
2013-10-15 06:32:12 -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
Ruben Pollan
73b1e3f3d4 Set the right extension on saving an attachment 2013-10-13 14:45:04 +02:00
Moxie Marlinspike
8d115562f0 Merge branch 'master' of github.com:WhisperSystems/TextSecure 2013-10-13 04:07:45 -07:00
Moxie Marlinspike
f26b9070f2 Update PRNG fix code sample.
Google updated their code sample to account for restrictive
SELinux configurations on some devices.
2013-10-13 04:06:58 -07:00
Moxie Marlinspike
2cbc4d3b0a Merge pull request #372 from meskio/key_notification
Upgrade notification KeyCachingService code to use NotificationCompat.Builder
2013-10-12 09:20:48 -07:00
Moxie Marlinspike
ee8c8530bf Merge pull request #373 from d3sre/issues-273
Issues 273
2013-10-12 09:17:51 -07:00
Moxie Marlinspike
763e4b1b27 Merge pull request #367 from nikolai-r/master
add option to disable audible inthread notifications
2013-10-12 09:15:54 -07:00
Desiree Sacher
4f49216103 corrected class info of NullPointerException messages 2013-10-12 15:32:45 +02:00
Desiree Sacher
ed4c8cd799 extended log of encrypted and plaintext messages NullPointerException 2013-10-12 15:29:03 +02:00
Ruben Pollan
4826dbcc34 Upgrade notification KeyCachingService code to NotificationCompat.Builder 2013-10-12 15:04:16 +02:00
Nikolai Rusakov
2cf7f82f07 closes #367 - add option to disable audible inthread notifications 2013-10-11 22:19:35 +00:00
Moxie Marlinspike
1c8f8666ba Make the switch to gradle!
1) ABS is now published as an AAR, so we can eliminate all local
   dependencies and bundled jars.

2) Upgrade to ABS 4.4.0 (The Last Release) and deal with the loss
   of Sherlock.Dialog by faking it with our own themes.

3) Remove all traces of ant. The modern world is here.
2013-10-10 13:52:24 -07:00
joshua stein
99e3e596bb Correctly preserve MMS image aspect ratios. 2013-10-10 01:43:48 -07:00
Steve R
45f4faaf4c Fix for timeout interval bug
Regardless of which theme is used, the text color for the timeout
  interval was being set to black. This made it difficult to
  read when using the Dark Theme.
2013-08-23 00:05:19 -04:00
Moxie Marlinspike
b14d9d84ad Fix for Android PRNG bug.
There is apparently an Android vulnerability with the PRNG it
provides through the JCE. This uses their suggested code to patch
the PRNG, and provides the option to regenerate identity keys.

http://android-developers.blogspot.com/2013/08/some-securerandom-thoughts.html
2013-08-15 11:27:14 -07:00
Moxie Marlinspike
8281ef18d4 Fix for ShortBufferException problem introduced in Android 4.3
Not really sure how it's possible for the system to give us an
extra block of data, but it does if both the input and output
buffers are sized the same during the first decrypt.  This
fixes things, but I wish I better understood why it was broken.
2013-08-10 09:09:00 -07:00
Moxie Marlinspike
7bd520cb41 Fix for batch selection bug 2013-07-22 15:30:12 -07:00
Moxie Marlinspike
7d07d56fc3 Fix for 'bad encrypted message' errors.
1) There was a regression in the outgoing multipart transport
   logic, such that the same 'identifier' byte would be used
   for all messages (0).  This now works correctly.

2) Added some additional heuristics on the receiving side.
   Now mutlipart containers are only valid for 1hr, and are
   considered invalid if the container size is different from
   the multipart message size.
2013-07-22 15:04:31 -07:00
Moxie Marlinspike
4281df7a28 display emoji correctly on devices of all densities 2013-07-15 17:33:30 -07:00
Moxie Marlinspike
c827f0a2a7 Merge pull request #249 from joeykrim/patch-1
Small clarification in the comments on the types of SMS to ignore
2013-07-14 11:33:23 -07:00
joeykrim
8464bc775a Removed extra comparisons by converting original phrase to uppercase, then comparing
Removed previous multiple comparisons that were variations of capitalizing the same phrase by converting the original phrase to all uppercase and then comparing
2013-07-13 16:41:09 -04:00
joeykrim
c89cac8785 Changed new Thread() to use new AsyncTask()
Changed new Thread() to use new AsyncTask() - same as was done in src/org/thoughtcrime/securesms/service/KeyCachingService.java - d97252d8d6
2013-07-12 22:40:14 -04:00
Moxie Marlinspike
dfa710a6fc Don't use ConnectivityManager checkRouteToHost for IPv6
T-Mobile LTE now uses IPv6 addresses for their MMSC, which are
incompatible with ConnectivityManager's checkRouteToHost.
2013-07-12 15:25:34 -07:00
joeykrim
87e8214bae Small clarification in the comments on the types of SMS to ignore 2013-07-08 10:16:25 -04:00
Moxie Marlinspike
d97252d8d6 Add ability to disable local encryption passphrase. 2013-07-01 10:15:36 -07:00
Moxie Marlinspike
68b82c168e Add in-app language selection support. 2013-06-29 18:03:55 -07:00
Moxie Marlinspike
4977092f7a Add support for soft keyboard 'enter' key. 2013-06-29 15:37:47 -07:00
Moxie Marlinspike
93c222fe9c Added "recent emoji" panel as an LRU cache. 2013-06-29 09:51:08 -07:00
Moxie Marlinspike
71e161c792 Switched to new emoji lookup pattern, added rendering support. 2013-06-28 16:56:30 -07:00
Moxie Marlinspike
2e31cfed11 Basic support for composing emoji 2013-06-27 20:57:27 -07:00
Moxie Marlinspike
288b416988 Fix NPEs 2013-06-25 13:20:29 -07:00
Moxie Marlinspike
e00914c977 Fix QR Code Regression. 2013-06-25 10:48:18 -07: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
903ab92f5f Basic navigation drawer support. 2013-06-22 21:44:12 -07:00
Moxie Marlinspike
5263ac1f1a Theme Support
1) Broke out the UI elements of the major Activites into stylable
   attributes.

2) Created a 'light' and 'dark' theme for the newly stylable attrs.

3) Touched up some of the UI spacing.

4) Implemented dynamic theme switching support.
2013-06-21 12:14:40 -07:00
Moxie Marlinspike
2928abc98f Catch attempts to dial on devices with no dialer. 2013-06-18 16:43:41 -07:00
Moxie Marlinspike
8524cc5598 Resolved a few MMS issues.
1) Fixed the "Unsupported Encoding!" problem.

2) Workaround for the Sprint issue, where the MMSC is adding a single
   extra byte to the end of each encrypted message.

3) Fixed the "large blob of base64 text" on encrypted MMS problem.
2013-06-15 09:06:15 -07:00
Moxie Marlinspike
d2a78ea84c Fix for contrived NPE on invalid recipient during conversation compose. 2013-06-01 12:42:45 -07:00
Moxie Marlinspike
ad1d927437 Fix for NPE when group selection fragment is no longer attached to activity. 2013-05-30 20:35:56 -07:00
Moxie Marlinspike
0534f9d95a Fix for NPE on null FROM in MMS header. 2013-05-30 20:29:13 -07:00
Moxie Marlinspike
dda5bc8838 Add a 'mark as read' button to expanded notifications. 2013-05-30 12:39:56 -07:00
Moxie Marlinspike
8c1ca6c9e0 Clean up identity key view activity 2013-05-23 18:54:16 -07:00
Moxie Marlinspike
95eb62190a Remove checkboxes from the multi-select UI 2013-05-23 18:37:04 -07:00
Moxie Marlinspike
3743c57edd Clean up list of identity keys. 2013-05-23 17:47:42 -07:00
Moxie Marlinspike
5e2b31af60 Add appropriate text for manual case when identity is trusted. 2013-05-23 17:17:28 -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
a0a6c3f211 Handle failed bitmap decoding 2013-05-21 10:32:48 -07:00
Moxie Marlinspike
3df67a1643 Properly return unknown recipient from SMS db on empty. 2013-05-21 10:23:27 -07:00
Moxie Marlinspike
b99cca8bfa Fix for NPE on failed icon click. 2013-05-17 12:53:16 -07:00
Moxie Marlinspike
c86e414c5f Include (somehow missed) support for send/receive encrypted MMS. 2013-05-16 13:48:44 -07:00
Moxie Marlinspike
e5f634ba45 Fix for NPE 2013-05-16 13:18:06 -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
3d49e90779 Add Virgin Mobile US to ApnDefaults. 2013-05-10 09:57:09 -07:00
Moxie Marlinspike
ef554ed265 Remove leaky logging. 2013-05-10 09:01:33 -07:00
Moxie Marlinspike
5c8fa148ca Limit UniversalTransport to SMS for now. 2013-05-07 18:25:36 -07:00
Moxie Marlinspike
5d910a2997 Store last seen application version number at install time. 2013-05-07 16:31:11 -07:00
Moxie Marlinspike
e07c1a8e92 Handle failed MMS connectivity state appropriately. 2013-05-07 15:09:24 -07:00
Moxie Marlinspike
43214a854c Fix for IllegalArgumentException with null URL host. 2013-05-06 19:45:05 -07:00
Moxie Marlinspike
ff41c6763d Fix for detached illegalstateexception 2013-05-06 19:33:31 -07:00
Moxie Marlinspike
6fedc6b737 Fix for double-click NPE? 2013-05-06 19:27:09 -07:00
Moxie Marlinspike
7090ca4a42 Don't remote-encrypt key exchange messages 2013-05-06 19:09:36 -07:00
Moxie Marlinspike
81107a98eb Send m-notifyresp-ind after retrieving MMS 2013-05-06 19:09:06 -07:00
Moxie Marlinspike
a057b628eb Added Rogers APN defaults 2013-05-06 14:18:34 -07:00
Moxie Marlinspike
01658cc454 Fix for notification preference regression 2013-05-06 14:07:28 -07:00
Moxie Marlinspike
1aa84b145f Add 'mark all as read' option 2013-05-06 13:59:40 -07:00
Moxie Marlinspike
b1b9846971 merge liliakai-settings 2013-05-06 12:48:16 -07:00
Moxie Marlinspike
c35aa09806 Filter MMS weirdness 2013-05-06 12:33:42 -07:00
Moxie Marlinspike
50fae64330 Replace LinkedHashMap with a SoftReference LRUCache. Add Slide cache. 2013-05-06 12:22:03 -07:00
Moxie Marlinspike
a362c8755a Don't check for auto-initiation on group threads. 2013-05-06 08:40:56 -07:00
Moxie Marlinspike
0b172cebce Use DB sending type rather than in-memory hashtable. 2013-05-06 08:40:56 -07:00
Moxie Marlinspike
79c554fcc7 Fixed group in-thread notifications 2013-05-06 08:40:56 -07:00
Moxie Marlinspike
723fb4ffdd MMS and Group Messaging Improvements
1) Display the individual sender name in a group conversation.

2) Add an "address" column to MmsDatabase and keep FROM there.

3) Remove all blocking operations from MmsDatabase.Reader path.

4) Strip SMIL and other undisplayable parts from part count.

5) Fix places where messages weren't being correctly decrypted.
2013-05-06 08:40:55 -07:00
Moxie Marlinspike
2305a648fb Minor refactoring 2013-05-06 08:40:55 -07:00
Moxie Marlinspike
e80882b83b Locally encrypted messages no longer show as ciphertext notifications. 2013-05-06 08:40:55 -07:00
Moxie Marlinspike
7c47ea5cec Make MMS more asynchronous and consistent with new SMS types.
1) We now delay MMS notifications until a payload is received,
   or there's an error downloading the payload.  This makes
   group messages more consistent.

2) All "text" parts of an MMS are combined into a second text
   record, which is stored in the MMS row directly rather than
   as a distinct part.  This allows for immediate text loading,
   which means there's no chance a ConversationItem will resize.

   To do this, we need to include MMS in the big DB migration
   that's already staged for this application update.  It's also
   an "application-level" migration, because we need the MasterSecret
   to do it.

3) On conversation display, all image-based parts now have their
   thumbnails loaded asynchronously.  This allows for smooth-scrolling.
   The thumbnails are also scaled more accurately.
2013-05-06 08:40:55 -07:00
Moxie Marlinspike
dd0aecc811 First cut at group messaging refactor. 2013-05-06 08:40:55 -07:00
Moxie Marlinspike
83e260436b Major storage layer refactoring to set the stage for clean GCM.
1) We now try to hand out cursors at a minimum.  There has always been
   a fairly clean insertion layer that handles encrypting message bodies,
   but the process of decrypting message bodies has always been less than
   ideal.  Here we introduce a "Reader" interface that will decrypt message
   bodies when appropriate and return objects that encapsulate record state.

   No more MessageDisplayHelper.  The MmsSmsDatabase interface is also more
   sane.

2) We finally rid ourselves of the technical debt associated with TextSecure's
   initial usage of the default SMS DB.  In that world, we weren't able to use
   anything other than the default "Inbox, Outbox, Sent" types to describe a
   message, and had to overload the message content itself with a set of
   local "prefixes" to describe what it was (encrypted, asymetric encrypted,
   remote encrypted, a key exchange, procssed key exchange), and so on.

   This includes a major schema update that transforms the "type" field into
   a bitmask that describes everything that used to be encoded in a prefix,
   and prefixes have been completely eliminated from the system.

   No more Prefix.java

3) Refactoring of the MultipartMessageHandler code.  It's less of a mess, and
   hopefully more clear as to what's going on.

The next step is to remove what we can from SmsTransportDetails and genericize
that interface for a GCM equivalent.
2013-05-06 08:40:55 -07:00
Moxie Marlinspike
303d1acd45 Initial client support for GCM message send/receive 2013-05-06 08:40:55 -07:00
Moxie Marlinspike
2f39283da3 Initial GCM registration 2013-05-06 08:40:55 -07:00
Moxie Marlinspike
f2475491fe Fix for NPE on null encrypted MMS messages. 2013-04-23 14:49:32 -07:00
Lilia Markham
815613cfaa Reorganize settings menu
Mostly xml work, with one small hack to fix the sub menu themes, found
here: http://code.google.com/p/android/issues/detail?id=4611#c35
2013-04-08 20:16:12 -07:00
Lilia Markham
e3c5e837e1 Remove sign key exchange preference
Yet another setting that most users will never touch. Workaround for
those who would is to use a different identity key per device.

Let this be a sacrifice to the android settings design pattern gods.
2013-03-27 20:57:28 -07:00
Lilia Markham
40eca5e0f6 Remove whitespace tag preference
The vast majority of users will never uncheck this option. Those who
would can send an unencrypted untagged message through the system sms
app. It would then be stored locally in the clear, but it was already
transmitted in the clear and likely stored on the recipient's side in
the clear, so the security gains of locally encrypting are low, and
again, this seems an extremely rare edge case.

By android design pattern specs for the settings menu, we should kill
this preference.
2013-03-27 20:54:42 -07:00
Moxie Marlinspike
fcea8ebc3f Added Telenor Norway to APN Defaults 2013-03-17 11:38:44 -07:00
cavanm
8e2288205c Use APN defaults when no other APN information is available.
Provides an in-app source for APN info for use in the case that the
device store is unavailable and the user hasn't provided local
connection parameters.

Only covers T-Moble USA, AT&T, and Verizon right now. Only T-Mobile is
tested. Other carriers can be added and tested on an ongoing basis.
2013-03-17 11:31:17 -07:00
Moxie Marlinspike
fb21c09dbe Catch NPE thrown by APN provider. 2013-03-17 11:19:36 -07:00
Moxie Marlinspike
5df88cc0a7 Scrub recipients for MMS messages so they'll be valid PLMN. 2013-03-14 15:59:28 -07:00
Moxie Marlinspike
ecaaff50da Switch UA to Android default and added x-wap-profile header 2013-03-14 08:44:42 -07:00
Moxie Marlinspike
cdd6d59e6e Remove send button smart enable/disabled.
Temporarily remove this functionality, since it doesn't account for
attachments yet.
2013-03-13 17:45:32 -07:00
Jake McGinty
674cd68ebd Modern-style Android chat icons (incl. secure icon)
Make the send-button appearance more similar to the default Android
messenger application
2013-03-10 16:05:35 -07:00
Moxie Marlinspike
b05c840616 Fix for MMS send bug with an APN proxy. 2013-03-10 15:47:13 -07:00
Moxie Marlinspike
58961fe0a8 Minor spelling correction. 2013-03-10 14:50:55 -07:00
Moxie Marlinspike
bb3777aa68 Fix for viewing group recipients without contact information. 2013-03-07 17:47:57 -08:00
Moxie Marlinspike
07c59d969a Prompt user for APN details when missing.
If TextSecure is running on a device without APN details, we prompt
the user to manually specify them when the user goes to send an MMS
message.
2013-03-04 17:43:04 -08:00
Moxie Marlinspike
01fdb1115d We don't support unknown content lengths yet. 2013-03-03 18:50:13 -08:00
Moxie Marlinspike
2e55e9cdca Guard NPE 2013-03-03 18:49:55 -08:00
Moxie Marlinspike
6230abb524 Add synchronized access to cache 2013-03-03 18:49:39 -08:00
Moxie Marlinspike
ef6a5c69af Tweak MMS retrieval and submission.
1) Only attempt direct connect outside of MMS radio mode on CDMA.

2) Don't switch back to normal radio state if pending messages remain.
2013-03-03 18:44:58 -08:00
Moxie Marlinspike
48576dbb58 Catch mysterious SMS too large exception. 2013-02-26 22:57:09 -08:00
Moxie Marlinspike
5ca7b1080c Fix for concurrentmodificationexception on race condition. 2013-02-26 22:56:48 -08:00
Moxie Marlinspike
eb9b2ef318 Fix for NPE on null mms bytes. 2013-02-26 22:56:15 -08:00
Moxie Marlinspike
6bd0f35787 Sometimes querying the APN DB throws this exception as well. 2013-02-26 22:55:23 -08:00
Moxie Marlinspike
2397176d9e Search support in ConversationList for <3.0 devices.
Switch to the newly-introduced ActionBarSherlock SearchView.
2013-02-24 19:37:37 -08:00
Moxie Marlinspike
34822557a6 Catch exception triggered by bug in telephony provider during import. 2013-02-24 11:59:43 -08:00
Moxie Marlinspike
bac6b78b11 Clear passphrase field on invalid entry. 2013-02-21 14:47:18 -08:00
Moxie Marlinspike
5bf5b404a1 Fix for notification NPE on unknown sender. 2013-02-20 20:44:38 -08:00
Moxie Marlinspike
f73adfc8f5 Change MMS network request pattern.
Currently we're flipping the radio in "MMS" mode, and connecting through
any proxies specified in the APN.  This always work, or at least doesn't
seem to work on Sprint, since the configured mms proxy rejects proxy
requests.

Instead we try the following in this order:

1) Connect over normal data connection directly to MMSC.
2) Connect over MMS radio connection to MMSC.
3) Connect over MMS radio connection with any configured proxy to MMSC.

Hopefully this doesn't fuck up shit on other unknown networks.
2013-02-20 18:10:33 -08:00
Moxie Marlinspike
df05508a6f Switch to AndroidHttpClient and explicit targeting. 2013-02-20 10:25:53 -08:00
Moxie Marlinspike
1ff4fd842c Pass on incoming messages until DB is imported. 2013-02-17 15:09:01 -08:00
Moxie Marlinspike
5eb04328d3 Improve passphrase and onboarding UI. Abstract out routing.
1) Update the create, prompt, and change passphrase activities.
   They are no longer dialog themed, and should look a little
   less ugly.

2) Update the import DB activity to be less ugly and more robust.

3) Abstract all of the state handling stuff out of
   ConversationListActivity.  This is now handled by RoutingActivity,
   which all launch intents move through.
2013-02-17 15:09:01 -08:00
Moxie Marlinspike
0a7181670c Radio updates happen frequently on some phones, switch to dynamic. 2013-02-14 20:42:29 -08:00
Moxie Marlinspike
d0d85ea52c Fix for duplicate message bug. 2013-02-14 19:15:40 -08:00
Moxie Marlinspike
c2dcf7ae74 Refactor MasterSecret initialization, access, and timeout paths.
1) Consolidate all of the KeyCachingService interaction into a single
   mixin. Activities extend delegates which call through to the mixin.

2) Switch Activity increment/decrement triggers from onStop to onPause
   in order to account for some screen locks that don't stop activities.
2013-02-10 17:30:51 -08:00
Moxie Marlinspike
90280a62ae Poor man's styling. 2013-02-09 17:43:31 -08:00
Moxie Marlinspike
2277dbd572 Localize ok/cancel 2013-02-09 17:38:33 -08:00
Moxie Marlinspike
471ef16a5b Support for robust delivery.
1) If a message fails to be delivered, post a notification in the
   status bar if that thread is not active and visible.

2) If a message fails to be delivered because there is no service,
   keep retrying every time service becomes available again.
2013-02-09 15:17:55 -08:00
Moxie Marlinspike
71f43075a9 Distinguish unread threads with background color. 2013-02-09 10:03:38 -08:00
Moxie Marlinspike
0a8c62e0e3 Include incoming message body in notifications.
1) Refactor the master secret reset logic to properly interact with
   services.

2) Add support for "BigText" and "Inbox" style notifications.

3) Decrypt message bodies when unlocked, display 'encrypted' when
   locked.
2013-02-08 16:27:43 -08:00
Moxie Marlinspike
49ea135e37 Don't auto-set thread to read on send. 2013-02-06 16:40:09 -08:00
Moxie Marlinspike
a29120d911 Fix for IndexOutOfBoundException (race condition on Recipients resolution) 2013-02-04 22:09:17 -08:00
Moxie Marlinspike
b044a68168 Fix for mysterious 'anonymous sender' NPE. 2013-02-04 21:51:25 -08:00
Moxie Marlinspike
01a5c889b0 Export stray strings for localization. 2013-02-04 11:12:03 -08:00
Moxie Marlinspike
dcf73cd009 Fix for 'group message' regression. 2013-02-04 11:03:19 -08:00
Moxie Marlinspike
bf92de394b Add support for resuming compose drafts. 2013-02-04 00:13:07 -08:00
Moxie Marlinspike
209711ae40 Fix notification behavior.
1) Don't add a notification item to the notification bar if the thread the
   message is for is active and visible.

2) Only sound the notification ringtone at 1/4th volume if the thread the
   message is for is active and visible.

3) Auto-clear the notification in the notification bar when a thread becomes
   visible from a screen-off situation.

4) Make notification updates asynchronous.
2013-02-03 18:41:34 -08:00
Moxie Marlinspike
288e2b5572 Suppport receiving 'share' actions from other apps. 2013-02-02 20:37:40 -08:00
Moxie Marlinspike
232e7bba2d A conversation can't be trimmed to 0. 2013-01-14 12:10:57 -08:00
Moxie Marlinspike
fe43ef65ab Support for auto-deleting old messages beyond a certain conversation thread length. 2013-01-09 21:06:56 -08:00
Moxie Marlinspike
a185750bb7 Preserve ConversationList scroll state in between onPause/onResume. 2013-01-09 20:39:05 -08:00
Moxie Marlinspike
5cb02445e8 Add support for "delivery notifications." Currently SMS-only. 2013-01-06 21:38:36 -08:00
Moxie Marlinspike
118560cf0d Fix for DB creation and migration with new date schema changes. 2013-01-06 18:47:20 -08:00
Moxie Marlinspike
2204584d8f Improve locking and performance on asynchronous contact loading. 2013-01-06 15:46:26 -08:00
Moxie Marlinspike
83f90ddd4e Display both sent and received time in message details.
1) We record time sent in SMS database (date_sent).

2) We record time received in MMS database (date_received).

3) We union this information correctly in MmsSmsDatabase.
2013-01-06 13:13:14 -08:00
Moxie Marlinspike
ead97953e8 Add proxy port option to local APN settings. 2013-01-05 15:48:29 -08:00
Moxie Marlinspike
68c29f283d Fall back to user-configured MMS params on SecurityException 2013-01-02 10:06:34 -08:00
Moxie Marlinspike
abd7fc67da Fix NoClassDefFound errors on 2.2 devices. 2013-01-01 15:38:09 -08:00
Moxie Marlinspike
b805c4db4e Fix for NPE on empty MMS PDU 2013-01-01 12:54:12 -08:00
Moxie Marlinspike
61d4192798 Refactor ContactPhotoFactory to handle changing local contact URIs. 2012-12-30 16:42:33 -08:00
Moxie Marlinspike
9b45e6068b Better asynchronous loading for Recipient information.
1) Switch back from AsyncTasks to an Executor and Futures.

2) Make the Executor operate LIFO.

3) Make the Executor thread a BACKGROUND_PRIORITY thread.
2012-12-27 12:00:14 -08:00
Moxie Marlinspike
9939830551 Refactor recipient access.
1) Refactor recipient class to support asynchronous loading operations.

2) Refactor recipient factory to simplify recipient access.

3) Consoliate everything into one recipient provider that is capable of
doing async lookups and intelligent caching.
2012-12-24 08:40:37 -08:00
Moxie Marlinspike
f685cb550b Collapse NewRecipientProvider into RecipientProvider 2012-12-12 03:56:38 -08:00
Moxie Marlinspike
54fad30f9f Add ability to specify APN information in TextSecure settings.
1) Add configuration options for APN information in TextSecure settings.

2) Fall back to TextSecure settings if system settings are unavailable
while sending/receiving MMS.

3) Catch sqlite exception when devices randomly don't have the same
APN db or table structure.
2012-12-08 16:49:57 -08:00
Moxie Marlinspike
84a29df1ee Switch passphrase creation to async task. 2012-12-01 16:02:56 -08:00
Moxie Marlinspike
0e5ff9bdac Fix for occasional NPE 2012-12-01 16:02:55 -08:00
Moxie Marlinspike
575341704e Proper recipient bracket parsing 2012-12-01 16:02:55 -08:00
Moxie Marlinspike
fa5e993191 Weird NPE 2012-12-01 16:02:55 -08:00
Moxie Marlinspike
c83d57aa59 Merge pull request #94 from thoughtbox/Change-default-behaviour-when-receiving-"flash"-messages
Changes default behaviour for CLASS 0 messages
2012-11-24 19:25:53 -08:00
Tor Houghton
4ced1a0f18 Changes default behaviour for CLASS 0 messages
"Flash" messages are no longer handled by TS.

Sorry for the multiple pulls -- previous request had a cut+paste typo.
2012-11-24 14:29:31 +01:00
Moxie Marlinspike
9bf434cb3b The <= GB QuickContactBadge is ugly. Let's do something nicer for them.
Unfortunately GB is 50% of the TS userbase, best not to neglect them.
2012-11-20 20:14:30 -08:00
Moxie Marlinspike
80a6c65790 We need READ_CALL_LOG if targetSDK is > 15. What a drag. 2012-11-20 19:09:46 -08:00
Moxie Marlinspike
c66e221598 Signal that we don't want screenshots of unlocked activities. 2012-11-20 18:49:56 -08:00
Moxie Marlinspike
47c83d2747 When retrieving MMS, continue on with best-effort in absence of APNs. 2012-11-18 14:52:33 -08:00
Tor Houghton
e8ffce53fe Fix reference to "forward" prefix
Code was erroneously referencing the string ID, rather than the
contents of the string (sorry!).
2012-11-05 18:45:04 +01:00
Moxie Marlinspike
acffda1ab8 formatting 2012-10-31 18:03:09 -07:00
Moxie Marlinspike
6b18f66e19 disambiguate send 2012-10-31 18:00:59 -07:00
Moxie Marlinspike
f26dbb2f34 disambiguate 2012-10-31 17:56:39 -07:00
Moxie Marlinspike
93c0fffc31 We need to force plaintext on key exchange messages. 2012-10-29 20:53:04 -07:00
Moxie Marlinspike
c5ed820590 Create DB indexes for optimized queries. 2012-10-29 18:01:09 -07:00
Moxie Marlinspike
3a9908b40d formatting 2012-10-29 17:34:14 -07:00
Moxie Marlinspike
187ec95817 Add collating support for group SMS/MMS messages.
1) When sending an SMS or MMS to multiple recipients, only show one
ConversationItem, but provide statistics on the number of recipients
delivered to.

2) Still break up the messages for secure and insecure messages.
2012-10-29 16:51:42 -07:00
Moxie Marlinspike
3a8d29e279 Major reorganization of view/model interactions.
Mostly, the inheritance graph for MessageRecord/MmsMessageRecord was
all messed up, and each class was overloaded for things it shouldn't
have been.

1) Broke MessageRecord/MmsMessageRecord up into: DisplayRecord, ThreadRecord,
MessageRecord, SmsMessageRecord, NotificationMmsMessageRecord, and
MediaMmsMessageRecord.

2) Updated all the adapters/views to keep pace with that change.
2012-10-28 18:24:21 -07:00