A private messenger for Android. https://github.com/signalapp/Signal-Android
Find a file
Curt Brune 7f0a7b0c13 Add ringrtc support
Initial commit of the RingRTC Java interface implementation.

The implementation lives in an external .aar with the package
org.signal.ringrtc.

The package provides two high level objects of interest
=======================================================

org.signal.ringrtc.CallConnection -- represents the session of a call,
very similar to WebRTC's PeerConnection.

org.signal.ringrtc.CallConnectionFactory -- creates CallConnection
objects, very similar to WebRTC's PeerConnectionFactory.

The implementation interfaces with the Android application in a few
places:
==================================================================

src/org/thoughtcrime/securesms/ApplicationContext.java -- RingRTC
library initialization at application startup.

src/org/thoughtcrime/securesms/service/WebRtcCallService.java -- Call
creation and state machine.

src/org/thoughtcrime/securesms/ringrtc -- this package implements
interface classes needed by ringrtc and a CallConnectionWrapper helper
class.

The two interfaces needed so far are:

  ringrtc/Logger.java
  ringrtc/SignalMessageRecipient.java

The logger is self-explanatory, but SignalMessageRecipient is a little
more involved.  SignalMessageRecipient encapsulates the Signal-Android
notion of "Recipient" and the mechanism for sending Signal Messages
related to audio/video calling.

The CallConnectionWrapper class is clone of the original
org.thoughtcrime.securesms.webrtc.PeerConnectionWrapper, suitably
modified to match the CallConnection interface.

This class continues to handle the Camera switching APIs, with that
portion of the code remaining unmodified from the original.

CallConnectionFactory Details
=============================

The primary public methods:

initialize() -- initialize the WebRTC library and RingRTC library.
The WebRTC initialization is lifted from the original Signal-Android
code.

createCallConnectionFactory() -- creates a CallConnectionFactory
object.  Internally it creates a WebRTC PeerConnectionFactory object
and a RingRTC CallConnectionFactory object.

dispose() -- tears down the CallConnectionFactory object, including
the internal PeerConnectionFactory and RingRTC CallConnectionFactory.

createCallConnection() -- creates a CallConnection object, connecting
that with an application controlled CallConnection.Observer object.

This function takes a CallConnection.Configuration object to link the
CallConnection object with some application provided services, like
sending Signal protocol messages.

CallConnection Details
======================

This object is a subclass of WebRTC's PeerConnection class.

The primary public methods and objects:

CallConnection.Configuration
----------------------------

Configuration object used to parameterize a call.  Notable members:

- SignalServiceMessageSender messageSender
- long callId
- org.signal.SignalMessageRecipient recipient

The 'accountManager' is used to fetch public information from the Signal
service, specifically used here to obtain the public Signal TURN
server details.

The 'callId' is a 64-bit pseudo-random number generated when the call
is initiated, used to identify the call through out its lifetime.

The "recipient' is an implementation of the
org.signal.SignalMessageRecipient interface, which encapsulates the
sending of Signal service messages to a recipient (remote peer) using
existing Signal protocol data structures.

The native library needs to be able to send Signal messages via the
service, but it does not have a native implementation to do so.
Instead the native code calls out to the client for sending Signal
messages.  To accomplish this, the client implements the
org.signal.SignalMessageRecipient interface and passes an instance of
that in a CallConnection.Configuration object.

CallConnection
--------------

dispose() -- tears down the CallConnection object, including the
internal PeerConnection and RingRTC CallConnection.

sendOffer() -- initiates a call to a remote recipient.  This is the
beginning of an outbound call.

validateResponse() -- checks an offer response recipient against the
originating call details.

handleOfferAnswer() -- handles the receipt of answer, which was a
response from an originating offer.

acceptOffer() -- accept an offer from a remote participant.  This is
the begin of an incoming call.

answerCall() -- invoked when the call is completely established and
online.

hangUp() -- hang up the connection and shut things done.  This is the
end of the call.

sendBusy() -- send the remote side an indication that the local side
is already in a call and the line is busy.

sendVideoStatus() -- send the current state of the local camera video
stream to the remote side.

CallConnection.Observer
-----------------------

Observer object, used by the RingRTC library to notify the client
application of important events and status changes.  Similar in spirit
to WebRTC's PeerConnection.Observer.

Observer callbacks come in three flavors:

- state change notifications,
- on stream notifications
- errors conditions

