...
 
Commits (24)
......@@ -7,6 +7,7 @@
adb.pid
bc-android.keystore
bin
bin-sdk
build
certdata.txt
check_tools.mk
......@@ -30,6 +31,7 @@ project.properties
res/.DS_Store
res/raw/lpconfig.xsd
res/raw/rootca.pem
res/raw/*_grammar
submodules/externals/build/cunit/CUnit/
submodules/externals/build/ffmpeg/arm/
submodules/externals/build/ffmpeg/x86
......@@ -47,6 +49,5 @@ tests/linphonetester_*
tests/tests.output
WORK
.d
google-services.json
gradle.properties
.*clang*
[submodule "submodules/linphone"]
path = submodules/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.git
[submodule "submodules/externals/ffmpeg"]
path = submodules/externals/ffmpeg
url = git://git.linphone.org/ffmpeg.git
ignore = dirty
[submodule "submodules/externals/x264"]
path = submodules/externals/x264
url = git://git.linphone.org/x264.git
ignore = dirty
[submodule "submodules/msx264"]
path = submodules/msx264
url = git://git.linphone.org/msx264.git
[submodule "submodules/externals/opencore-amr"]
path = submodules/externals/opencore-amr
url = git://git.linphone.org/opencore-amr.git
ignore = dirty
[submodule "submodules/msamr"]
path = submodules/msamr
url = git://git.linphone.org/msamr.git
[submodule "submodules/externals/libvpx"]
path = submodules/externals/libvpx
url = git://git.linphone.org/libvpx.git
ignore = dirty
[submodule "submodules/bzrtp"]
path = submodules/bzrtp
url = git://git.linphone.org/bzrtp.git
[submodule "submodules/externals/srtp"]
path = submodules/externals/srtp
url = git://git.linphone.org/srtp.git
[submodule "submodules/mssilk"]
path = submodules/mssilk
url = git://git.linphone.org/mssilk.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.git
[submodule "submodules/externals/libxml2"]
path = submodules/externals/libxml2
url = git://git.gnome.org/libxml2.git
ignore = dirty
[submodule "submodules/externals/libupnp"]
path = submodules/externals/libupnp
url = git://git.linphone.org/libupnp.git
[submodule "submodules/externals/opus"]
path = submodules/externals/opus
url = git://git.linphone.org/opus.git
ignore = dirty
[submodule "submodules/mswebrtc"]
path = submodules/mswebrtc
url = git://git.linphone.org/mswebrtc.git
[submodule "submodules/msopenh264"]
path = submodules/msopenh264
url = git://git.linphone.org/msopenh264.git
[submodule "submodules/externals/openh264"]
path = submodules/externals/openh264
url = https://github.com/cisco/openh264
ignore = dirty
[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
[submodule "submodules/bcunit"]
path = submodules/bcunit
url = git://git.linphone.org/bcunit.git
[submodule "submodules/externals/vo-amrwbenc"]
path = submodules/externals/vo-amrwbenc
url = git://git.linphone.org/vo-amrwbenc.git
[submodule "submodules/externals/codec2"]
path = submodules/externals/codec2
url = git://git.linphone.org/codec2
[submodule "submodules/externals/libjpeg-turbo"]
path = submodules/externals/libjpeg-turbo
url = git://git.linphone.org/libjpeg-turbo.git
[submodule "submodules/mediastreamer2"]
path = submodules/mediastreamer2
url = git://git.linphone.org/mediastreamer2.git
[submodule "submodules/oRTP"]
path = submodules/oRTP
url = git://git.linphone.org/ortp.git
[submodule "submodules/bcmatroska2"]
path = submodules/bcmatroska2
url = git://git.linphone.org/bcmatroska2.git
<?xml version="1.0" encoding="utf-8"?>
<manifest package="org.linphone.core"
xmlns:android="http://schemas.android.com/apk/res/android"
android:installLocation="auto"
android:versionCode="3320"
android:versionName="3.3.2">
<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="26"/>
</manifest>
<?xml version="1.0" encoding="utf-8"?>
<manifest package="org.linphone"
xmlns:android="http://schemas.android.com/apk/res/android"
android:installLocation="auto"
android:versionCode="3320"
android:versionName="3.3.2">
<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="26"/>
</manifest>
#!/bin/bash
# Script found at http://everydaywithlinux.blogspot.fr/2012/11/patch-strings-in-binary-files-with-sed.html
function patch_strings_in_file() {
local FILE="$1"
local PATTERN="$2"
local REPLACEMENT="$3"
# Find all unique strings in FILE that contain the pattern
STRINGS=$(strings ${FILE} | grep ${PATTERN} | sort -u -r)
if [ "${STRINGS}" != "" ] ; then
echo "File '${FILE}' contain strings with '${PATTERN}' in them:"
for OLD_STRING in ${STRINGS} ; do
# Create the new string with a simple bash-replacement
NEW_STRING=${OLD_STRING//${PATTERN}/${REPLACEMENT}}
# Create null terminated ASCII HEX representations of the strings
OLD_STRING_HEX="$(echo -n ${OLD_STRING} | xxd -g 0 -u -ps -c 256)00"
NEW_STRING_HEX="$(echo -n ${NEW_STRING} | xxd -g 0 -u -ps -c 256)00"
if [ ${#NEW_STRING_HEX} -le ${#OLD_STRING_HEX} ] ; then
# Pad the replacement string with null terminations so the
# length matches the original string
while [ ${#NEW_STRING_HEX} -lt ${#OLD_STRING_HEX} ] ; do
NEW_STRING_HEX="${NEW_STRING_HEX}00"
done
# Now, replace every occurrence of OLD_STRING with NEW_STRING
echo -n "Replacing ${OLD_STRING} with ${NEW_STRING}... "
hexdump -ve '1/1 "%.2X"' ${FILE} | \
sed "s/${OLD_STRING_HEX}/${NEW_STRING_HEX}/g" | \
xxd -r -p > ${FILE}.tmp
chmod --reference ${FILE} ${FILE}.tmp
mv ${FILE}.tmp ${FILE}
echo "Done!"
else
echo "New string '${NEW_STRING}' is longer than old" \
"string '${OLD_STRING}'. Skipping."
fi
done
fi
}
patch_strings_in_file libs/armeabi-v7a/liblinphone-armeabi-v7a.so "./obj/local/armeabi-v7a/libffmpeg-linphone-arm.so" "libffmpeg-linphone-arm.so"
patch_strings_in_file libs/x86/liblinphone-x86.so "./obj/local/x86/libffmpeg-linphone-x86.so" "libffmpeg-linphone-x86.so"
......@@ -2,79 +2,36 @@
buildDir = 'bin'
def getPackageName() {
return "org.linphone"
}
def firebaseEnable() {
File googleFile = new File('google-services.json')
return googleFile.exists()
return "org.linphone"
}
buildscript {
File googleFile = new File('google-services.json')
repositories {
jcenter()
mavenCentral()
mavenLocal()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'
if (googleFile.exists()) {
classpath 'com.google.gms:google-services:3.1.0'
repositories {
google()
jcenter()
}
}
}
allprojects {
repositories {
jcenter()
mavenCentral()
mavenLocal()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'
classpath 'com.google.gms:google-services:3.1.0'
}
}
apply plugin: 'com.android.application'
dependencies {
androidTestCompile('com.android.support.test.espresso:espresso-core:+') {
exclude module: 'support-annotations'
}
androidTestCompile 'com.jayway.android.robotium:robotium-solo:+'
androidTestCompile 'junit:junit:+'
compile 'org.apache.commons:commons-compress:+'
if (firebaseEnable()) {
compile 'com.google.firebase:firebase-messaging:11.+'
} else {
compile fileTree(include: 'gcm.jar', dir: 'libs')
compile 'com.android.support:support-v4:27.1.0'
}
allprojects {
repositories {
google()
jcenter()
}
}
if (firebaseEnable()) {
apply plugin: 'com.google.gms.google-services'
}
//// Submodule Dir /////
def submoduleDir = ['submodules/mediastreamer2/java/src',
'submodules/linphone/java/j2se',
'submodules/linphone/java/common',
'submodules/linphone/java/impl',
'submodules/linphone/coreapi/help/examples/java']
////////////////////////
apply plugin: 'com.android.application'
///// Exclude Files /////
def excludeFiles = []
// Exclude firebase file if not enable
if (!firebaseEnable()) {
excludeFiles.add('**/Firebase*')
println '[Push Notification] Firebase disabled'
} else {
excludeFiles.add('**/gcm*')
println '[Push Notification] Firebase enabled'
}
excludeFiles.add('**/mediastream/MediastreamerActivity.java')
// Remove or comment if you want to use those
excludeFiles.add('**/gcm*')
def excludePackage = []
......@@ -82,119 +39,90 @@ excludePackage.add('**/gdb.*')
excludePackage.add('**/libopenh264**')
excludePackage.add('**/**tester**')
excludePackage.add('**/LICENSE.txt')
/////////////////////////
repositories {
maven {
// Replace snapshots by releases for releases !
url "https://linphone.org/snapshots/maven_repository"
}
}
android {
defaultConfig {
compileSdkVersion 26
buildToolsVersion "27.0.3"
applicationId getPackageName()
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
lintOptions {
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
disable 'MissingTranslation', 'UnusedResources'
}
// Signing
signingConfigs {
release {
storeFile file(RELEASE_STORE_FILE)
storePassword RELEASE_STORE_PASSWORD
keyAlias RELEASE_KEY_ALIAS
keyPassword RELEASE_KEY_PASSWORD
defaultConfig {
compileSdkVersion 26
applicationId getPackageName()
multiDexEnabled true
}
}
buildTypes {
release {
signingConfig signingConfigs.release
lintOptions {
checkReleaseBuilds false
abortOnError false
disable 'MissingTranslation', 'UnusedResources'
}
packaged {
initWith release
signingConfig null
applicationVariants.all { variant ->
variant.outputs.all {
outputFileName = "linphone-android-${variant.buildType.name}-${project.version}.apk"
}
}
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
def srcDirs = submoduleDir
srcDirs.addAll(['src/android'])
java.srcDirs = srcDirs
resources.srcDirs = srcDirs
aidl.srcDirs = srcDirs
renderscript.srcDirs = srcDirs
res.srcDirs = ['res']
assets.srcDirs = ['assets']
jniLibs.srcDirs = ['libs']
java.excludes = excludeFiles
// Exclude some useless files
packagingOptions {
excludes = excludePackage
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
def srcDirs = ['src/android']
java.srcDirs = srcDirs
resources.srcDirs = srcDirs
aidl.srcDirs = srcDirs
renderscript.srcDirs = srcDirs
res.srcDirs = ['res']
assets.srcDirs = ['assets']
jniLibs.srcDirs = ['libs']
java.excludes = excludeFiles
packagingOptions {
excludes = excludePackage
}
}
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
sourceSets {
androidTest {
manifest.srcFile 'AndroidManifest.xml'
def srcDirs = submoduleDir
srcDirs.addAll(['src/android',
'src/androidTest'])
java.srcDirs = srcDirs
resources.srcDirs = srcDirs
aidl.srcDirs = srcDirs
renderscript.srcDirs = srcDirs
res.srcDirs = ['res']
assets.srcDirs = ['assets']
jniLibs.srcDirs = ['libs']
java.excludes = excludeFiles
// Exclude some useless files
packagingOptions {
excludes = excludePackage
}
packagingOptions {
pickFirst 'META-INF/NOTICE'
pickFirst 'META-INF/LICENSE'
exclude 'META-INF/MANIFEST.MF'
}
}
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
packagingOptions {
pickFirst 'META-INF/NOTICE'
pickFirst 'META-INF/LICENSE'
exclude 'META-INF/MANIFEST.MF'
}
static def isLocalDebugAarAvailable() {
File debugAar = new File('linphone-sdk-android/linphone-sdk-android-debug.aar')
return debugAar.exists()
}
// Grant permissions
android.applicationVariants.all { variant ->
def applicationId = getPackageName()
def adb = android.getAdbExecutable().toString()
def variantName = variant.name.capitalize()
def grantPermissionTask = tasks.create("grant${variantName}Permissions").doLast({
"${adb} devices".execute().text.eachLine {
"${adb} shell pm grant ${applicationId} android.permission.RECORD_AUDIO".execute()
"${adb} shell pm grant ${applicationId} android.permission.WRITE_EXTERNAL_STORAGE".execute()
"${adb} shell pm grant ${applicationId} android.permission.CAMERA".execute()
"${adb} shell pm grant ${applicationId} android.permission.READ_PHONE_STATE".execute()
"${adb} shell pm grant ${applicationId} android.permission.READ_CONTACTS".execute()
"${adb} shell pm grant ${applicationId} android.permission.WRITE_CONTACTS".execute()
}
})
static def isLocalReleaseAarAvailable() {
File releaseAar = new File('linphone-sdk-android/linphone-sdk-android-release.aar')
return releaseAar.exists()
}
task runApplication {
doLast {
def result = exec {
executable = android.getAdbExecutable().toString()
ignoreExitValue true
args = ['shell', 'monkey', '-p', getPackageName(), '-c', 'android.intent.category.LAUNCHER', '1']
}
}
static def isLocalAarAvailable() {
return isLocalDebugAarAvailable() || isLocalReleaseAarAvailable()
}
dependencies {
implementation 'org.apache.commons:commons-compress:1.16.1'
implementation 'com.google.firebase:firebase-messaging:15.0.2'
implementation 'com.android.support:support-v4:27.0.1'
implementation 'com.android.support:support-v4:27.0.1'
/*if (isLocalAarAvailable()) {
releaseImplementation project(path: ":linphone-sdk-android", configuration: 'release')
debugImplementation project(path: ":linphone-sdk-android", configuration: 'debug')
} else {*/
implementation "org.linphone.legacy:linphone-sdk-android:4.2+"
//}
}
apply plugin: 'com.google.gms.google-services'
\ No newline at end of file
#!/bin/sh
error_on_quit=0
echo_err() {
echo "$@" >&2
error_on_quit=1
}
check_installed() {
if [ -z "$(which $1)" ]; then
echo_err "Could not find $1. Please install $2."
return 1
fi
return 0
}
for prog in automake autoconf pkg-config java ant yasm nasm wget; do
check_installed "$prog" "it"
done
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"
# check that at least one target is installed
if [ -z "$(android list target -c)" ]; then
echo_err "Install at least one android target in the android SDK"
fi
fi
if nasm -f elf32 2>&1 | grep -q "fatal: unrecognised output format"; then
echo_err "Invalid version of nasm: your version does not support elf32 output format. If you have installed nasm, please check that your PATH env variable is set correctly."
fi
if ! (find submodules/linphone/mediastreamer2 -mindepth 1 2>/dev/null | grep -q . \
|| find submodules/linphone/oRTP -mindepth 1 2>/dev/null | grep -q .); then
echo_err "Missing some git submodules. Did you run 'git submodule update --init --recursive'?"
fi
# Android NDK should NOT be simlinked!
if [ -L "$ANDROID_NDK" ] && [ -d "$ANDROID_NDK" ]; then
echo_err "ANDROID_NDK=$ANDROID_NDK must NOT be a symbolic link, please modify it accordingly"
fi
if [ $error_on_quit = 0 ]; then
rm -f check_tools.mk
touch check_tools.mk
echo "JAVA=\"$(which java)\"" >> check_tools.mk
echo "ANTLR=\"$(which java)\" -jar \"submodules/externals/antlr3/antlr-3.2.jar\"" >> check_tools.mk
else
echo "Failed to detect required tools, aborting."
fi
exit $error_on_quit
############################################################################
# CMakeLists.txt
# Copyright (C) 2018 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
############################################################################
# Blacklist these dependencies because they are useless for now
lcb_blacklist_dependencies("libxsd" "xerces-c" "soci")
**********************************
* LINPHONE customs parameters *
**********************************
In res/values/non_localizable_custom.xml (filled with linphone default options):
1. Global
* Set the default domain used by the application:
<string name="default_domain">sip.linphone.org</string
2. Assistant
* Server xmlrpc url for accounts
<string name="wizard_url">https://sip3.linphone.org:444/inapp.php</string>
* In CreateAccount, allow username instead of phone number for creating a new account
<bool name="assistant_allow_username">true</bool>
* Hide buttons in assistant menu
<bool name="hide_linphone_accounts_in_assistant">false</bool>
<bool name="hide_generic_accounts_in_assistant">false</bool>
<bool name="hide_remote_provisioning_in_assistant">false</bool>
3. Inapp
* Enabled inapp purchase
<bool name="enable_in_app_purchase">true</bool>
* Days before end of trial period that launch daily notification to remind user to buy an account
<integer name="days_notification_shown">5</integer>
* Time between two inapp notifications in seconds
<integer name="time_between_inapp_notification">86400</integer>
* Hide username field in purchase view (automatically get from default account)
<bool name="hide_username_in_inapp">true</bool>
In res/raw/linphonerc_factory sections:
[in-app-purchase]
* Server xmlrpc url for inapp
server_url=https://sip3.linphone.org:444/inapp.php
* Item ids from the google play store
purchasable_items_ids=test_account_subscription
[app]
* Numbers of digits to enter for validation/recover account
activation_code_length=4
[assistant]
* Set the default domain used for account creation :
domain=sip.linphone.org
* Set the default password length (min-max) :
password_max_length=-1
password_min_length=1
* Set the default username length (min-max) :
username_length=-1
username_max_length=64
username_min_length=1
username_regex=^[a-z0-9_.\-]*$
* Server xmlrpc url for accounts
xmlrpc_url=https://sip3.linphone.org:444/inapp.php
{
"project_info": {
"project_number": "929724111839",
"firebase_url": "https://linphone-android-8a563.firebaseio.com",
"project_id": "linphone-android-8a563",
"storage_bucket": "linphone-android-8a563.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:929724111839:android:4662ea9a056188c4",
"android_client_info": {
"package_name": "org.linphone"
}
},
"oauth_client": [
{
"client_id": "929724111839-co5kffto4j7dets7oolvfv0056cvpfbl.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "org.linphone",
"certificate_hash": "85463a95603f7b6331899b74b85d53d043dcd500"
}
},
{
"client_id": "929724111839-v5so1tcd65iil7dd7sde8jgii44h8luf.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyCKrwWhkbA7Iy3wpEI8_ZvKOMp5jf6vV6A"
}
],
"services": {
"analytics_service": {
"status": 1
},
"appinvite_service": {
"status": 2,
"other_platform_oauth_client": [
{
"client_id": "929724111839-jeehfdpak33vbtfd97kgghmt9uar5796.apps.googleusercontent.com",
"client_type": 3
}
]
},
"ads_service": {
"status": 2
}
}
}
],
"configuration_version": "1"
}
\ No newline at end of file
......@@ -4,4 +4,5 @@ RELEASE_STORE_PASSWORD=
RELEASE_KEY_ALIAS=
RELEASE_KEY_PASSWORD=
#org.gradle.jvmargs=-XX\:MaxHeapSize\=2048M -Xmx2048M
org.gradle.jvmargs=-Xmx1536M
# Must be present to used ndk-gdb
# In ndk-gdb you need to set the path of your symbols
# Command: set solib-search-path YOUR_PROJECT_ROOT/libs-debug/ABI/
\ No newline at end of file
# This is used by ndk-gdb
APP_ABI := arm64-v8a x86 armeabi armeabi-v7a
\ No newline at end of file
// Project information
buildDir = 'bin'
buildscript {
repositories {
jcenter()
mavenCentral()
mavenLocal()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'
}
}
allprojects {
repositories {
jcenter()
mavenCentral()
mavenLocal()
google()
}
}
configurations {
javadocDeps
}
apply plugin: 'com.android.library'
dependencies {
compile group: 'org.apache.commons', name: 'commons-compress', version: '+'
javadocDeps group: 'org.apache.commons', name: 'commons-compress', version: '+'
}
def submoduleDir = ['submodules/mediastreamer2/java/src',
'submodules/linphone/java/j2se',
'submodules/linphone/java/common',
'submodules/linphone/java/impl',
'submodules/linphone/coreapi/help/examples/java']
def excludePackage = []
excludePackage.add('**/gdb.*')
excludePackage.add('**/libopenh264**')
excludePackage.add('**/**tester**')
excludePackage.add('**/LICENSE.txt')
android {
defaultConfig {
compileSdkVersion 26
buildToolsVersion "27.0.3"
multiDexEnabled true
}
lintOptions {
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
}
sourceSets {
main {
manifest.srcFile 'AndroidManifestLibrary.xml'
java.srcDirs = submoduleDir
resources.srcDirs = submoduleDir
aidl.srcDirs = submoduleDir
renderscript.srcDirs = submoduleDir
jniLibs.srcDirs = ['libs']
java.excludes = ['**/mediastream/MediastreamerActivity.java']
// Exclude some useless files
packagingOptions {
excludes = excludePackage
}
}
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
}
///////////// Task /////////////
task(releaseJavadoc, type: Javadoc, dependsOn: "assembleRelease") {
source = submoduleDir
excludes = ['**/mediastream/MediastreamerActivity.java',
'**/**.html',
'**/**.aidl']
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
classpath += files(android.libraryVariants.release.javaCompile.classpath.files)
classpath += configurations.javadocDeps
options.encoding = 'UTF-8'
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.srcDirs
}
task androidJavadocsJar(type: Jar, dependsOn: releaseJavadoc) {
classifier = 'javadoc'
from releaseJavadoc.destinationDir
}
task sdkZip(type: Zip) {
String appName = "liblinphone-android-sdk"
String gitSha = 'git describe --always'.execute().text.trim()
String newSdkName = appName + "-" + gitSha + ".zip"
from('bin/libs',
'bin/outputs/aar')
include '*'
archiveName newSdkName
}
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="linphone/j2se"/>
<classpathentry kind="src" path="linphone/impl"/>
<classpathentry kind="src" path="linphone/common"/>
<classpathentry excluding="org/linphone/mediastream/MediastreamerActivity.java" kind="src" path="mediastreamer2"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="lib" path="libs/android-junit-report-1.5.8.jar"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>
# built application files
*.apk
*.ap_
# files for the dex VM
*.dex
# Java class files
*.class
# generated files
bin/
gen/
libs/
obj/
# Local configuration file (sdk path, etc)
local.properties
assets
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>liblinphoneTester</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.ApkBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
<linkedResources>
<link>
<name>linphone</name>
<type>2</type>
<locationURI>PARENT-1-PROJECT_LOCATION/submodules/linphone/java</locationURI>
</link>
<link>
<name>mediastreamer2</name>
<type>2</type>
<locationURI>PARENT-1-PROJECT_LOCATION/submodules/linphone/mediastreamer2/java/src</locationURI>
</link>
</linkedResources>
</projectDescription>
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.linphone.tester"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="26" />
<instrumentation
android:targetPackage="org.linphone.tester"
android:name="org.linphone.tester.TestRunner" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="org.linphone.tester.MainActivity"
android:label="@string/app_name"
android:screenOrientation="nosensor"
android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="org.linphone.tester.LogsActivity"
android:label="@string/title_activity_logs"
android:screenOrientation="nosensor"
android:launchMode="singleTask">
</activity>
<activity
android:name="org.linphone.tester.SuitesActivity"
android:label="@string/title_activity_suites"
android:screenOrientation="nosensor"
android:launchMode="singleTask">
</activity>
<uses-library android:name="android.test.runner" />
</application>
</manifest>
all: copy-files
../gradlew clean
../gradlew uninstallDebug
run-all-tests: copy-files
../gradlew :installDebugAndroidTest && \
../gradlew :installDebug && \
../gradlew :grantDebugPermissions -i && \
../gradlew :connectedAndroidTest -i \
copy-libs:
mkdir -p assets && \
mkdir -p assets/config_files && \
rm -rf libs/arm64-v8a
if test -d "../liblinphone-sdk/android-arm64"; then \
mkdir -p libs/arm64-v8a && \
cp -f ../liblinphone-sdk/android-arm64/lib/*.so libs/arm64-v8a && \
cp -f ../liblinphone-sdk/android-arm64/lib/mediastreamer/plugins/*.so libs/arm64-v8a && \
cp -f ../liblinphone-sdk/android-arm64/share/linphone/rootca.pem assets/config_files; \
fi
if test -f "../liblinphone-sdk/android-arm64/bin/gdbserver"; then \
cp -f ../liblinphone-sdk/android-arm64/bin/gdbserver libs/arm64-v8a && \
cp -f ../liblinphone-sdk/android-arm64/bin/gdb.setup libs/arm64-v8a; \
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/*.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/*.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
#! /bin/bash
adb logcat -v time > $1 &
echo $! >adb.pid
// Project information
buildDir = 'bin'
def getPackageName() {
return "org.linphone.tester"
}
buildscript {
repositories {
jcenter()
mavenCentral()
mavenLocal()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
}
}
allprojects {
repositories {
jcenter()
mavenCentral()
mavenLocal()
google()
}
}
apply plugin: 'com.android.application'
dependencies {
androidTestCompile group: 'org.apache.commons', name: 'commons-compress', version: '+'
androidTestCompile group: 'junit', name: 'junit', version: '+'
androidTestCompile group: 'com.jayway.android.robotium', name: 'robotium', version: '+'
androidTestCompile fileTree(dir: 'libs', include: 'android-junit-report*.jar')
compile group: 'org.apache.commons', name: 'commons-compress', version: '+'
compile group: 'junit', name: 'junit', version: '+'
compile group: 'com.jayway.android.robotium', name: 'robotium-solo', version: '+'
compile fileTree(dir: 'libs', include: 'android-junit-report*.jar')
compile project(":libLinphoneAndroidSdk")
}
android {
defaultConfig {
compileSdkVersion 26
buildToolsVersion "26.0.0"
applicationId getPackageName()
multiDexEnabled true
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
jniLibs.srcDir 'libs'
// Exclude some useless files
packagingOptions {
exclude '**/gdb.*'
}
}
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
sourceSets {
androidTest {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
jniLibs.srcDir 'libs'
}
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
testOptions {
unitTests.all {
// All the usual Gradle options.
testLogging {
events "passed", "skipped", "failed", "standardOut", "standardError"
outputs.upToDateWhen {false}
showStandardStreams = true
}
}
}
lintOptions {
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
}
}
// Grant permissions
android.applicationVariants.all { variant ->
def applicationId = getPackageName()
def applicationIdtest = "${getPackageName()}.test"
def adb = android.getAdbExecutable().toString()
def variantName = variant.name.capitalize()
def grantPermissionTask = tasks.create("grant${variantName}Permissions") << {
"${adb} devices".execute().text.eachLine {
if(it.endsWith("device")){
def device = it.split()[0]
println "Granting permissions on devices ${device}"
"${adb} shell pm grant ${applicationId} android.permission.RECORD_AUDIO".execute()
"${adb} shell pm grant ${applicationId} android.permission.WRITE_EXTERNAL_STORAGE".execute()
"${adb} shell pm grant ${applicationId} android.permission.CAMERA".execute()
"${adb} shell pm grant ${applicationIdtest} android.permission.RECORD_AUDIO".execute()
"${adb} shell pm grant ${applicationIdtest} android.permission.WRITE_EXTERNAL_STORAGE".execute()
"${adb} shell pm grant ${applicationIdtest} android.permission.CAMERA".execute()
}
}
}
}
tasks.withType(Test) {
testLogging {
exceptionFormat 'full'
showCauses true
showExceptions true
showStackTraces true
showStandardStreams false
ignoreFailures = true
}
connectedAndroidTest {
ignoreFailures = true
}
}
#!/usr/bin/env sh
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn ( ) {
echo "$*"
}
die ( ) {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Escape application args
save ( ) {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi
exec "$JAVACMD" "$@"
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega