导航菜单

页面标题

页面副标题

Clash Legends v0.0.1 - PaystackApiFactory.java 源代码

正在查看: Clash Legends v0.0.1 应用的 PaystackApiFactory.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package co.paystack.android.mobilemoney.data.api;

import android.os.Build;
import co.paystack.android.BuildConfig;
import co.paystack.android.api.service.PaystackApiService;
import co.paystack.android.api.service.converter.WrappedResponseConverter;
import co.paystack.android.api.utils.TLSSocketFactory;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import java.security.KeyManagementException;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.util.concurrent.TimeUnit;
import kotlin.Metadata;
import kotlin.jvm.internal.Intrinsics;
import okhttp3.Interceptor;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

@Metadata(bv = {1, 0, 3}, d1 = {"\u0000\u0018\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0000\bÀ\u0002\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\u0006\u0010\u0005\u001a\u00020\u0006R\u000e\u0010\u0003\u001a\u00020\u0004X\u0082T¢\u0006\u0002\n\u0000¨\u0006\u0007"}, d2 = {"Lco/paystack/android/mobilemoney/data/api/PaystackApiFactory;", "", "()V", "BASE_URL", "", "createRetrofitService", "Lco/paystack/android/api/service/PaystackApiService;", "paystack_release"}, k = 1, mv = {1, 1, 16})
public final class PaystackApiFactory {
    private static final String BASE_URL = "https://api.paystack.co/";
    public static final PaystackApiFactory INSTANCE = new PaystackApiFactory();

    private PaystackApiFactory() {
    }

    public final PaystackApiService createRetrofitService() throws NoSuchAlgorithmException, KeyManagementException, KeyStoreException {
        Gson gson = new GsonBuilder().setDateFormat("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'SSS'Z'").create();
        TLSSocketFactory tlsV1point2factory = new TLSSocketFactory();
        OkHttpClient okHttpClient = new OkHttpClient.Builder().addInterceptor(new Interceptor() {
            public final Response intercept(Interceptor.Chain chain) {
                Request original = chain.request();
                Request.Builder builder = original.newBuilder().header("User-Agent", "Android_" + Build.VERSION.SDK_INT + "_Paystack_" + BuildConfig.VERSION_NAME).header("X-Paystack-Build", String.valueOf(-1)).header("Accept", "application/json").method(original.method(), original.body());
                Request request = builder.build();
                return chain.proceed(request);
            }
        }).sslSocketFactory(tlsV1point2factory, tlsV1point2factory.getX509TrustManager()).connectTimeout(1L, TimeUnit.MINUTES).readTimeout(1L, TimeUnit.MINUTES).writeTimeout(1L, TimeUnit.MINUTES).build();
        Retrofit retrofit = new Retrofit.Builder().baseUrl(BASE_URL).client(okHttpClient).addConverterFactory(new WrappedResponseConverter.Factory()).addConverterFactory(GsonConverterFactory.create(gson)).build();
        Object create = retrofit.create(PaystackApiService.class);
        Intrinsics.checkExpressionValueIsNotNull(create, "retrofit.create(PaystackApiService::class.java)");
        return (PaystackApiService) create;
    }
}