Merge branch 'master' into dev_in_app_purchase

Conflicts:
	AndroidManifest.xml
	res/raw/linphonerc_factory
	res/values/non_localizable_custom.xml
	res/xml/preferences.xml
	src/org/linphone/LinphonePreferences.java
	src/org/linphone/SettingsFragment.java
	src/org/linphone/compatibility/ApiFivePlus.java
	src/org/linphone/setup/SetupActivity.java
	src/org/linphone/xmlrpc/XmlRpcHelper.java
	src/org/linphone/xmlrpc/XmlRpcListener.java
	src/org/linphone/xmlrpc/XmlRpcListenerBase.java
This commit is contained in:
Margaux Clerc 2016-06-27 17:25:10 +02:00
commit 0da687df64
1109 changed files with 23938 additions and 20293 deletions

8
.gitignore vendored
View file

@ -14,13 +14,16 @@ default.properties
doc
gen
liblinphone-junit-report.xml
liblinphone-sdk
liblinphonetester_*.zip
libs
libs-debug
linphone-android.iml
linphone-junit-report*.xml
linphonetester_*.zip
lint.xml
local.properties
Makefile
obj
proguard-project.txt
project.properties
@ -38,3 +41,8 @@ tests/*$py.class
tests/build.xml
tests/project.properties
ant_password.properties
liblinphone_tester/liblinphonetester_*
liblinphone_tester/tests.output
tests/linphonetester_*
tests/tests.output
WORK

61
.gitmodules vendored
View file

@ -1,18 +1,12 @@
[submodule "linphone"]
path = submodules/linphone
url = git://git.linphone.org/linphone
url = git://git.linphone.org/linphone.git
[submodule "submodules/externals/gsm"]
path = submodules/externals/gsm
url = git://git.linphone.org/gsm.git
[submodule "submodules/externals/speex"]
path = submodules/externals/speex
url = git://git.linphone.org/speex
[submodule "submodules/msilbc"]
path = submodules/msilbc
url = git://git.linphone.org/msilbc.git
[submodule "submodules/libilbc-rfc3951"]
path = submodules/libilbc-rfc3951
url = git://git.linphone.org/libilbc-rfc3951.git
url = git://git.linphone.org/speex.git
[submodule "submodules/externals/ffmpeg"]
path = submodules/externals/ffmpeg
url = git://git.linphone.org/ffmpeg.git
@ -26,14 +20,14 @@
url = git://git.linphone.org/msx264.git
[submodule "submodules/externals/opencore-amr"]
path = submodules/externals/opencore-amr
url = git://git.code.sf.net/p/opencore-amr/code
url = git://git.linphone.org/opencore-amr.git
ignore = dirty
[submodule "submodules/msamr"]
path = submodules/msamr
url = git://git.linphone.org/msamr
url = git://git.linphone.org/msamr.git
[submodule "submodules/externals/libvpx"]
path = submodules/externals/libvpx
url = https://chromium.googlesource.com/webm/libvpx
url = git://git.linphone.org/libvpx.git
ignore = dirty
[submodule "submodules/bzrtp"]
path = submodules/bzrtp
@ -46,34 +40,34 @@
url = git://git.linphone.org/mssilk.git
[submodule "submodules/externals/vo-amrwbenc"]
path = submodules/externals/vo-amrwbenc
url = git://git.code.sf.net/p/opencore-amr/vo-amrwbenc
url = git://git.linphone.org/vo-amrwbenc.git
[submodule "submodules/bcg729"]
path = submodules/bcg729
url = git://git.linphone.org/bcg729.git
[submodule "submodules/belle-sip"]
path = submodules/belle-sip
url = git://git.linphone.org/belle-sip
url = git://git.linphone.org/belle-sip.git
[submodule "submodules/externals/antlr3"]
path = submodules/externals/antlr3
url = git://git.linphone.org/antlr3.git
ignore = dirty
[submodule "submodules/externals/libxml2"]
path = submodules/externals/libxml2
url = git://git.gnome.org/libxml2
url = git://git.gnome.org/libxml2.git
ignore = dirty
[submodule "submodules/externals/libupnp"]
path = submodules/externals/libupnp
url = git://git.code.sf.net/p/pupnp/code
url = git://git.linphone.org/libupnp.git
[submodule "submodules/externals/cunit"]
path = submodules/externals/cunit
url = git://git.linphone.org/cunit.git
[submodule "submodules/externals/axmlrpc"]
path = submodules/externals/axmlrpc
url = git://git.linphone.org/axmlrpc.git
[submodule "submodules/externals/polarssl"]
path = submodules/externals/polarssl
url = git://git.linphone.org/polarssl.git
[submodule "submodules/externals/opus"]
path = submodules/externals/opus
url = git://git.opus-codec.org/opus.git
url = git://git.linphone.org/opus.git
ignore = dirty
[submodule "submodules/mswebrtc"]
path = submodules/mswebrtc
url = git://git.linphone.org/mswebrtc.git
@ -85,9 +79,28 @@
url = https://github.com/cisco/openh264
ignore = dirty
[submodule "submodules/externals/libmatroska"]
path = submodules/externals/libmatroska
url = https://github.com/Matroska-Org/foundation-source.git
path = submodules/externals/libmatroska-c
url = git://git.linphone.org/libmatroska-c.git
ignore = dirty
[submodule "submodules/externals/webrtc"]
path = submodules/externals/webrtc
url = git://git.linphone.org/webrtc.git
[submodule "submodules/mscodec2"]
path = submodules/mscodec2
url = git://git.linphone.org/mscodec2.git
[submodule "submodules/bctoolbox"]
path = submodules/bctoolbox
url = git://git.linphone.org/bctoolbox.git
[submodule "submodules/externals/mbedtls"]
path = submodules/externals/mbedtls
url = git://git.linphone.org/mbedtls.git
ignore = dirty
[submodule "submodules/cmake-builder"]
path = submodules/cmake-builder
url = git://git.linphone.org/linphone-cmake-builder.git
[submodule "submodules/externals/bv16-floatingpoint"]
path = submodules/externals/bv16-floatingpoint
url = git://git.linphone.org/bv16-floatingpoint.git
[submodule "submodules/belr"]
path = submodules/belr
url = git://git.linphone.org/belr.git
[submodule "submodules/belcard"]
path = submodules/belcard
url = git://git.linphone.org/belcard.git

View file

@ -8,8 +8,3 @@ type = ANDROID
file_filter = res/values-<lang>/strings.xml
source_file = res/values/strings.xml
source_lang = en
[linphone-android.customxml]
file_filter = res/values-<lang>/custom.xml
source_file = res/values/custom.xml
source_lang = en

View file

@ -1,8 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.linphone"
android:versionCode="2411" android:installLocation="auto">
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="22"/>
android:versionCode="3100" android:installLocation="auto">
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="23"/>
<!-- Permissions for Push Notification -->
<permission android:name="org.linphone.permission.C2D_MESSAGE" android:protectionLevel="signature" /> <!-- Change package ! -->
@ -45,7 +46,7 @@
<supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true"/>
<application android:label="@string/app_name" android:icon="@drawable/logo_linphone_57x57" android:largeHeap="true" android:allowBackup="true">
<application android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:largeHeap="true" android:allowBackup="true">
<activity android:name="org.linphone.LinphoneLauncherActivity"
android:label="@string/app_name"
@ -74,7 +75,7 @@
</intent-filter>
<intent-filter>
<data android:mimeType="vnd.android.cursor.item/org.linphone.profile" />
<data android:mimeType="vnd.android.cursor.item/org.linphone.profile" /> <!-- Change package ! -->
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
@ -91,7 +92,7 @@
</intent-filter>
</activity>
<activity android:name="org.linphone.IncomingCallActivity"
<activity android:name=".CallIncomingActivity"
android:theme="@style/NoTitle"
android:noHistory="true"
android:launchMode="singleTop"
@ -101,9 +102,18 @@
</intent-filter>
</activity>
<activity android:name="org.linphone.InCallActivity"
<activity android:name=".CallOutgoingActivity"
android:theme="@style/NoTitle"
android:noHistory="true"
android:launchMode="singleTop"
android:screenOrientation="behind">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity android:name=".CallActivity"
android:theme="@style/FullScreen"
android:noHistory="true"
android:launchMode="singleTop">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
@ -117,19 +127,9 @@
</intent-filter>-->
</activity>
<activity android:name="org.linphone.ChatActivity"
android:theme="@style/NoTitle"
android:configChanges="orientation|screenSize|keyboardHidden"
android:windowSoftInputMode="adjustPan|adjustResize"
android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity android:name="org.linphone.setup.SetupActivity"
<activity android:name=".assistant.AssistantActivity"
android:theme="@style/NoTitle"
android:screenOrientation="nosensor">
android:screenOrientation="behind">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
@ -143,7 +143,7 @@
</intent-filter>
</activity>
<activity android:name="org.linphone.setup.RemoteProvisioningLoginActivity"
<activity android:name="org.linphone.assistant.RemoteProvisioningLoginActivity"
android:theme="@style/NoTitle"
android:screenOrientation="nosensor">
<intent-filter>
@ -151,7 +151,7 @@
</intent-filter>
</activity>
<activity android:name="org.linphone.setup.RemoteProvisioningActivity"
<activity android:name="org.linphone.assistant.RemoteProvisioningActivity"
android:theme="@style/NoTitle"
android:screenOrientation="nosensor">
<intent-filter>
@ -199,6 +199,7 @@
<receiver android:name="org.linphone.BootReceiver">
<intent-filter><action android:name="android.intent.action.BOOT_COMPLETED"></action></intent-filter>
<intent-filter><action android:name="android.intent.action.ACTION_SHUTDOWN"></action></intent-filter>
</receiver>
<receiver android:name="org.linphone.PhoneStateChangedReceiver">
@ -253,6 +254,13 @@
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity android:name="org.linphone.tutorials.TutorialCardDavSync"
android:theme="@style/NoTitle">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
</application>

529
Makefile
View file

@ -1,529 +0,0 @@
NDK_PATH=$(shell dirname `which ndk-build`)
NDK_MAJOR_VERSION=$(shell cat $(NDK_PATH)/RELEASE.TXT | sed "s/r\([0-9]\{1,2\}\).*/\1/")
SDK_PATH=$(shell dirname `which android`)
SDK_PLATFORM_TOOLS_PATH=$(shell dirname `which adb`)
ARM_COMPILER_PATH=`find "$(NDK_PATH)" -name "arm-linux-androideabi-gcc-4*" -print | tail -1`
ARM_TOOLCHAIN_PATH=$(shell dirname $(ARM_COMPILER_PATH))/arm-linux-androideabi-
X86_COMPILER_PATH=`find "$(NDK_PATH)" -name "i686-linux-android-gcc-4*" -print | tail -1`
X86_TOOLCHAIN_PATH=$(shell dirname $(X86_COMPILER_PATH))/i686-linux-android-
NUMCPUS=$(shell grep -c '^processor' /proc/cpuinfo 2>/dev/null || echo "4" )
TOPDIR=$(shell pwd)
LIBLINPHONE_VERSION=$(shell cd submodules/linphone && git describe --always)
LINPHONE_ANDROID_DEBUG_VERSION=$(shell git describe --always)
BELLESIP_VERSION_SCRIPT:=cat submodules/belle-sip/configure.ac | grep "AC_INIT(" | sed -e "s/.*belle-sip\]//" | sed -e "s/].*//" | sed -e "s/.*\[//"
BELLESIP_VERSION=$(shell $(BELLESIP_VERSION_SCRIPT))
ANDROID_MOST_RECENT_TARGET=$(shell android list target -c | grep -E 'android-[0-9]+' | tail -n1)
#We force target 19 because 21 creates binaries incompatible with older versions due to rand() function no longer inline (congrats to Google's developers)
NDKBUILD_TARGET=android-19
#The NDK target used to compile external third parties (ffmpeg, x264)
EXTERNAL_MAKE_TARGET=14
ARM_SYSROOT=${NDK_PATH}/platforms/android-$(EXTERNAL_MAKE_TARGET)/arch-arm
X86_SYSROOT=${NDK_PATH}/platforms/android-$(EXTERNAL_MAKE_TARGET)/arch-x86
SQLITE_VERSION=3071700
SQLITE_BASENAME=sqlite-amalgamation-$(SQLITE_VERSION)
SQLITE_URL=http://www.sqlite.org/2013/$(SQLITE_BASENAME).zip
ENABLE_GPL_THIRD_PARTIES=1
#override CC variable to disable compiler specific FLAGS in configure using the system compiler instead of the android one
CC=
PACKAGE_NAME=$(shell sed -nE 's|<property name="linphone.package.name" value="(.*)" />|\1|p' custom_rules.xml)
#default options, can be overidden using make OPTION=value .
ifeq ($(ENABLE_GPL_THIRD_PARTIES),1)
BUILD_G729=1
else
#x264 and g729 requires additional licensing agreements.
BUILD_X264=0
BUILD_G729=0
endif
NDK_DEBUG=0
BUILD_VIDEO=1
BUILD_OPENH264=1
BUILD_NON_FREE_CODECS=1
ENABLE_OPENH264_DECODER=1
BUILD_UPNP=1
BUILD_AMRNB=full # 0, light or full
BUILD_AMRWB=1
BUILD_ZRTP=1
BUILD_SILK=1
BUILD_TUNNEL=0
BUILD_WEBRTC_AECM=1
BUILD_OPUS=1
BUILD_MATROSKA=1
BUILD_WEBRTC_ISAC=1
BUILD_FOR_X86=1
BUILD_FOR_ARM=1
USE_JAVAH=1
BUILD_TLS=1
BUILD_SQLITE=1
BUILD_CONTACT_HEADER=0
BUILD_RTP_MAP=0
BUILD_DONT_CHECK_HEADERS_IN_MESSAGE=0
BUILD_ILBC=1
LIBLINPHONE_EXTENDED_SRC_FILES=
LIBLINPHONE_EXTENDED_C_INCLUDES=
LIBLINPHONE_EXTENDED_CFLAGS=
APP_STL=stlport_static
ANT_SILENT=$(shell ant -h | grep -q -- -S && echo 1 || echo 0)
# Checks
CHECK_MSG=$(shell ./check_tools.sh)
ifneq ($(CHECK_MSG),)
$(error Some tools are missing.)
else
ifeq ($(BUILD_OPENH264),1)
ifneq ($(shell echo $(NDK_MAJOR_VERSION)\>=10 | bc),1)
$(error ndk version [$(NDK_MAJOR_VERSION)] not compatible with openh264.)
endif
endif
include check_tools.mk
endif
OPENSSL_DIR=$(shell openssl version -d | sed "s/OPENSSLDIR: \"\(.*\)\"/\1/")
ifneq ($(shell ls $(OPENSSL_DIR)/certs),)
HTTPS_CA_DIR=$(OPENSSL_DIR)/certs
else
HTTPS_CA_DIR=$(OPENSSL_DIR)
endif
ifeq ($(ANT_SILENT), 1)
ANT=ant -e -S
else
ANT=ant -e
endif
# Temporary check: in case of MediastreamActivity.java file existing while it should not anymore, print an error message
# and abort build since otherwise java compilation will fail.
ifneq ($(shell ls ./submodules/linphone/mediastreamer2/java/src/org/linphone/mediastream/MediastreamerActivity.java 2>/dev/null),)
$(error ./submodules/linphone/mediastreamer2/java/src/org/linphone/mediastream/MediastreamerActivity.java found: please either remove it or move it to MediastreamActivity.java.ignored before continuing.)
endif
ifeq ($(BUILD_NON_FREE_CODECS), 0)
BUILD_OPENH264=0
ENABLE_OPENH264_DECODER=0
BUILD_AMRNB=0
BUILD_AMRWB=0
BUILD_G729=0
BUILD_X264=0
endif
all: update-project generate-apk
ifeq ($(ENABLE_GPL_THIRD_PARTIES),1)
@echo "***************************************************************************"
@echo "***** CAUTION, this liblinphone SDK is built using 3rd party GPL code *****"
@echo "***** Even if you acquired a proprietary license from Belledonne *****"
@echo "***** Communications, this SDK is GPL and GPL only. *****"
@echo "***** To disable 3rd party gpl code, please use: *****"
@echo "***** $$ make ENABLE_GPL_THIRD_PARTIES=0 *****"
@echo "***************************************************************************"
else
@echo
@echo "*****************************************************************"
@echo "***** Linphone SDK without 3rd party GPL software *****"
@echo "***** If you acquired a proprietary license from Belledonne *****"
@echo "***** Communications, this SDK can be used to create *****"
@echo "***** a proprietary linphone-based application. *****"
@echo "*****************************************************************"
endif
install: install-apk run-linphone
#libilbc
LIBILBC_SRC_DIR=$(TOPDIR)/submodules/libilbc-rfc3951
LIBILBC_BUILD_DIR=$(LIBILBC_SRC_DIR)
$(LIBILBC_SRC_DIR)/configure:
cd $(LIBILBC_SRC_DIR) && ./autogen.sh
$(LIBILBC_BUILD_DIR)/Makefile: $(LIBILBC_SRC_DIR)/configure
cd $(LIBILBC_BUILD_DIR) && \
./configure \
$(LIBILBC_BUILD_DIR)/src/iLBC_decode.c: $(LIBILBC_BUILD_DIR)/Makefile
cd $(LIBILBC_BUILD_DIR)/downloads && make \
|| ( echo "iLBC prepare stage failed" ; exit 1 )
ifeq ($(BUILD_ILBC),1)
prepare-ilbc: $(LIBILBC_BUILD_DIR)/src/iLBC_decode.c
else
prepare-ilbc:
endif
#ffmpeg
ifeq ($(BUILD_VIDEO),1)
BUILD_FFMPEG_DEPS=$(FFMPEG_SRC_DIR)/non_versioned_soname_patch_applied.txt $(FFMPEG_BUILD_DIR)/arm/libffmpeg-linphone-arm.so
ifeq ($(BUILD_FOR_X86), 1)
BUILD_FFMPEG_DEPS+=$(FFMPEG_BUILD_DIR)/x86/libffmpeg-linphone-x86.so
endif
endif
FFMPEG_SRC_DIR=$(TOPDIR)/submodules/externals/ffmpeg
FFMPEG_BUILD_DIR=$(TOPDIR)/submodules/externals/build/ffmpeg
FFMPEG_CONFIGURE_OPTIONS=--target-os=linux --enable-cross-compile --enable-runtime-cpudetect \
--disable-everything --disable-doc --disable-ffplay --disable-ffmpeg --disable-ffprobe --disable-ffserver \
--disable-avdevice --disable-avfilter --disable-avformat --disable-swresample --disable-network \
--enable-decoder=mjpeg --enable-encoder=mjpeg --enable-decoder=mpeg4 --enable-encoder=mpeg4 --enable-decoder=h264 \
--enable-decoder=h263p --enable-encoder=h263p --enable-decoder=h263 --enable-encoder=h263 --extra-cflags="-w" \
--disable-static --enable-shared --disable-symver
FFMPEG_ARM_CONFIGURE_OPTIONS=--build-suffix=-linphone-arm --arch=arm --sysroot=$(ARM_SYSROOT) --cross-prefix=$(ARM_TOOLCHAIN_PATH) --enable-pic
FFMPEG_X86_CONFIGURE_OPTIONS=--build-suffix=-linphone-x86 --arch=x86 --sysroot=$(X86_SYSROOT) --cross-prefix=$(X86_TOOLCHAIN_PATH) --disable-mmx --disable-sse2 --disable-ssse3 --extra-cflags='-O3'
$(FFMPEG_SRC_DIR)/non_versioned_soname_patch_applied.txt:
@patch -p0 < $(TOPDIR)/patches/ffmpeg_non_versioned_soname.patch
touch $@
$(FFMPEG_BUILD_DIR)/arm/config.h:
mkdir -p $(FFMPEG_BUILD_DIR)/arm && \
cd $(FFMPEG_BUILD_DIR)/arm && \
$(FFMPEG_SRC_DIR)/configure $(FFMPEG_CONFIGURE_OPTIONS) $(FFMPEG_ARM_CONFIGURE_OPTIONS)
sed -i.bak 's/#define HAVE_SYSCTL 1/#define HAVE_SYSCTL 0/g' $(FFMPEG_BUILD_DIR)/arm/config.h
sed -i.bak 's/#define HAVE_GETHRTIME 1/#define HAVE_GETHRTIME 0/g' $(FFMPEG_BUILD_DIR)/arm/config.h
$(FFMPEG_BUILD_DIR)/arm/libavcodec/libavcodec-linphone-arm.so: $(FFMPEG_BUILD_DIR)/arm/config.h
cd $(FFMPEG_BUILD_DIR)/arm && \
make -j${NUMCPUS} \
|| ( echo "Build of ffmpeg for arm failed." ; exit 1 )
$(FFMPEG_BUILD_DIR)/arm/libffmpeg-linphone-arm.so: $(FFMPEG_BUILD_DIR)/arm/libavcodec/libavcodec-linphone-arm.so
cd $(FFMPEG_BUILD_DIR)/arm && \
rm libavcodec/log2_tab.o && \
$(ARM_TOOLCHAIN_PATH)gcc -lm -lz --sysroot=$(ARM_SYSROOT) -Wl,--no-undefined -Wl,-z,noexecstack -shared libavutil/*.o libavutil/arm/*.o libavcodec/*.o libavcodec/arm/*.o libswscale/*.o -o libffmpeg-linphone-arm.so
$(FFMPEG_BUILD_DIR)/x86/config.h:
mkdir -p $(FFMPEG_BUILD_DIR)/x86 && \
cd $(FFMPEG_BUILD_DIR)/x86 && \
$(FFMPEG_SRC_DIR)/configure $(FFMPEG_CONFIGURE_OPTIONS) $(FFMPEG_X86_CONFIGURE_OPTIONS)
sed -i.bak 's/#define HAVE_SYSCTL 1/#define HAVE_SYSCTL 0/g' $(FFMPEG_BUILD_DIR)/x86/config.h
sed -i.bak 's/#define HAVE_GETHRTIME 1/#define HAVE_GETHRTIME 0/g' $(FFMPEG_BUILD_DIR)/x86/config.h
$(FFMPEG_BUILD_DIR)/x86/libavcodec/libavcodec-linphone-x86.so: $(FFMPEG_BUILD_DIR)/x86/config.h
cd $(FFMPEG_BUILD_DIR)/x86 && \
make -j${NUMCPUS} \
|| ( echo "Build of ffmpeg for x86 failed." ; exit 1 )
$(FFMPEG_BUILD_DIR)/x86/libffmpeg-linphone-x86.so: $(FFMPEG_BUILD_DIR)/x86/libavcodec/libavcodec-linphone-x86.so
cd $(FFMPEG_BUILD_DIR)/x86 && \
rm libavcodec/log2_tab.o && \
$(X86_TOOLCHAIN_PATH)gcc -lm -lz --sysroot=$(X86_SYSROOT) -Wl,--no-undefined -Wl,-z,noexecstack -shared libavutil/*.o libavutil/x86/*.o libavcodec/*.o libavcodec/x86/*.o libswscale/*.o -o libffmpeg-linphone-x86.so
build-ffmpeg: $(BUILD_FFMPEG_DEPS)
clean-ffmpeg:
rm -rf $(FFMPEG_BUILD_DIR)/arm && \
rm -rf $(FFMPEG_BUILD_DIR)/x86
#x264
ifeq ($(BUILD_VIDEO),1)
ifeq ($(BUILD_X264), 1)
BUILD_X264_DEPS=$(X264_SRC_DIR)/log2f_fix_patch_applied.txt $(X264_BUILD_DIR)/arm/libx264.a
ifeq ($(BUILD_FOR_X86), 1)
BUILD_X264_DEPS+=$(X264_BUILD_DIR)/x86/libx264.a
endif
endif
X264_SRC_DIR=$(TOPDIR)/submodules/externals/x264
X264_BUILD_DIR=$(TOPDIR)/submodules/externals/build/x264
X264_CONFIGURE_OPTIONS=--enable-static
X264_ARM_CONFIGURE_OPTIONS=--host=arm-none-linux-gnueabi --sysroot=$(ARM_SYSROOT) --cross-prefix=$(ARM_TOOLCHAIN_PATH) --enable-pic
X264_X86_CONFIGURE_OPTIONS=--host=i686-linux-gnueabi --sysroot=$(X86_SYSROOT) --cross-prefix=$(X86_TOOLCHAIN_PATH)
$(X264_SRC_DIR)/log2f_fix_patch_applied.txt:
@patch -p0 < $(TOPDIR)/patches/x264_log2f_fix.patch
touch $@
$(X264_BUILD_DIR)/arm/libx264.a:
mkdir -p $(X264_BUILD_DIR)/arm && \
cd $(X264_SRC_DIR) && \
$(X264_SRC_DIR)/configure $(X264_CONFIGURE_OPTIONS) $(X264_ARM_CONFIGURE_OPTIONS) && \
make -j$(NUMCPUS) STRIP= && \
cp libx264.a $(X264_BUILD_DIR)/arm/libx264.a && \
make clean \
|| ( echo "Build of x264 for arm failed." ; exit 1 )
$(X264_BUILD_DIR)/x86/libx264.a:
mkdir -p $(X264_BUILD_DIR)/x86 && \
cd $(X264_SRC_DIR) && \
$(X264_SRC_DIR)/configure $(X264_CONFIGURE_OPTIONS) $(X264_X86_CONFIGURE_OPTIONS) && \
make -j$(NUMCPUS) STRIP= && \
cp libx264.a $(X264_BUILD_DIR)/x86/libx264.a && \
make clean \
|| ( echo "Build of x264 for x86 failed." ; exit 1 )
endif
build-x264: $(BUILD_X264_DEPS)
clean-x264:
rm -rf $(X264_BUILD_DIR)/arm && \
rm -rf $(X264_BUILD_DIR)/x86
#openh264
ifeq ($(BUILD_VIDEO),1)
ifeq ($(BUILD_OPENH264), 1)
BUILD_OPENH264_DEPS=build-openh264-arm
ifeq ($(BUILD_FOR_X86), 1)
BUILD_OPENH264_DEPS+=build-openh264-x86
endif
endif
endif
OPENH264_SRC_DIR=$(TOPDIR)/submodules/externals/openh264
OPENH264_BUILD_DIR=$(TOPDIR)/submodules/externals/build/openh264
OPENH264_BUILD_DIR_ARM=$(OPENH264_BUILD_DIR)/arm
OPENH264_BUILD_DIR_X86=$(OPENH264_BUILD_DIR)/x86
$(OPENH264_SRC_DIR)/patch.stamp: $(TOPDIR)/patches/openh264-permissive.patch
cd $(OPENH264_SRC_DIR) && patch -p1 < $(TOPDIR)/patches/openh264-permissive.patch && touch $(OPENH264_SRC_DIR)/patch.stamp
openh264-patch: $(OPENH264_SRC_DIR)/patch.stamp
openh264-install-headers:
mkdir -p $(OPENH264_SRC_DIR)/include/wels
rsync -rvLpgoc --exclude ".git" $(OPENH264_SRC_DIR)/codec/api/svc/* $(OPENH264_SRC_DIR)/include/wels/.
copy-openh264-x86: openh264-patch openh264-install-headers
mkdir -p $(OPENH264_BUILD_DIR)
mkdir -p $(OPENH264_BUILD_DIR_X86)
cd $(OPENH264_BUILD_DIR_X86) \
&& rsync -rvLpgoc --exclude ".git" $(OPENH264_SRC_DIR)/* .
copy-openh264-arm: openh264-patch openh264-install-headers
mkdir -p $(OPENH264_BUILD_DIR)
mkdir -p $(OPENH264_BUILD_DIR_ARM)
cd $(OPENH264_BUILD_DIR_ARM) \
&& rsync -rvLpgoc --exclude ".git" $(OPENH264_SRC_DIR)/* .
build-openh264-x86: copy-openh264-x86
cd $(OPENH264_BUILD_DIR_X86) && \
make libraries -j$(NUMCPUS) OS=android ARCH=x86 NDKROOT=$(NDK_PATH) TARGET=$(NDKBUILD_TARGET)
build-openh264-arm: copy-openh264-arm
cd $(OPENH264_BUILD_DIR_ARM) && \
make libraries -j$(NUMCPUS) OS=android ARCH=arm NDKROOT=$(NDK_PATH) TARGET=$(NDKBUILD_TARGET)
build-openh264: $(BUILD_OPENH264_DEPS)
clean-openh264:
cd $(OPENH264_SRC_DIR) && git clean -dfx && git reset --hard
rm -rf $(OPENH264_BUILD_DIR_ARM)
rm -rf $(OPENH264_BUILD_DIR_X86)
#libvpx
ifeq ($(BUILD_VIDEO),1)
BUILD_VPX_DEPS=$(LIBVPX_SRC_DIR)/configure_android_x86_patch_applied.txt $(LIBVPX_BUILD_DIR)/arm/libvpx.a
ifeq ($(BUILD_FOR_X86), 1)
BUILD_VPX_DEPS+=$(LIBVPX_BUILD_DIR)/x86/libvpx.a
endif
endif
LIBVPX_SRC_DIR=$(TOPDIR)/submodules/externals/libvpx
LIBVPX_BUILD_DIR=$(TOPDIR)/submodules/externals/build/libvpx
LIBVPX_CONFIGURE_OPTIONS=--disable-vp9 --disable-examples --disable-unit-tests --disable-postproc --enable-error-concealment --enable-debug
$(LIBVPX_SRC_DIR)/configure_android_x86_patch_applied.txt:
@patch -p1 < $(TOPDIR)/patches/libvpx_configure_android_x86.patch
touch $@
$(LIBVPX_BUILD_DIR)/arm/libvpx.a:
mkdir -p $(LIBVPX_BUILD_DIR)/arm && \
cd $(LIBVPX_BUILD_DIR)/arm && \
$(LIBVPX_SRC_DIR)/configure --target=armv7-android-gcc --sdk-path=$(NDK_PATH) $(LIBVPX_CONFIGURE_OPTIONS) && \
make -j${NUMCPUS} \
|| ( echo "Build of libvpx for arm failed." ; exit 1 )
$(LIBVPX_BUILD_DIR)/x86/libvpx.a:
mkdir -p $(LIBVPX_BUILD_DIR)/x86 && \
cd $(LIBVPX_BUILD_DIR)/x86 && \
$(LIBVPX_SRC_DIR)/configure --target=x86-android-gcc --sdk-path=$(NDK_PATH) $(LIBVPX_CONFIGURE_OPTIONS) && \
make -j${NUMCPUS} \
|| ( echo "Build of libvpx for x86 failed." ; exit 1 )
build-vpx: $(BUILD_VPX_DEPS)
clean-vpx:
cd $(LIBVPX_SRC_DIR) && git clean -dfx && git reset --hard
rm -rf submodules/externals/build/libvpx/arm && \
rm -rf submodules/externals/build/libvpx/x86
#srtp
$(TOPDIR)/submodules/externals/srtp/config.h : $(TOPDIR)/submodules/externals/build/srtp/config.h
@cd $(TOPDIR)/submodules/externals/srtp/ && \
cp ../build/srtp/config.h . \
|| ( echo "SRTP prepare state failed." ; exit 1 )
prepare-srtp: $(TOPDIR)/submodules/externals/srtp/config.h
#ms2
prepare-mediastreamer2:
@cd $(TOPDIR)/submodules/linphone/mediastreamer2/src/ && \
eval `cat Makefile.am | grep xxd | grep yuv2rgb.vs | sed 's/\$$(abs_builddir)/./'` && \
eval `cat Makefile.am | grep xxd | grep yuv2rgb.fs | sed 's/\$$(abs_builddir)/./'` && \
if ! [ -e yuv2rgb.vs.h ]; then echo "yuv2rgb.vs.h creation error (do you have 'xxd' application installed ?)"; exit 1; fi && \
if ! [ -e yuv2rgb.fs.h ]; then echo "yuv2rgb.fs.h creation error (do you have 'xxd' application installed ?)"; exit 1; fi
#antlr3
ANLTR3_SRC_DIR=$(TOPDIR)/submodules/externals/antlr3/runtime/C/include/
ANTLR3_BUILD_DIR=$(ANTLR3_SRC_DIR)
$(ANLTR3_SRC_DIR)/antlr3config.h: $(TOPDIR)/submodules/externals/build/antlr3/antlr3config.h
cp $(TOPDIR)/submodules/externals/build/antlr3/antlr3config.h $(ANLTR3_SRC_DIR)
prepare-antlr3: $(ANLTR3_SRC_DIR)/antlr3config.h
%.tokens: %.g
$(ANTLR) -make -fo $(dir $^) $^
#Belle-sip
BELLESIP_SRC_DIR=$(TOPDIR)/submodules/belle-sip
BELLESIP_BUILD_DIR=$(BELLESIP_SRC_DIR)
prepare-belle-sip: $(BELLESIP_SRC_DIR)/src/grammars/belle_sip_message.tokens $(BELLESIP_SRC_DIR)/src/grammars/belle_sdp.tokens
#CUnit
prepare-cunit: $(TOPDIR)/submodules/externals/cunit/CUnit/Headers/*.h
[ -d $(TOPDIR)/submodules/externals/build/cunit/CUnit ] || mkdir $(TOPDIR)/submodules/externals/build/cunit/CUnit
cp $^ $(TOPDIR)/submodules/externals/build/cunit/CUnit
$(TOPDIR)/res/raw/rootca.pem:
HTTPS_CA_DIR=$(HTTPS_CA_DIR) $(TOPDIR)/submodules/linphone/scripts/mk-ca-bundle.pl $@
prepare-liblinphone_tester: $(TOPDIR)/submodules/linphone/tester/tester_hosts $(TOPDIR)/res/raw/rootca.pem $(TOPDIR)/submodules/linphone/tester/messages.db
rm -rf liblinphone_tester/assets/config_files
mkdir -p liblinphone_tester/assets/config_files
for file in $^; do \
cp -rf $$file $(TOPDIR)/liblinphone_tester/assets/config_files/. \
;done
cp -rf $(TOPDIR)/submodules/linphone/tester/certificates $(TOPDIR)/liblinphone_tester/assets/config_files
cp -rf $(TOPDIR)/submodules/linphone/tester/sounds $(TOPDIR)/liblinphone_tester/assets/config_files
cp -rf $(TOPDIR)/submodules/linphone/tester/images $(TOPDIR)/liblinphone_tester/assets/config_files
cp -rf $(TOPDIR)/submodules/linphone/tester/rcfiles $(TOPDIR)/liblinphone_tester/assets/config_files
#Matroska2
MATROSKA_SRC_DIR=$(TOPDIR)/submodules/externals/libmatroska
MATROSKA_BUILD_DIR=$(TOPDIR)/submodules/externals/build/libmatroska
ifeq ($(BUILD_MATROSKA), 1)
prepare-matroska2: $(MATROSKA_SRC_DIR)/patch_applied.txt
else
prepare-matroska2:
endif
$(MATROSKA_SRC_DIR)/patch_applied.txt: $(MATROSKA_BUILD_DIR)/fix_libmatroska2.patch
cd $(MATROSKA_SRC_DIR); patch -p1 < $<; touch $@
#Build targets
prepare-sources: build-ffmpeg build-x264 build-openh264 prepare-ilbc build-vpx prepare-srtp prepare-mediastreamer2 prepare-antlr3 prepare-belle-sip $(TOPDIR)/res/raw/rootca.pem prepare-matroska2
GENERATE_OPTIONS = NDK_DEBUG=$(NDK_DEBUG) BUILD_FOR_X86=$(BUILD_FOR_X86) \
BUILD_AMRNB=$(BUILD_AMRNB) BUILD_AMRWB=$(BUILD_AMRWB) BUILD_SILK=$(BUILD_SILK) BUILD_G729=$(BUILD_G729) BUILD_OPUS=$(BUILD_OPUS) \
BUILD_VIDEO=$(BUILD_VIDEO) BUILD_X264=$(BUILD_X264) BUILD_OPENH264=$(BUILD_OPENH264) ENABLE_OPENH264_DECODER=$(ENABLE_OPENH264_DECODER) BUILD_MATROSKA=$(BUILD_MATROSKA) \
BUILD_UPNP=$(BUILD_UPNP) BUILD_ZRTP=$(BUILD_ZRTP) BUILD_WEBRTC_AECM=$(BUILD_WEBRTC_AECM) BUILD_WEBRTC_ISAC=$(BUILD_WEBRTC_ISAC) BUILD_ILBC=$(BUILD_ILBC) \
BUILD_FOR_ARM=$(BUILD_FOR_ARM) BUILD_NON_FREE_CODECS=$(BUILD_NON_FREE_CODECS)
LIBLINPHONE_OPTIONS = $(GENERATE_OPTIONS) \
LIBLINPHONE_VERSION=$(LIBLINPHONE_VERSION) BELLESIP_VERSION=$(BELLESIP_VERSION) USE_JAVAH=$(USE_JAVAH) \
BUILD_TUNNEL=$(BUILD_TUNNEL) BUILD_TLS=$(BUILD_TLS) BUILD_SQLITE=$(BUILD_SQLITE) \
BUILD_CONTACT_HEADER=$(BUILD_CONTACT_HEADER) BUILD_RTP_MAP=$(BUILD_RTP_MAP) \
LIBLINPHONE_EXTENDED_SRC_FILES="$(LIBLINPHONE_EXTENDED_SRC_FILES)" \
LIBLINPHONE_EXTENDED_C_INCLUDES="$(LIBLINPHONE_EXTENDED_C_INCLUDES)" \
LIBLINPHONE_EXTENDED_CFLAGS="$(LIBLINPHONE_EXTENDED_CFLAGS)" \
APP_STL="$(APP_STL)" \
BUILD_DONT_CHECK_HEADERS_IN_MESSAGE=$(BUILD_DONT_CHECK_HEADERS_IN_MESSAGE)
MEDIASTREAMER2_OPTIONS = $(GENERATE_OPTIONS) BUILD_MEDIASTREAMER2_SDK=1
generate-libs: prepare-sources javah
$(NDK_PATH)/ndk-build $(LIBLINPHONE_OPTIONS) -j$(NUMCPUS) TARGET_PLATFORM=$(NDKBUILD_TARGET)
./bsed.sh # Fix path to libffmpeg library in linphone.so because of Android M Preview issue: https://code.google.com/p/android-developer-preview/issues/detail?id=2239
generate-mediastreamer2-libs: prepare-sources
@cd $(TOPDIR)/submodules/linphone/mediastreamer2/java && \
$(NDK_PATH)/ndk-build $(MEDIASTREAMER2_OPTIONS) -j$(NUMCPUS) TARGET_PLATFORM=$(NDKBUILD_TARGET)
update-project: $(TOPDIR)/res/raw/rootca.pem
$(SDK_PATH)/android update project --path . --target $(ANDROID_MOST_RECENT_TARGET)
$(SDK_PATH)/android update test-project --path tests -m .
$(SDK_PATH)/android update project --path liblinphone_tester --target $(ANDROID_MOST_RECENT_TARGET)
update-mediastreamer2-project:
@cd $(TOPDIR)/submodules/linphone/mediastreamer2/java && \
$(SDK_PATH)/android update project --path . --target $(ANDROID_MOST_RECENT_TARGET)
liblinphone_tester: update-project prepare-sources prepare-cunit prepare-liblinphone_tester javah
$(NDK_PATH)/ndk-build -C liblinphone_tester $(LIBLINPHONE_OPTIONS) -j$(NUMCPUS) TARGET_PLATFORM=$(NDKBUILD_TARGET)
$(MAKE) -C liblinphone_tester
javah:
$(ANT) javah
generate-apk: java-clean generate-libs
echo "version.name=$(LINPHONE_ANDROID_DEBUG_VERSION)" > default.properties
$(ANT) debug
generate-mediastreamer2-apk: java-clean generate-mediastreamer2-libs
@cd $(TOPDIR)/submodules/linphone/mediastreamer2/java && \
echo "version.name=$(LINPHONE_ANDROID_DEBUG_VERSION)" > default.properties && \
$(ANT) debug
uninstall:
adb uninstall $(PACKAGE_NAME)
install-apk:
ant installd
release: update-project
$(ANT) clean
patch -p1 < release.patch
cat ant.properties | grep version.name > default.properties
$(ANT) release
patch -Rp1 < release.patch
run-linphone:
ant run
run-liblinphone-tests: liblinphone_tester
$(MAKE) -C liblinphone_tester run-all-tests
run-basic-tests: update-project
$(ANT) partial-clean
$(MAKE) -C tests run-basic-tests ANT_SILENT=$(ANT_SILENT)
run-all-tests: update-project
$(ANT) partial-clean
$(MAKE) -C tests run-all-tests ANT_SILENT=$(ANT_SILENT)
clean-ndk-build:
- $(NDK_PATH)/ndk-build clean $(LIBLINPHONE_OPTIONS)
$(ANT) clean
@if [ -f $(TOPDIR)/submodules/linphone/mediastreamer2/java/project.properties ]; then \
cd $(TOPDIR)/submodules/linphone/mediastreamer2/java && $(ANT) clean; \
fi
.NOTPARALLEL clean-native: clean-ndk-build clean-ffmpeg clean-x264 clean-openh264 clean-vpx
java-clean:
$(ANT) clean
clean: clean-native java-clean
veryclean: clean
.PHONY: clean install-apk run-linphone
generate-sdk: liblinphone-android-sdk
liblinphone-android-sdk: generate-apk
$(ANT) liblinphone-android-sdk
linphone-android-sdk: generate-apk
$(ANT) linphone-android-sdk
mediastreamer2-sdk: update-mediastreamer2-project generate-mediastreamer2-apk
@cd $(TOPDIR)/submodules/linphone/mediastreamer2/java && \
$(ANT) mediastreamer2-sdk
pull-transifex:
tx pull -af
push-transifex:
tx push -s -t -f --no-interactive

94
README
View file

@ -8,22 +8,24 @@ COMPILATION INSTRUCTIONS
To build liblinphone for Android, you must:
-------------------------------------------
0) download the Android sdk with platform-tools and tools updated to latest revision (at least API 16 is needed), then add both 'tools' and 'platform-tools' folders in your path.
1) download the Android ndk (=r10c) from google and add it to your path (no symlink !!!).
2) install yasm, nasm, curl, ant, rsync and the autotools: autoconf, automake, aclocal, libtoolize, pkgconfig
1) download the Android ndk (version r11) from google and add it to your path (no symlink !!!).
2) install yasm, nasm, ant, python, cmake and vim-common
On 64 bits linux systems you'll need the ia32-libs package
With the latest Debian (multiarch), you need this:
dpkg --add-architecture i386
aptitude update
aptitude install libstdc++6:i386 libgcc1:i386 zlib1g:i386 libncurses5:i386
3) run the Makefile script in the top level directory. This will download iLBC source files and convert some assembly files in VP8 project.
3) run `./prepare.py` in the top level directory. This will configure the build and generate a Makefile in the top level directory.
Some options can be passed to choose what you want to include in the build and the platforms for which you want to build. Use `./prepare.py --help` to see what these options are.
4) run the Makefile script in the top level directory.
$ make
4) (Optional) To install the generated apk into a plugged device, run
5) (Optional) To install the generated apk into a plugged device, run
$ make install
5) (Optional) To generate a liblinphone SDK zip containing a full jar and native libraries, run
6) (Optional) To generate a liblinphone SDK zip containing a full jar and native libraries, run
$ make liblinphone-android-sdk
6) (Optional) To generate a libmediastreamer2 SDK zip containing a full jar and native libraries, run
7) (Optional) To generate a libmediastreamer2 SDK zip containing a full jar and native libraries, run
$ make mediastreamer2-sdk
7) (Optional) To generate a signed apk to publish on the Google Play, run
8) (Optional) To generate a signed apk to publish on the Google Play, run
$ make release
Make sure you filled the ant.properties values for version.name, key.store and key.alias in order to correctly sign the generated apk.
You also may want to create a file name ant_password.properties with the following:
@ -42,7 +44,7 @@ To create an apk with a different package name
You need to edit the custom_rules.xml file:
1) look for the property named "linphone.package.name" and change it value accordingly
2) also update the values in the AndroidManifest file where the comment <!-- Change package ! --> appears
3) update the path to the sounds in the linphonerc-factory files in the res folders and optionally change default sip account on linphonerc-default
3) change the package name also in the files: res/xml/syncadapter.xml, res/xml/contacts.xml and res/values/non_localizable_custom where <!-- Change package ! --> appears
4) run again the Makefile script by calling "make"
To run the liblinphone test suite on android
@ -51,8 +53,7 @@ Simply run
$ make liblinphone_tester
This will be build everything, generate an apk, and install it on the connected device if any.
You can speed up the compilation by using ccache (compiler cache, see https://ccache.samba.org/). Simply export:
export NDK_CCACHE=ccache
You can speed up the compilation by using ccache (compiler cache, see https://ccache.samba.org/). Give the "-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache" options to the prepare.py script.
TROUBLESHOOTING
***************
@ -73,74 +74,7 @@ Caused by: java.lang.UnsatisfiedLinkError: Couldn't load linphone-armeabi-v7a: f
BUILD OPTIONS
*************
Some options can be passed to make, like "make SOME_OPTION=SOME_VALUE".
The build options are to be passed to the prepare.py script.
For example to enable the x264 encoder give the "-DENABLE_X264=YES" to prepare.py.
ENABLE_GPL_THIRD_PARTIES
values: 0 (GPL third parties disabled) or 1 (GPL third parties enabled), default value: 1
GPL third parties are: X264 and G729
BUILD_VIDEO
values: 0 (no video) or 1 (video enabled), default value: 1
BUILD_OPENH264
values: 0 (don't build openH264) or 1 (build openH264), default value: 1
ENABLE_OPENH264_DECODER
values: 0 (disable openh264 decoder) or 1 (enable openh264 decoder), default value: 1
BUILD_X264
values: 0 (don't build x264) or 1 (build x264), default value: 0
BUILD_AMRNB
values: 0 (don't build amrnb codec), light (try to use amrnb codec from android), full (build your own amrnb codec), default value: full
BUILD_AMRWB
values: 0 (don't build amrwb codec), 1 (build your own amrwb codec): default value: 1
BUILD_ZRTP
values: 0 (don't support ZRTP), 1 (support ZRTP), default value: 1
BUILD_SILK
values: 0 (don't build silk plugin), 1 (build silk) [silk is Skype nonfree patented audio codec], default value: 1
BUILD_G729
values: 0 (don't build g729 plugin), 1 (build g729) [g729 is nonfree patented audio codec, contact Sipro lab for more details]
default value: 1
BUILD_TUNNEL
values: 0 (don't build tunnel), 1 (build tunnel) [requires a non-free tunnel implementation in submodules/linphone/tunnel]
default value: 0
BUILD_WEBRTC_AECM
values: 0 (don't build echo canceler), 1 (build echo canceler)
default value: 1
USE_JAVAH
values: 0 (don't generate header), 1 (generate header for linphone_core_jni) [used to check errors at liblinphone compilation]
default value: 1
BUILD_FOR_X86
values: 0 (don't generate liblinphone libraries for x86 architecture), 1 (build liblinphone libraries for x86 architecture)
default value: 1
BUILD_SQLITE
values: 0 (don't build sqlite3), 1 (build sqlite3) [used to store chat messages inside liblinphone]
default value: 1
BUILD_TLS
values: 0 (don't build tls), 1 (do build tls), default value: 1
BUILD_WEBRTC_ISAC
values: 0 (don't build isac), 1 (do build isac), default value: 1
BUILD_OPUS
values: 0 (don't build opus), 1 (do build opus), default value: 1
BUILD_UPNP
values: 0 (don't build upnp), 1 (do build upnp), default value: 1
BUILD_MATROSKA
values: 0 (don't build matroska and ebml), 1 (do build matroska and ebml), default value: 0
BUILD_ILBC
values: 0 (don't build iLBC), 1 (do build iLBC), default value: 1
The available options can be listed with the `./prepare.py --list-features`

View file

@ -1,4 +1,4 @@
source.dir=src:submodules/linphone/mediastreamer2/java/src:submodules/linphone/java/j2se:submodules/linphone/java/common:submodules/linphone/java/impl:submodules/linphone/coreapi/help/java:submodules/externals/axmlrpc/src/main/java
key.store=bc-android.keystore
key.alias=nw8000
version.name=2.4.0
version.name=2.5.0

View file

@ -3,7 +3,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.0'
classpath 'com.android.tools.build:gradle:1.3.0'
}
}
apply plugin: 'android'
@ -13,7 +13,7 @@ dependencies {
}
android {
compileSdkVersion 22
compileSdkVersion 23
buildToolsVersion "20.0.0"
sourceSets {

View file

@ -18,7 +18,11 @@ check_installed() {
for prog in automake autoconf pkg-config java ant yasm nasm wget; do
check_installed "$prog" "it"
done
check_installed "libtoolize" "libtool"
if [ $(uname) = "Darwin" ]; then
check_installed "libtool" "libtool"
else
check_installed "libtoolize" "libtool"
fi
check_installed "ndk-build" "android NDK"
if check_installed "android" "android SDK"; then
check_installed "adb" "android SDK platform tools"

View file

@ -36,6 +36,7 @@
<class name="org.linphone.core.PresencePersonImpl" />
<class name="org.linphone.core.PresenceServiceImpl" />
<class name="org.linphone.core.ErrorInfoImpl" />
<class name="org.linphone.core.TunnelConfigImpl" />
</javah>
<javah outputfile="gen/xml2lpc_jni.h">
<classpath>
@ -126,24 +127,28 @@
<zip destfile="liblinphone-android-sdk-${version.name}.zip">
<zipfileset dir="libs" prefix="libs" includes="**/*.so" />
<zipfileset dir="${out.absolute.dir}" includes="liblinphone.jar" prefix="libs"/>
<zipfileset dir="libs-debug" prefix="libs-debug" includes="**/*.so" />
<zipfileset dir="${out.absolute.dir}" includes="liblinphone.jar" prefix="libs-debug"/>
</zip>
</target>
<target name="linphone-android-sdk">
<echo level="info">Creating library output jar file...</echo>
<property name="out.library.jar.file" location="${out.absolute.dir}/linphone.jar" />
<jar destfile="${out.library.jar.file}">
<fileset dir="${out.classes.absolute.dir}"
includes="org/linphone/mediastream/**/*.class org/linphone/core/**/*.class org/linphone/**/*.class"/>
<fileset dir="submodules/linphone/java" >
<include name="common/org/linphone/core/*.java"/>
<include name="j2se/org/linphone/core/*.java"/>
</fileset>
</jar>
<echo level="info">Creating library output jar file...</echo>
<property name="out.library.jar.file" location="${out.absolute.dir}/linphone.jar" />
<jar destfile="${out.library.jar.file}">
<fileset dir="${out.classes.absolute.dir}"
includes="org/linphone/mediastream/**/*.class org/linphone/core/**/*.class org/linphone/**/*.class de/timroes/axmlrpc/**/*.class de/timroes/base64/Base64.class"/>
<fileset dir="submodules/linphone/java" >
<include name="common/org/linphone/core/*.java"/>
<include name="j2se/org/linphone/core/*.java"/>
</fileset>
</jar>
<zip destfile="linphone-android-sdk-${version.name}.zip">
<zipfileset dir="libs" prefix="libs" includes="**/*.so" />
<zipfileset dir="${out.absolute.dir}" includes="linphone.jar" prefix="libs"/>
</zip>
</target>
<zipfileset dir="libs" prefix="libs" includes="**/*.so" />
<zipfileset dir="${out.absolute.dir}" includes="linphone.jar" prefix="libs"/>
<zipfileset dir="libs-debug" prefix="libs-debug" includes="**/*.so" />
<zipfileset dir="${out.absolute.dir}" includes="linphone.jar" prefix="libs-debug"/>
</zip>
</target>
</project>

