导航菜单

页面标题

页面副标题

Moneyman v2.316.0.0 - a.java 源代码

正在查看: Moneyman v2.316.0.0 应用的 a.java JAVA 源代码文件

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


package Wj;

import Eh.C;
import Eh.y;
import Vf.A;
import android.content.Context;
import io.ktor.client.engine.okhttp.OkHttpConfig;
import io.sentry.C1243y1;
import java.io.IOException;
import java.io.InputStream;
import java.security.KeyManagementException;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.NoSuchProviderException;
import java.security.UnrecoverableKeyException;
import java.security.cert.CertificateException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.NoSuchElementException;
import java.util.Objects;
import java.util.Optional;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import javax.net.ssl.KeyManagerFactory;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLParameters;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.TrustManager;
import javax.net.ssl.TrustManagerFactory;
import javax.net.ssl.X509ExtendedKeyManager;
import javax.net.ssl.X509ExtendedTrustManager;
import javax.net.ssl.X509KeyManager;
import javax.net.ssl.X509TrustManager;
import kg.InterfaceC1345k;
import nl.altindag.ssl.exception.GenericKeyManagerException;
import nl.altindag.ssl.exception.GenericKeyStoreException;
import nl.altindag.ssl.exception.GenericSSLContextException;
import nl.altindag.ssl.exception.GenericSecurityException;
import okhttp3.CertificatePinner;
import okhttp3.OkHttpClient;

public final class a implements InterfaceC1345k {
    public final int a;
    public final String[] b;
    public final b c;

    public a(String[] strArr, b bVar, int i) {
        this.a = i;
        this.b = strArr;
        this.c = bVar;
    }