For state notifications, the callback contains the callId, the
recipient and a CallConnection.CallEvent type.

For streams, the callback contains the callId, the
recipient and a org.webrtc.MediaStream.

For errors, the callback contains the callId, the recipient and an
exception type.  The currently thrown exceptions include:

- UntrustedIdentityException
- UnregisteredUserException
- IOException

Signed-off-by: Curt Brune <curt@signal.org>

Updates to support ringrtc-android version 0.1.0.

* simplify logging interface

It is no longer necessary for the application to specify a Log object
as the library can log via the NDK directly.

* improve error handling and notification

In a number of places where ringrtc errors could occur, no
notification was ever sent to the user, nor was the UI cleaned up.  It
would look like the app was in hung state.

This patch updates these situations to send the WebRtcViewModel a
NETWORK_FAILURE message.

* update handleIncomingCall() for lockManager and notification

During the conversion to RingRTC, the implementation of
handleIncomingCall() missed a couple of things:

-- updating the Phone state with the lockManager
-- sending a message to the viewModel

* log the callId in various handler methods

For debugging purposes it is very handy to have the callId present in
the log during the various call handler methods.

Signed-off-by: Curt Brune <curt@signal.org>
2019-08-22 10:04:23 -04:00
.github Update the issue template. 2018-03-31 02:01:26 -07:00
.tx Updated language translations. 2019-03-02 20:46:40 -08:00
apkdiff Ignore resources.arsc in apkdiff.py 2019-05-11 10:46:25 -07:00
apntool update APN list, fix MMSC issues 2015-03-12 11:15:14 -07:00
artwork Change the app icon 2017-03-14 15:46:19 -07:00
assets Update emoji. 2019-07-03 19:04:17 -04:00
buildSrc Gradle witness - Do not hide resolution errors. 2019-05-30 20:22:03 -03:00
gradle/wrapper Gradle/Gradlew/AndroidGradlePlugin update. 2019-03-18 15:09:56 -07:00
jni Transcode video during attachment upload. 2019-07-31 09:54:46 -04:00
libs Transcode video during attachment upload. 2019-07-31 09:54:46 -04:00
protobuf Add sticker support. 2019-05-30 01:08:01 -04:00
res Use EmojiTextView in the sticker preview. 2019-08-22 10:04:23 -04:00
src/org/thoughtcrime/securesms Add ringrtc support 2019-08-22 10:04:23 -04:00
test URL encoded scrubber. 2019-08-22 10:04:23 -04:00
website Fix tap-to-upgrade on website releases. 2019-01-13 19:08:33 -08:00
.gitattributes materialize conversation item indicators 2014-11-18 11:27:08 -08:00
.gitignore Lint. 2019-05-10 11:57:43 -03:00
AndroidManifest.xml Create a new system for application-level migrations. 2019-08-22 10:04:23 -04:00
build.gradle Add ringrtc support 2019-08-22 10:04:23 -04:00
BUILDING.md Remove reference to Pixelapse in BUILDING.md. 2018-07-02 17:58:26 -07:00
CONTRIBUTING.md Update the Android Transifex links in CONTRIBUTING.md. 2018-08-30 08:21:55 -07:00
Dockerfile Updated Gradle to 5.1 2019-01-29 09:22:44 -08:00
gradle.properties Convert to AndroidX. 2019-06-17 12:52:42 -04:00
gradlew Gradle/Gradlew/AndroidGradlePlugin update. 2019-03-18 15:09:56 -07:00
gradlew.bat Gradle/Gradlew/AndroidGradlePlugin update. 2019-03-18 15:09:56 -07:00
LICENSE Initial Project Import 2011-12-20 10:20:44 -08:00
lint-baseline.xml Lint - baseline of errors. 2019-05-28 17:36:07 -03:00
lint.xml Do not use Canvas size. 2019-07-17 14:07:20 -04:00
NOTICE Initial Project Import 2011-12-20 10:20:44 -08:00
pkcs11.config Update release config 2018-10-30 09:20:54 -07:00
proguard-appcompat-v7.pro Giphy integration 2016-10-18 10:28:42 -07:00
proguard-automation.pro Fix the faulty tests in AttachmentDatabaseTest.java 2017-01-12 10:23:35 -08:00
proguard-ez-vcard.pro Convert vCard attachments to Shared Contacts. 2018-05-21 15:45:22 -04:00
proguard-firebase-messaging.pro FCM improvements. 2019-02-15 14:21:23 -08:00
proguard-glide.pro Update to glide 4.x 2017-10-11 17:47:12 -07:00
proguard-google-play-services.pro refactor proguard rules 2015-04-02 14:49:45 -07:00
proguard-jackson.pro refactor proguard rules 2015-04-02 14:49:45 -07:00
proguard-klinker.pro Add proguard config for klinker library 2017-05-12 15:47:04 -07:00
proguard-okhttp.pro Add splash screen for setting profiles 2017-09-03 19:45:43 -07:00
proguard-retrofit.pro Support for Signal calls. 2015-09-30 14:30:09 -07:00
proguard-retrolambda.pro Join recipient preferences into thread query for faster lookup 2017-08-28 10:30:50 -07:00
proguard-rounded-image-view.pro refactor proguard rules 2015-04-02 14:49:45 -07:00
proguard-shortcutbadger.pro Add proguard rule for ShortcutBadger now that they use reflection. 2015-05-07 17:20:44 -07:00
proguard-sqlite.pro Migrate from SQLite and ciphertext blobs to SQLCipher + KeyStore 2018-01-30 17:27:05 -08:00
proguard-square-okhttp.pro refactor proguard rules 2015-04-02 14:49:45 -07:00
proguard-square-okio.pro refactor proguard rules 2015-04-02 14:49:45 -07:00
proguard.cfg Switch RedPhone view<->service interaction to use event bus 2015-11-04 17:56:20 -08:00
README.md Changed URL of the user forum. 2018-09-27 10:29:30 -07:00
ReproducibleBuilds.md Bring the Reproducible Builds instructions and script into repo. 2019-05-10 11:57:43 -03:00

