package com.mobon.sdk; import android.app.Activity; import android.content.Context; import android.content.ContextWrapper; import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.graphics.Bitmap; import android.net.Uri; import android.os.AsyncTask; import android.os.Build; import android.os.Bundle; import android.os.Handler; import android.os.Looper; import android.text.TextUtils; import com.google.android.gms.ads.RequestConfiguration; import com.unity3d.services.core.device.reader.JsonStorageKeyNames; import com.unity3d.services.core.request.metrics.MetricCommonTags; import e7.b; import h5.i0; import java.io.IOException; import java.text.DecimalFormat; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.Random; import java.util.UUID; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; /* loaded from: classes2.dex */ public abstract class a { /* renamed from: com.mobon.sdk.a$a, reason: collision with other inner class name */ class RunnableC0099a implements Runnable { /* renamed from: a, reason: collision with root package name */ final /* synthetic */ Context f7491a; /* renamed from: b, reason: collision with root package name */ final /* synthetic */ f f7492b; RunnableC0099a(Context context, f fVar) { this.f7491a = context; this.f7492b = fVar; } /* JADX WARN: Code restructure failed: missing block: B:23:0x0047, code lost: if (r1 != null) goto L44; */ /* JADX WARN: Code restructure failed: missing block: B:24:0x006c, code lost: f7.l.i(r1, "Key.ADID", com.mobon.sdk.a.q(r1)); */ /* JADX WARN: Code restructure failed: missing block: B:39:0x006a, code lost: if (r1 != null) goto L44; */ /* JADX WARN: Code restructure failed: missing block: B:44:0x005f, code lost: if (r1 != null) goto L44; */ /* JADX WARN: Code restructure failed: missing block: B:49:0x0054, code lost: if (r1 != null) goto L44; */ @Override // java.lang.Runnable /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct code enable 'Show inconsistent code' option in preferences */ public void run() { /* r4 = this; java.lang.String r0 = "Key.ADID" r1 = 0 android.content.Context r2 = r4.f7491a // Catch: java.lang.Throwable -> L4a java.lang.Exception -> L4c com.google.android.gms.common.GooglePlayServicesRepairableException -> L57 com.google.android.gms.common.GooglePlayServicesNotAvailableException -> L62 if (r2 == 0) goto L43 java.lang.String r3 = "Key.AGE_LEVEL_KIDS" boolean r2 = f7.l.a(r2, r3) // Catch: java.lang.Throwable -> L4a java.lang.Exception -> L4c com.google.android.gms.common.GooglePlayServicesRepairableException -> L57 com.google.android.gms.common.GooglePlayServicesNotAvailableException -> L62 if (r2 != 0) goto L43 android.content.Context r2 = r4.f7491a // Catch: java.lang.Throwable -> L4a java.lang.Exception -> L4c com.google.android.gms.common.GooglePlayServicesRepairableException -> L57 com.google.android.gms.common.GooglePlayServicesNotAvailableException -> L62 com.google.android.gms.ads.identifier.AdvertisingIdClient$Info r1 = com.google.android.gms.ads.identifier.AdvertisingIdClient.getAdvertisingIdInfo(r2) // Catch: java.lang.Throwable -> L4a java.lang.Exception -> L4c com.google.android.gms.common.GooglePlayServicesRepairableException -> L57 com.google.android.gms.common.GooglePlayServicesNotAvailableException -> L62 if (r1 == 0) goto L3d boolean r2 = r1.isLimitAdTrackingEnabled() // Catch: java.lang.Throwable -> L4a java.lang.Exception -> L4c com.google.android.gms.common.GooglePlayServicesRepairableException -> L57 com.google.android.gms.common.GooglePlayServicesNotAvailableException -> L62 if (r2 != 0) goto L3d java.lang.String r2 = r1.getId() // Catch: java.lang.Throwable -> L4a java.lang.Exception -> L4c com.google.android.gms.common.GooglePlayServicesRepairableException -> L57 com.google.android.gms.common.GooglePlayServicesNotAvailableException -> L62 boolean r3 = android.text.TextUtils.isEmpty(r2) // Catch: java.lang.Throwable -> L4a java.lang.Exception -> L4c com.google.android.gms.common.GooglePlayServicesRepairableException -> L57 com.google.android.gms.common.GooglePlayServicesNotAvailableException -> L62 if (r3 != 0) goto L36 java.lang.String r3 = "00" boolean r3 = r2.startsWith(r3) // Catch: java.lang.Throwable -> L4a java.lang.Exception -> L4c com.google.android.gms.common.GooglePlayServicesRepairableException -> L57 com.google.android.gms.common.GooglePlayServicesNotAvailableException -> L62 if (r3 == 0) goto L30 goto L36 L30: android.content.Context r3 = r4.f7491a // Catch: java.lang.Throwable -> L4a java.lang.Exception -> L4c com.google.android.gms.common.GooglePlayServicesRepairableException -> L57 com.google.android.gms.common.GooglePlayServicesNotAvailableException -> L62 f7.l.i(r3, r0, r2) // Catch: java.lang.Throwable -> L4a java.lang.Exception -> L4c com.google.android.gms.common.GooglePlayServicesRepairableException -> L57 com.google.android.gms.common.GooglePlayServicesNotAvailableException -> L62 goto L43 L36: android.content.Context r2 = r4.f7491a // Catch: java.lang.Throwable -> L4a java.lang.Exception -> L4c com.google.android.gms.common.GooglePlayServicesRepairableException -> L57 com.google.android.gms.common.GooglePlayServicesNotAvailableException -> L62 L38: java.lang.String r3 = com.mobon.sdk.a.a(r2) // Catch: java.lang.Throwable -> L4a java.lang.Exception -> L4c com.google.android.gms.common.GooglePlayServicesRepairableException -> L57 com.google.android.gms.common.GooglePlayServicesNotAvailableException -> L62 goto L40 L3d: android.content.Context r2 = r4.f7491a // Catch: java.lang.Throwable -> L4a java.lang.Exception -> L4c com.google.android.gms.common.GooglePlayServicesRepairableException -> L57 com.google.android.gms.common.GooglePlayServicesNotAvailableException -> L62 goto L38 L40: f7.l.i(r2, r0, r3) // Catch: java.lang.Throwable -> L4a java.lang.Exception -> L4c com.google.android.gms.common.GooglePlayServicesRepairableException -> L57 com.google.android.gms.common.GooglePlayServicesNotAvailableException -> L62 L43: if (r1 != 0) goto L73 android.content.Context r1 = r4.f7491a if (r1 == 0) goto L73 goto L6c L4a: r2 = move-exception goto L79 L4c: r2 = move-exception r2.printStackTrace() // Catch: java.lang.Throwable -> L4a if (r1 != 0) goto L73 android.content.Context r1 = r4.f7491a if (r1 == 0) goto L73 goto L6c L57: r2 = move-exception r2.printStackTrace() // Catch: java.lang.Throwable -> L4a if (r1 != 0) goto L73 android.content.Context r1 = r4.f7491a if (r1 == 0) goto L73 goto L6c L62: r2 = move-exception r2.printStackTrace() // Catch: java.lang.Throwable -> L4a if (r1 != 0) goto L73 android.content.Context r1 = r4.f7491a if (r1 == 0) goto L73 L6c: java.lang.String r2 = com.mobon.sdk.a.a(r1) f7.l.i(r1, r0, r2) L73: com.mobon.sdk.f r0 = r4.f7492b r0.f() return L79: if (r1 != 0) goto L86 android.content.Context r1 = r4.f7491a if (r1 == 0) goto L86 java.lang.String r3 = com.mobon.sdk.a.a(r1) f7.l.i(r1, r0, r3) L86: com.mobon.sdk.f r0 = r4.f7492b r0.f() throw r2 */ throw new UnsupportedOperationException("Method not decompiled: com.mobon.sdk.a.RunnableC0099a.run():void"); } } class b implements h5.j { /* renamed from: a, reason: collision with root package name */ final /* synthetic */ Context f7493a; /* renamed from: b, reason: collision with root package name */ final /* synthetic */ String f7494b; /* renamed from: c, reason: collision with root package name */ final /* synthetic */ boolean f7495c; /* renamed from: d, reason: collision with root package name */ final /* synthetic */ int f7496d; /* renamed from: e, reason: collision with root package name */ final /* synthetic */ boolean f7497e; /* renamed from: f, reason: collision with root package name */ final /* synthetic */ h7.c f7498f; /* renamed from: com.mobon.sdk.a$b$a, reason: collision with other inner class name */ class RunnableC0100a implements Runnable { RunnableC0100a() { } @Override // java.lang.Runnable public void run() { h7.c cVar = b.this.f7498f; if (cVar != null) { cVar.a(false, null, "NoConnectNetwork"); } } } /* renamed from: com.mobon.sdk.a$b$b, reason: collision with other inner class name */ class RunnableC0101b implements Runnable { /* renamed from: a, reason: collision with root package name */ final /* synthetic */ String f7500a; RunnableC0101b(String str) { this.f7500a = str; } @Override // java.lang.Runnable public void run() { b bVar = b.this; a.u(bVar.f7493a, this.f7500a, bVar.f7494b, bVar.f7495c, bVar.f7496d, bVar.f7497e, bVar.f7498f); } } class c implements Runnable { /* renamed from: a, reason: collision with root package name */ final /* synthetic */ IOException f7502a; c(IOException iOException) { this.f7502a = iOException; } @Override // java.lang.Runnable public void run() { h7.c cVar = b.this.f7498f; if (cVar != null) { cVar.a(false, null, this.f7502a.toString()); } } } b(Context context, String str, boolean z10, int i10, boolean z11, h7.c cVar) { this.f7493a = context; this.f7494b = str; this.f7495c = z10; this.f7496d = i10; this.f7497e = z11; this.f7498f = cVar; } @Override // h5.j public void a(h5.i iVar, i0 i0Var) { if (i0Var == null || !i0Var.S() || i0Var.c() == null) { new Handler(Looper.getMainLooper()).post(new RunnableC0100a()); return; } String R = i0Var.c().R(); f7.f.a("getMobonAdData data : " + R); i0Var.close(); a.u(this.f7493a, R, this.f7494b, this.f7495c, this.f7496d, this.f7497e, this.f7498f); } @Override // h5.j public void b(h5.i iVar, IOException iOException) { f7.f.b("API_MOBILE_BANNER ERROR", "error => " + iOException.toString()); String e10 = f7.l.e(this.f7493a, "Key.MEDIATION_INFO_ARRAY" + this.f7494b); if (TextUtils.isEmpty(e10)) { new Handler(Looper.getMainLooper()).post(new c(iOException)); } else { new Handler(Looper.getMainLooper()).post(new RunnableC0101b(e10)); } } } class c implements h5.j { /* renamed from: a, reason: collision with root package name */ final /* synthetic */ h7.c f7504a; /* renamed from: b, reason: collision with root package name */ final /* synthetic */ JSONObject f7505b; c(h7.c cVar, JSONObject jSONObject) { this.f7504a = cVar; this.f7505b = jSONObject; } @Override // h5.j public void a(h5.i iVar, i0 i0Var) { h7.c cVar; if (i0Var == null || !i0Var.S() || i0Var.c() == null) { cVar = this.f7504a; if (cVar == null) { return; } } else { String R = i0Var.c().R(); f7.f.a("coupang cps data : " + R); i0Var.close(); try { JSONObject jSONObject = new JSONObject(R); if (TextUtils.equals(jSONObject.optString("result_code"), "200")) { JSONObject jSONObject2 = jSONObject.getJSONObject(JsonStorageKeyNames.DATA_KEY); jSONObject2.put("adNetwork", "coupang"); jSONObject2.put("mobonLogo", "https://img.mobon.net/newAd/img/logoImg/mobonLogo02.png"); jSONObject2.put("mobonUrl", "https://img.mobon.net/ad/linfo.php"); h7.c cVar2 = this.f7504a; if (cVar2 != null) { cVar2.a(true, jSONObject2, RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED); } } else { h7.c cVar3 = this.f7504a; if (cVar3 != null) { cVar3.a(true, this.f7505b, RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED); } } return; } catch (Exception unused) { cVar = this.f7504a; if (cVar == null) { return; } } } cVar.a(true, this.f7505b, RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED); } @Override // h5.j public void b(h5.i iVar, IOException iOException) { f7.f.b("API_COUPANG_CPS ERROR", "error => " + iOException.toString()); h7.c cVar = this.f7504a; if (cVar != null) { cVar.a(true, this.f7505b, RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED); } } } class d implements h5.j { /* renamed from: a, reason: collision with root package name */ final /* synthetic */ h7.c f7506a; /* renamed from: b, reason: collision with root package name */ final /* synthetic */ JSONObject f7507b; d(h7.c cVar, JSONObject jSONObject) { this.f7506a = cVar; this.f7507b = jSONObject; } @Override // h5.j public void a(h5.i iVar, i0 i0Var) { h7.c cVar; JSONObject jSONObject; if (i0Var == null || !i0Var.S() || i0Var.c() == null) { cVar = this.f7506a; if (cVar == null) { return; } } else { String R = i0Var.c().R(); f7.f.a("mobmixer native data : " + R); i0Var.close(); try { JSONArray optJSONArray = new JSONObject(R).optJSONArray("list"); if (optJSONArray != null) { jSONObject = optJSONArray.getJSONObject(0).getJSONObject(JsonStorageKeyNames.DATA_KEY); jSONObject.put("adNetwork", "MOBMIXER"); } else { jSONObject = null; } if (TextUtils.isEmpty(jSONObject.optString("client"))) { h7.c cVar2 = this.f7506a; if (cVar2 != null) { cVar2.a(true, this.f7507b, RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED); return; } return; } h7.c cVar3 = this.f7506a; if (cVar3 != null) { cVar3.a(true, jSONObject, RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED); return; } return; } catch (Exception unused) { cVar = this.f7506a; if (cVar == null) { return; } } } cVar.a(true, this.f7507b, RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED); } @Override // h5.j public void b(h5.i iVar, IOException iOException) { f7.f.b("API_COUPANG_CPS ERROR", "error => " + iOException.toString()); h7.c cVar = this.f7506a; if (cVar != null) { cVar.a(true, this.f7507b, RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED); } } } private static Activity c(Context context) { if (context instanceof Activity) { return (Activity) context; } if (context instanceof ContextWrapper) { return c(((ContextWrapper) context).getBaseContext()); } return null; } public static void d(Context context, f fVar) { AsyncTask.THREAD_POOL_EXECUTOR.execute(new RunnableC0099a(context, fVar)); } public static String e(Context context) { return f7.l.e(context, "Key.ADID"); } public static String f(Context context) { try { return context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionName; } catch (PackageManager.NameNotFoundException unused) { return null; } } public static String g(Context context) { ApplicationInfo applicationInfo = context.getApplicationInfo(); int i10 = applicationInfo.labelRes; return i10 == 0 ? applicationInfo.nonLocalizedLabel.toString() : context.getString(i10); } public static String h(Context context) { JSONObject jSONObject; String e10 = f7.l.e(context, "Key.AT_FREQUENCY_DATA"); if (TextUtils.isEmpty(e10)) { return RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED; } try { jSONObject = new JSONObject(e10); } catch (JSONException e11) { e11.printStackTrace(); jSONObject = null; } return jSONObject.toString(); } protected static String i(Context context) { String e10 = f7.l.e(context, "Key.BACON_URL_LIST_DATA"); if (TextUtils.isEmpty(e10)) { return null; } String v10 = v(context, e10); f7.l.i(context, "Key.BACON_URL_LIST_DATA", v10); try { JSONArray optJSONArray = new JSONObject(v10).optJSONArray(JsonStorageKeyNames.DATA_KEY); if (optJSONArray == null || optJSONArray.length() <= 0) { return null; } return y(optJSONArray).getJSONObject(0).toString(); } catch (Exception e11) { e11.printStackTrace(); return null; } } public static String j(String str) { if (str.equals(RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED)) { return RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED; } try { return new DecimalFormat("###,###").format(Long.parseLong(str)); } catch (Exception unused) { return str; } } public static Map k(Context context) { String a10 = f7.d.a(); String e10 = f7.l.e(context, "Key.RUNNING_SAVE_DATE"); if (RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED.equals(e10) || !a10.equals(e10)) { f7.l.i(context, "Key.AT_FREQUENCY_DATA", RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED); f7.l.i(context, "Key.RUNNING_SAVE_DATE", a10); } HashMap hashMap = new HashMap(); hashMap.put("sdk_version", "1"); hashMap.put("fbAt", h(context)); hashMap.put("us", f7.l.e(context, "Key.MOBON_MEDIA_US_VALUE")); hashMap.put("bntype", "99"); hashMap.put("cntsr", "1"); hashMap.put("cntad", "1"); hashMap.put("au_id", f7.l.e(context, "Key.AUID")); hashMap.put("deviceInfo", MetricCommonTags.METRIC_COMMON_TAG_PLATFORM_ANDROID); hashMap.put("increaseViewCnt", "false"); if (e.f7583a) { hashMap.put("sdkYn", "true"); } return hashMap; } public static String l(Context context) { return (((("&adid=" + f7.l.e(context, "Key.ADID")) + "&osIndex=3") + "&osVer=" + Build.VERSION.RELEASE) + "&appId=" + context.getPackageName()) + "&appName=" + g(context); } public static final String m(Context context, String str) { Bundle bundle; try { f7.f.b("Package Name", context.getPackageName()); ApplicationInfo applicationInfo = context.getPackageManager().getApplicationInfo(context.getPackageName(), 128); if (applicationInfo != null && (bundle = applicationInfo.metaData) != null) { return bundle.getString(str); } } catch (PackageManager.NameNotFoundException e10) { f7.f.c("getMetaData() Exception!", e10); } return RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED; } protected static void n(Context context, String str, Map map, boolean z10, int i10, boolean z11, h7.c cVar) { if (TextUtils.isEmpty(str)) { if (cVar != null) { cVar.a(false, null, "Ad UnitId Empty"); } } else { f7.i.b(context, p.f7783a + "www.mediacategory.com/servlet/adbnMobileBanner?s=" + str, map, RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED).z(new b(context, str, z10, i10, z11, cVar)); } } public static String o(String str, String str2) { return Uri.parse(str).getQueryParameter(str2); } public static String p(Context context) { return "SKT"; } /* JADX INFO: Access modifiers changed from: private */ public static String q(Context context) { String e10 = f7.l.e(context, "Key.UUID"); if (TextUtils.isEmpty(e10)) { UUID randomUUID = UUID.randomUUID(); e10 = randomUUID != null ? randomUUID.toString() : RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED; } f7.l.i(context, "Key.UUID", e10); return e10; } protected static boolean r(Context context) { Activity c10 = c(context); return c10 == null || !c10.isFinishing(); } public static boolean s(String str) { try { Double.parseDouble(str); return true; } catch (NumberFormatException unused) { return false; } } public static void t(Context context, JSONArray jSONArray, JSONObject jSONObject, h7.c cVar) { for (int i10 = 0; i10 < jSONArray.length(); i10++) { try { JSONObject jSONObject2 = jSONArray.getJSONObject(i10); String optString = jSONObject2.optString("name"); String optString2 = jSONObject2.optString("unitid"); String optString3 = jSONObject2.optString("mediaKey"); if (optString.contains("cpadapter")) { HashMap hashMap = new HashMap(); if (TextUtils.isEmpty(optString2)) { optString2 = optString3; } hashMap.put("channelId", optString2); f7.i.b(context, p.f7783a + "www.mediacategory.com/servlet/sdkCoupangApi", hashMap, RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED).z(new c(cVar, jSONObject)); return; } if (optString.equalsIgnoreCase("admixersdk")) { HashMap hashMap2 = new HashMap(); hashMap2.put("ifa", e(context)); f7.i.a(context, optString2, hashMap2).z(new d(cVar, jSONObject)); return; } } catch (Exception e10) { e10.printStackTrace(); return; } } if (cVar != null) { cVar.a(true, jSONObject, RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED); } } /* JADX INFO: Access modifiers changed from: private */ /* JADX WARN: Multi-variable type inference failed */ /* JADX WARN: Removed duplicated region for block: B:151:0x0409 A[Catch: Exception -> 0x0480, TRY_LEAVE, TryCatch #0 {Exception -> 0x0480, blocks: (B:47:0x017d, B:50:0x01ad, B:52:0x01b9, B:54:0x01c7, B:55:0x01da, B:57:0x01e7, B:59:0x01ed, B:60:0x01f3, B:62:0x01fe, B:65:0x0206, B:66:0x0209, B:69:0x0213, B:71:0x0219, B:72:0x0244, B:74:0x0466, B:75:0x0229, B:77:0x022f, B:79:0x0235, B:80:0x024f, B:82:0x0259, B:84:0x025f, B:86:0x0267, B:90:0x0282, B:92:0x0298, B:104:0x02d4, B:106:0x02cc, B:122:0x02e3, B:125:0x02ef, B:127:0x02f5, B:128:0x0377, B:130:0x037d, B:131:0x0396, B:134:0x03a4, B:135:0x03a8, B:137:0x03ae, B:138:0x03b2, B:141:0x03c2, B:144:0x03cb, B:146:0x03d5, B:147:0x03d9, B:149:0x03e6, B:151:0x0409, B:153:0x0428, B:155:0x0440, B:157:0x03dd, B:159:0x0310, B:161:0x0318, B:163:0x031e, B:164:0x032c, B:165:0x0361, B:167:0x036e, B:168:0x0331, B:170:0x0339, B:171:0x034d, B:173:0x01d2, B:174:0x01b4, B:186:0x0491, B:188:0x0498), top: B:46:0x017d }] */ /* JADX WARN: Removed duplicated region for block: B:179:0x057f */ /* JADX WARN: Removed duplicated region for block: B:181:? A[RETURN, SYNTHETIC] */ /* JADX WARN: Removed duplicated region for block: B:202:0x04da A[Catch: Exception -> 0x055f, TRY_ENTER, TryCatch #1 {Exception -> 0x055f, blocks: (B:191:0x04b4, B:195:0x04bc, B:199:0x04d3, B:202:0x04da, B:203:0x04ec, B:206:0x0506, B:209:0x051a, B:211:0x0532, B:214:0x053a, B:217:0x053e, B:219:0x0558, B:222:0x04f2, B:224:0x04f8, B:225:0x04e1, B:229:0x04c6, B:231:0x04cc), top: B:184:0x048f }] */ /* JADX WARN: Removed duplicated region for block: B:205:0x04f1 A[ADDED_TO_REGION] */ /* JADX WARN: Removed duplicated region for block: B:208:0x0518 A[ADDED_TO_REGION] */ /* JADX WARN: Removed duplicated region for block: B:219:0x0558 A[Catch: Exception -> 0x055f, TRY_LEAVE, TryCatch #1 {Exception -> 0x055f, blocks: (B:191:0x04b4, B:195:0x04bc, B:199:0x04d3, B:202:0x04da, B:203:0x04ec, B:206:0x0506, B:209:0x051a, B:211:0x0532, B:214:0x053a, B:217:0x053e, B:219:0x0558, B:222:0x04f2, B:224:0x04f8, B:225:0x04e1, B:229:0x04c6, B:231:0x04cc), top: B:184:0x048f }] */ /* JADX WARN: Removed duplicated region for block: B:221:? A[RETURN, SYNTHETIC] */ /* JADX WARN: Removed duplicated region for block: B:222:0x04f2 A[Catch: Exception -> 0x055f, TryCatch #1 {Exception -> 0x055f, blocks: (B:191:0x04b4, B:195:0x04bc, B:199:0x04d3, B:202:0x04da, B:203:0x04ec, B:206:0x0506, B:209:0x051a, B:211:0x0532, B:214:0x053a, B:217:0x053e, B:219:0x0558, B:222:0x04f2, B:224:0x04f8, B:225:0x04e1, B:229:0x04c6, B:231:0x04cc), top: B:184:0x048f }] */ /* JADX WARN: Removed duplicated region for block: B:225:0x04e1 A[Catch: Exception -> 0x055f, TryCatch #1 {Exception -> 0x055f, blocks: (B:191:0x04b4, B:195:0x04bc, B:199:0x04d3, B:202:0x04da, B:203:0x04ec, B:206:0x0506, B:209:0x051a, B:211:0x0532, B:214:0x053a, B:217:0x053e, B:219:0x0558, B:222:0x04f2, B:224:0x04f8, B:225:0x04e1, B:229:0x04c6, B:231:0x04cc), top: B:184:0x048f }] */ /* JADX WARN: Removed duplicated region for block: B:45:0x017b */ /* JADX WARN: Type inference failed for: r0v47, types: [java.lang.StringBuilder] */ /* JADX WARN: Type inference failed for: r0v57, types: [java.lang.StringBuilder] */ /* JADX WARN: Type inference failed for: r13v6, types: [java.lang.StringBuilder] */ /* JADX WARN: Type inference failed for: r2v0, types: [java.lang.String] */ /* JADX WARN: Type inference failed for: r2v1 */ /* JADX WARN: Type inference failed for: r2v2, types: [h7.c] */ /* JADX WARN: Type inference failed for: r2v6 */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct code enable 'Show inconsistent code' option in preferences */ public static void u(android.content.Context r33, java.lang.String r34, java.lang.String r35, boolean r36, int r37, boolean r38, h7.c r39) { /* Method dump skipped, instructions count: 1417 To view this dump change 'Code comments level' option to 'DEBUG' */ throw new UnsupportedOperationException("Method not decompiled: com.mobon.sdk.a.u(android.content.Context, java.lang.String, java.lang.String, boolean, int, boolean, h7.c):void"); } protected static String v(Context context, String str) { try { int c10 = f7.l.c(context, "Key.MOBON_MEDIA_BACON_PERIOD_VALUE"); if (c10 < 1) { return str; } JSONObject jSONObject = new JSONObject(str); JSONArray optJSONArray = jSONObject.optJSONArray(JsonStorageKeyNames.DATA_KEY); if (optJSONArray == null) { return RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED; } d7.a aVar = new d7.a(context); aVar.G(c10); JSONArray jSONArray = new JSONArray(); for (int i10 = 0; i10 < optJSONArray.length(); i10++) { JSONObject jSONObject2 = optJSONArray.getJSONObject(i10); if (!aVar.z(RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED, jSONObject2.optString("site_url"))) { jSONArray.put(jSONObject2); } } f7.f.a("usable bacon count :: " + jSONArray.length()); jSONObject.put(JsonStorageKeyNames.DATA_KEY, jSONArray); return jSONObject.toString(); } catch (Exception e10) { e10.printStackTrace(); return str; } } public static void w(Context context, String str) { HashMap hashMap = new HashMap(); String e10 = f7.l.e(context, "Key.AT_FREQUENCY_DATA"); try { JSONObject jSONObject = TextUtils.isEmpty(e10) ? new JSONObject() : new JSONObject(e10); Iterator keys = jSONObject.keys(); while (keys.hasNext()) { String obj = keys.next().toString(); hashMap.put(obj, Integer.valueOf(jSONObject.getInt(obj))); } hashMap.put(str, hashMap.containsKey(str) ? Integer.valueOf(((Integer) hashMap.get(str)).intValue() + 1) : 1); for (Map.Entry entry : hashMap.entrySet()) { jSONObject.put((String) entry.getKey(), entry.getValue()); } f7.l.i(context, "Key.AT_FREQUENCY_DATA", jSONObject.toString()); } catch (JSONException e11) { e11.printStackTrace(); } } public static int x(Bitmap bitmap) { b.c f10; if (bitmap == null) { return 16777215; } e7.b a10 = e7.b.b(bitmap).a(); if (a10 != null && a10.i() != null) { f10 = a10.i(); } else if (a10 != null && a10.h() != null) { f10 = a10.h(); } else if (a10 != null && a10.g() != null) { f10 = a10.g(); } else { if (a10 == null || a10.f() == null) { return 16777215; } f10 = a10.f(); } return f10.e(); } public static JSONArray y(JSONArray jSONArray) { Random random = new Random(); for (int length = jSONArray.length() - 1; length >= 0; length--) { int nextInt = random.nextInt(length + 1); Object obj = jSONArray.get(nextInt); jSONArray.put(nextInt, jSONArray.get(length)); jSONArray.put(length, obj); } return jSONArray; } }