导航菜单

页面标题

页面副标题

Kahramaa v15.23.3 - WebServiceFactoryV2.java 源代码

正在查看: Kahramaa v15.23.3 应用的 WebServiceFactoryV2.java JAVA 源代码文件

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


package com.qa.kahramaa.kahramaa.base.retrofit;

import com.qa.kahramaa.kahramaa.base.BaseApplication;
import java.security.GeneralSecurityException;
import java.security.KeyStore;
import java.util.Arrays;
import java.util.concurrent.TimeUnit;
import javax.net.ssl.TrustManager;
import javax.net.ssl.TrustManagerFactory;
import javax.net.ssl.X509TrustManager;
import okhttp3.CertificatePinner;
import okhttp3.OkHttpClient;
import okhttp3.logging.HttpLoggingInterceptor;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

public class WebServiceFactoryV2 {

    public static final int f3457a = 0;

    static {
        System.loadLibrary("keys");
    }

    public static boolean a(c[] cVarArr) {
        if (cVarArr.length <= 0) {
            return false;
        }
        c cVar = cVarArr[0];
        if (cVar instanceof c) {
            return cVar.f3464b;
        }
        return false;
    }

    public static CertificatePinner b() {
        return new CertificatePinner.Builder().add("mstg.km.qa", getSSlPinDev()).add("mprd.km.qa", getSSlPin()).build();
    }

    public static q c(c... cVarArr) {
        Retrofit build;
        StringBuilder h10 = android.support.v4.media.c.h("Basic ");
        h10.append(getMprd());
        String sb2 = h10.toString();
        HttpLoggingInterceptor httpLoggingInterceptor = new HttpLoggingInterceptor();
        httpLoggingInterceptor.setLevel(HttpLoggingInterceptor.Level.NONE);
        try {
            new a.a(BaseApplication.a().getApplicationContext());
        } catch (Exception unused) {
        }
        if (a.a.u()) {
            build = null;
            return (q) build.create(q.class);
        }
        OkHttpClient.Builder addInterceptor = new OkHttpClient.Builder().addInterceptor(new r(sb2, cVarArr)).addInterceptor(httpLoggingInterceptor);
        TimeUnit timeUnit = TimeUnit.MILLISECONDS;
        OkHttpClient.Builder certificatePinner = addInterceptor.connectTimeout(180000L, timeUnit).readTimeout(180000L, timeUnit).certificatePinner(b());
        ma.k kVar = new ma.k();
        kVar.f10610k = 1;
        ma.j a10 = kVar.a();
        build = new Retrofit.Builder().baseUrl("https://mprd.km.qa/CSTServices/Service.svc/").addConverterFactory(GsonConverterFactory.create(a10)).client(certificatePinner.build()).build();
        return (q) build.create(q.class);
    }

    public static q d(c... cVarArr) {
        Retrofit build;
        n.b().getClass();
        String c7 = n.c();
        n.b().getClass();
        String a10 = n.a();
        HttpLoggingInterceptor httpLoggingInterceptor = new HttpLoggingInterceptor();
        httpLoggingInterceptor.setLevel(HttpLoggingInterceptor.Level.NONE);
        try {
            new a.a(BaseApplication.a().getApplicationContext());
        } catch (Exception unused) {
        }
        if (a.a.u()) {
            build = null;
            return (q) build.create(q.class);
        }
        p pVar = new p();
        OkHttpClient.Builder addInterceptor = new OkHttpClient.Builder().addInterceptor(new t(cVarArr, c7, a10)).addInterceptor(httpLoggingInterceptor);
        TimeUnit timeUnit = TimeUnit.MILLISECONDS;
        OkHttpClient.Builder authenticator = addInterceptor.connectTimeout(180000L, timeUnit).readTimeout(180000L, timeUnit).certificatePinner(b()).authenticator(pVar);
        ma.k kVar = new ma.k();
        kVar.f10610k = 1;
        ma.j a11 = kVar.a();
        build = new Retrofit.Builder().baseUrl("https://mprd.km.qa/KMServices/").addConverterFactory(GsonConverterFactory.create(a11)).client(authenticator.build()).build();
        return (q) build.create(q.class);
    }

    public static q e(c... cVarArr) {
        Retrofit build;
        StringBuilder h10 = android.support.v4.media.c.h("Basic ");
        h10.append(getMprd());
        String sb2 = h10.toString();
        HttpLoggingInterceptor httpLoggingInterceptor = new HttpLoggingInterceptor();
        httpLoggingInterceptor.setLevel(HttpLoggingInterceptor.Level.NONE);
        try {
            new a.a(BaseApplication.a().getApplicationContext());
        } catch (Exception unused) {
        }
        if (a.a.u()) {
            build = null;
            return (q) build.create(q.class);
        }
        OkHttpClient.Builder addInterceptor = new OkHttpClient.Builder().addInterceptor(new s(sb2, cVarArr)).addInterceptor(httpLoggingInterceptor);
        TimeUnit timeUnit = TimeUnit.MILLISECONDS;
        OkHttpClient.Builder certificatePinner = addInterceptor.connectTimeout(180000L, timeUnit).readTimeout(180000L, timeUnit).certificatePinner(b());
        ma.k kVar = new ma.k();
        kVar.f10610k = 1;
        ma.j a10 = kVar.a();
        build = new Retrofit.Builder().baseUrl("https://mprd.km.qa/PTServices/").addConverterFactory(GsonConverterFactory.create(a10)).client(certificatePinner.build()).build();
        return (q) build.create(q.class);
    }

    public static X509TrustManager f() {
        try {
            TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
            trustManagerFactory.init((KeyStore) null);
            TrustManager[] trustManagers = trustManagerFactory.getTrustManagers();
            if (trustManagers.length == 1) {
                TrustManager trustManager = trustManagers[0];
                if (trustManager instanceof X509TrustManager) {
                    return (X509TrustManager) trustManager;
                }
            }
            throw new IllegalStateException("Unexpected default trust managers:" + Arrays.toString(trustManagers));
        } catch (GeneralSecurityException unused) {
            throw new AssertionError();
        }
    }

    public static native String getDashboardDec();

    public static native String getDashboardDecIv();

    public static native String getDashboardEnc();

    public static native String getDashboardEncIv();

    public static native String getIv();

    public static native String getMerchantId();

    public static native String getMprd();

    public static native String getSSlPin();

    public static native String getSSlPinDev();

    public static native String getSec();
}