Skip to content

Commit d83a3d7

Browse files
committed
Support for Signal calls.
Merge in RedPhone // FREEBIE
1 parent 3d4ae60 commit d83a3d7

File tree

2,585 files changed

+803493
-46
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,585 files changed

+803493
-46
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,5 @@ library/lib/
2121
library/obj/
2222
ffpr
2323
test/androidTestEspresso/res/values/arrays.xml
24+
obj/
25+
jni/libspeex/.deps/

AndroidManifest.xml

+8
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,12 @@
9898
<meta-data android:name="org.thoughtcrime.securesms.mms.TextSecureGlideModule"
9999
android:value="GlideModule" />
100100

101+
<activity android:name="org.thoughtcrime.redphone.RedPhone"
102+
android:screenOrientation="portrait"
103+
android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|screenSize|fontScale"
104+
android:launchMode="singleTask">
105+
</activity>
106+
101107
<activity android:name=".CountrySelectionActivity"
102108
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
103109

@@ -302,6 +308,8 @@
302308

303309
<activity android:name="com.soundcloud.android.crop.CropImageActivity" />
304310

311+
<service android:enabled="true" android:name="org.thoughtcrime.redphone.RedPhoneService"/>
312+
305313
<service android:enabled="true" android:name=".service.ApplicationMigrationService"/>
306314
<service android:enabled="true" android:name=".service.KeyCachingService"/>
307315
<service android:enabled="true" android:name=".service.RegistrationService"/>

build.gradle