Signal Android

Signal is a messaging app for simple private communication with friends.

Signal uses your phone's data connection (WiFi/3G/4G) to communicate securely, optionally supports plain SMS/MMS to function as a unified messenger, and can also encrypt the stored messages on your phone.

Currently available on the Play store.

Get it on Google Play

Contributing Bug reports

We use GitHub for bug tracking. Please search the existing issues for your bug and create a new one if the issue is not yet tracked!

https://github.com/signalapp/Signal-Android/issues

Joining the Beta

Want to live life on the bleeding edge and help out with testing?

You can subscribe to Signal Android Beta releases here: https://play.google.com/apps/testing/org.thoughtcrime.securesms

If you're interested in a life of peace and tranquility, stick with the standard releases.

Contributing Translations

Interested in helping to translate Signal? Contribute here:

https://www.transifex.com/projects/p/signal-android/

Contributing Code

Instructions on how to setup your development environment and build Signal can be found in BUILDING.md.

If you're new to the Signal codebase, we recommend going through our issues and picking out a simple bug to fix (check the "easy" label in our issues) in order to get yourself familiar. Also please have a look at the CONTRIBUTING.md, that might answer some of your questions.

For larger changes and feature ideas, we ask that you propose it on the unofficial Community Forum for a high-level discussion with the wider community before implementation.

Contributing Ideas

Have something you want to say about Open Whisper Systems projects or want to be part of the conversation? Get involved in the community forum.

Help

Support

For troubleshooting and questions, please visit our support center!

https://support.signal.org/

Documentation

Looking for documentation? Check out the wiki!

https://github.com/signalapp/Signal-Android/wiki

Legal things

Cryptography Notice

This distribution includes cryptographic software. The country in which you currently reside may have restrictions on the import, possession, use, and/or re-export to another country, of encryption software. BEFORE using any encryption software, please check your country's laws, regulations and policies concerning the import, possession, or use, and re-export of encryption software, to see if this is permitted. See http://www.wassenaar.org/ for more information.

The U.S. Government Department of Commerce, Bureau of Industry and Security (BIS), has classified this software as Export Commodity Control Number (ECCN) 5D002.C.1, which includes information security software using or performing cryptographic functions with asymmetric algorithms. The form and manner of this distribution makes it eligible for export under the License Exception ENC Technology Software Unrestricted (TSU) exception (see the BIS Export Administration Regulations, Section 740.13) for both object code and source code.

License

Copyright 2011 Whisper Systems

Copyright 2013-2017 Open Whisper Systems

Licensed under the GPLv3: http://www.gnu.org/licenses/gpl-3.0.html

Google Play and the Google Play logo are trademarks of Google Inc.