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

Commit ad266b94 authored by desperateCoder's avatar desperateCoder
Browse files

upgrade Retrofit to 2.7.0

parent d0da3028
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -144,7 +144,7 @@ dependencies {

    implementation 'commons-io:commons-io:2.6'

    implementation 'com.squareup.retrofit2:retrofit:2.6.2'
    implementation 'com.squareup.retrofit2:retrofit:2.7.0'
    implementation 'com.squareup.okhttp3:okhttp:3.12.6' // 3.13+ requires Lollipop, but our minSdkVersion is 14

    spotbugsPlugins 'com.h3xstream.findsecbugs:findsecbugs-plugin:1.10.1'
+0 −1
Original line number Diff line number Diff line
@@ -22,7 +22,6 @@ package com.nextcloud.android.sso.aidl;
import androidx.core.util.ObjectsCompat;

import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
+1 −1
Original line number Diff line number Diff line
@@ -120,7 +120,7 @@ public class NextcloudAPI {
    }

    public Response performRequestV2(final @NonNull Type type, NextcloudRequest request) throws Exception {
        Log.d(TAG, "performRequest() called with: type = [" + type + "], request = [" + request + "]");
        Log.d(TAG, "performRequestV2() called with: type = [" + type + "], request = [" + request + "]");

        Response result = null;
        Response response = performNetworkRequestV2(request);
+10 −0
Original line number Diff line number Diff line
@@ -45,6 +45,11 @@ public class BufferedSourceSSO implements BufferedSource {
        throw new UnsupportedOperationException("Not implemented");
    }

    @Override
    public Buffer getBuffer() {
        return buffer();
    }

    @Override
    public boolean exhausted() throws IOException {
        throw new UnsupportedOperationException("Not implemented");
@@ -246,6 +251,11 @@ public class BufferedSourceSSO implements BufferedSource {
        throw new UnsupportedOperationException("Not implemented");
    }

    @Override
    public BufferedSource peek() {
        throw new UnsupportedOperationException("Not implemented");
    }

    @Override
    public InputStream inputStream() {
        return mInputStream;
+13 −1
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ public class NextcloudRetrofitApiBuilder {

    @SuppressWarnings("unchecked") // Single-interface proxy creation guarded by parameter safety.
    public <T> T create(final Class<T> service) {
        retrofit2.Utils.validateServiceInterface(service);
        validateServiceInterface(service);
        return (T) Proxy.newProxyInstance(
                service.getClassLoader(),
                new Class<?>[]{service},
@@ -43,4 +43,16 @@ public class NextcloudRetrofitApiBuilder {
        }
        return result;
    }

    private static <T> void validateServiceInterface(Class<T> service) {
        if (!service.isInterface()) {
            throw new IllegalArgumentException("API declarations must be interfaces.");
        }
        // Prevent API interfaces from extending other interfaces. This not only avoids a bug in
        // Android (http://b.android.com/58753) but it forces composition of API declarations which is
        // the recommended pattern.
        if (service.getInterfaces().length > 0) {
            throw new IllegalArgumentException("API interfaces must not extend other interfaces.");
        }
    }
}