Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dbc8c325 authored by David A. Velasco's avatar David A. Velasco
Browse files

Merge branch 'develop'

parents e3dddbdc c8f6e5ad
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
language: android
android:
  components:
    - build-tools-20.0.0
    - build-tools-22.0.1
    - android-19
    - android-17
    - android-14
+3 −5
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@ buildscript {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.0.0'
        classpath 'com.android.tools.build:gradle:1.2.3'
    }
}
apply plugin: 'com.android.library'
@@ -13,14 +13,12 @@ repositories {
}

dependencies {
    compile 'commons-httpclient:commons-httpclient:3.1'
    compile 'org.apache.jackrabbit:jackrabbit-webdav:2.7.2'
    compile 'org.slf4j:slf4j-api:1.7.5'
    compile 'org.apache.jackrabbit:jackrabbit-webdav:2.10.1'
}

android {
    compileSdkVersion 19
    buildToolsVersion "20.0.0"
    buildToolsVersion "22.0.1"

    sourceSets {
        main {
+1 −1
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@ dependencies {

android {
    compileSdkVersion 19
    buildToolsVersion "20.0.0"
    buildToolsVersion "22.0.1"

    sourceSets {
        main {
+7 −7
Original line number Diff line number Diff line
@@ -83,6 +83,7 @@ public class OwnCloudClientFactory {
                am.getUserData(account, AccountUtils.Constants.KEY_SUPPORTS_SAML_WEB_SSO) != null;
        OwnCloudClient client = createOwnCloudClient(baseUri, appContext, !isSamlSso);

        String username = account.name.substring(0, account.name.lastIndexOf('@'));
        if (isOauth2) {
            String accessToken = am.blockingGetAuthToken(
            		account, 
@@ -100,11 +101,10 @@ public class OwnCloudClientFactory {
            		false);
            
            client.setCredentials(
            		OwnCloudCredentialsFactory.newSamlSsoCredentials(accessToken)
            		OwnCloudCredentialsFactory.newSamlSsoCredentials(username, accessToken)
    		);

        } else {
            String username = account.name.substring(0, account.name.lastIndexOf('@'));
            //String password = am.getPassword(account);
            String password = am.blockingGetAuthToken(
            		account, 
@@ -137,6 +137,7 @@ public class OwnCloudClientFactory {
                am.getUserData(account, AccountUtils.Constants.KEY_SUPPORTS_SAML_WEB_SSO) != null;
        OwnCloudClient client = createOwnCloudClient(baseUri, appContext, !isSamlSso);

        String username = account.name.substring(0, account.name.lastIndexOf('@'));
        if (isOauth2) {    // TODO avoid a call to getUserData here
            AccountManagerFuture<Bundle> future =  am.getAuthToken(
            		account,  
@@ -166,12 +167,11 @@ public class OwnCloudClientFactory {
            String accessToken = result.getString(AccountManager.KEY_AUTHTOKEN);
            if (accessToken == null) throw new AuthenticatorException("WTF!");
            client.setCredentials(
            		OwnCloudCredentialsFactory.newSamlSsoCredentials(accessToken)
            		OwnCloudCredentialsFactory.newSamlSsoCredentials(username, accessToken)
    		);


        } else {
            String username = account.name.substring(0, account.name.lastIndexOf('@'));
            //String password = am.getPassword(account);
            //String password = am.blockingGetAuthToken(account, MainApp.getAuthTokenTypePass(),
            // false);
Loading