View file

@ -15,7 +15,6 @@ endif
ifeq ($(_BUILD_VIDEO),0)
ifeq (,$(DUMP_VAR))
$(info $(TARGET_ARCH_ABI): Video is disabled for targets other than armeabi-v7a and x86)
endif
endif
@ -54,10 +53,19 @@ include $(linphone-root-dir)/submodules/externals/build/gsm/Android.mk
# Matroska
ifeq ($(BUILD_MATROSKA), 1)
include $(linphone-root-dir)/submodules/externals/build/libmatroska/Android.mk
include $(linphone-root-dir)/submodules/externals/build/libmatroska-c/Android.mk
endif
ifeq ($(BUILD_BCTOOLBOX_MBEDTLS),1)
include $(linphone-root-dir)/submodules/externals/build/mbedtls/Android.mk
include $(linphone-root-dir)/submodules/bctoolbox/build/android/Android-mbedtls.mk
else
include $(linphone-root-dir)/submodules/externals/build/polarssl/Android.mk
include $(linphone-root-dir)/submodules/bctoolbox/build/android/Android-polarssl.mk
endif
include $(linphone-root-dir)/submodules/bctoolbox/build/android/Android-tester.mk
ifeq ($(BUILD_MEDIASTREAMER2_SDK), 0)
include $(linphone-root-dir)/submodules/externals/build/antlr3/Android.mk
include $(linphone-root-dir)/submodules/belle-sip/build/android/Android.mk
@ -77,20 +85,19 @@ endif
ifeq ($(BUILD_SILK), 1)
ifeq (,$(DUMP_VAR))
$(info $(TARGET_ARCH_ABI): Build proprietary SILK plugin for mediastreamer2)
endif
include $(linphone-root-dir)/submodules/mssilk/Android.mk
endif
ifeq ($(BUILD_ILBC), 1)
include $(linphone-root-dir)/submodules/msilbc/Android.mk
ifeq ($(BUILD_CODEC2), 1)
include $(linphone-root-dir)/submodules/mscodec2/Android.mk
include $(linphone-root-dir)/submodules/externals/build/codec2/Android.mk
endif
ifeq ($(_BUILD_VIDEO),1)
ifeq ($(_BUILD_X264),1)
ifeq (,$(DUMP_VAR))
$(info $(TARGET_ARCH_ABI): Build X264 plugin for mediastreamer2)
endif
include $(linphone-root-dir)/submodules/msx264/Android.mk
include $(linphone-root-dir)/submodules/externals/build/x264/Android.mk
@ -98,7 +105,6 @@ endif
ifeq ($(_BUILD_OPENH264),1)
ifeq (,$(DUMP_VAR))
$(info $(TARGET_ARCH_ABI): Build OpenH264 plugin for mediastreamer2)
endif
include $(linphone-root-dir)/submodules/msopenh264/Android.mk
include $(linphone-root-dir)/submodules/externals/build/openh264/Android.mk
@ -113,7 +119,6 @@ endif #_BUILD_VIDEO
ifeq ($(BUILD_ZRTP), 1)
ifeq (,$(DUMP_VAR))
$(info $(TARGET_ARCH_ABI): Build ZRTP support)
endif
include $(linphone-root-dir)/submodules/bzrtp/Android.mk
endif
@ -156,31 +161,27 @@ WEBRTC_BUILD_NEON_LIBS=false
# AECM
ifneq ($(BUILD_WEBRTC_AECM),0)
ifeq ($(TARGET_ARCH_ABI), armeabi-v7a)
$(info $(TARGET_ARCH_ABI): Build NEON modules for AECM)
WEBRTC_BUILD_NEON_LIBS=true
endif
$(info $(TARGET_ARCH_ABI): Build AECM from WebRTC)
include $(linphone-root-dir)/submodules/externals/build/webrtc/system_wrappers/Android.mk
include $(linphone-root-dir)/submodules/externals/build/webrtc/modules/audio_processing/utility/Android.mk
include $(linphone-root-dir)/submodules/externals/build/webrtc/modules/audio_processing/aecm/Android.mk
include $(linphone-root-dir)/submodules/mswebrtc/build/android/system_wrappers/Android.mk
include $(linphone-root-dir)/submodules/mswebrtc/build/android/modules/audio_processing/utility/Android.mk
include $(linphone-root-dir)/submodules/mswebrtc/build/android/modules/audio_processing/aecm/Android.mk
endif
# iSAC
ifneq ($(BUILD_WEBRTC_ISAC),0)
# don't build for neon in x86
ifeq ($(TARGET_ARCH_ABI), armeabi-v7a)
$(info $(TARGET_ARCH_ABI): Build NEON modules for ISAC)
WEBRTC_BUILD_NEON_LIBS=true
endif
$(info $(TARGET_ARCH_ABI): Build iSAC plugin for mediastreamer2)
include $(linphone-root-dir)/submodules/externals/build/webrtc/modules/audio_coding/codecs/isac/fix/source/Android.mk
include $(linphone-root-dir)/submodules/mswebrtc/build/android/modules/audio_coding/codecs/isac/fix/source/Android.mk
include $(linphone-root-dir)/submodules/mswebrtc/build/android/modules/audio_coding/codecs/ilbc/Android.mk
endif
# common modules for ISAC and AECM
ifneq ($(BUILD_WEBRTC_AECM)$(BUILD_WEBRTC_ISAC),00)
$(info $(TARGET_ARCH_ABI): Build common modules for iSAC and AECM ($(BUILD_WEBRTC_AECM)$(BUILD_WEBRTC_ISAC)))
include $(linphone-root-dir)/submodules/externals/build/webrtc/common_audio/signal_processing/Android.mk
ifneq ($(BUILD_WEBRTC_AECM)$(BUILD_WEBRTC_ISAC)$(BUILD_ILBC),000)
include $(linphone-root-dir)/submodules/mswebrtc/build/android/common_audio/signal_processing/Android.mk
include $(linphone-root-dir)/submodules/mswebrtc/Android.mk
endif

