Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minSDK 19 to support libs #1576

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ android {
}

defaultConfig {
minSdkVersion 14
minSdkVersion 19
targetSdkVersion 34

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@

import android.os.Parcel;

import com.nextcloud.common.OkHttpCredentialsUtil;
import java.nio.charset.StandardCharsets;

import okhttp3.Credentials;

public class OwnCloudAnonymousCredentials implements OwnCloudCredentials {

Expand All @@ -35,7 +37,7 @@ public boolean authTokenExpires() {

@Override
public String toOkHttpCredentials() {
return OkHttpCredentialsUtil.basic(getUsername(), getAuthToken());
return Credentials.basic(getUsername(), getAuthToken(), StandardCharsets.UTF_8);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@

import android.os.Parcel;

import com.nextcloud.common.OkHttpCredentialsUtil;

import org.apache.commons.httpclient.UsernamePasswordCredentials;
import org.apache.commons.httpclient.auth.AuthPolicy;
import org.apache.commons.httpclient.auth.AuthScope;

import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;

import okhttp3.Credentials;

public class OwnCloudBasicCredentials implements OwnCloudCredentials {

private String username;
Expand Down Expand Up @@ -59,11 +60,9 @@ public boolean authTokenExpires() {

@Override
public String toOkHttpCredentials() {
return OkHttpCredentialsUtil.basic(username, authToken);
return Credentials.basic(username, authToken, StandardCharsets.UTF_8);
}



/*
* Autogenerated Parcelable interface
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import android.os.Bundle;

import com.nextcloud.common.NextcloudClient;
import com.nextcloud.common.OkHttpCredentialsUtil;
import com.nextcloud.common.User;
import com.owncloud.android.lib.common.accounts.AccountTypeUtils;
import com.owncloud.android.lib.common.accounts.AccountUtils;
Expand All @@ -32,8 +31,11 @@
import com.owncloud.android.lib.common.utils.Log_OC;

import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.security.GeneralSecurityException;

import okhttp3.Credentials;

public class OwnCloudClientFactory {

final private static String TAG = OwnCloudClientFactory.class.getSimpleName();
Expand Down Expand Up @@ -223,7 +225,7 @@ public static NextcloudClient createNextcloudClient(Account account, Context app

return createNextcloudClient(baseUri,
userId,
OkHttpCredentialsUtil.basic(username, password),
Credentials.basic(username, password, StandardCharsets.UTF_8),
appContext,
true);
}
Expand Down
2 changes: 1 addition & 1 deletion sample_client/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ android {
}

defaultConfig {
minSdkVersion 14
minSdkVersion 19
targetSdkVersion 34

multiDexEnabled true
Expand Down
Loading