APK反编译源代码展示 - 南明离火平台提供

应用版本信息
应用名称:JioFiberPartner
版本号:5.2.0
包名称:com.jfp.prod

MD5 校验值:7cd346351ab05a28e42aff65173e0141

反编译源代码说明

f.java 文件包含反编译后的源代码,请注意,该内容仅供学习和参考使用,不得用于非法用途。


package f8;

import java.security.KeyStoreException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
import javax.net.ssl.TrustManager;
import javax.net.ssl.TrustManagerFactory;
import javax.net.ssl.X509TrustManager;

class f implements X509TrustManager {

    private static final X509Certificate[] f8436f = new X509Certificate[0];

    private final TrustManager[] f8437a;

    private final g f8438b;

    private final long f8439c;

    private final List<byte[]> f8440d = new LinkedList();

    private final Set<X509Certificate> f8441e = Collections.synchronizedSet(new HashSet());

    public f(g gVar, e eVar) {
        this.f8437a = d(gVar);
        this.f8438b = gVar;
        this.f8439c = eVar.getPinCreationTimeInMillis();
        for (String str : eVar.getPins()) {
            this.f8440d.add(c(str));
        }
    }

    private void a(X509Certificate[] x509CertificateArr) {
        if (this.f8439c != -1 && System.currentTimeMillis() - this.f8439c > 15552000000L) {
            io.fabric.sdk.android.c.p().e("Fabric", "Certificate pins are stale, (" + (System.currentTimeMillis() - this.f8439c) + " millis vs 15552000000 millis) falling back to system trust.");
            return;
        }
        for (X509Certificate x509Certificate : a.a(x509CertificateArr, this.f8438b)) {
            if (e(x509Certificate)) {
                return;
            }
        }
        throw new CertificateException("No valid pins found in chain!");
    }

    private void b(X509Certificate[] x509CertificateArr, String str) {
        for (TrustManager trustManager : this.f8437a) {
            ((X509TrustManager) trustManager).checkServerTrusted(x509CertificateArr, str);
        }
    }

    private byte[] c(String str) {
        int length = str.length();
        byte[] bArr = new byte[length / 2];
        for (int i10 = 0; i10 < length; i10 += 2) {
            bArr[i10 / 2] = (byte) ((Character.digit(str.charAt(i10), 16) << 4) + Character.digit(str.charAt(i10 + 1), 16));
        }
        return bArr;
    }

    private TrustManager[] d(g gVar) {
        try {
            TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance("X509");
            trustManagerFactory.init(gVar.f8442a);
            return trustManagerFactory.getTrustManagers();
        } catch (KeyStoreException e10) {
            throw new AssertionError(e10);
        } catch (NoSuchAlgorithmException e11) {
            throw new AssertionError(e11);
        }
    }

    private boolean e(X509Certificate x509Certificate) {
        try {
            byte[] digest = MessageDigest.getInstance("SHA1").digest(x509Certificate.getPublicKey().getEncoded());
            Iterator<byte[]> it = this.f8440d.iterator();
            while (it.hasNext()) {
                if (Arrays.equals(it.next(), digest)) {
                    return true;
                }
            }
            return false;
        } catch (NoSuchAlgorithmException e10) {
            throw new CertificateException(e10);
        }
    }

    @Override
    public void checkClientTrusted(X509Certificate[] x509CertificateArr, String str) {
        throw new CertificateException("Client certificates not supported!");
    }

    @Override
    public void checkServerTrusted(X509Certificate[] x509CertificateArr, String str) {
        if (this.f8441e.contains(x509CertificateArr[0])) {
            return;
        }
        b(x509CertificateArr, str);
        a(x509CertificateArr);
        this.f8441e.add(x509CertificateArr[0]);
    }

    @Override
    public X509Certificate[] getAcceptedIssuers() {
        return f8436f;
    }
}