+14-7
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ dependencies {
7878
compile 'org.whispersystems:jobmanager:0.11.0'
7979
compile 'org.whispersystems:libpastelog:1.0.6'
8080
compile 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
81-
compile 'org.whispersystems:textsecure-android:1.6.2'
81+
compile 'org.whispersystems:textsecure-android:1.7.2'
8282
compile 'com.h6ah4i.android.compat:mulsellistprefcompat:1.0.0'
8383

8484
testCompile 'junit:junit:4.12'
@@ -129,22 +129,23 @@ dependencyVerification {
129129
'org.whispersystems:jobmanager:ea9cb943c4892fb90c1eea1be30efeb85cefca213d52c788419553b58d0ed70d',
130130
'org.whispersystems:libpastelog:550d33c565380d90f4c671e7b8ed5f3a6da55a9fda468373177106b2eb5220b2',
131131
'com.amulyakhare:com.amulyakhare.textdrawable:54c92b5fba38cfd316a07e5a30528068f45ce8515a6890f1297df4c401af5dcb',
132-
'org.whispersystems:textsecure-android:6fc3a127b4ab63533e571066a8c6686e82d071d804f4563eee66a3773dd094e0',
132+
'org.whispersystems:textsecure-android:0bc637dcfd1ef25888f07f05120fe0360c182e012a5151fcf6d96464ba850e8f',
133+
'com.h6ah4i.android.compat:mulsellistprefcompat:47167c5cb796de1a854788e9ff318358e36c8fb88123baaa6e38fb78511dfabe',
133134
'com.nineoldandroids:library:68025a14e3e7673d6ad2f95e4b46d78d7d068343aa99256b686fe59de1b3163a',
134135
'javax.inject:javax.inject:91c77044a50c481636c32d916fd89c9118a72195390452c81065080f957de7ff',
135136
'com.madgag.spongycastle:core:8d6240b974b0aca4d3da9c7dd44d42339d8a374358aca5fc98e50a995764511f',
136-
'org.whispersystems:textsecure-java:9167ae6cbc34b62b5d51b2dd687306ca94eab6cf5fa7cf426f40ec32d3d37cf8',
137137
'org.whispersystems:axolotl-android:40d3db5004a84749a73f68d2f0d01b2ae35a73c54df96d8c6c6723b96efb6fc0',
138+
'org.whispersystems:textsecure-java:137ef598a3bb77bf53930f76e3881190d12a91a597c2a17bf48835611fcf2f66',
139+
'org.whispersystems:axolotl-java:6daee739b89d8d7101de6d98f77132fee48495c6ea647d880e77def842f999ea',
140+
'org.whispersystems:curve25519-android:3c29a4131a69b0d16baaa3d707678deb39602c3a3ffd75805ce7f9db252e5d0d',
138141
'com.googlecode.libphonenumber:libphonenumber:eba17eae81dd622ea89a00a3a8c025b2f25d342e0d9644c5b62e16f15687c3ab',
139142
'com.google.protobuf:protobuf-java:e0c1c64575c005601725e7c6a02cebf9e1285e888f756b2a1d73ffa8d725cc74',
140143
'com.squareup.okhttp:okhttp:89b7f63e2e5b6c410266abc14f50fe52ea8d2d8a57260829e499b1cd9f0e61af',
141144
'com.fasterxml.jackson.core:jackson-databind:835097bcdd11f5bc8a08378c70d4c8054dfa4b911691cc2752063c75534d198d',
142-
'org.whispersystems:axolotl-java:6daee739b89d8d7101de6d98f77132fee48495c6ea647d880e77def842f999ea',
143-
'org.whispersystems:curve25519-android:3c29a4131a69b0d16baaa3d707678deb39602c3a3ffd75805ce7f9db252e5d0d',
145+
'org.whispersystems:curve25519-java:9ccef8f5aba05d9942336f023c589d6278b4f9135bdc34a7bade1f4e7ad65fa3',
144146
'com.squareup.okio:okio:5e1098bd3fdee4c3347f5ab815b40ba851e4ab1b348c5e49a5b0362f0ce6e978',
145147
'com.fasterxml.jackson.core:jackson-annotations:0ca408c24202a7626ec8b861e99d85eca5e38b73311dd6dd12e3e9deecc3fe94',
146148
'com.fasterxml.jackson.core:jackson-core:cbf4604784b4de226262845447a1ad3bb38a6728cebe86562e2c5afada8be2c0',
147-
'org.whispersystems:curve25519-java:9ccef8f5aba05d9942336f023c589d6278b4f9135bdc34a7bade1f4e7ad65fa3',
148149
'com.android.support:support-v4:1e2e4d35ac7fd30db5ce3bc177b92e4d5af86acef2ef93e9221599d733346f56',
149150
'com.android.support:support-annotations:7bc07519aa613b186001160403bcfd68260fa82c61cc7e83adeedc9b862b94ae',
150151
]
@@ -163,7 +164,11 @@ android {
163164
targetSdkVersion 22
164165

165166
buildConfigField "long", "BUILD_TIMESTAMP", System.currentTimeMillis() + "L"
166-
buildConfigField "String", "PUSH_URL", "\"https://textsecure-service.whispersystems.org\""
167+
buildConfigField "String", "TEXTSECURE_URL", "\"https://textsecure-service-staging.whispersystems.org\""
168+
buildConfigField "String", "USER_AGENT", "\"OWA\""
169+
buildConfigField "String", "REDPHONE_MASTER_URL", "\"https://redphone-staging.whispersystems.org\""
170+
buildConfigField "String", "REDPHONE_RELAY_HOST", "\"redphone-staging-relay.whispersystems.org\""
171+
buildConfigField "String", "REDPHONE_PREFIX_NAME", "\".whispersystems.org\""
167172
buildConfigField "boolean", "DEV_BUILD", "false"
168173
}
169174

@@ -200,6 +205,7 @@ android {
200205
'proguard-rounded-image-view.pro',
201206
'proguard-glide.pro',
202207
'proguard-shortcutbadger.pro',
208+
'proguard-retrofit.pro',
203209
'proguard.cfg'
204210
}
205211
release {
@@ -222,6 +228,7 @@ android {
222228
renderscript.srcDirs = ['src']
223229
res.srcDirs = ['res']
224230
assets.srcDirs = ['assets']
231+
jniLibs.srcDirs = ['libs']
225232
}
226233
androidTest {
227234
java.srcDirs = ['test/androidTest/java']

jni/Android.mk

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
JNI_DIR := $(call my-dir)
2+
3+
include $(JNI_DIR)/libspeex/Android.mk
4+
5+
include $(JNI_DIR)/webrtc/common_audio/signal_processing/Android.mk
6+
include $(JNI_DIR)/webrtc/modules/audio_processing/aec/Android.mk
7+
include $(JNI_DIR)/webrtc/modules/audio_processing/aecm/Android.mk
8+
include $(JNI_DIR)/webrtc/modules/audio_processing/agc/Android.mk
9+
include $(JNI_DIR)/webrtc/modules/audio_processing/ns/Android.mk
10+
include $(JNI_DIR)/webrtc/modules/audio_processing/utility/Android.mk
11+
include $(JNI_DIR)/webrtc/system_wrappers/source/Android.mk
12+
13+
include $(JNI_DIR)/webrtc/modules/audio_coding/neteq/Android.mk
14+
include $(JNI_DIR)/webrtc/modules/audio_coding/codecs/g711/Android.mk
15+
include $(JNI_DIR)/webrtc/modules/audio_coding/codecs/cng/Android.mk
16+
include $(JNI_DIR)/webrtc/common_audio/vad/Android.mk
17+
18+
include $(JNI_DIR)/openssl/Android.mk
19+
20+
LOCAL_PATH := $(call my-dir)
21+
22+
include $(CLEAR_VARS)
23+
24+
LOCAL_MODULE := redphone-audio
25+
LOCAL_C_INCLUDES := $(JNI_DIR)/libsrtp/include/ $(JNI_DIR)/libsrtp/crypto/include/ $(JNI_DIR)/libspeex/include/ $(JNI_DIR)/webrtc/ $(JNI_DIR)/openssl/include/ $(JNI_DIR)
26+
LOCAL_LDLIBS += -lOpenSLES -llog
27+
LOCAL_CFLAGS += -Wall
28+
29+
LOCAL_SRC_FILES := \
30+
$(JNI_DIR)/redphone/MicrophoneReader.cpp \
31+
$(JNI_DIR)/redphone/AudioCodec.cpp \
32+
$(JNI_DIR)/redphone/RtpAudioSender.cpp \
33+
$(JNI_DIR)/redphone/RtpPacket.cpp \
34+
$(JNI_DIR)/redphone/RtpAudioReceiver.cpp \
35+
$(JNI_DIR)/redphone/AudioPlayer.cpp \
36+
$(JNI_DIR)/redphone/JitterBuffer.cpp \
37+
$(JNI_DIR)/redphone/CallAudioManager.cpp \
38+
$(JNI_DIR)/redphone/WebRtcJitterBuffer.cpp \
39+
$(JNI_DIR)/redphone/SrtpStream.cpp \
40+
$(JNI_DIR)/redphone/NetworkUtil.cpp
41+
42+
LOCAL_STATIC_LIBRARIES := \
43+
libspeex \
44+
libwebrtc_aecm \
45+
libwebrtc_ns \
46+
libwebrtc_spl \
47+
libwebrtc_apm_utility \
48+
libwebrtc_system_wrappers \
49+
libwebrtc_neteq \
50+
libwebrtc_g711 \
51+
libwebrtc_cng \
52+
libwebrtc_spl \
53+
libwebrtc_vad \
54+
libcrypto_static
55+
56+
57+
include $(BUILD_SHARED_LIBRARY)
58+

jni/Application.mk

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
APP_ABI := armeabi armeabi-v7a x86
2+
APP_PLATFORM := android-9
3+
APP_STL := stlport_static
4+
APP_CPPFLAGS += -fexceptions
5+
APP_OPTIM := debug

jni/android-webrtc.mk

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
2+
#
3+
# Use of this source code is governed by a BSD-style license
4+
# that can be found in the LICENSE file in the root of the source
5+
# tree. An additional intellectual property rights grant can be found
6+
# in the file PATENTS. All contributing project authors may
7+
# be found in the AUTHORS file in the root of the source tree.
8+
9+
# These defines will apply to all source files
10+
# Think again before changing it
11+
MY_WEBRTC_COMMON_DEFS := \
12+
'-DWEBRTC_TARGET_PC' \
13+
'-DWEBRTC_LINUX' \
14+
'-DWEBRTC_THREAD_RR' \
15+
'-DWEBRTC_CLOCK_TYPE_REALTIME' \
16+
'-DWEBRTC_ANDROID'
17+
# The following macros are used by modules,
18+
# we might need to re-organize them
19+
# '-DWEBRTC_ANDROID_OPENSLES' [module audio_device]
20+
# '-DNETEQ_VOICEENGINE_CODECS' [module audio_coding neteq]
21+
# '-DWEBRTC_MODULE_UTILITY_VIDEO' [module media_file] [module utility]
22+
ifeq ($(TARGET_ARCH),arm)
23+
MY_WEBRTC_COMMON_DEFS += \
24+
'-DWEBRTC_ARCH_ARM'
25+
# '-DWEBRTC_DETECT_ARM_NEON' # only used in a build configuration without Neon
26+
# TODO(kma): figure out if the above define could be moved to NDK build only.
27+
28+
# TODO(kma): test if the code under next two macros works with generic GCC compilers
29+
ifeq ($(ARCH_ARM_HAVE_NEON),true)
30+
MY_WEBRTC_COMMON_DEFS += \
31+
'-DWEBRTC_ARCH_ARM_NEON'
32+
endif
33+
34+
ifneq (,$(filter '-DWEBRTC_DETECT_ARM_NEON' '-DWEBRTC_ARCH_ARM_NEON', \
35+
$(MY_WEBRTC_COMMON_DEFS)))
36+
WEBRTC_BUILD_NEON_LIBS := true
37+
# TODO(kma): Use MY_ARM_CFLAGS_NEON for Neon libraies in AECM, NS, and iSAC.
38+
MY_ARM_CFLAGS_NEON := \
39+
-mfpu=neon \
40+
-mfloat-abi=softfp \
41+
-flax-vector-conversions
42+
endif
43+
44+
ifeq ($(ARCH_ARM_HAVE_ARMV7A),true)
45+
MY_WEBRTC_COMMON_DEFS += \
46+
'-DWEBRTC_ARCH_ARM_V7A'
47+
endif
48+
49+
endif # ifeq ($(TARGET_ARCH),arm)
50+
51+
#added for redphone
52+
53+
#MY_WEBRTC_COMMON_DEFS += '-DNDEBUG'

jni/libspeex/Android.mk

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
LOCAL_PATH := $(call my-dir)
2+
3+
include $(CLEAR_VARS)
4+
5+
LOCAL_MODULE := libspeex
6+
LOCAL_CFLAGS := -DFIXED_POINT -DUSE_KISS_FFT -DEXPORT="" -UHAVE_CONFIG_H
7+
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
8+
9+
LOCAL_SRC_FILES := \
10+
$(LOCAL_PATH)/bits.c \
11+
$(LOCAL_PATH)/buffer.c \
12+
$(LOCAL_PATH)/cb_search.c \
13+
$(LOCAL_PATH)/exc_10_16_table.c \
14+
$(LOCAL_PATH)/exc_10_32_table.c \
15+
$(LOCAL_PATH)/exc_20_32_table.c \
16+
$(LOCAL_PATH)/exc_5_256_table.c \
17+
$(LOCAL_PATH)/exc_5_64_table.c \
18+
$(LOCAL_PATH)/exc_8_128_table.c \
19+
$(LOCAL_PATH)/fftwrap.c \
20+
$(LOCAL_PATH)/filterbank.c \
21+
$(LOCAL_PATH)/filters.c \
22+
$(LOCAL_PATH)/gain_table.c \
23+
$(LOCAL_PATH)/gain_table_lbr.c \
24+
$(LOCAL_PATH)/hexc_10_32_table.c \
25+
$(LOCAL_PATH)/hexc_table.c \
26+
$(LOCAL_PATH)/high_lsp_tables.c \
27+
$(LOCAL_PATH)/jitter.c \
28+
$(LOCAL_PATH)/kiss_fft.c \
29+
$(LOCAL_PATH)/kiss_fftr.c \
30+
$(LOCAL_PATH)/lpc.c \
31+
$(LOCAL_PATH)/lsp.c \
32+
$(LOCAL_PATH)/lsp_tables_nb.c \
33+
$(LOCAL_PATH)/ltp.c \
34+
$(LOCAL_PATH)/mdf.c \
35+
$(LOCAL_PATH)/modes.c \
36+
$(LOCAL_PATH)/modes_wb.c \
37+
$(LOCAL_PATH)/nb_celp.c \
38+
$(LOCAL_PATH)/preprocess.c \
39+
$(LOCAL_PATH)/quant_lsp.c \
40+
$(LOCAL_PATH)/resample.c \
41+
$(LOCAL_PATH)/sb_celp.c \
42+
$(LOCAL_PATH)/scal.c \
43+
$(LOCAL_PATH)/smallft.c \
44+
$(LOCAL_PATH)/speex.c \
45+
$(LOCAL_PATH)/speex_callbacks.c \
46+
$(LOCAL_PATH)/speex_header.c \
47+
$(LOCAL_PATH)/stereo.c \
48+
$(LOCAL_PATH)/vbr.c \
49+
$(LOCAL_PATH)/vq.c \
50+
$(LOCAL_PATH)/window.c
51+
52+
include $(BUILD_STATIC_LIBRARY)

0 commit comments

Comments
 (0)