View file

@ -36,6 +36,10 @@ ifeq ($(BUILD_G729),)
BUILD_G729=0
endif
ifeq ($(BUILD_CODEC2),)
BUILD_CODEC2=0
endif
ifeq ($(BUILD_VIDEO),)
BUILD_VIDEO=1
endif
@ -51,10 +55,15 @@ ifeq ($(BUILD_UPNP),1)
APP_MODULES += libupnp
endif
APP_MODULES +=bctoolbox bctoolbox_tester
ifeq ($(BUILD_TLS),1)
ifeq ($(BUILD_BCTOOLBOX_MBEDTLS),1)
APP_MODULES +=mbedtls
else
APP_MODULES +=polarssl
endif
endif
endif
ifeq ($(BUILD_VIDEO),1)
APP_MODULES += libffmpeg-linphone
@ -99,6 +108,13 @@ ifneq ($(BUILD_OPUS), 0)
APP_MODULES += libopus
endif
ifeq ($(BUILD_ILBC), 1)
APP_MODULES += libwebrtc_spl libwebrtc_ilbc libmswebrtc
ifneq (,$(findstring armeabi,$(TARGET_ARCH_ABI)))
APP_MODULES += libwebrtc_spl_neon
endif
endif
ifneq ($(BUILD_WEBRTC_AECM), 0)
APP_MODULES += libwebrtc_system_wrappers libwebrtc_spl libwebrtc_apm_utility libwebrtc_aecm libmswebrtc
ifneq (,$(findstring armeabi,$(TARGET_ARCH_ABI)))
@ -127,8 +143,8 @@ ifeq ($(BUILD_ZRTP), 1)
APP_MODULES += libbzrtp
endif
ifeq ($(BUILD_ILBC), 1)
APP_MODULES +=libmsilbc
ifeq ($(BUILD_CODEC2), 1)
APP_MODULES +=libcodec2 libmscodec2
endif
ifeq ($(BUILD_SRTP), 1)

