VegeFruits v7.1版本的 MD5 值为:2ff167dfba698c783e879938fe00b9ce
以下内容为反编译后的 fg.java 源代码,内容仅作参考
package com.yandex.metrica.impl.ob;
import android.os.Build;
import android.util.Base64;
import com.mopub.common.Constants;
import com.yandex.metrica.impl.ob.ex;
import java.io.IOException;
import java.security.GeneralSecurityException;
import java.security.KeyStore;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.cert.X509Certificate;
import java.util.List;
import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManager;
import javax.net.ssl.TrustManagerFactory;
import org.apache.http.conn.scheme.PlainSocketFactory;
import org.apache.http.conn.scheme.Scheme;
import org.apache.http.conn.scheme.SchemeRegistry;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager;
import org.apache.http.params.BasicHttpParams;
class fg {
public static String a(X509Certificate x509Certificate) {
try {
return Base64.encodeToString(MessageDigest.getInstance("SHA-256").digest(x509Certificate.getPublicKey().getEncoded()), 2);
} catch (NoSuchAlgorithmException e) {
throw new AssertionError(e);
}
}
public static fs a(List<X509Certificate> list) throws GeneralSecurityException, IOException {
TrustManager[] trustManagerArr;
fm flVar;
if (list == null || list.isEmpty()) {
trustManagerArr = null;
} else {
KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType());
keyStore.load(null, null);
int i = 0;
while (true) {
int i2 = i;
if (i2 >= list.size()) {
break;
}
keyStore.setCertificateEntry("ca" + i2, list.get(i2));
i = i2 + 1;
}
TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
trustManagerFactory.init(keyStore);
trustManagerArr = trustManagerFactory.getTrustManagers();
}
SSLContext sSLContext = SSLContext.getInstance("TLS");
sSLContext.init(null, trustManagerArr, null);
if (Build.VERSION.SDK_INT >= 9) {
flVar = new fn(sSLContext.getSocketFactory());
} else {
ex.a aVar = new ex.a(sSLContext);
PlainSocketFactory socketFactory = PlainSocketFactory.getSocketFactory();
BasicHttpParams basicHttpParams = new BasicHttpParams();
SchemeRegistry schemeRegistry = new SchemeRegistry();
schemeRegistry.register(new Scheme(Constants.HTTP, socketFactory, 80));
schemeRegistry.register(new Scheme("https", aVar, 443));
flVar = new fl(new DefaultHttpClient(new ThreadSafeClientConnManager(basicHttpParams, schemeRegistry), basicHttpParams));
}
return new fs(new fq(flVar));
}
public static boolean a(fd fdVar) {
return !"https://certificate.mobile.yandex.net/api/v1/pins".equals(fdVar.b());
}
}