FLIX VISION v2.8.2版本的 MD5 值为:4c8f04d6db90386313134c0796491235

以下内容为反编译后的 c.java 源代码,内容仅作参考


package ca;

import android.os.Build;
import android.util.Log;
import com.google.gson.j;
import gb.g;
import java.io.IOException;
import java.util.ArrayList;
import java.util.concurrent.TimeUnit;
import javax.net.ssl.SSLContext;
import okhttp3.ConnectionSpec;
import okhttp3.Interceptor;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import okhttp3.TlsVersion;
import okhttp3.logging.HttpLoggingInterceptor;
import retrofit2.Retrofit;
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
import retrofit2.converter.gson.GsonConverterFactory;
import retrofit2.converter.scalars.ScalarsConverterFactory;

public final class c {

    public static d f4857a;

    public static d f4858b;

    public static d f4859c;

    public static d f4860d;

    public static d f4861e;

    public class a implements Interceptor {
        @Override
        public Response intercept(Interceptor.Chain chain) throws IOException {
            Request request = chain.request();
            return chain.proceed(request.newBuilder().header("User-Agent", "MacOS").method(request.method(), request.body()).build());
        }
    }

    public class b implements Interceptor {
        @Override
        public Response intercept(Interceptor.Chain chain) throws IOException {
            Request request = chain.request();
            return chain.proceed(request.newBuilder().header("User-Agent", "MacOS").method(request.method(), request.body()).build());
        }
    }

    public class C0057c implements Interceptor {
        @Override
        public Response intercept(Interceptor.Chain chain) throws IOException {
            chain.request();
            return chain.proceed(chain.request());
        }
    }

    public static OkHttpClient.Builder enableTls12OnPreLollipop(OkHttpClient.Builder builder) {
        try {
            SSLContext sSLContext = SSLContext.getInstance("TLSv1.2");
            sSLContext.init(null, null, null);
            builder.sslSocketFactory(new g(sSLContext.getSocketFactory()));
            ConnectionSpec build = new ConnectionSpec.Builder(ConnectionSpec.MODERN_TLS).tlsVersions(TlsVersion.TLS_1_2).build();
            ArrayList arrayList = new ArrayList();
            arrayList.add(build);
            arrayList.add(ConnectionSpec.COMPATIBLE_TLS);
            arrayList.add(ConnectionSpec.CLEARTEXT);
            builder.connectionSpecs(arrayList);
        } catch (Exception e10) {
            Log.e("OkHttpTLSCompat", "Error while setting TLS 1.2", e10);
        }
        return builder;
    }

    public static d getInstanceAllDebridAPI() {
        if (f4858b == null) {
            HttpLoggingInterceptor httpLoggingInterceptor = new HttpLoggingInterceptor();
            httpLoggingInterceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
            f4858b = (d) new Retrofit.Builder().baseUrl("https://api.alldebrid.com").addConverterFactory(GsonConverterFactory.create()).addCallAdapterFactory(RxJava2CallAdapterFactory.create()).client(new OkHttpClient.Builder().addInterceptor(httpLoggingInterceptor).build()).build().create(d.class);
        }
        return f4858b;
    }

    public static d getInstanceDebrid() {
        if (f4859c == null) {
            HttpLoggingInterceptor httpLoggingInterceptor = new HttpLoggingInterceptor();
            httpLoggingInterceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
            f4859c = (d) new Retrofit.Builder().baseUrl("https://api.real-debrid.com").addConverterFactory(GsonConverterFactory.create()).addCallAdapterFactory(RxJava2CallAdapterFactory.create()).client(new OkHttpClient.Builder().addInterceptor(httpLoggingInterceptor).build()).build().create(d.class);
        }
        return f4859c;
    }

    public static d getInstanceFlix(String str) {
        d dVar = (d) new Retrofit.Builder().baseUrl(str).addConverterFactory(GsonConverterFactory.create(new j().setLenient().create())).addCallAdapterFactory(RxJava2CallAdapterFactory.create()).client(new OkHttpClient.Builder().addInterceptor(new a()).build()).build().create(d.class);
        f4857a = dVar;
        return dVar;
    }

    public static d getInstanceHDO(String str) {
        d dVar = (d) new Retrofit.Builder().baseUrl(str).addConverterFactory(ScalarsConverterFactory.create()).client(new OkHttpClient.Builder().addInterceptor(new b()).build()).build().create(d.class);
        f4857a = dVar;
        return dVar;
    }

    public static d getInstancePremiumizeAPI() {
        if (f4858b == null) {
            HttpLoggingInterceptor httpLoggingInterceptor = new HttpLoggingInterceptor();
            httpLoggingInterceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
            f4858b = (d) new Retrofit.Builder().baseUrl("https://www.premiumize.me").addConverterFactory(GsonConverterFactory.create()).addCallAdapterFactory(RxJava2CallAdapterFactory.create()).client(new OkHttpClient.Builder().addInterceptor(httpLoggingInterceptor).build()).build().create(d.class);
        }
        return f4858b;
    }

    public static OkHttpClient getNewHttpClient() {
        if (Build.VERSION.SDK_INT < 22) {
            OkHttpClient.Builder cache = new OkHttpClient.Builder().followRedirects(true).followSslRedirects(true).retryOnConnectionFailure(true).cache(null);
            TimeUnit timeUnit = TimeUnit.SECONDS;
            return enableTls12OnPreLollipop(cache.connectTimeout(15L, timeUnit).writeTimeout(15L, timeUnit).readTimeout(15L, timeUnit)).build();
        }
        HttpLoggingInterceptor httpLoggingInterceptor = new HttpLoggingInterceptor();
        httpLoggingInterceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
        return new OkHttpClient.Builder().addInterceptor(httpLoggingInterceptor).build();
    }

    public static d getRequest(String str) {
        if (f4861e == null) {
            f4861e = (d) new Retrofit.Builder().baseUrl(str).addConverterFactory(GsonConverterFactory.create()).addCallAdapterFactory(RxJava2CallAdapterFactory.create()).client(new OkHttpClient.Builder().addInterceptor(new C0057c()).build()).build().create(d.class);
        }
        return f4861e;
    }

    public static d getRequestTmdb() {
        if (f4860d == null) {
            f4860d = (d) new Retrofit.Builder().baseUrl("https://api.themoviedb.org").addConverterFactory(GsonConverterFactory.create()).addCallAdapterFactory(RxJava2CallAdapterFactory.create()).client(getNewHttpClient()).build().create(d.class);
        }
        return f4860d;
    }
}