From: masensio Date: Mon, 16 Dec 2013 09:52:48 +0000 (+0100) Subject: Merge branch 'develop' into refactor_remote_operation_to_read_file X-Git-Tag: oc-android-1.5.5~84^2~5 X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/commitdiff_plain/07b82ef42fdcae37899771ea24ae5c0076853207?hp=c344de7b81a58ae7aeae1693db6a2953f8e98d99 Merge branch 'develop' into refactor_remote_operation_to_read_file --- diff --git a/AndroidManifest.xml b/AndroidManifest.xml index bdd792b0..80fc7e3c 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -18,8 +18,8 @@ along with this program. If not, see . --> + android:versionCode="105002" + android:versionName="1.5.2" xmlns:android="http://schemas.android.com/apk/res/android"> @@ -113,7 +113,7 @@ + > diff --git a/SETUP.md b/SETUP.md index 64701577..1b5de18d 100644 --- a/SETUP.md +++ b/SETUP.md @@ -25,15 +25,17 @@ NOTE: You must have the Android SDK 'tools/', and 'platforms-tools/' folders in ### 3. Building with console/maven: -NOTE: You must have mvn in your environment path +NOTE: You must have mvn (version >= 3.1.1) in your environment path. Current Android 'platforms-tools' need to be installed. * Download/install Android plugin for Maven, then build ownCloud with mvn: * "cd .." * "git clone https://github.com/mosabua/maven-android-sdk-deployer.git" * "cd maven-android-sdk-deployer" -* "mvn -pl com.simpligility.android.sdk-deployer:android-17 -am install" -* "cd ../android" -* Now you can create APK using "mvn package" +* "mvn -pl com.simpligility.android.sdk-deployer:android-19 -am install" +* "cd ../android/oc_framework" +* "mvn install" +* "cd .." +* Now you can create ownCloud APK using "mvn package" ### 4. Building with Eclipse: @@ -44,13 +46,13 @@ NOTE: You must have the Android SDK 'tools/', and 'platforms-tools/' folders in * Clean project and compile. * If any error appear, check the project properties; in the 'Android' section, API Level should be greater or equal than 14. * Make sure android/actionbarsherlock/library/bin/library.jar was created. -* Create a new "Android Project from Existing Code". Choose android/oc_framework/library as root. +* Create a new "Android Project from Existing Code". Choose android/oc_framework as root. * Clean project and compile. * If any error appear, check the project properties; in the 'Android' section, API Level should be 19 or greater. * Make sure android/oc_framework/bin/classes.jar was created. * Import ownCloud Android project. * Clean project and compile. -* If any error appears, check the project properties; in the 'Android' section: +* If any error appears, check the project properties of owncloud-android project; in the 'Android' section: - API Level should be 19 or greater. - Two library projects should appear referred in the bottom square: actionbarsherlock/library and oc_framework. Add them if needed. * After those actions you should be good to go. HAVE FUN! diff --git a/oc_framework/pom.xml b/oc_framework/pom.xml new file mode 100755 index 00000000..674c0310 --- /dev/null +++ b/oc_framework/pom.xml @@ -0,0 +1,81 @@ + + + + 4.0.0 + com.owncloud.android + oc_framework + ${owncloud.version} + jar + oc_framework for Owncloud Android + + + 1.5.1-SNAPSHOT + 1.6 + + 4.4_r1 + + 19 + + + oc_framwork for Owncloud for Android + + + + + android + android + ${google.android-version} + provided + + + + commons-httpclient + commons-httpclient + 3.1 + + + + org.apache.jackrabbit + jackrabbit-webdav + 2.5.2 + + + + + + ${project.artifactId} + + src + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.0 + + ${java-version} + ${java-version} + + + + + com.jayway.maven.plugins.android.generation2 + android-maven-plugin + 3.8.0 + + + ${env.ANDROID_HOME} + ${google.android-api} + + + true + + + + + + + + diff --git a/oc_framework/src/com/owncloud/android/oc_framework/network/AdvancedSslSocketFactory.java b/oc_framework/src/com/owncloud/android/oc_framework/network/AdvancedSslSocketFactory.java index e24fa364..775473a2 100644 --- a/oc_framework/src/com/owncloud/android/oc_framework/network/AdvancedSslSocketFactory.java +++ b/oc_framework/src/com/owncloud/android/oc_framework/network/AdvancedSslSocketFactory.java @@ -24,12 +24,15 @@ import java.net.InetSocketAddress; import java.net.Socket; import java.net.SocketAddress; import java.net.UnknownHostException; +//import java.security.Provider; import java.security.cert.X509Certificate; +//import java.util.Enumeration; import javax.net.SocketFactory; import javax.net.ssl.SSLContext; import javax.net.ssl.SSLException; import javax.net.ssl.SSLHandshakeException; +//import javax.net.ssl.SSLParameters; import javax.net.ssl.SSLPeerUnverifiedException; import javax.net.ssl.SSLSession; import javax.net.ssl.SSLSocket; @@ -39,6 +42,7 @@ import org.apache.commons.httpclient.params.HttpConnectionParams; import org.apache.commons.httpclient.protocol.ProtocolSocketFactory; import org.apache.http.conn.ssl.X509HostnameVerifier; +//import android.os.Build; import android.util.Log; @@ -84,8 +88,47 @@ public class AdvancedSslSocketFactory implements ProtocolSocketFactory { return socket; } + /* + private void logSslInfo() { + if (Build.VERSION.SDK_INT > Build.VERSION_CODES.FROYO) { + Log.v(TAG, "SUPPORTED SSL PARAMETERS"); + logSslParameters(mSslContext.getSupportedSSLParameters()); + Log.v(TAG, "DEFAULT SSL PARAMETERS"); + logSslParameters(mSslContext.getDefaultSSLParameters()); + Log.i(TAG, "CURRENT PARAMETERS"); + Log.i(TAG, "Protocol: " + mSslContext.getProtocol()); + } + Log.i(TAG, "PROVIDER"); + logSecurityProvider(mSslContext.getProvider()); + } - /** + private void logSecurityProvider(Provider provider) { + Log.i(TAG, "name: " + provider.getName()); + Log.i(TAG, "version: " + provider.getVersion()); + Log.i(TAG, "info: " + provider.getInfo()); + Enumeration keys = provider.propertyNames(); + String key; + while (keys.hasMoreElements()) { + key = (String) keys.nextElement(); + Log.i(TAG, " property " + key + " : " + provider.getProperty(key)); + } + } + + private void logSslParameters(SSLParameters params) { + Log.v(TAG, "Cipher suites: "); + String [] elements = params.getCipherSuites(); + for (int i=0; i. + * + */ + +package com.owncloud.android.oc_framework.network; + +import java.lang.ref.WeakReference; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.concurrent.atomic.AtomicReference; + +import javax.net.ssl.SSLSocket; + +import android.util.Log; + + +/** + * Enables the support of Server Name Indication if existing + * in the underlying network implementation. + * + * Build as a singleton. + * + * @author David A. Velasco + */ +public class ServerNameIndicator { + + private static final String TAG = ServerNameIndicator.class.getSimpleName(); + + private static final AtomicReference mSingleInstance = new AtomicReference(); + + private static final String METHOD_NAME = "setHostname"; + + private final WeakReference> mSSLSocketClassRef; + private final WeakReference mSetHostnameMethodRef; + + + /** + * Private constructor, class is a singleton. + * + * @param sslSocketClass Underlying implementation class of {@link SSLSocket} used to connect with the server. + * @param setHostnameMethod Name of the method to call to enable the SNI support. + */ + private ServerNameIndicator(Class sslSocketClass, Method setHostnameMethod) { + mSSLSocketClassRef = new WeakReference>(sslSocketClass); + mSetHostnameMethodRef = (setHostnameMethod == null) ? null : new WeakReference(setHostnameMethod); + } + + + /** + * Calls the {@code #setHostname(String)} method of the underlying implementation + * of {@link SSLSocket} if exists. + * + * Creates and initializes the single instance of the class when needed + * + * @param hostname The name of the server host of interest. + * @param sslSocket Client socket to connect with the server. + */ + public static void setServerNameIndication(String hostname, SSLSocket sslSocket) { + final Method setHostnameMethod = getMethod(sslSocket); + if (setHostnameMethod != null) { + try { + setHostnameMethod.invoke(sslSocket, hostname); + Log.i(TAG, "SNI done, hostname: " + hostname); + + } catch (IllegalArgumentException e) { + Log.e(TAG, "Call to SSLSocket#setHost(String) failed ", e); + + } catch (IllegalAccessException e) { + Log.e(TAG, "Call to SSLSocket#setHost(String) failed ", e); + + } catch (InvocationTargetException e) { + Log.e(TAG, "Call to SSLSocket#setHost(String) failed ", e); + } + } else { + Log.i(TAG, "SNI not supported"); + } + } + + + /** + * Gets the method to invoke trying to minimize the effective + * application of reflection. + * + * @param sslSocket Instance of the SSL socket to use in connection with server. + * @return Method to call to indicate the server name of interest to the server. + */ + private static Method getMethod(SSLSocket sslSocket) { + final Class sslSocketClass = sslSocket.getClass(); + final ServerNameIndicator instance = mSingleInstance.get(); + if (instance == null) { + return initFrom(sslSocketClass); + + } else if (instance.mSSLSocketClassRef.get() != sslSocketClass) { + // the underlying class changed + return initFrom(sslSocketClass); + + } else if (instance.mSetHostnameMethodRef == null) { + // SNI not supported + return null; + + } else { + final Method cachedSetHostnameMethod = instance.mSetHostnameMethodRef.get(); + return (cachedSetHostnameMethod == null) ? initFrom(sslSocketClass) : cachedSetHostnameMethod; + } + } + + + /** + * Singleton initializer. + * + * Uses reflection to extract and 'cache' the method to invoke to indicate the desited host name to the server side. + * + * @param sslSocketClass Underlying class providing the implementation of {@link SSLSocket}. + * @return Method to call to indicate the server name of interest to the server. + */ + private static Method initFrom(Class sslSocketClass) { + Log.i(TAG, "SSLSocket implementation: " + sslSocketClass.getCanonicalName()); + Method setHostnameMethod = null; + try { + setHostnameMethod = sslSocketClass.getMethod(METHOD_NAME, String.class); + } catch (SecurityException e) { + Log.e(TAG, "Could not access to SSLSocket#setHostname(String) method ", e); + + } catch (NoSuchMethodException e) { + Log.i(TAG, "Could not find SSLSocket#setHostname(String) method - SNI not supported"); + } + mSingleInstance.set(new ServerNameIndicator(sslSocketClass, setHostnameMethod)); + return setHostnameMethod; + } + +} diff --git a/oc_jb_workaround/AndroidManifest.xml b/oc_jb_workaround/AndroidManifest.xml index 1b12fb49..46e92691 100644 --- a/oc_jb_workaround/AndroidManifest.xml +++ b/oc_jb_workaround/AndroidManifest.xml @@ -1,8 +1,8 @@ + android:versionCode="0100011" + android:versionName="1.0.11" > 4.0.0 com.owncloud.android owncloud - 1.3.21-SNAPSHOT + ${owncloud.version} apk Owncloud Android + 1.5.1-SNAPSHOT 1.6 - 4.2.2_r2 + + 4.4_r1 + + 19 4.2.0 @@ -22,7 +26,7 @@ scm:git:git@github.com:owncloud/android.git https://github.com/owncloud/android - + @@ -51,6 +55,13 @@ jackrabbit-webdav 2.5.2 + + + + com.owncloud.android + oc_framework + ${owncloud.version} + @@ -74,12 +85,11 @@ com.jayway.maven.plugins.android.generation2 android-maven-plugin - 3.5.0 + 3.8.0 - ${env.ANDROID_HOME} - 17 + ${google.android-api} true diff --git a/res/drawable-hdpi/winter_holidays_icon.png b/res/drawable-hdpi/winter_holidays_icon.png new file mode 100644 index 00000000..c1764b6d Binary files /dev/null and b/res/drawable-hdpi/winter_holidays_icon.png differ diff --git a/res/drawable-ldpi/winter_holidays_icon.png b/res/drawable-ldpi/winter_holidays_icon.png new file mode 100644 index 00000000..9261d327 Binary files /dev/null and b/res/drawable-ldpi/winter_holidays_icon.png differ diff --git a/res/drawable-mdpi/winter_holidays_icon.png b/res/drawable-mdpi/winter_holidays_icon.png new file mode 100644 index 00000000..b0226dce Binary files /dev/null and b/res/drawable-mdpi/winter_holidays_icon.png differ diff --git a/res/layout-land/account_setup.xml b/res/layout-land/account_setup.xml index 1025bcff..4eea9b36 100644 --- a/res/layout-land/account_setup.xml +++ b/res/layout-land/account_setup.xml @@ -27,7 +27,7 @@ @@ -186,27 +186,33 @@ -