diff --git a/Makefile b/Makefile
index 7e09bc98e..e28ed6af1 100644
--- a/Makefile
+++ b/Makefile
@@ -109,7 +109,7 @@ prepare-belle-sip: $(BELLESIP_SRC_DIR)/src/belle_sip_message.tokens $(BELLESIP_S
prepare-sources: prepare-ffmpeg prepare-ilbc prepare-vpx prepare-silk prepare-srtp prepare-mediastreamer2 prepare-antlr3 prepare-belle-sip
-generate-libs:
+generate-libs: prepare-sources
$(NDK_PATH)/ndk-build LINPHONE_VERSION=$(LINPHONE_VERSION) BUILD_UPNP=$(BUILD_UPNP) BUILD_REMOTE_PROVISIONING=$(BUILD_REMOTE_PROVISIONING) BUILD_X264=$(BUILD_X264) BUILD_AMRNB=$(BUILD_AMRNB) BUILD_AMRWB=$(BUILD_AMRWB) BUILD_GPLV3_ZRTP=$(BUILD_GPLV3_ZRTP) BUILD_SILK=$(BUILD_SILK) BUILD_G729=$(BUILD_G729) BUILD_TUNNEL=$(BUILD_TUNNEL) BUILD_WEBRTC_AECM=$(BUILD_WEBRTC_AECM) BUILD_FOR_X86=$(BUILD_FOR_X86) USE_JAVAH=$(USE_JAVAH) -j$(NUMCPUS)
update-project:
@@ -149,3 +149,6 @@ clean:
.PHONY: clean
+generate-sdk: generate-apk
+ ant liblinphone-sdk
+
diff --git a/custom_rules.xml b/custom_rules.xml
index cda9d1e46..fdecf9fbb 100644
--- a/custom_rules.xml
+++ b/custom_rules.xml
@@ -121,4 +121,23 @@
+
+
+ Creating library output jar file...
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jni/Android.mk b/jni/Android.mk
index bf21aee00..2a6fd7472 100755
--- a/jni/Android.mk
+++ b/jni/Android.mk
@@ -19,7 +19,7 @@ LINPHONE_VIDEO=0
BUILD_X264=0
endif
-include $(linphone-root-dir)/jni/libneon/Android.mk
+include $(linphone-root-dir)/submodules/linphone/mediastreamer2/jni/libneon/Android.mk
##ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
ifeq ($(BUILD_GPLV3_ZRTP), 1)
@@ -64,13 +64,6 @@ endif
include $(linphone-root-dir)/submodules/externals/build/antlr3/Android.mk
include $(linphone-root-dir)/submodules/belle-sip/build/android/Android.mk
-# Openssl
-ifeq ($(wildcard $(linphone-root-dir)/submodules/externals/prebuilts/ssl.mk),)
-include $(linphone-root-dir)/submodules/externals/openssl/Android.mk
-else
-include $(linphone-root-dir)/submodules/externals/prebuilts/ssl.mk
-include $(linphone-root-dir)/submodules/externals/prebuilts/crypto.mk
-endif
include $(linphone-root-dir)/submodules/linphone/oRTP/build/android/Android.mk
@@ -80,6 +73,14 @@ include $(linphone-root-dir)/submodules/linphone/mediastreamer2/tools/Android.mk
ifeq ($(BUILD_TUNNEL), 1)
+# Openssl
+ifeq ($(wildcard $(linphone-root-dir)/submodules/externals/prebuilts/ssl.mk),)
+include $(linphone-root-dir)/submodules/externals/openssl/Android.mk
+else
+include $(linphone-root-dir)/submodules/externals/prebuilts/ssl.mk
+include $(linphone-root-dir)/submodules/externals/prebuilts/crypto.mk
+endif
+#tunnel
include $(linphone-root-dir)/submodules/tunnel/Android.mk
endif
diff --git a/jni/Application.mk b/jni/Application.mk
index 9adfaf8d3..d8cb8da7e 100644
--- a/jni/Application.mk
+++ b/jni/Application.mk
@@ -72,7 +72,10 @@ APP_MODULES += libtunnelclient
endif
ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
+ifeq ($(BUILD_TUNNEL), 1)
APP_MODULES += liblincrypto liblinssl
+endif
+
APP_MODULES +=libmsilbc
ifeq ($(BUILD_GPLV3_ZRTP), 1)
@@ -93,4 +96,3 @@ APP_ABI := armeabi-v7a armeabi
ifeq ($(BUILD_FOR_X86), 1)
APP_ABI += x86
endif
-APP_CFLAGS:=-DDISABLE_NEON
diff --git a/jni/libneon/Android.mk b/jni/libneon/Android.mk
deleted file mode 100755
index dbdb0078f..000000000
--- a/jni/libneon/Android.mk
+++ /dev/null
@@ -1,37 +0,0 @@
-##
-## Android.mk -Android build script-
-##
-##
-## Copyright (C) 2010 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.
-##
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_CPP_EXTENSION := .cc
-
-LOCAL_SRC_FILES := \
- libneon_jni.cc
-
-LOCAL_STATIC_LIBRARIES := cpufeatures
-
-LOCAL_MODULE := libneon
-
-include $(BUILD_SHARED_LIBRARY)
-
-$(call import-module,android/cpufeatures)
diff --git a/jni/libneon/libneon_jni.cc b/jni/libneon/libneon_jni.cc
deleted file mode 100644
index 15298e803..000000000
--- a/jni/libneon/libneon_jni.cc
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
-libneon_jni.cc
-Copyright (C) 2013 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.
- */
-
-#include
-
-extern "C" {
-#include
-#include
-
-static JavaVM *jvm=0;
-
-JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *ajvm, void *reserved)
-{
- jvm=ajvm;
- return JNI_VERSION_1_2;
-}
-
-extern "C" jboolean Java_org_linphone_CpuUtils_hasNeon(JNIEnv* env, jobject thiz) {
- return android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON;
-}
-}
diff --git a/src/org/linphone/CpuUtils.java b/src/org/linphone/CpuUtils.java
deleted file mode 100644
index 3882f6098..000000000
--- a/src/org/linphone/CpuUtils.java
+++ /dev/null
@@ -1,34 +0,0 @@
-package org.linphone;
-/*
-CpuUtils.java
-Copyright (C) 2013 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.
- */
-
-/**
- * @author Sylvain Berfini
- */
-public class CpuUtils {
- private native boolean hasNeon();
-
- public CpuUtils() {
-
- }
-
- public boolean isCpuNeon() {
- return hasNeon();
- }
-}
diff --git a/submodules/linphone b/submodules/linphone
index bf0db8f9e..d44378253 160000
--- a/submodules/linphone
+++ b/submodules/linphone
@@ -1 +1 @@
-Subproject commit bf0db8f9e4e18b4745a55e7943b59ced8ff4a8d2
+Subproject commit d44378253138ee5be1146c3da1b1c0dc20625b2f