View file

@ -1,5 +1,62 @@
all:
ANDROID_MOST_RECENT_TARGET=$(shell android list target -c | grep -E 'android-[0-9]+' | tail -n1)
all: update-project copy-files
ant debug install
run-all-tests: all
ant test
update-project:
android update project --path . --target $(ANDROID_MOST_RECENT_TARGET)
copy-libs:
rm -rf libs/armeabi
mkdir -p assets/config_files
if test -d "../liblinphone-sdk/android-arm"; then \
mkdir -p libs/armeabi && \
cp -f ../liblinphone-sdk/android-arm/lib/libgnustl_shared.so libs/armeabi && \
cp -f ../liblinphone-sdk/android-arm/lib/lib*-armeabi.so libs/armeabi && \
cp -f ../liblinphone-sdk/android-arm/lib/mediastreamer/plugins/*.so libs/armeabi && \
cp -f ../liblinphone-sdk/android-arm/share/linphone/rootca.pem assets/config_files; \
fi
if test -f "../liblinphone-sdk/android-arm/bin/gdbserver"; then \
cp -f ../liblinphone-sdk/android-arm/bin/gdbserver libs/armeabi && \
cp -f ../liblinphone-sdk/android-arm/bin/gdb.setup libs/armeabi; \
fi
rm -rf libs/armeabi-v7a
if test -d "../liblinphone-sdk/android-armv7"; then \
mkdir -p libs/armeabi-v7a && \
cp -f ../liblinphone-sdk/android-armv7/lib/libgnustl_shared.so libs/armeabi-v7a && \
cp -f ../liblinphone-sdk/android-armv7/lib/lib*-armeabi-v7a.so libs/armeabi-v7a && \
cp -f ../liblinphone-sdk/android-armv7/lib/mediastreamer/plugins/*.so libs/armeabi-v7a && \
cp -f ../liblinphone-sdk/android-armv7/share/linphone/rootca.pem assets/config_files; \
fi
if test -f "../liblinphone-sdk/android-armv7/bin/gdbserver"; then \
cp -f ../liblinphone-sdk/android-armv7/bin/gdbserver libs/armeabi-v7a && \
cp -f ../liblinphone-sdk/android-armv7/bin/gdb.setup libs/armeabi-v7a; \
fi
rm -rf libs/x86
if test -d "../liblinphone-sdk/android-x86"; then \
mkdir -p libs/x86 && \
cp -f ../liblinphone-sdk/android-x86/lib/libgnustl_shared.so libs/x86 && \
cp -f ../liblinphone-sdk/android-x86/lib/lib*-x86.so libs/x86 && \
cp -f ../liblinphone-sdk/android-x86/lib/mediastreamer/plugins/*.so libs/x86 && \
cp -f ../liblinphone-sdk/android-x86/share/linphone/rootca.pem assets/config_files; \
fi
if test -f "../liblinphone-sdk/android-x86/bin/gdbserver"; then \
cp -f ../liblinphone-sdk/android-x86/bin/gdbserver libs/x86 && \
cp -f ../liblinphone-sdk/android-x86/bin/gdb.setup libs/x86; \
fi
copy-files: ../submodules/linphone/tester/tester_hosts ../submodules/linphone/tester/messages.db
$(MAKE) copy-libs
rm -rf assets/config_files
mkdir -p assets/config_files
for file in $^; do \
cp -rf $$file assets/config_files/. ; \
done
cp -rf ../submodules/linphone/tester/certificates assets/config_files
cp -rf ../submodules/linphone/tester/images assets/config_files
cp -rf ../submodules/linphone/tester/rcfiles assets/config_files
cp -rf ../submodules/linphone/tester/sounds assets/config_files
cp -rf ../submodules/linphone/tester/vcards assets/config_files

View file

@ -43,6 +43,7 @@
<resourcecontains resource="${output.file}" substring="longMsg=junit.framework.AssertionFailedError: View with id: '" />
<resourcecontains resource="${output.file}" substring="longMsg=java.lang.RuntimeException:" />
<resourcecontains resource="${output.file}" substring="longMsg=java.lang.NullPointerException:" />
<resourcecontains resource="${output.file}" substring="android.util.AndroidException: INSTRUMENTATION_FAILED:" />
</or>
</condition>
<exec executable="bash" unless:set="has.crashed">
@ -72,7 +73,7 @@
</exec>
<exec executable="bash" >
<arg value="-c" />
<arg value="cat ${archive.name} |ndk-stack -sym obj/local/`adb shell getprop ro.product.cpu.abi | tr -d '\r'`" />
<arg value="cat ${archive.name} |ndk-stack -sym libs-debug/`adb shell getprop ro.product.cpu.abi | tr -d '\r'`" />
</exec>
<fail message="Tests crashed" status="125"/>
</target>

View file

@ -23,9 +23,10 @@ public class LogsActivity extends Activity {
@Override
public void run() {
String path = mLogsActivity.getFilesDir().getAbsolutePath()+"/config_files";
String res_path = mLogsActivity.getFilesDir().getAbsolutePath()+"/config_files";
String write_path = mLogsActivity.getCacheDir().getPath();
tester = new TesterLogger(mLogsActivity);
List<String> list = new LinkedList<String>(Arrays.asList(new String[]{"tester", "--verbose", "--config", path}));
List<String> list = new LinkedList<String>(Arrays.asList(new String[]{"tester", "--verbose", "--resource-dir", res_path, "--writable-dir", write_path}));
list.addAll(Arrays.asList(mArgs));
String[] array = list.toArray(new String[list.size()]);
tester.run(array);
@ -37,7 +38,7 @@ public class LogsActivity extends Activity {
});
}
}
private static String join(String [] array, String separator) {
String ret = "";
for(int i = 0; i < array.length; ++i) {
@ -48,7 +49,7 @@ public class LogsActivity extends Activity {
}
return ret;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@ -75,7 +76,7 @@ public class LogsActivity extends Activity {
getMenuInflater().inflate(R.menu.activity_logs, menu);
return true;
}
public void addLog(int level, String message) {
mLogs += message;
((TextView)findViewById(R.id.textView1)).append(message);
@ -86,7 +87,7 @@ public class LogsActivity extends Activity {
finish();
}
}
public void done() {
}
}

View file

@ -16,28 +16,28 @@ public class TestUnit extends AndroidTestCase {
private String mSuite;
private String mTest;
static Boolean isAssetCopied=false;
public TestUnit(String suite, String test) {
mSuite = suite;
mTest = test;
setName(suite + "/" + test);
}
public TestUnit(String name) {
String[] tab = name.split("/");
String[] tab = name.split("/");
mSuite = tab[0];
mTest = tab[1];
setName(name);
}
static public void copyAssetsFromPackage(Context ctx) throws IOException {
copyAssetsFromPackage(ctx,"config_files");
}
public static void copyAssetsFromPackage(Context ctx,String fromPath) throws IOException {
new File(ctx.getFilesDir().getPath()+"/"+fromPath).mkdir();
for (String f :ctx.getAssets().list(fromPath)) {
String current_name=fromPath+"/"+f;
InputStream lInputStream;
@ -50,8 +50,8 @@ public class TestUnit extends AndroidTestCase {
continue;
}
FileOutputStream lOutputStream = new FileOutputStream(new File(ctx.getFilesDir().getPath()+"/"+current_name));//ctx.openFileOutput (fromPath+"/"+f, 0);
int readByte;
byte[] buff = new byte[8048];
while (( readByte = lInputStream.read(buff)) != -1) {
@ -75,13 +75,15 @@ public class TestUnit extends AndroidTestCase {
protected void tearDown() throws Exception {
super.tearDown();
}
@Override
protected void runTest() {
String path = getContext().getFilesDir().getPath()+"/config_files";
String res_path = getContext().getFilesDir().getPath()+"/config_files";
String write_path = getContext().getCacheDir().getPath();
Tester tester = new Tester();
List<String> list = new LinkedList<String>(Arrays.asList(new String[]{"tester", "--verbose", "--config", path, "--suite", mSuite, "--test", mTest}));
List<String> list = new LinkedList<String>(Arrays.asList(new String[]{"tester", "--verbose", "--resource-dir", res_path, "--writable-dir", write_path, "--suite", mSuite, "--test", mTest}));
String[] array = list.toArray(new String[list.size()]);
Assert.assertTrue(tester.run(array) == 0);
}
}
}

View file

@ -25,23 +25,22 @@ public class Tester {
}
static {
System.loadLibrary("cunit");
List<String> cpuabis=Version.getCpuAbis();
String ffmpegAbi;
boolean libLoaded=false;
Throwable firstException=null;
for (String abi : cpuabis){
Log.i("LinphoneCoreFactoryImpl","Trying to load liblinphone for " + abi);
ffmpegAbi=abi;
// FFMPEG (audio/video)
if (abi.startsWith("armeabi")) {
ffmpegAbi="arm";
}
loadOptionalLibrary("ffmpeg-linphone-"+ffmpegAbi);
loadOptionalLibrary("ffmpeg-linphone-" + abi);
//Main library
try {
System.loadLibrary("bctoolbox-" + abi);
System.loadLibrary("bctoolbox-tester-" + abi);
System.loadLibrary("ortp-" + abi);
System.loadLibrary("mediastreamer_base-" + abi);
System.loadLibrary("mediastreamer_voip-" + abi);
System.loadLibrary("linphone-" + abi);
System.loadLibrary("linphone_tester-" + abi);
System.loadLibrary("linphonetester-" + abi);
Log.i("LinphoneCoreFactoryImpl","Loading done with " + abi);
libLoaded=true;

View file

@ -6,6 +6,8 @@ import org.linphone.core.LinphoneCoreFactory;
import org.linphone.core.LinphoneCoreListenerBase;
import org.linphone.core.LinphoneFriend;
import org.linphone.core.PayloadType;
import org.linphone.mediastream.MediastreamerAndroidContext;
import org.linphone.mediastream.Factory;
import android.test.AndroidTestCase;
import junit.framework.Assert;
@ -31,7 +33,7 @@ public class WrapperTester extends AndroidTestCase {
mCore.enableVideoMulticast(false);
Assert.assertEquals(false, mCore.videoMulticastEnabled());
LinphoneCallParams params = mCore.createDefaultCallParameters();
LinphoneCallParams params = mCore.createCallParams(null);
params.enableAudioMulticast(true);
Assert.assertEquals(true, params.audioMulticastEnabled());
params.enableAudioMulticast(false);
@ -85,13 +87,20 @@ public class WrapperTester extends AndroidTestCase {
LinphoneFriend friend = LinphoneCoreFactory.instance().createLinphoneFriend("sip:lala@test.linphone.org");
friend.setRefKey(key);
Assert.assertEquals(friend.getRefKey(),key);
//Test filter enablement
Factory factory = mCore.getMSFactory();
factory.enableFilterFromName("MSUlawEnc", false);
Assert.assertFalse(factory.filterFromNameEnabled("MSUlawEnc"));
factory.enableFilterFromName("MSUlawEnc", true);
}
@Override
protected void setUp() throws Exception {
// TODO Auto-generated method stub
super.setUp();
mCore = LinphoneCoreFactory.instance().createLinphoneCore(new LinphoneCoreListenerBase(),null);
LinphoneCoreFactory.instance().setDebugMode(true, "WrapperTester");
mCore = LinphoneCoreFactory.instance().createLinphoneCore(new LinphoneCoreListenerBase(),getContext());
}
@Override

Binary file not shown.

View file

@ -1,36 +1,37 @@
--- a/submodules/externals/libvpx/build/make/configure.sh
+++ b/submodules/externals/libvpx/build/make/configure.sh
@@ -1037,6 +1037,33 @@ EOF
os2)
AS=${AS:-nasm}
;;
+ android*)
+ SDK_PATH=${sdk_path}
+ COMPILER_LOCATION=`find "${SDK_PATH}" \
+ -name "i686-linux-android-gcc*" -print -quit`
+ TOOLCHAIN_PATH=${COMPILER_LOCATION%/*}/i686-linux-android-
+ CC=${TOOLCHAIN_PATH}gcc
+ CXX=${TOOLCHAIN_PATH}g++
+ AR=${TOOLCHAIN_PATH}ar
+ LD=${TOOLCHAIN_PATH}gcc
+ STRIP=${TOOLCHAIN_PATH}strip
+ NM=${TOOLCHAIN_PATH}nm
diff --git a/build/make/configure.sh b/build/make/configure.sh
index c592b63..e4998d7 100644
--- a/build/make/configure.sh
+++ b/build/make/configure.sh
@@ -1132,6 +1132,32 @@ EOF
AS=${AS:-nasm}
add_ldflags -Zhigh-mem
;;
+ android*)
+ SDK_PATH=${sdk_path}
+ COMPILER_LOCATION=`find "${SDK_PATH}" \
+ -name "i686-linux-android-gcc*" -print -quit`
+ TOOLCHAIN_PATH=${COMPILER_LOCATION%/*}/i686-linux-android-
+ CC=${TOOLCHAIN_PATH}gcc
+ CXX=${TOOLCHAIN_PATH}g++
+ AR=${TOOLCHAIN_PATH}ar
+ LD=${TOOLCHAIN_PATH}gcc
+ STRIP=${TOOLCHAIN_PATH}strip
+ NM=${TOOLCHAIN_PATH}nm
+
+ if [ -z "${alt_libc}" ]; then
+ alt_libc=`find "${SDK_PATH}" -name arch-x86 -print | \
+ awk '{n = split($0,a,"/"); \
+ split(a[n-1],b,"-"); \
+ print $0 " " b[2]}' | \
+ sort -g -k 2 | \
+ awk '{ print $1 }' | tail -1`
+ fi
+ if [ -z "${alt_libc}" ]; then
+ alt_libc=`find "${SDK_PATH}" -name arch-x86 -print | \
+ awk '{n = split($0,a,"/"); \
+ split(a[n-1],b,"-"); \
+ print $0 " " b[2]}' | \
+ sort -g -k 2 | \
+ awk '{ print $1 }' | tail -1`
+ fi
+
+ add_cflags "--sysroot=${alt_libc}"
+ add_ldflags "--sysroot=${alt_libc}"
+ add_cflags "--sysroot=${alt_libc}"
+ add_ldflags "--sysroot=${alt_libc}"
+
+ soft_enable realtime_only
+ ;;
+
esac
+ soft_enable realtime_only
+ ;;
esac
AS="${alt_as:-${AS:-auto}}"
AS="${alt_as:-${AS:-auto}}"

375
prepare.py Executable file
View file

@ -0,0 +1,375 @@
#!/usr/bin/env python
############################################################################
# prepare.py
# Copyright (C) 2016 Belledonne Communications, Grenoble France
#
############################################################################
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
############################################################################
import fnmatch
import os
import re
import sys
from distutils.spawn import find_executable
from logging import error, warning, info
from subprocess import Popen
sys.dont_write_bytecode = True
sys.path.insert(0, 'submodules/cmake-builder')
try:
import prepare
except Exception as e:
error(
"Could not find prepare module: {}, probably missing submodules/cmake-builder? Try running:\n"
"git submodule sync && git submodule update --init --recursive".format(e))
exit(1)
class AndroidTarget(prepare.Target):
def __init__(self, arch):
prepare.Target.__init__(self, 'android-' + arch)
current_path = os.path.dirname(os.path.realpath(__file__))
self.config_file = 'configs/config-android.cmake'
self.toolchain_file = 'toolchains/toolchain-android-' + arch + '.cmake'
self.output = 'liblinphone-sdk/android-' + arch
self.external_source_path = os.path.join(current_path, 'submodules')
class AndroidArmTarget(AndroidTarget):
def __init__(self):
AndroidTarget.__init__(self, 'arm')
self.additional_args += ['-DENABLE_VIDEO=NO']
class AndroidArmv7Target(AndroidTarget):
def __init__(self):
AndroidTarget.__init__(self, 'armv7')
class AndroidX86Target(AndroidTarget):
def __init__(self):
AndroidTarget.__init__(self, 'x86')
android_targets = {
'arm': AndroidArmTarget(),
'armv7': AndroidArmv7Target(),
'x86': AndroidX86Target()
}
class AndroidPreparator(prepare.Preparator):
def __init__(self, targets=android_targets):
prepare.Preparator.__init__(self, targets)
self.min_supported_ndk = 10
self.max_supported_ndk = 12
self.unsupported_ndk_version = None
self.release_with_debug_info = True
self.veryclean = True
self.show_gpl_disclaimer = True
self.argparser.add_argument('-ac', '--all-codecs', help="Enable all codecs, including the non-free ones", action='store_true')
def parse_args(self):
prepare.Preparator.parse_args(self)
if self.args.all_codecs:
self.additional_args += ["-DENABLE_GPL_THIRD_PARTIES=YES"]
self.additional_args += ["-DENABLE_NON_FREE_CODECS=YES"]
self.additional_args += ["-DENABLE_AMRNB=YES"]
self.additional_args += ["-DENABLE_AMRWB=YES"]
self.additional_args += ["-DENABLE_BV16=YES"]
self.additional_args += ["-DENABLE_CODEC2=YES"]
self.additional_args += ["-DENABLE_G729=YES"]
self.additional_args += ["-DENABLE_GSM=YES"]
self.additional_args += ["-DENABLE_ILBC=YES"]
self.additional_args += ["-DENABLE_ISAC=YES"]
self.additional_args += ["-DENABLE_OPUS=YES"]
self.additional_args += ["-DENABLE_SILK=YES"]
self.additional_args += ["-DENABLE_SPEEX=YES"]
self.additional_args += ["-DENABLE_FFMPEG=YES"]
self.additional_args += ["-DENABLE_H263=YES"]
self.additional_args += ["-DENABLE_H263P=YES"]
self.additional_args += ["-DENABLE_MPEG4=YES"]
self.additional_args += ["-DENABLE_OPENH264=YES"]
self.additional_args += ["-DENABLE_VPX=YES"]
# self.additional_args += ["-DENABLE_X264=YES"] # Do not activate x264 because it has text relocation issues
def list_feature_target(self):
return android_targets['armv7']
def check_ndk_version(self):
retval = True
ndk_build = find_executable('ndk-build')
ndk_path = os.path.dirname(ndk_build)
# NDK prior to r11 had a RELEASE.TXT file holding the version number
release_file = os.path.join(ndk_path, 'RELEASE.TXT')
if os.path.isfile(release_file):
version = open(release_file).read().strip()
res = re.match('^r(\d+)(.*)$', version)
version = int(res.group(1))
retval = False
else:
# Hack to find the NDK version since the RELEASE.TXT file is no longer there
python_config_files = []
for root, dirnames, filenames in os.walk(ndk_path):
for filename in fnmatch.filter(filenames, 'python-config'):
python_config_files.append(os.path.join(root, filename))
if len(python_config_files) > 0:
version = open(python_config_files[0]).readlines()[0]
res = re.match('^.*/(aosp-)?ndk-r(\d+).*$', version)
version = int(res.group(2))
retval = False
else:
error("Could not get Android NDK version!")
sys.exit(-1)
if retval == False and (version < self.min_supported_ndk or version > self.max_supported_ndk):
self.unsupported_ndk_version = version
retval = True
return retval
def check_environment(self):
ret = 0
ret_sdk = not self.check_is_installed('android', 'Android SDK tools')
ret_ndk = not self.check_is_installed('ndk-build', 'Android NDK r{}'.format(self.max_supported_ndk))
if not ret_ndk:
ret_ndk = self.check_ndk_version()
ret |= ret_sdk
ret |= ret_ndk
ret |= prepare.Preparator.check_environment(self)
return ret
def show_environment_errors(self):
if self.unsupported_ndk_version is not None:
error("Unsupported Android NDK r{}. Please install version r{}.".format(self.unsupported_ndk_version, self.max_supported_ndk))
else:
prepare.Preparator.show_environment_errors(self)
def clean(self):
prepare.Preparator.clean(self)
if os.path.isfile('Makefile'):
os.remove('Makefile')
if os.path.isdir('WORK') and not os.listdir('WORK'):
os.rmdir('WORK')
if os.path.isdir('liblinphone-sdk') and not os.listdir('liblinphone-sdk'):
os.rmdir('liblinphone-sdk')
def generate_makefile(self, generator, project_file=''):
platforms = self.args.target
arch_targets = ""
for arch in platforms:
arch_targets += """
{arch}: {arch}-build
{arch}-build:
\t{generator} WORK/android-{arch}/cmake
\t@echo "Done"
""".format(arch=arch, generator=generator)
makefile = """
archs={archs}
TOPDIR=$(shell pwd)
LINPHONE_ANDROID_VERSION=$(shell git describe --always)
ANDROID_MOST_RECENT_TARGET=$(shell android list target -c | grep -E 'android-[0-9]+' | tail -n1)
ANT_SILENT=$(shell ant -h | grep -q -- -S && echo 1 || echo 0)
PACKAGE_NAME=$(shell sed -nE 's|<property name="linphone.package.name" value="(.*)" />|\\1|p' custom_rules.xml)
.PHONY: all
.NOTPARALLEL: all generate-apk generate-mediastreamer2-apk install release
all: update-project generate-apk
build: $(addsuffix -build, $(archs))
clean: java-clean
install: install-apk run-linphone
java-clean:
\tant clean
$(TOPDIR)/res/raw/rootca.pem:
\tcp liblinphone-sdk/android-{first_arch}/share/linphone/rootca.pem $@
copy-libs:
\trm -rf libs-debug/armeabi
\trm -rf libs/armeabi
\tif test -d "liblinphone-sdk/android-arm"; then \\
\t\tmkdir -p libs-debug/armeabi && \\
\t\tcp -f liblinphone-sdk/android-arm/lib/libgnustl_shared.so libs-debug/armeabi && \\
\t\tcp -f liblinphone-sdk/android-arm/lib/lib*-armeabi.so libs-debug/armeabi && \\
\t\tcp -f liblinphone-sdk/android-arm/lib/mediastreamer/plugins/*.so libs-debug/armeabi && \\
\t\tmkdir -p libs/armeabi && \\
\t\tcp -f liblinphone-sdk/android-arm/lib/libgnustl_shared.so libs/armeabi && \\
\t\tcp -f liblinphone-sdk/android-arm/lib/lib*-armeabi.so libs/armeabi && \\
\t\tcp -f liblinphone-sdk/android-arm/lib/mediastreamer/plugins/*.so libs/armeabi && \\
\t\tsh WORK/android-arm/strip.sh libs/armeabi/*.so; \\
\tfi
\tif test -f "liblinphone-sdk/android-arm/bin/gdbserver"; then \\
\t\tcp -f liblinphone-sdk/android-arm/bin/gdbserver libs-debug/armeabi && \\
\t\tcp -f liblinphone-sdk/android-arm/bin/gdb.setup libs-debug/armeabi && \\
\t\tcp -f liblinphone-sdk/android-arm/bin/gdbserver libs/armeabi && \\
\t\tcp -f liblinphone-sdk/android-arm/bin/gdb.setup libs/armeabi; \\
\tfi
\trm -rf libs-debug/armeabi-v7a
\trm -rf libs/armeabi-v7a
\tif test -d "liblinphone-sdk/android-armv7"; then \\
\t\tmkdir -p libs-debug/armeabi-v7a && \\
\t\tcp -f liblinphone-sdk/android-armv7/lib/libgnustl_shared.so libs-debug/armeabi-v7a && \\
\t\tcp -f liblinphone-sdk/android-armv7/lib/lib*-armeabi-v7a.so libs-debug/armeabi-v7a && \\
\t\tcp -f liblinphone-sdk/android-armv7/lib/mediastreamer/plugins/*.so libs-debug/armeabi-v7a && \\
\t\tmkdir -p libs/armeabi-v7a && \\
\t\tcp -f liblinphone-sdk/android-armv7/lib/libgnustl_shared.so libs/armeabi-v7a && \\
\t\tcp -f liblinphone-sdk/android-armv7/lib/lib*-armeabi-v7a.so libs/armeabi-v7a && \\
\t\tcp -f liblinphone-sdk/android-armv7/lib/mediastreamer/plugins/*.so libs/armeabi-v7a && \\
\t\tsh WORK/android-armv7/strip.sh libs/armeabi-v7a/*.so; \\
\tfi
\tif test -f "liblinphone-sdk/android-armv7/bin/gdbserver"; then \\
\t\tcp -f liblinphone-sdk/android-armv7/bin/gdbserver libs-debug/armeabi-v7a && \\
\t\tcp -f liblinphone-sdk/android-armv7/bin/gdb.setup libs-debug/armeabi-v7a && \\
\t\tcp -f liblinphone-sdk/android-armv7/bin/gdbserver libs/armeabi-v7a && \\
\t\tcp -f liblinphone-sdk/android-armv7/bin/gdb.setup libs/armeabi-v7a; \\
\tfi
\trm -rf libs-debug/x86
\trm -rf libs/x86
\tif test -d "liblinphone-sdk/android-x86"; then \\
\t\tmkdir -p libs-debug/x86 && \\
\t\tcp -f liblinphone-sdk/android-x86/lib/libgnustl_shared.so libs-debug/x86 && \\
\t\tcp -f liblinphone-sdk/android-x86/lib/lib*-x86.so libs-debug/x86 && \\
\t\tcp -f liblinphone-sdk/android-x86/lib/mediastreamer/plugins/*.so libs-debug/x86 && \\
\t\tmkdir -p libs/x86 && \\
\t\tcp -f liblinphone-sdk/android-x86/lib/libgnustl_shared.so libs/x86 && \\
\t\tcp -f liblinphone-sdk/android-x86/lib/lib*-x86.so libs/x86 && \\
\t\tcp -f liblinphone-sdk/android-x86/lib/mediastreamer/plugins/*.so libs/x86 && \\
\t\tsh WORK/android-x86/strip.sh libs/x86/*.so; \\
\tfi
\tif test -f "liblinphone-sdk/android-x86/bin/gdbserver"; then \\
\t\tcp -f liblinphone-sdk/android-x86/bin/gdbserver libs-debug/x86 && \\
\t\tcp -f liblinphone-sdk/android-x86/bin/gdb.setup libs-debug/x86 && \\
\t\tcp -f liblinphone-sdk/android-x86/bin/gdbserver libs/x86 && \\
\t\tcp -f liblinphone-sdk/android-x86/bin/gdb.setup libs/x86; \\
\tfi
update-project:
\tandroid update project --path . --target $(ANDROID_MOST_RECENT_TARGET)
\tandroid update test-project --path tests -m .
update-mediastreamer2-project:
\t@cd $(TOPDIR)/submodules/linphone/mediastreamer2/java && \\
\tandroid update project --path . --target $(ANDROID_MOST_RECENT_TARGET)
generate-apk: java-clean build copy-libs $(TOPDIR)/res/raw/rootca.pem update-project
\techo "version.name=$(LINPHONE_ANDROID_VERSION)" > default.properties && \\
\tant debug
generate-mediastreamer2-apk: java-clean build copy-libs update-mediastreamer2-project
\t@cd $(TOPDIR)/submodules/linphone/mediastreamer2/java && \\
\techo "version.name=$(LINPHONE_ANDROID_VERSION)" > default.properties && \\
\tant debug
install-apk:
\tant installd
uninstall:
\tadb uninstall $(PACKAGE_NAME)
release: java-clean build copy-libs update-project
\tpatch -p1 < release.patch
\tcat ant.properties | grep version.name > default.properties
\tant release
\tpatch -Rp1 < release.patch
generate-sdk: liblinphone-android-sdk
liblinphone-android-sdk: generate-apk
\tant liblinphone-android-sdk
linphone-android-sdk: generate-apk
\tant linphone-android-sdk
mediastreamer2-sdk: generate-mediastreamer2-apk
\t@cd $(TOPDIR)/submodules/linphone/mediastreamer2/java && \\
\tant mediastreamer2-sdk
liblinphone_tester:
\t$(MAKE) -C liblinphone_tester
run-linphone:
\tant run
run-liblinphone-tests:
\t$(MAKE) -C liblinphone_tester run-all-tests
run-basic-tests: update-project
\tant partial-clean
\t$(MAKE) -C tests run-basic-tests ANT_SILENT=$(ANT_SILENT)
run-all-tests: update-project
\tant partial-clean
\t$(MAKE) -C tests run-all-tests ANT_SILENT=$(ANT_SILENT)
pull-transifex:
\ttx pull -af
push-transifex:
\ttx push -s -f --no-interactive
{arch_targets}
help-prepare-options:
\t@echo "prepare.py was previously executed with the following options:"
\t@echo " {options}"
help: help-prepare-options
\t@echo ""
\t@echo "(please read the README.md file first)"
\t@echo ""
\t@echo "Available architectures: {archs}"
\t@echo ""
\t@echo "Available targets:"
\t@echo ""
\t@echo " * all or generate-apk: builds all architectures and creates the linphone application APK"
\t@echo " * generate-sdk: builds all architectures and creates the liblinphone SDK"
\t@echo " * install: install the linphone application APK (run this only after generate-apk)"
\t@echo " * uninstall: uninstall the linphone application"
\t@echo ""
""".format(archs=' '.join(platforms), arch_opts='|'.join(platforms),
first_arch=platforms[0], options=' '.join(sys.argv),
arch_targets=arch_targets, generator=generator)
f = open('Makefile', 'w')
f.write(makefile)
f.close()
def main():
preparator = AndroidPreparator()
preparator.parse_args()
if preparator.check_environment() != 0:
preparator.show_environment_errors()
return 1
return preparator.run()
if __name__ == "__main__":
sys.exit(main())

View file

@ -6,8 +6,8 @@ index 5ef1374..86e13be 100644
<supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true"/>
- <application android:label="@string/app_name" android:icon="@drawable/logo_linphone_57x57" android:largeHeap="true" android:allowBackup="true">
+ <application android:label="@string/app_name" android:icon="@drawable/logo_linphone_57x57" android:largeHeap="true" android:allowBackup="true" android:debuggable="false">
- <application android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:largeHeap="true" android:allowBackup="true">
+ <application android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:largeHeap="true" android:allowBackup="true" android:debuggable="false">
<activity android:name="org.linphone.LinphoneLauncherActivity"
android:label="@string/app_name"

View file

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="false" android:color="@android:color/darker_gray" />
<item android:color="@android:color/black"/>
</selector>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 149 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

Some files were not shown because too many files have changed in this diff Show more