package com.mobon.sdk; import android.app.Activity; import android.content.ActivityNotFoundException; import android.content.Context; import android.content.Intent; import android.content.res.ColorStateList; import android.content.res.Resources; import android.graphics.Bitmap; import android.graphics.Color; import android.graphics.Rect; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; import android.net.Uri; import android.net.http.SslError; import android.os.Handler; import android.os.Looper; import android.os.Message; import android.os.PowerManager; import android.text.TextUtils; import android.util.DisplayMetrics; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; import android.view.ViewTreeObserver; import android.webkit.CookieManager; import android.webkit.SslErrorHandler; import android.webkit.WebChromeClient; import android.webkit.WebResourceError; import android.webkit.WebResourceRequest; import android.webkit.WebSettings; import android.webkit.WebView; import android.webkit.WebViewClient; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.RelativeLayout; import android.widget.TextView; import com.google.android.gms.ads.RequestConfiguration; import com.unity3d.services.core.device.reader.JsonStorageKeyNames; import java.io.IOException; import java.net.URLDecoder; import java.util.Map; import java.util.Timer; import java.util.TimerTask; import java.util.concurrent.atomic.AtomicInteger; import org.json.JSONArray; import org.json.JSONObject; /* loaded from: classes2.dex */ public class n extends RelativeLayout { private Object A; private boolean B; private int C; private String D; private long E; private f7.h F; private b6.j G; private String H; private boolean I; private long J; private int K; private final Runnable L; private int M; private boolean N; private boolean O; private int P; /* renamed from: a, reason: collision with root package name */ private ImageView f7695a; /* renamed from: b, reason: collision with root package name */ private TextView f7696b; /* renamed from: c, reason: collision with root package name */ private TextView f7697c; /* renamed from: d, reason: collision with root package name */ private final int[] f7698d; /* renamed from: e, reason: collision with root package name */ private final int[] f7699e; /* renamed from: f, reason: collision with root package name */ private final int[] f7700f; /* renamed from: g, reason: collision with root package name */ private final Context f7701g; /* renamed from: h, reason: collision with root package name */ private RelativeLayout f7702h; /* renamed from: i, reason: collision with root package name */ private ImageView f7703i; /* renamed from: j, reason: collision with root package name */ private final AtomicInteger f7704j; /* renamed from: k, reason: collision with root package name */ private final int f7705k; /* renamed from: l, reason: collision with root package name */ private String f7706l; /* renamed from: m, reason: collision with root package name */ private ColorStateList f7707m; /* renamed from: n, reason: collision with root package name */ private String f7708n; /* renamed from: o, reason: collision with root package name */ private int f7709o; /* renamed from: p, reason: collision with root package name */ private int f7710p; /* renamed from: q, reason: collision with root package name */ private String f7711q; /* renamed from: r, reason: collision with root package name */ private String f7712r; /* renamed from: s, reason: collision with root package name */ private h7.a f7713s; /* renamed from: t, reason: collision with root package name */ private int f7714t; /* renamed from: u, reason: collision with root package name */ private boolean f7715u; /* renamed from: v, reason: collision with root package name */ private WebView f7716v; /* renamed from: w, reason: collision with root package name */ private int f7717w; /* renamed from: x, reason: collision with root package name */ private LinearLayout f7718x; /* renamed from: y, reason: collision with root package name */ private Handler f7719y; /* renamed from: z, reason: collision with root package name */ private boolean f7720z; class a implements x6.e { /* renamed from: a, reason: collision with root package name */ final /* synthetic */ String f7721a; /* renamed from: b, reason: collision with root package name */ final /* synthetic */ ImageView f7722b; /* renamed from: com.mobon.sdk.n$a$a, reason: collision with other inner class name */ class ViewTreeObserverOnGlobalLayoutListenerC0108a implements ViewTreeObserver.OnGlobalLayoutListener { /* renamed from: a, reason: collision with root package name */ final /* synthetic */ int f7724a; /* renamed from: b, reason: collision with root package name */ final /* synthetic */ int f7725b; ViewTreeObserverOnGlobalLayoutListenerC0108a(int i10, int i11) { this.f7724a = i10; this.f7725b = i11; } @Override // android.view.ViewTreeObserver.OnGlobalLayoutListener public void onGlobalLayout() { if (n.this.f7695a == null || !n.this.f7715u) { return; } n.this.f7695a.getViewTreeObserver().removeOnGlobalLayoutListener(this); int measuredWidth = n.this.f7695a.getMeasuredWidth(); int i10 = (this.f7724a * measuredWidth) / this.f7725b; ViewGroup.LayoutParams layoutParams = n.this.f7695a.getLayoutParams(); layoutParams.width = measuredWidth; layoutParams.height = i10; n.this.f7695a.setLayoutParams(layoutParams); } } a(String str, ImageView imageView) { this.f7721a = str; this.f7722b = imageView; } @Override // x6.e public boolean a(h6.e eVar, Object obj, y6.h hVar, boolean z10) { System.out.println("!!!!!!!!! RectView image load fail : " + this.f7721a); return false; } @Override // x6.e /* renamed from: c, reason: merged with bridge method [inline-methods] */ public boolean b(Drawable drawable, Object obj, y6.h hVar, e6.a aVar, boolean z10) { int x10; try { f7.f.a("drawImage() onResourceReady "); n.this.N = true; } catch (Exception e10) { e10.printStackTrace(); } if (n.this.f7695a == null) { f7.f.a("drawImage() mContentIv null "); return false; } if (n.this.B && drawable != null && (x10 = com.mobon.sdk.a.x(((BitmapDrawable) drawable).getBitmap())) != 16777215) { ImageView imageView = this.f7722b; if (imageView != null) { imageView.setVisibility(8); } n.this.setBackgroundColor(x10); } if (n.this.f7703i != null) { n.this.f7703i.setVisibility(0); } if (TextUtils.equals(f7.l.e(n.this.f7701g, "com.mobon.sdk.MediaCode"), "jeomsin") && n.this.f7695a != null) { n.this.f7695a.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserverOnGlobalLayoutListenerC0108a(drawable.getIntrinsicHeight(), drawable.getIntrinsicWidth())); } return false; } } class b implements Runnable { /* renamed from: a, reason: collision with root package name */ final /* synthetic */ String f7727a; /* renamed from: b, reason: collision with root package name */ final /* synthetic */ ImageView f7728b; b(String str, ImageView imageView) { this.f7727a = str; this.f7728b = imageView; } @Override // java.lang.Runnable public void run() { if (n.this.N) { return; } f7.f.a("drawImage() not call retry "); n.this.r0(this.f7727a, this.f7728b); } } class c implements Runnable { c() { } @Override // java.lang.Runnable public void run() { Rect rect = new Rect(); n.this.f7696b.getPaint().getTextBounds(n.this.f7696b.getText().toString(), 0, n.this.f7696b.getText().length(), rect); LinearLayout linearLayout = (LinearLayout) n.this.f7702h.findViewById(com.mobon.sdk.j.f7657q); if (linearLayout == null || linearLayout.getLayoutParams() == null || !(linearLayout.getLayoutParams() instanceof RelativeLayout.LayoutParams)) { return; } RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) linearLayout.getLayoutParams(); layoutParams.width = rect.width() + layoutParams.leftMargin + layoutParams.rightMargin; linearLayout.setLayoutParams(layoutParams); } } class d implements x6.e { /* renamed from: a, reason: collision with root package name */ final /* synthetic */ JSONObject f7731a; d(JSONObject jSONObject) { this.f7731a = jSONObject; } @Override // x6.e public boolean a(h6.e eVar, Object obj, y6.h hVar, boolean z10) { ((b6.i) ((b6.i) n.this.G.u(this.f7731a.optString("img")).x()).F0(q6.c.i()).e0(new ColorDrawable(-1))).A0(n.this.f7695a); return false; } @Override // x6.e /* renamed from: c, reason: merged with bridge method [inline-methods] */ public boolean b(Drawable drawable, Object obj, y6.h hVar, e6.a aVar, boolean z10) { ((b6.i) ((b6.i) n.this.G.u(this.f7731a.optString("img")).x()).F0(q6.c.i()).e0(new ColorDrawable(-1))).A0(n.this.f7695a); return false; } } class e implements x6.e { class a implements ViewTreeObserver.OnGlobalLayoutListener { /* renamed from: a, reason: collision with root package name */ final /* synthetic */ int f7734a; /* renamed from: b, reason: collision with root package name */ final /* synthetic */ int f7735b; a(int i10, int i11) { this.f7734a = i10; this.f7735b = i11; } @Override // android.view.ViewTreeObserver.OnGlobalLayoutListener public void onGlobalLayout() { ImageView imageView; ViewGroup.LayoutParams layoutParams; if (n.this.f7695a == null || !n.this.f7715u) { return; } n.this.f7695a.getViewTreeObserver().removeOnGlobalLayoutListener(this); int measuredWidth = n.this.f7695a.getMeasuredWidth(); int i10 = (this.f7734a * measuredWidth) / this.f7735b; if (n.this.f7695a.getLayoutParams() instanceof LinearLayout.LayoutParams) { imageView = n.this.f7695a; layoutParams = new LinearLayout.LayoutParams(measuredWidth, i10); } else { imageView = n.this.f7695a; layoutParams = new RelativeLayout.LayoutParams(measuredWidth, i10); } imageView.setLayoutParams(layoutParams); } } e() { } @Override // x6.e public boolean a(h6.e eVar, Object obj, y6.h hVar, boolean z10) { return false; } @Override // x6.e /* renamed from: c, reason: merged with bridge method [inline-methods] */ public boolean b(Drawable drawable, Object obj, y6.h hVar, e6.a aVar, boolean z10) { n.this.N = true; if (!TextUtils.equals(f7.l.e(n.this.f7701g, "com.mobon.sdk.MediaCode"), "jeomsin") || n.this.f7695a == null) { return false; } n.this.f7695a.getViewTreeObserver().addOnGlobalLayoutListener(new a(drawable.getIntrinsicHeight(), drawable.getIntrinsicWidth())); return false; } } class f implements Runnable { /* renamed from: a, reason: collision with root package name */ final /* synthetic */ JSONObject f7737a; /* renamed from: b, reason: collision with root package name */ final /* synthetic */ ImageView f7738b; f(JSONObject jSONObject, ImageView imageView) { this.f7737a = jSONObject; this.f7738b = imageView; } @Override // java.lang.Runnable public void run() { if (n.this.N) { return; } f7.f.a("drawGoodsImage() not call retry "); n.this.q0(this.f7737a, this.f7738b); } } class g implements Runnable { g() { } @Override // java.lang.Runnable public void run() { n.this.removeAllViews(); } } class h implements h5.j { class a implements Runnable { a() { } @Override // java.lang.Runnable public void run() { n.this.u0(); } } h() { } /* JADX WARN: Code restructure failed: missing block: B:19:0x0071, code lost: if (r6.f7741a.f7713s == null) goto L18; */ /* JADX WARN: Code restructure failed: missing block: B:20:0x0073, code lost: r6.f7741a.f7713s.onLoadedAdInfo(false, "No fill"); */ /* JADX WARN: Code restructure failed: missing block: B:21:0x007c, code lost: com.mobon.sdk.n.n(r6.f7741a); */ /* JADX WARN: Code restructure failed: missing block: B:22:?, code lost: return; */ /* JADX WARN: Code restructure failed: missing block: B:24:0x009e, code lost: if (r6.f7741a.f7713s != null) goto L17; */ @Override // h5.j /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct code enable 'Show inconsistent code' option in preferences */ public void a(h5.i r7, h5.i0 r8) { /* r6 = this; java.lang.String r7 = "No fill" r0 = 0 java.lang.String r1 = "API_MOBON_BACON_URL_LIST ERROR" java.lang.String r2 = "error => " if (r8 == 0) goto L82 boolean r3 = r8.S() if (r3 == 0) goto L82 h5.l0 r3 = r8.c() if (r3 == 0) goto L82 java.lang.String r3 = "call API_MOBON_BACON_URL_LIST" f7.f.a(r3) // Catch: java.lang.Exception -> L54 h5.l0 r8 = r8.c() // Catch: java.lang.Exception -> L54 java.lang.String r8 = r8.R() // Catch: java.lang.Exception -> L54 boolean r3 = android.text.TextUtils.isEmpty(r8) // Catch: java.lang.Exception -> L54 if (r3 != 0) goto La1 com.mobon.sdk.n r3 = com.mobon.sdk.n.this // Catch: java.lang.Exception -> L54 android.content.Context r3 = com.mobon.sdk.n.H(r3) // Catch: java.lang.Exception -> L54 java.lang.String r4 = "Key.BACON_URL_LIST_DATA" f7.l.i(r3, r4, r8) // Catch: java.lang.Exception -> L54 com.mobon.sdk.n r8 = com.mobon.sdk.n.this // Catch: java.lang.Exception -> L54 android.content.Context r8 = com.mobon.sdk.n.H(r8) // Catch: java.lang.Exception -> L54 java.lang.String r3 = "Key.BACON_LIST_DOWNLOAD_SAVE_TIME" long r4 = java.lang.System.currentTimeMillis() // Catch: java.lang.Exception -> L54 f7.l.h(r8, r3, r4) // Catch: java.lang.Exception -> L54 android.os.Handler r8 = new android.os.Handler // Catch: java.lang.Exception -> L54 android.os.Looper r3 = android.os.Looper.getMainLooper() // Catch: java.lang.Exception -> L54 r8.(r3) // Catch: java.lang.Exception -> L54 com.mobon.sdk.n$h$a r3 = new com.mobon.sdk.n$h$a // Catch: java.lang.Exception -> L54 r3.() // Catch: java.lang.Exception -> L54 r8.post(r3) // Catch: java.lang.Exception -> L54 goto La1 L54: r8 = move-exception java.lang.StringBuilder r3 = new java.lang.StringBuilder r3.() r3.append(r2) java.lang.String r8 = r8.toString() r3.append(r8) java.lang.String r8 = r3.toString() f7.f.b(r1, r8) com.mobon.sdk.n r8 = com.mobon.sdk.n.this h7.a r8 = com.mobon.sdk.n.l(r8) if (r8 == 0) goto L7c L73: com.mobon.sdk.n r8 = com.mobon.sdk.n.this h7.a r8 = com.mobon.sdk.n.l(r8) r8.onLoadedAdInfo(r0, r7) L7c: com.mobon.sdk.n r7 = com.mobon.sdk.n.this com.mobon.sdk.n.n(r7) goto La1 L82: java.lang.StringBuilder r3 = new java.lang.StringBuilder r3.() r3.append(r2) java.lang.String r8 = r8.Y() r3.append(r8) java.lang.String r8 = r3.toString() f7.f.b(r1, r8) com.mobon.sdk.n r8 = com.mobon.sdk.n.this h7.a r8 = com.mobon.sdk.n.l(r8) if (r8 == 0) goto L7c goto L73 La1: return */ throw new UnsupportedOperationException("Method not decompiled: com.mobon.sdk.n.h.a(h5.i, h5.i0):void"); } @Override // h5.j public void b(h5.i iVar, IOException iOException) { f7.f.b("API_MOBON_BACON_URL_LIST ERROR", "error => " + iOException.toString()); } } class i implements Runnable { /* renamed from: a, reason: collision with root package name */ final /* synthetic */ String f7743a; /* renamed from: b, reason: collision with root package name */ final /* synthetic */ String f7744b; /* renamed from: c, reason: collision with root package name */ final /* synthetic */ CookieManager f7745c; class a implements View.OnTouchListener { a(i iVar) { } @Override // android.view.View.OnTouchListener public boolean onTouch(View view, MotionEvent motionEvent) { return motionEvent.getAction() == 2; } } class b extends WebChromeClient { class a extends WebViewClient { a() { } @Override // android.webkit.WebViewClient public boolean shouldOverrideUrlLoading(WebView webView, String str) { Intent intent = new Intent("android.intent.action.VIEW"); if (str.contains("mediacategory.com")) { str = str + "&au_id=" + f7.l.e(n.this.f7701g, "Key.AUID"); } intent.setData(Uri.parse(str)); intent.addFlags(268435456); try { n.this.f7701g.startActivity(intent); if (n.this.f7713s != null) { n.this.f7713s.onAdClicked(); } n.n(n.this); if (n.this.f7716v != null) { n.this.f7716v.onResume(); n.this.f7716v.loadUrl("javascript:mixerClickFn();"); } } catch (ActivityNotFoundException unused) { n.this.f7701g.startActivity(Intent.createChooser(intent, "title")); } if (n.this.f7716v == null || !str.contains("//img.mobon.net/ad/linfo.php")) { return true; } n.this.f7716v.goBack(); return true; } } /* renamed from: com.mobon.sdk.n$i$b$b, reason: collision with other inner class name */ class RunnableC0109b implements Runnable { RunnableC0109b() { } @Override // java.lang.Runnable public void run() { if (n.this.F != null ? n.this.F.j() : false) { return; } if (n.this.f7713s != null) { n.this.f7713s.onLoadedAdInfo(false, "No fill"); } n.n(n.this); } } b() { } /* JADX WARN: Code restructure failed: missing block: B:8:0x0036, code lost: if (r3.equals("AdapterFailCallback") == false) goto L19; */ @Override // android.webkit.WebChromeClient /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct code enable 'Show inconsistent code' option in preferences */ public void onConsoleMessage(java.lang.String r3, int r4, java.lang.String r5) { /* r2 = this; java.lang.String r4 = "Uncaught SyntaxError:" boolean r4 = r3.contains(r4) r5 = 1 if (r4 != 0) goto L38 java.lang.String r4 = "Uncaught ReferenceError:" boolean r4 = r3.contains(r4) if (r4 != 0) goto L38 java.lang.StringBuilder r4 = new java.lang.StringBuilder r4.() java.lang.String r0 = "AdapterFailCallback_" r4.append(r0) com.mobon.sdk.n$i r0 = com.mobon.sdk.n.i.this com.mobon.sdk.n r0 = com.mobon.sdk.n.this java.lang.String r0 = com.mobon.sdk.n.b0(r0) r4.append(r0) java.lang.String r4 = r4.toString() boolean r4 = r3.equals(r4) if (r4 != 0) goto L38 java.lang.String r4 = "AdapterFailCallback" boolean r4 = r3.equals(r4) if (r4 == 0) goto L87 L38: java.lang.String r4 = "wp_json" boolean r4 = r3.contains(r4) if (r4 != 0) goto L87 com.mobon.sdk.n$i r3 = com.mobon.sdk.n.i.this com.mobon.sdk.n r3 = com.mobon.sdk.n.this android.webkit.WebView r3 = com.mobon.sdk.n.Z(r3) if (r3 == 0) goto L86 com.mobon.sdk.n$i r3 = com.mobon.sdk.n.i.this com.mobon.sdk.n r3 = com.mobon.sdk.n.this boolean r3 = com.mobon.sdk.n.c0(r3) if (r3 == 0) goto L55 goto L86 L55: com.mobon.sdk.n$i r3 = com.mobon.sdk.n.i.this com.mobon.sdk.n r3 = com.mobon.sdk.n.this android.webkit.WebView r3 = com.mobon.sdk.n.Z(r3) r3.onPause() com.mobon.sdk.n$i r3 = com.mobon.sdk.n.i.this com.mobon.sdk.n r3 = com.mobon.sdk.n.this android.widget.RelativeLayout r3 = com.mobon.sdk.n.r(r3) r3.removeAllViews() com.mobon.sdk.n$i r3 = com.mobon.sdk.n.i.this com.mobon.sdk.n r3 = com.mobon.sdk.n.this com.mobon.sdk.n.d0(r3, r5) android.os.Handler r3 = new android.os.Handler android.os.Looper r4 = android.os.Looper.getMainLooper() r3.(r4) com.mobon.sdk.n$i$b$b r4 = new com.mobon.sdk.n$i$b$b r4.() r0 = 500(0x1f4, double:2.47E-321) r3.postDelayed(r4, r0) goto Lce L86: return L87: java.lang.StringBuilder r4 = new java.lang.StringBuilder r4.() java.lang.String r0 = "AdapterSuccessCallback_" r4.append(r0) com.mobon.sdk.n$i r0 = com.mobon.sdk.n.i.this com.mobon.sdk.n r0 = com.mobon.sdk.n.this java.lang.String r0 = com.mobon.sdk.n.b0(r0) r4.append(r0) java.lang.String r4 = r4.toString() boolean r3 = r3.equals(r4) if (r3 == 0) goto Lce com.mobon.sdk.n$i r3 = com.mobon.sdk.n.i.this com.mobon.sdk.n r3 = com.mobon.sdk.n.this android.webkit.WebView r3 = com.mobon.sdk.n.Z(r3) if (r3 == 0) goto Lce com.mobon.sdk.n$i r3 = com.mobon.sdk.n.i.this com.mobon.sdk.n r3 = com.mobon.sdk.n.this h7.a r3 = com.mobon.sdk.n.l(r3) if (r3 == 0) goto Lc7 com.mobon.sdk.n$i r3 = com.mobon.sdk.n.i.this com.mobon.sdk.n r3 = com.mobon.sdk.n.this h7.a r3 = com.mobon.sdk.n.l(r3) java.lang.String r4 = "" r3.onLoadedAdInfo(r5, r4) Lc7: com.mobon.sdk.n$i r3 = com.mobon.sdk.n.i.this com.mobon.sdk.n r3 = com.mobon.sdk.n.this com.mobon.sdk.n.n(r3) Lce: return */ throw new UnsupportedOperationException("Method not decompiled: com.mobon.sdk.n.i.b.onConsoleMessage(java.lang.String, int, java.lang.String):void"); } @Override // android.webkit.WebChromeClient public boolean onCreateWindow(WebView webView, boolean z10, boolean z11, Message message) { WebView webView2 = new WebView(n.this.f7701g); webView.addView(webView2); ((WebView.WebViewTransport) message.obj).setWebView(webView2); message.sendToTarget(); webView2.setWebViewClient(new a()); return true; } } class c extends WebViewClient { c() { } @Override // android.webkit.WebViewClient public void onPageFinished(WebView webView, String str) { if (!str.contains("/servlet/auid")) { if (!n.this.B) { n.this.f7702h.setVisibility(0); return; } else { n.this.P = 0; n.this.s0(webView); return; } } if (i.this.f7743a.equals("mbadapter")) { i iVar = i.this; n.this.y0(iVar.f7744b); } else { i iVar2 = i.this; n.this.z0(iVar2.f7744b); } } @Override // android.webkit.WebViewClient public void onReceivedError(WebView webView, WebResourceRequest webResourceRequest, WebResourceError webResourceError) { CharSequence description; int errorCode; int errorCode2; super.onReceivedError(webView, webResourceRequest, webResourceError); StringBuilder sb = new StringBuilder(); sb.append("!!!!!!!!!!!!!!!!!!!!!!! onReceivedError : "); description = webResourceError.getDescription(); sb.append((Object) description); f7.f.a(sb.toString()); f7.f.a("!!!!!!!!!!!!!!!!!!!!!!! onReceivedError url : " + webResourceRequest.getUrl()); errorCode = webResourceError.getErrorCode(); if (errorCode != -1) { errorCode2 = webResourceError.getErrorCode(); if (errorCode2 == -10 || n.this.I) { return; } if (n.this.f7716v != null) { n.this.f7716v.loadUrl("about:blank"); n.this.f7716v.onPause(); } if (n.this.f7702h != null) { n.this.f7702h.removeAllViews(); } if (n.this.F != null ? n.this.F.j() : false) { return; } n.this.I = true; if (n.this.f7713s != null) { n.this.f7713s.onLoadedAdInfo(false, "No fill"); } n.n(n.this); } } @Override // android.webkit.WebViewClient public void onReceivedSslError(WebView webView, SslErrorHandler sslErrorHandler, SslError sslError) { sslErrorHandler.cancel(); f7.f.a("!!!!!!!!!!!!!!!!!!!!!!! onReceivedSslError : "); if (n.this.f7716v == null || n.this.I) { return; } n.this.f7716v.onPause(); n.this.f7702h.removeAllViews(); n.this.I = true; if (n.this.F != null ? n.this.F.j() : false) { return; } if (n.this.f7713s != null) { n.this.f7713s.onLoadedAdInfo(false, "No fill"); } n.n(n.this); } @Override // android.webkit.WebViewClient public boolean shouldOverrideUrlLoading(WebView webView, String str) { Intent intent = new Intent("android.intent.action.VIEW"); if (str.contains("mediacategory.com")) { str = str + "&au_id=" + f7.l.e(n.this.f7701g, "Key.AUID"); } intent.setData(Uri.parse(str)); intent.addFlags(268435456); try { n.this.f7701g.startActivity(intent); if (n.this.f7713s != null) { n.this.f7713s.onAdClicked(); } n.n(n.this); if (n.this.f7716v == null) { return true; } n.this.f7716v.onResume(); n.this.f7716v.loadUrl("javascript:mixerClickFn();"); return true; } catch (ActivityNotFoundException unused) { n.this.f7701g.startActivity(Intent.createChooser(intent, "title")); return super.shouldOverrideUrlLoading(webView, str); } } } i(String str, String str2, CookieManager cookieManager) { this.f7743a = str; this.f7744b = str2; this.f7745c = cookieManager; } @Override // java.lang.Runnable public void run() { View.inflate(n.this.f7701g, com.mobon.sdk.k.f7687u, n.this.f7702h); n nVar = n.this; nVar.f7716v = (WebView) nVar.f7702h.findViewById(com.mobon.sdk.j.f7666z); if (n.this.f7716v == null) { if (n.this.F != null ? n.this.F.j() : false) { return; } n.this.f7702h.removeAllViews(); if (n.this.f7713s != null) { n.this.f7713s.onLoadedAdInfo(false, "No fill"); } n.n(n.this); return; } WebSettings settings = n.this.f7716v.getSettings(); settings.setJavaScriptEnabled(true); settings.setBuiltInZoomControls(false); settings.setJavaScriptCanOpenWindowsAutomatically(true); settings.setSupportMultipleWindows(true); String path = n.this.f7701g.getDir("database", 0).getPath(); settings.setDatabaseEnabled(true); settings.setDatabasePath(path); settings.setDomStorageEnabled(true); settings.setBlockNetworkLoads(false); settings.setMixedContentMode(0); n.this.f7716v.setLayerType(2, null); if (n.this.f7701g instanceof Activity) { ((Activity) n.this.f7701g).getWindow().setFlags(16777216, 16777216); } n.this.f7716v.setVerticalScrollBarEnabled(false); n.this.f7716v.setHorizontalScrollBarEnabled(false); n.this.f7716v.setBackgroundColor(0); if (n.this.B) { n.this.f7716v.setDrawingCacheEnabled(true); } n.this.f7716v.setOnTouchListener(new a(this)); n.this.f7716v.setWebChromeClient(new b()); n.this.f7716v.setWebViewClient(new c()); this.f7745c.setAcceptThirdPartyCookies(n.this.f7716v, true); String cookie = this.f7745c.getCookie("https://mediacategory.com"); String e10 = f7.l.e(n.this.f7701g, "Key.AUID"); if (!TextUtils.isEmpty(cookie) && !TextUtils.isEmpty(e10) && (cookie == null || cookie.contains(e10))) { if (this.f7743a.equals("mbadapter")) { n.this.y0(this.f7744b); return; } else { n.this.z0(this.f7744b); return; } } n.this.f7702h.setVisibility(4); String str = com.mobon.sdk.p.f7783a + "www.mediacategory.com/servlet/auid?adid=" + f7.l.e(n.this.f7701g, "Key.ADID"); if (n.this.f7716v != null) { n.this.f7716v.onResume(); n.this.f7716v.loadUrl(str); } } } class j implements Runnable { /* renamed from: a, reason: collision with root package name */ final /* synthetic */ View f7751a; j(View view) { this.f7751a = view; } @Override // java.lang.Runnable public void run() { try { try { View view = this.f7751a; if (view != null) { Bitmap drawingCache = view.getDrawingCache(); if (drawingCache != null) { Bitmap createBitmap = Bitmap.createBitmap(drawingCache); if (createBitmap != null) { int x10 = com.mobon.sdk.a.x(createBitmap); if (x10 != 16777215) { ((View) this.f7751a.getParent()).setBackgroundColor(x10); } else { n.this.s0(this.f7751a); } createBitmap.recycle(); } } else { n.this.s0(this.f7751a); } } if (n.this.f7702h == null) { return; } } catch (Exception e10) { e10.printStackTrace(); if (n.this.f7702h == null) { return; } } n.this.f7702h.setVisibility(0); } catch (Throwable th) { if (n.this.f7702h != null) { n.this.f7702h.setVisibility(0); } throw th; } } } class k implements Runnable { k() { } @Override // java.lang.Runnable public void run() { try { ViewGroup.LayoutParams layoutParams = n.this.f7718x.getLayoutParams(); layoutParams.width = n.this.f7718x.getHeight(); n.this.f7718x.setLayoutParams(layoutParams); } catch (Exception e10) { e10.printStackTrace(); } } } class l implements Runnable { l() { } @Override // java.lang.Runnable public void run() { if (n.this.f7716v != null) { if (n.this.f7713s != null) { n.this.f7713s.onLoadedAdInfo(true, RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED); } n.n(n.this); } } } class m extends TimerTask { m() { } @Override // java.util.TimerTask, java.lang.Runnable public void run() { n.this.A0(); } } /* renamed from: com.mobon.sdk.n$n, reason: collision with other inner class name */ class RunnableC0110n implements Runnable { /* renamed from: a, reason: collision with root package name */ final /* synthetic */ String f7756a; RunnableC0110n(String str) { this.f7756a = str; } /* JADX WARN: Can't fix incorrect switch cases order, some code will duplicate */ @Override // java.lang.Runnable public void run() { char c10; RelativeLayout.LayoutParams layoutParams; int i10; RelativeLayout.LayoutParams layoutParams2; int i11; int i12; int i13; float dimension; n.this.setGravity(1); n.this.f7702h = new RelativeLayout(n.this.f7701g); String str = n.this.f7706l; str.hashCode(); switch (str.hashCode()) { case -539160351: if (str.equals("BANNER_600x600")) { c10 = 0; break; } c10 = 65535; break; case 915674794: if (str.equals("BANNER_RATIO_14")) { c10 = 1; break; } c10 = 65535; break; case 1093292213: if (str.equals("BANNER_300x250")) { c10 = 2; break; } c10 = 65535; break; case 1150549399: if (str.equals("BANNER_320x100")) { c10 = 3; break; } c10 = 65535; break; case 1516336828: if (str.equals("BANNER_FILLx60")) { c10 = 4; break; } c10 = 65535; break; case 1516336921: if (str.equals("BANNER_FILLx90")) { c10 = 5; break; } c10 = 65535; break; case 1976777269: if (str.equals("BANNER_320x50")) { c10 = 6; break; } c10 = 65535; break; default: c10 = 65535; break; } switch (c10) { case 0: DisplayMetrics displayMetrics = n.this.f7701g.getResources().getDisplayMetrics(); if (n.this.f7701g.getResources().getConfiguration().orientation == 1) { int i14 = displayMetrics.widthPixels; layoutParams = new RelativeLayout.LayoutParams(i14, i14); i10 = displayMetrics.widthPixels; } else { int i15 = displayMetrics.heightPixels; layoutParams = new RelativeLayout.LayoutParams(i15, i15); i10 = displayMetrics.heightPixels; } layoutParams.height = i10; layoutParams.width = i10; layoutParams2 = layoutParams; break; case 1: layoutParams2 = new RelativeLayout.LayoutParams(-1, -1); break; case 2: Resources resources = n.this.getResources(); i11 = com.mobon.sdk.h.f7636g; int dimension2 = (int) resources.getDimension(i11); Resources resources2 = n.this.getResources(); i12 = com.mobon.sdk.h.f7631b; layoutParams2 = new RelativeLayout.LayoutParams(dimension2, (int) resources2.getDimension(i12)); layoutParams2.width = (int) n.this.getResources().getDimension(i11); dimension = n.this.getResources().getDimension(i12); layoutParams2.height = (int) dimension; break; case 3: Resources resources3 = n.this.getResources(); i11 = com.mobon.sdk.h.f7635f; int dimension3 = (int) resources3.getDimension(i11); Resources resources4 = n.this.getResources(); i12 = com.mobon.sdk.h.f7630a; layoutParams2 = new RelativeLayout.LayoutParams(dimension3, (int) resources4.getDimension(i12)); layoutParams2.width = (int) n.this.getResources().getDimension(i11); dimension = n.this.getResources().getDimension(i12); layoutParams2.height = (int) dimension; break; case 4: Resources resources5 = n.this.getResources(); i13 = com.mobon.sdk.h.f7633d; layoutParams2 = new RelativeLayout.LayoutParams(-1, (int) resources5.getDimension(i13)); dimension = n.this.getResources().getDimension(i13); layoutParams2.height = (int) dimension; break; case 5: Resources resources6 = n.this.getResources(); i13 = com.mobon.sdk.h.f7634e; layoutParams2 = new RelativeLayout.LayoutParams(-1, (int) resources6.getDimension(i13)); dimension = n.this.getResources().getDimension(i13); layoutParams2.height = (int) dimension; break; case 6: Resources resources7 = n.this.getResources(); i11 = com.mobon.sdk.h.f7635f; int dimension4 = (int) resources7.getDimension(i11); Resources resources8 = n.this.getResources(); i12 = com.mobon.sdk.h.f7632c; layoutParams2 = new RelativeLayout.LayoutParams(dimension4, (int) resources8.getDimension(i12)); layoutParams2.width = (int) n.this.getResources().getDimension(i11); dimension = n.this.getResources().getDimension(i12); layoutParams2.height = (int) dimension; break; default: layoutParams2 = new RelativeLayout.LayoutParams(-1, -2); break; } n.this.f7702h.setLayoutParams(layoutParams2); n.this.f7702h.setGravity(17); n nVar = n.this; nVar.addView(nVar.f7702h); if (TextUtils.isEmpty(this.f7756a)) { return; } n.this.C0(this.f7756a, false); } } class o implements Runnable { o() { } @Override // java.lang.Runnable public void run() { if (n.this.f7710p > 0) { n.this.o0(); } n.this.w0(); } } class p implements Runnable { /* renamed from: a, reason: collision with root package name */ final /* synthetic */ String f7759a; p(String str) { this.f7759a = str; } @Override // java.lang.Runnable public void run() { n.this.C0(this.f7759a, true); } } class q implements Runnable { q() { } @Override // java.lang.Runnable public void run() { n.this.w0(); } } class r implements h7.c { class a implements Runnable { /* renamed from: a, reason: collision with root package name */ final /* synthetic */ JSONObject f7763a; /* renamed from: com.mobon.sdk.n$r$a$a, reason: collision with other inner class name */ class C0111a implements h7.e { /* renamed from: com.mobon.sdk.n$r$a$a$a, reason: collision with other inner class name */ class RunnableC0112a implements Runnable { /* renamed from: a, reason: collision with root package name */ final /* synthetic */ f7.b f7766a; /* renamed from: b, reason: collision with root package name */ final /* synthetic */ String f7767b; RunnableC0112a(f7.b bVar, String str) { this.f7766a = bVar; this.f7767b = str; } @Override // java.lang.Runnable public void run() { n.this.a(this.f7766a.h(), this.f7767b); } } C0111a() { } @Override // h7.e public void a(String str, f7.b bVar) { f7.f.a("onLoadedAdData : " + bVar.h() + " : " + str); try { if (n.this.f7702h != null) { n.this.f7702h.removeAllViews(); } if (n.this.getParent() != null) { n.this.f7720z = true; ((ViewGroup) n.this.getParent()).removeView(n.this); } if (bVar.h().equalsIgnoreCase("appbacon")) { n.this.f7712r = bVar.k(); n.this.v0(str); } else { if (!bVar.h().equalsIgnoreCase("mbadapter") && !bVar.h().equalsIgnoreCase("mbmixadapter")) { n.this.x0(str); } new Handler(Looper.getMainLooper()).postDelayed(new RunnableC0112a(bVar, bVar.k()), 10L); } n.this.A = null; } catch (Exception e10) { e10.printStackTrace(); if (n.this.f7713s != null) { n.this.f7713s.onLoadedAdInfo(false, e10.getLocalizedMessage()); } n.n(n.this); } } @Override // h7.e public void b() { } @Override // h7.e public void c(String str) { if (n.this.f7713s != null) { n.this.f7713s.onLoadedAdInfo(false, "No fill"); n.this.f7713s = null; } n.n(n.this); } @Override // h7.e public void d(f7.b bVar) { n.this.A = bVar.e(); if (n.this.A == null) { if (n.this.f7713s != null) { n.this.f7713s.onLoadedAdInfo(false, "ERROR " + bVar.f() + " load"); } n.n(n.this); return; } f7.f.a("onAdAdapter " + bVar.f() + " getView Not NULL!!!! "); if (n.this.f7702h != null) { n.this.f7702h.removeAllViews(); } if (n.this.getParent() != null) { n.this.f7720z = true; ((ViewGroup) n.this.getParent()).removeView(n.this); } n.this.f7702h.addView((View) n.this.A); if (n.this.f7713s != null) { n.this.f7713s.onLoadedAdInfo(true, RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED); } n.n(n.this); n.this.f7720z = false; } @Override // h7.e public void e() { } @Override // h7.e public void onAdClicked() { if (n.this.f7713s != null) { n.this.f7713s.onAdClicked(); } n.n(n.this); } @Override // h7.e public void onAdClosed() { } @Override // h7.e public void onAdImpression() { } } a(JSONObject jSONObject) { this.f7763a = jSONObject; } @Override // java.lang.Runnable public void run() { if (com.mobon.sdk.e.f7583a) { if (n.this.f7710p > 0) { n.this.f7714t = 0; } n nVar = n.this; nVar.F = new f7.h(nVar.f7701g, this.f7763a, n.this.f7706l); n.this.F.a(new C0111a()); return; } if (!TextUtils.isEmpty(this.f7763a.toString())) { n.this.C0(this.f7763a.toString(), false); } else if (n.this.f7713s != null) { n.this.f7713s.onLoadedAdInfo(false, "No fill"); } } } r() { } @Override // h7.c public void a(boolean z10, JSONObject jSONObject, String str) { if (z10) { new Handler(Looper.getMainLooper()).post(new a(jSONObject)); return; } synchronized (this) { if (n.this.f7713s != null) { n.this.f7713s.onLoadedAdInfo(false, str); } n.n(n.this); n.this.f7713s = null; n.o(n.this, null); } } } class s implements Runnable { s() { } @Override // java.lang.Runnable public void run() { if (n.this.f7719y == null || n.this.getParent() == null) { return; } PowerManager powerManager = (PowerManager) n.this.f7701g.getSystemService("power"); if (n.this.f7715u && powerManager.isScreenOn()) { n.this.K = 0; if (System.currentTimeMillis() - n.this.J >= n.this.f7710p * 1000) { n.this.J = System.currentTimeMillis(); n.this.w0(); } } else if (n.t(n.this) > 100) { return; } if (n.this.f7719y != null) { n.this.f7719y.postDelayed(n.this.L, n.this.f7710p * 1000); } } } class t implements Runnable { /* renamed from: a, reason: collision with root package name */ final /* synthetic */ String f7770a; /* renamed from: b, reason: collision with root package name */ final /* synthetic */ String f7771b; /* renamed from: c, reason: collision with root package name */ final /* synthetic */ String f7772c; /* renamed from: d, reason: collision with root package name */ final /* synthetic */ JSONObject f7773d; /* renamed from: e, reason: collision with root package name */ final /* synthetic */ boolean f7774e; /* renamed from: f, reason: collision with root package name */ final /* synthetic */ String f7775f; /* renamed from: g, reason: collision with root package name */ final /* synthetic */ String f7776g; /* renamed from: h, reason: collision with root package name */ final /* synthetic */ String f7777h; /* renamed from: i, reason: collision with root package name */ final /* synthetic */ String f7778i; /* renamed from: j, reason: collision with root package name */ final /* synthetic */ String f7779j; class a implements View.OnClickListener { a() { } @Override // android.view.View.OnClickListener public void onClick(View view) { f7.m.b(n.this.f7701g, n.this.D, false); } } class b implements View.OnClickListener { b() { } @Override // android.view.View.OnClickListener public void onClick(View view) { f7.f.a("landing url : " + t.this.f7770a); long currentTimeMillis = System.currentTimeMillis(); if (currentTimeMillis - n.this.E < 1000) { f7.f.a("ad double click !!!"); return; } n.this.E = currentTimeMillis; t tVar = t.this; if (!tVar.f7774e) { f7.m.b(n.this.f7701g, t.this.f7770a, false); if (n.this.f7713s != null) { n.this.f7713s.onAdClicked(); } n.n(n.this); return; } try { String optString = tVar.f7773d.optString("site_icon"); if (!optString.contains(".png")) { optString = t.this.f7773d.optString("mimg_250_250"); if (TextUtils.isEmpty(optString)) { optString = t.this.f7773d.optString("img"); } } Context context = n.this.f7701g; t tVar2 = t.this; f7.m.g(context, tVar2.f7777h, optString, tVar2.f7778i); d7.a aVar = new d7.a(n.this.f7701g); t tVar3 = t.this; aVar.c(tVar3.f7777h, tVar3.f7779j); f7.m.b(n.this.f7701g, t.this.f7770a, true); if (n.this.f7713s != null) { n.this.f7713s.onAdClicked(); } n.n(n.this); } catch (Exception e10) { e10.printStackTrace(); } } } t(String str, String str2, String str3, JSONObject jSONObject, boolean z10, String str4, String str5, String str6, String str7, String str8) { this.f7770a = str; this.f7771b = str2; this.f7772c = str3; this.f7773d = jSONObject; this.f7774e = z10; this.f7775f = str4; this.f7776g = str5; this.f7777h = str6; this.f7778i = str7; this.f7779j = str8; } /* JADX WARN: Can't fix incorrect switch cases order, some code will duplicate */ /* JADX WARN: Code restructure failed: missing block: B:215:0x0577, code lost: if (r9.equals("BANNER_300x250") == false) goto L157; */ /* JADX WARN: Removed duplicated region for block: B:19:0x00f8 */ /* JADX WARN: Removed duplicated region for block: B:52:0x02c6 */ @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() { /* Method dump skipped, instructions count: 2152 To view this dump change 'Code comments level' option to 'DEBUG' */ throw new UnsupportedOperationException("Method not decompiled: com.mobon.sdk.n.t.run():void"); } } public n(Context context, String str) { super(context); this.f7698d = new int[]{com.mobon.sdk.k.f7671e, com.mobon.sdk.k.f7672f, com.mobon.sdk.k.f7675i, com.mobon.sdk.k.f7674h, com.mobon.sdk.k.f7673g}; this.f7699e = new int[]{com.mobon.sdk.k.f7667a, com.mobon.sdk.k.f7670d, com.mobon.sdk.k.f7669c, com.mobon.sdk.k.f7668b}; this.f7700f = new int[]{com.mobon.sdk.k.f7690x, com.mobon.sdk.k.f7691y}; this.f7704j = new AtomicInteger(0); this.f7705k = 0; this.f7706l = "BANNER_320x50"; this.f7711q = null; this.f7712r = null; this.f7713s = null; this.f7717w = -1; this.B = true; this.C = -1; this.H = RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED; this.L = new s(); this.N = false; this.O = false; this.f7701g = context; this.f7706l = str; } /* JADX INFO: Access modifiers changed from: private */ public void A0() { h7.a aVar; if (this.f7701g == null && (aVar = this.f7713s) != null) { aVar.onLoadedAdInfo(false, "context null"); } this.G = b6.e.t(this.f7701g.getApplicationContext()); f7.f.a("rectBanner onInit bannerId :: " + this.f7711q); if (this.f7704j.get() > 5) { this.f7704j.set(0); return; } if (TextUtils.isEmpty(this.f7711q)) { f7.f.a("mobon banner 설정값을 아직 받지못하여 재시도!!!"); new Timer().schedule(new m(), this.f7704j.incrementAndGet() * 500); return; } this.f7704j.set(0); if (TextUtils.isEmpty(this.f7706l)) { this.f7706l = "BANNER_320x50"; } setMainLayout(RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED); this.f7720z = false; } /* JADX INFO: Access modifiers changed from: private */ public void a(String str, String str2) { if (this.f7702h == null) { h7.a aVar = this.f7713s; if (aVar != null) { aVar.onLoadedAdInfo(false, "No fill"); return; } return; } try { if (getParent() != null) { this.f7720z = true; ((ViewGroup) getParent()).removeView(this); } this.I = false; this.f7702h.removeAllViews(); CookieManager cookieManager = CookieManager.getInstance(); cookieManager.setAcceptCookie(true); cookieManager.getCookie("https://mediacategory.com"); if (!this.O) { cookieManager.setCookie("https://mediacategory.com", RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED); } this.O = true; this.f7702h.setVisibility(4); new Handler(Looper.getMainLooper()).post(new i(str, str2, cookieManager)); } catch (Exception e10) { e10.printStackTrace(); f7.f.b("ERROR", "error => " + e10.toString()); } } private boolean getBaconUrlListData() { if (System.currentTimeMillis() <= f7.l.d(this.f7701g, "Key.BACON_LIST_DOWNLOAD_SAVE_TIME") + 3600000) { return true; } f7.i.a(this.f7701g, com.mobon.sdk.p.f7783a + "www.mediacategory.com/servlet/API/ver2.0/JSON/sNo/" + this.f7712r + "/BACON?type=availableUrlList", null).z(new h()); return false; } static /* synthetic */ h7.b n(n nVar) { nVar.getClass(); return null; } static /* synthetic */ h7.b o(n nVar, h7.b bVar) { nVar.getClass(); return bVar; } /* JADX INFO: Access modifiers changed from: private */ public void o0() { Handler handler = this.f7719y; if (handler == null) { this.f7719y = new Handler(Looper.getMainLooper()); } else { handler.removeCallbacksAndMessages(handler); } this.f7719y.postDelayed(this.L, this.f7710p * 1000); } /* JADX INFO: Access modifiers changed from: private */ /* JADX WARN: Removed duplicated region for block: B:10:0x002a */ /* JADX WARN: Removed duplicated region for block: B:45:0x018d */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct code enable 'Show inconsistent code' option in preferences */ public void q0(org.json.JSONObject r9, android.widget.ImageView r10) { /* Method dump skipped, instructions count: 439 To view this dump change 'Code comments level' option to 'DEBUG' */ throw new UnsupportedOperationException("Method not decompiled: com.mobon.sdk.n.q0(org.json.JSONObject, android.widget.ImageView):void"); } /* JADX ERROR: ConcurrentModificationException in pass: ConstructorVisitor java.util.ConcurrentModificationException at java.base/java.util.ArrayList$Itr.checkForComodification(Unknown Source) at java.base/java.util.ArrayList$Itr.next(Unknown Source) at jadx.core.dex.visitors.ConstructorVisitor.insertPhiInsn(ConstructorVisitor.java:139) at jadx.core.dex.visitors.ConstructorVisitor.processInvoke(ConstructorVisitor.java:91) at jadx.core.dex.visitors.ConstructorVisitor.replaceInvoke(ConstructorVisitor.java:56) at jadx.core.dex.visitors.ConstructorVisitor.visit(ConstructorVisitor.java:42) */ /* JADX INFO: Access modifiers changed from: private */ public void r0( /* JADX ERROR: ConcurrentModificationException in pass: ConstructorVisitor java.util.ConcurrentModificationException at java.base/java.util.ArrayList$Itr.checkForComodification(Unknown Source) at java.base/java.util.ArrayList$Itr.next(Unknown Source) at jadx.core.dex.visitors.ConstructorVisitor.insertPhiInsn(ConstructorVisitor.java:139) at jadx.core.dex.visitors.ConstructorVisitor.processInvoke(ConstructorVisitor.java:91) at jadx.core.dex.visitors.ConstructorVisitor.replaceInvoke(ConstructorVisitor.java:56) */ /* JADX ERROR: Method generation error jadx.core.utils.exceptions.JadxRuntimeException: Code variable not set in r5v0 ?? at jadx.core.dex.instructions.args.SSAVar.getCodeVar(SSAVar.java:238) at jadx.core.codegen.MethodGen.addMethodArguments(MethodGen.java:223) at jadx.core.codegen.MethodGen.addDefinition(MethodGen.java:168) at jadx.core.codegen.ClassGen.addMethodCode(ClassGen.java:401) at jadx.core.codegen.ClassGen.addMethod(ClassGen.java:335) at jadx.core.codegen.ClassGen.lambda$addInnerClsAndMethods$3(ClassGen.java:301) at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Unknown Source) at java.base/java.util.ArrayList.forEach(Unknown Source) at java.base/java.util.stream.SortedOps$RefSortingSink.end(Unknown Source) at java.base/java.util.stream.Sink$ChainedReference.end(Unknown Source) at java.base/java.util.stream.ReferencePipeline$7$1FlatMap.end(Unknown Source) at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source) at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source) at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Unknown Source) at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Unknown Source) at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source) at java.base/java.util.stream.ReferencePipeline.forEach(Unknown Source) at jadx.core.codegen.ClassGen.addInnerClsAndMethods(ClassGen.java:297) at jadx.core.codegen.ClassGen.addClassBody(ClassGen.java:286) at jadx.core.codegen.ClassGen.addClassBody(ClassGen.java:270) at jadx.core.codegen.ClassGen.addClassCode(ClassGen.java:161) at jadx.core.codegen.ClassGen.makeClass(ClassGen.java:103) at jadx.core.codegen.CodeGen.wrapCodeGen(CodeGen.java:45) at jadx.core.codegen.CodeGen.generateJavaCode(CodeGen.java:34) at jadx.core.codegen.CodeGen.generate(CodeGen.java:22) at jadx.core.ProcessClass.process(ProcessClass.java:79) at jadx.core.ProcessClass.generateCode(ProcessClass.java:117) at jadx.core.dex.nodes.ClassNode.generateClassCode(ClassNode.java:402) at jadx.core.dex.nodes.ClassNode.decompile(ClassNode.java:390) at jadx.core.dex.nodes.ClassNode.getCode(ClassNode.java:340) */ /* JADX INFO: Access modifiers changed from: private */ public void s0(View view) { if (view == null) { return; } int i10 = this.P + 1; this.P = i10; if (i10 > 1) { this.f7702h.setVisibility(0); } else { new Handler(Looper.getMainLooper()).postDelayed(new j(view), 50L); } } static /* synthetic */ int t(n nVar) { int i10 = nVar.K + 1; nVar.K = i10; return i10; } /* JADX INFO: Access modifiers changed from: private */ public void v0(String str) { if (TextUtils.isEmpty(this.f7712r)) { h7.a aVar = this.f7713s; if (aVar != null) { aVar.onLoadedAdInfo(false, "Empty bacon UnitId"); return; } return; } if (!f7.m.f("com.nhn.android.search", this.f7701g)) { h7.a aVar2 = this.f7713s; if (aVar2 != null) { aVar2.onLoadedAdInfo(false, "No fill"); return; } return; } if (getBaconUrlListData()) { String i10 = com.mobon.sdk.a.i(this.f7701g); if (!TextUtils.isEmpty(i10)) { A0(); new Handler(Looper.getMainLooper()).postDelayed(new p(i10), 10L); } else { if (!TextUtils.isEmpty(str)) { x0(str); return; } h7.a aVar3 = this.f7713s; if (aVar3 != null) { aVar3.onLoadedAdInfo(false, "wrong bacon Unit or No fill"); } } } } /* JADX INFO: Access modifiers changed from: private */ public void w0() { if (this.f7704j.get() > 5) { h7.a aVar = this.f7713s; if (aVar != null) { aVar.onLoadedAdInfo(false, "Empty UnitId"); } this.f7704j.getAndSet(0); return; } if (TextUtils.isEmpty(this.f7711q)) { new Handler(Looper.getMainLooper()).postDelayed(new q(), this.f7704j.incrementAndGet() * 500); return; } f7.l.f(this.f7701g, "Key.BACON_BANNER_VISIBLE", !f7.l.a(r0, "Key.BACON_BANNER_VISIBLE")); Map k10 = com.mobon.sdk.a.k(this.f7701g); k10.put("s", this.f7711q); com.mobon.sdk.a.n(this.f7701g, this.f7711q, k10, this.f7710p > 0, this.f7717w, false, new r()); } /* JADX INFO: Access modifiers changed from: private */ public void x0(String str) { try { if (new JSONObject(str).getJSONArray("client").getJSONObject(0).optInt("length") == 0) { h7.a aVar = this.f7713s; if (aVar != null) { aVar.onLoadedAdInfo(false, "No fill"); } this.f7713s = null; return; } if (getParent() != null) { this.f7720z = true; ((ViewGroup) getParent()).removeView(this); } if (TextUtils.isEmpty(this.f7706l)) { this.f7706l = "BANNER_320x50"; } this.f7702h = null; setMainLayout(str); } catch (Exception e10) { h7.a aVar2 = this.f7713s; if (aVar2 != null) { aVar2.onLoadedAdInfo(false, e10.getLocalizedMessage()); } } } /* JADX INFO: Access modifiers changed from: private */ public void y0(String str) { if (this.f7716v == null) { this.f7702h.removeAllViews(); h7.a aVar = this.f7713s; if (aVar != null) { aVar.onLoadedAdInfo(false, "No fill"); return; } return; } String b10 = com.mobon.sdk.o.b(this.f7701g, str, "320_50"); this.H = str; try { WebView webView = this.f7716v; if (webView != null) { webView.onResume(); this.f7716v.loadDataWithBaseURL("https://mediacategory.com", b10, "text/html; charset=utf-8", "UTF-8", null); } } catch (Exception e10) { e10.printStackTrace(); } new Handler(Looper.getMainLooper()).postDelayed(new l(), 10L); } /* JADX INFO: Access modifiers changed from: private */ public void z0(String str) { if (this.f7716v == null) { this.f7702h.removeAllViews(); h7.a aVar = this.f7713s; if (aVar != null) { aVar.onLoadedAdInfo(false, "No fill"); return; } return; } String[] split = str.split("_"); if (split.length < 2) { f7.h hVar = this.F; if (hVar != null ? hVar.j() : false) { return; } this.f7702h.removeAllViews(); h7.a aVar2 = this.f7713s; if (aVar2 != null) { aVar2.onLoadedAdInfo(false, "No fill"); return; } return; } this.H = split[0]; String a10 = com.mobon.sdk.o.a(this.f7701g, str, split); try { WebView webView = this.f7716v; if (webView != null) { webView.onResume(); this.f7716v.loadDataWithBaseURL("https://mediacategory.com", a10, "text/html; charset=utf-8", "UTF-8", null); } } catch (Exception e10) { e10.printStackTrace(); } } public n B0(String str) { this.f7711q = str; A0(); return this; } protected void C0(String str, boolean z10) { JSONArray jSONArray; String str2; String optString; if (this.f7702h == null) { h7.a aVar = this.f7713s; if (aVar != null) { aVar.onLoadedAdInfo(false, "No fill"); return; } return; } this.f7720z = false; this.N = false; try { if (getParent() != null) { this.f7720z = true; ((ViewGroup) getParent()).removeView(this); } this.f7702h.removeAllViews(); if (this.f7706l == null) { this.f7706l = "BANNER_320x50"; } if (z10) { jSONArray = null; str2 = RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED; } else { JSONObject jSONObject = new JSONObject(str).getJSONArray("client").getJSONObject(0); this.D = jSONObject.optString("mobonInfo"); jSONArray = jSONObject.getJSONArray(JsonStorageKeyNames.DATA_KEY); str2 = jSONObject.optString("target"); } h7.a aVar2 = this.f7713s; if (aVar2 != null) { aVar2.onLoadedAdInfo(true, RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED); } this.f7720z = false; JSONObject jSONObject2 = z10 ? new JSONObject(str) : jSONArray.getJSONObject(this.f7714t); String optString2 = jSONObject2.optString("pcode"); String optString3 = TextUtils.isEmpty(jSONObject2.optString("s")) ? this.f7711q : jSONObject2.optString("s"); String optString4 = jSONObject2.optString("site_url", RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED); String optString5 = jSONObject2.optString("drc_link", RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED); if (z10) { optString = optString5; } else { optString = jSONObject2.optString(TextUtils.isEmpty(jSONObject2.optString("drcUrl")) ? "purl" : "drcUrl"); } if (z10) { String queryParameter = Uri.parse(optString).getQueryParameter("slink"); if (!TextUtils.isEmpty(queryParameter)) { optString = URLDecoder.decode(queryParameter, "UTF-8"); } } String str3 = optString; String decode = z10 ? URLDecoder.decode(jSONObject2.optString("site_title"), "UTF-8") : jSONObject2.optString("site_name"); String decode2 = z10 ? URLDecoder.decode(jSONObject2.optString("site_code"), "UTF-8") : com.mobon.sdk.a.o(str3, "sc"); String optString6 = jSONObject2.optString("increaseViewKey"); String optString7 = jSONObject2.optString("advrtsReplcCode", RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED); String optString8 = jSONObject2.optString("cta_text", RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED); if (!TextUtils.isEmpty(optString6)) { f7.m.h(this.f7701g, "www.mediacategory.com/servlet/API/ver3.0/JSON/sNo/" + optString3 + "/VIEW", optString6, str2, 1); } new Handler(Looper.getMainLooper()).post(new t(str3, decode2, optString2, jSONObject2, z10, optString7, optString8, decode, optString5, optString4)); } catch (Exception e10) { e10.printStackTrace(); f7.f.b("ERROR", "error => " + e10.toString()); } } @Override // android.view.ViewGroup public int getDescendantFocusability() { return super.getDescendantFocusability(); } @Override // android.view.ViewGroup, android.view.View protected void onDetachedFromWindow() { super.onDetachedFromWindow(); if (this.f7720z) { return; } this.f7710p = 0; p0(); } @Override // android.widget.RelativeLayout, android.view.View protected void onMeasure(int i10, int i11) { super.onMeasure(i10, i11); } @Override // android.view.View public void onWindowFocusChanged(boolean z10) { f7.f.a("hasWindowFocus = " + z10); super.onWindowFocusChanged(z10); } @Override // android.view.View protected void onWindowVisibilityChanged(int i10) { f7.f.a("onWindowVisibilityChanged = " + i10); if (i10 == 8) { this.f7715u = false; WebView webView = this.f7716v; if (webView != null) { webView.onPause(); } } else if (i10 == 0) { this.f7715u = true; WebView webView2 = this.f7716v; if (webView2 != null) { webView2.onResume(); } if (this.f7718x != null) { new Handler(Looper.getMainLooper()).post(new k()); } } super.onWindowVisibilityChanged(i10); } public void p0() { new Handler(Looper.getMainLooper()).post(new g()); WebView webView = this.f7716v; if (webView != null) { try { webView.onPause(); this.f7716v = null; } catch (Exception e10) { e10.printStackTrace(); } } Handler handler = this.f7719y; if (handler != null) { handler.removeCallbacksAndMessages(handler); this.f7719y = null; } } public void setAdListener(h7.a aVar) { this.f7713s = aVar; } public void setBgColor(int i10) { try { this.f7707m = ColorStateList.valueOf(i10); } catch (Exception unused) { } } protected void setMainLayout(String str) { RelativeLayout relativeLayout = this.f7702h; if (relativeLayout != null) { relativeLayout.removeAllViews(); this.f7702h = null; } new Handler(Looper.getMainLooper()).post(new RunnableC0110n(str)); } public void setScaleType(String str) { this.f7708n = str; } public void t0() { if (!f7.l.a(this.f7701g, "Key.AGE_LEVEL_KIDS")) { new Handler(Looper.getMainLooper()).postDelayed(new o(), 10L); return; } h7.a aVar = this.f7713s; if (aVar != null) { aVar.onLoadedAdInfo(false, "No fill"); } } public void u0() { v0(RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED); } public void setAdListener(h7.b bVar) { } public void setBgColor(String str) { try { this.f7707m = ColorStateList.valueOf(Color.parseColor(str)); } catch (Exception unused) { } } }