package com.baidu.mobads.production.b; import android.content.Context; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.graphics.Rect; import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.net.wifi.WifiInfo; import android.net.wifi.WifiManager; import android.webkit.CookieManager; import android.webkit.CookieSyncManager; import com.alibaba.android.arouter.utils.Consts; import com.baidu.mobads.interfaces.IXAdRequestInfo; import com.baidu.mobads.interfaces.utils.IXAdCommonUtils; import com.baidu.mobads.interfaces.utils.IXAdSystemUtils; import com.baidu.mobads.utils.XAdSDKFoundationFacade; import com.baidu.mobads.utils.b; import java.util.HashSet; import java.util.Set; public class c { /* renamed from: a reason: collision with root package name */ private Set<String> f16839a; /* renamed from: b reason: collision with root package name */ private Set<String> f16840b; private Set<String> c; private CookieManager d; private IXAdSystemUtils e = XAdSDKFoundationFacade.getInstance().getSystemUtils(); private IXAdCommonUtils f = XAdSDKFoundationFacade.getInstance().getCommonUtils(); private Context g; private int h; private String i; private String j; public c(Context context, int i2, String str) { this.g = context; this.h = i2; this.i = str; this.j = null; b(); c(); } /* JADX WARNING: Failed to process nested try/catch */ /* JADX WARNING: Missing exception handler attribute for start block: B:2:0x0005 */ private void b() { CookieSyncManager.createInstance(this.g); try { CookieManager instance = CookieManager.getInstance(); this.d = instance; instance.setAcceptCookie(true); } catch (Throwable unused) { } } private void c() { HashSet hashSet = new HashSet(); this.f16839a = hashSet; hashSet.add("46000"); this.f16839a.add("46002"); this.f16839a.add("46007"); HashSet hashSet2 = new HashSet(); this.f16840b = hashSet2; hashSet2.add("46001"); this.f16840b.add("46006"); HashSet hashSet3 = new HashSet(); this.c = hashSet3; hashSet3.add("46003"); this.c.add("46005"); } private void d() { Rect screenRect = this.f.getScreenRect(this.g); int height = screenRect.height(); int width = screenRect.width(); boolean e2 = e(); String str = null; String a2 = e2 ? a(h()) : null; int f2 = e2 ? f() : 0; if (e2) { str = g(); } String cuid = this.e.getCUID(this.g); a("v", i()); a(IXAdRequestInfo.IMSI, b.a("MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvz5XO+wDhxUaIDOtrp72fUeIfTYXUSkZXNbA0REQzFGXPFqeMvKEOacgixdfeb/1jWif6dE2pzX1kwMAaOCenIjP9MSw8ZRgR3bZmRq8IuiBPDLI68tFDE6jpA8WjTlcaSkBy06iPtPckAT3LQiPFQroz4Dsoxnrw1QFO82QyWoFfUhGZjj895BQSjfjJjZajOoEY6GBtcRmI30XlVUwMJT9JAqf8GjyvoOMDR3Tjp226UepBIF/NhJKMrW3M5a0SHWo6r+KiAuG6pSVCHPXdP6MaQ/6W2W62wxRqrf24hi407qyKOu4MiEAPbEP3UjdIV3AW1nADjUzg2nxSjRFKQIDAQAB", this.e.getIMEI(this.g))); a("aid", b.a("MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvz5XO+wDhxUaIDOtrp72fUeIfTYXUSkZXNbA0REQzFGXPFqeMvKEOacgixdfeb/1jWif6dE2pzX1kwMAaOCenIjP9MSw8ZRgR3bZmRq8IuiBPDLI68tFDE6jpA8WjTlcaSkBy06iPtPckAT3LQiPFQroz4Dsoxnrw1QFO82QyWoFfUhGZjj895BQSjfjJjZajOoEY6GBtcRmI30XlVUwMJT9JAqf8GjyvoOMDR3Tjp226UepBIF/NhJKMrW3M5a0SHWo6r+KiAuG6pSVCHPXdP6MaQ/6W2W62wxRqrf24hi407qyKOu4MiEAPbEP3UjdIV3AW1nADjUzg2nxSjRFKQIDAQAB", this.e.getAndroidId(this.g))); a("m", a(this.e.getMacAddress(this.g))); a("cuid", b.a("MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvz5XO+wDhxUaIDOtrp72fUeIfTYXUSkZXNbA0REQzFGXPFqeMvKEOacgixdfeb/1jWif6dE2pzX1kwMAaOCenIjP9MSw8ZRgR3bZmRq8IuiBPDLI68tFDE6jpA8WjTlcaSkBy06iPtPckAT3LQiPFQroz4Dsoxnrw1QFO82QyWoFfUhGZjj895BQSjfjJjZajOoEY6GBtcRmI30XlVUwMJT9JAqf8GjyvoOMDR3Tjp226UepBIF/NhJKMrW3M5a0SHWo6r+KiAuG6pSVCHPXdP6MaQ/6W2W62wxRqrf24hi407qyKOu4MiEAPbEP3UjdIV3AW1nADjUzg2nxSjRFKQIDAQAB", cuid)); a("ct", Integer.valueOf(a.a(this.g))); a("oi", Integer.valueOf(j())); a("src", 1); a("h", Integer.valueOf(height)); a(IXAdRequestInfo.WIDTH, Integer.valueOf(width)); a("apm", a2); a("rssi", Integer.valueOf(f2)); a("apn", str); a("isc", Integer.valueOf(e2 ? 1 : 0)); } private boolean e() { try { NetworkInfo activeNetworkInfo = ((ConnectivityManager) this.g.getSystemService("connectivity")).getActiveNetworkInfo(); if (activeNetworkInfo == null || activeNetworkInfo.getType() != 1) { return false; } return true; } catch (Exception unused) { return false; } } private int f() { try { WifiInfo connectionInfo = ((WifiManager) this.g.getSystemService(IXAdSystemUtils.NT_WIFI)).getConnectionInfo(); if (connectionInfo == null) { return 0; } return connectionInfo.getRssi(); } catch (Exception unused) { return 0; } } private String g() { return ""; } private String h() { return ""; } private String i() { String str; try { PackageInfo packageInfo = this.g.getPackageManager().getPackageInfo(this.g.getPackageName(), 0); if (packageInfo == null) { str = null; } else { str = packageInfo.versionName; } if (str != null) { return str.replace(Consts.DOT, "-"); } return null; } catch (PackageManager.NameNotFoundException unused) { return null; } } private int j() { String networkOperator = this.e.getNetworkOperator(this.g); if (networkOperator == null) { return 0; } if (this.f16839a.contains(networkOperator)) { return 1; } if (this.c.contains(networkOperator)) { return 2; } return this.f16840b.contains(networkOperator) ? 3 : 99; } public String a() { d(); if (this.j != null) { return "https://cpu.baidu.com/block/app/" + this.i + "/" + this.j; } return "https://cpu.baidu.com/" + this.h + "/" + this.i; } private void a(String str, Object obj) { StringBuffer stringBuffer = new StringBuffer(); stringBuffer.append(str); stringBuffer.append("="); stringBuffer.append(obj); stringBuffer.append(";"); try { this.d.setCookie("https://cpu.baidu.com/", stringBuffer.toString()); } catch (Throwable unused) { } } public c(Context context, String str, String str2) { this.g = context; this.j = str; this.i = str2; this.h = -1; b(); c(); } private String a(String str) { if (str == null) { return null; } return str.replace(":", "-"); } }