    @Override
    public final Object invoke(Object obj) {
        X509ExtendedKeyManager x509ExtendedKeyManager;
        X509ExtendedTrustManager a;
        boolean z;
        TrustManager trustManager;
        A a2 = A.a;
        b bVar = this.c;
        String[] strArr = this.b;
        int i = 0;
        switch (this.a) {
            case 0:
                OkHttpClient.Builder config = (OkHttpClient.Builder) obj;
                kotlin.jvm.internal.i.g(config, "$this$config");
                config.certificatePinner(new CertificatePinner.Builder().add("www.moneyman.com.mx", (String[]) Arrays.copyOf(strArr, strArr.length)).build());
                Context context = bVar.a;
                U9.a aVar = U9.c.a;
                byte[] m = y.m("Z3EzTXYydWtWVzdTeTltcmFiVHdmYw==");
                aVar.getClass();
                String obj2 = C.j0(y.l(U9.a.a(m))).toString();
                TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()).init((KeyStore) null);
                int i2 = Iq.e.b;
                Iq.d dVar = new Iq.d();
                InputStream openRawResource = context.getResources().openRawResource(2131951616);
                char[] charArray = obj2.toCharArray();
                kotlin.jvm.internal.i.f(charArray, "toCharArray(...)");
                if (openRawResource == null || Uq.b.a("PKCS12")) {
                    throw new GenericKeyStoreException("Identity details are empty, which are required to be present when SSL/TLS is enabled");
                }
                int i3 = Tq.c.a;
                try {
                    KeyStore keyStore = Uq.b.a((String) null) ? KeyStore.getInstance("PKCS12") : KeyStore.getInstance("PKCS12", (String) null);
                    keyStore.load(openRawResource, charArray);
                    Lq.b bVar2 = new Lq.b(keyStore, charArray);
                    ArrayList arrayList = dVar.a;
                    arrayList.add(bVar2);
                    ArrayList arrayList2 = dVar.d;
                    arrayList2.add(new Sq.j(Tk.a.p(null)));
                    boolean isEmpty = arrayList.isEmpty();
                    ArrayList arrayList3 = dVar.b;
                    ArrayList arrayList4 = dVar.c;
                    if (isEmpty && arrayList4.isEmpty() && arrayList3.isEmpty() && arrayList2.isEmpty()) {
                        throw new GenericSecurityException("Could not create instance of SSLFactory because Identity and Trust material are not present. Please provide at least a Trust material.");
                    }
                    if ((arrayList.isEmpty() && arrayList4.isEmpty()) ? false : true) {
                        int i4 = Tq.b.a;
                        C1243y1 c1243y1 = new C1243y1(20);
                        Iterator it = arrayList4.iterator();
                        while (true) {
                            boolean hasNext = it.hasNext();
                            ArrayList arrayList5 = (ArrayList) c1243y1.b;
                            if (hasNext) {
                                arrayList5.add(Tq.b.c((X509KeyManager) it.next()));
                            } else {
                                Iterator it2 = arrayList.iterator();
                                while (it2.hasNext()) {
                                    Lq.b bVar3 = (Lq.b) it2.next();
                                    KeyStore keyStore2 = bVar3.a;
                                    char[] cArr = bVar3.b;
                                    try {
                                        KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
                                        try {
                                            keyManagerFactory.init(keyStore2, cArr);
                                            arrayList5.add(Tq.b.a(keyManagerFactory));
                                        } catch (KeyStoreException | NoSuchAlgorithmException | UnrecoverableKeyException e) {
                                            throw new GenericKeyManagerException(e);
                                        }
                                    } catch (NoSuchAlgorithmException e2) {
                                        throw new GenericKeyManagerException(e2);
                                    }
                                }
                                ((HashMap) c1243y1.c).putAll(dVar.f);
                                x509ExtendedKeyManager = c1243y1.q();
                            }
                        }
                    } else {
                        x509ExtendedKeyManager = null;
                    }
                    if (arrayList3.isEmpty() && arrayList2.isEmpty()) {
                        a = null;
                    } else {
                        Tq.f fVar = new Tq.f();
                        Iterator it3 = arrayList2.iterator();
                        while (true) {
                            boolean hasNext2 = it3.hasNext();
                            ArrayList arrayList6 = fVar.a;
                            if (hasNext2) {
                                arrayList6.add(Tk.a.e0((X509TrustManager) it3.next()));
                            } else {
                                Iterator it4 = arrayList3.iterator();
                                while (it4.hasNext()) {
                                    arrayList6.add(Tk.a.p((KeyStore) it4.next()));
                                }
                                a = fVar.a();
                            }
                        }
                    }
                    X509ExtendedKeyManager[] x509ExtendedKeyManagerArr = x509ExtendedKeyManager != null ? new X509ExtendedKeyManager[]{Tq.b.c(x509ExtendedKeyManager)} : null;
                    X509ExtendedTrustManager[] x509ExtendedTrustManagerArr = a != null ? new X509ExtendedTrustManager[]{Tk.a.e0(a)} : null;
                    try {
                        SSLContext sSLContext = SSLContext.getInstance("TLS");
                        sSLContext.init(x509ExtendedKeyManagerArr, x509ExtendedTrustManagerArr, null);
                        int i5 = dVar.k;
                        if (i5 >= 0) {
                            if (i5 < 0) {
                                throw new IllegalArgumentException(String.format("Unsupported timeout has been provided. Timeout should be equal or greater than [%d], but received [%d]", 0, Integer.valueOf(i5)));
                            }
                            sSLContext.getClientSessionContext().setSessionTimeout(i5);
                            sSLContext.getServerSessionContext().setSessionTimeout(i5);
                        }
                        int i6 = dVar.l;
                        if (i6 >= 0) {
                            if (i6 < 0) {
                                throw new IllegalArgumentException(String.format("Unsupported cache size has been provided. Cache size should be equal or greater than [%d], but received [%d]", 0, Integer.valueOf(i6)));
                            }
                            sSLContext.getClientSessionContext().setSessionCacheSize(i6);
                            sSLContext.getServerSessionContext().setSessionCacheSize(i6);
                        }
                        SSLParameters defaultSSLParameters = sSLContext.getDefaultSSLParameters();
                        List asList = Arrays.asList(defaultSSLParameters.getCipherSuites());
                        List asList2 = Arrays.asList(defaultSSLParameters.getProtocols());
                        Stream filter = dVar.h.stream().distinct().filter(new Iq.b(0));
                        Objects.requireNonNull(asList);
                        String[] strArr2 = (String[]) filter.filter(new Iq.c(asList, 0)).collect(Collectors.collectingAndThen(Collectors.toList(), new Tq.a(new String[0], 1)));
                        Stream filter2 = dVar.g.stream().distinct().filter(new Iq.b(0));
                        Objects.requireNonNull(asList2);
                        String[] strArr3 = (String[]) filter2.filter(new Iq.c(asList2, 0)).collect(Collectors.collectingAndThen(Collectors.toList(), new Tq.a(new String[0], 1)));
                        SSLParameters sSLParameters = dVar.e;
                        sSLParameters.setCipherSuites(strArr2);
                        sSLParameters.setProtocols(strArr3);
                        ArrayList arrayList7 = dVar.j;
                        ArrayList arrayList8 = dVar.i;
                        SSLParameters sSLParameters2 = new SSLParameters();
                        String[] strArr4 = (String[]) Optional.ofNullable(sSLParameters.getCipherSuites()).filter(new Iq.b(13)).orElseGet(new Tq.d(defaultSSLParameters, 0));
                        String[] strArr5 = (String[]) Optional.ofNullable(sSLParameters.getProtocols()).filter(new Iq.b(14)).orElseGet(new Tq.d(defaultSSLParameters, 1));
                        if (!arrayList7.isEmpty()) {
                            strArr4 = (String[]) Arrays.stream(strArr4).filter(new Tq.e(0, arrayList7)).toArray(new Sq.c(1));
                            if (strArr4.length == 0) {
                                strArr4 = defaultSSLParameters.getCipherSuites();
                            }
                        }
                        if (!arrayList8.isEmpty()) {
                            strArr5 = (String[]) Arrays.stream(strArr5).filter(new Tq.e(1, arrayList8)).toArray(new Sq.c(2));
                            if (strArr5.length == 0) {
                                strArr5 = defaultSSLParameters.getProtocols();
                            }
                        }
                        sSLParameters2.setCipherSuites(strArr4);
                        sSLParameters2.setProtocols(strArr5);
                        if (sSLParameters.getWantClientAuth() ? sSLParameters.getWantClientAuth() : defaultSSLParameters.getWantClientAuth()) {
                            z = true;
                            sSLParameters2.setWantClientAuth(true);
                        } else {
                            z = true;
                        }
                        if (sSLParameters.getNeedClientAuth() ? sSLParameters.getNeedClientAuth() : defaultSSLParameters.getNeedClientAuth()) {
                            sSLParameters2.setNeedClientAuth(z);
                        }
                        Pq.a aVar2 = new Pq.a(sSLContext, sSLParameters2);
                        new Mq.a();
                        B2.c cVar = new B2.c(14);
                        cVar.b = aVar2;
                        cVar.c = a;
                        cVar.d = sSLParameters2;
                        Iq.e eVar = new Iq.e(cVar);
                        TrustManager[] trustManagers = ((TrustManagerFactory) Optional.ofNullable((X509ExtendedTrustManager) cVar.c).map(new Iq.a(0)).get()).getTrustManagers();
                        if (trustManagers != null) {
                            int length = trustManagers.length;
                            while (i < length) {
                                trustManager = trustManagers[i];
                                if (!(trustManager instanceof X509TrustManager)) {
                                    i++;
                                }
                            }
                            throw new NoSuchElementException("Array contains no element matching the predicate.");
                        }
                        trustManager = null;
                        kotlin.jvm.internal.i.e(trustManager, "null cannot be cast to non-null type javax.net.ssl.X509TrustManager");
                        SSLSocketFactory socketFactory = ((Pq.a) eVar.a.b).getSocketFactory();
                        kotlin.jvm.internal.i.f(socketFactory, "getSocketFactory(...)");
                        m mVar = new m(socketFactory, (X509TrustManager) trustManager);
                        config.sslSocketFactory(mVar.a, mVar.b);
                        return a2;
                    } catch (KeyManagementException | NoSuchAlgorithmException | NoSuchProviderException e3) {
                        throw new GenericSSLContextException(e3);
                    }
                } catch (IOException e4) {
                    e = e4;
                    throw new GenericKeyStoreException(e);
                } catch (KeyStoreException e5) {
                    e = e5;
                    throw new GenericKeyStoreException(e);
                } catch (NoSuchAlgorithmException e6) {
                    e = e6;
                    throw new GenericKeyStoreException(e);
                } catch (NoSuchProviderException e9) {
                    e = e9;
                    throw new GenericKeyStoreException(e);
                } catch (CertificateException e10) {
                    e = e10;
                    throw new GenericKeyStoreException(e);
                }
            default:
                OkHttpConfig create = (OkHttpConfig) obj;
                kotlin.jvm.internal.i.g(create, "$this$create");
                create.config(new a(strArr, bVar, i));
                return a2;
        }
    }
}