package com.mitan.sdk.ss; import android.app.Activity; import android.content.res.Resources; import android.graphics.Rect; import android.os.Build; import android.os.Bundle; import android.os.Handler; import android.os.Looper; import android.os.Message; import android.text.TextUtils; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.FrameLayout; import android.widget.ImageView; import android.widget.TextView; import com.mitan.sdk.R; import com.mitan.sdk.c.B; import com.mitan.sdk.essent.module.p; import com.mitan.sdk.essent.module.r; import com.mitan.sdk.essent.module.t; import com.mitan.sdk.essent.module.u; import com.mitan.sdk.sd.ps.img.CompactImageView; import java.lang.ref.WeakReference; /* renamed from: com.mitan.sdk.ss.hd reason: case insensitive filesystem */ public class C0655hd extends C0707oa implements M, N { public static final int h = 770; public O i; public AbstractC0723qa j; public AbstractC0730ra k; public a l; public View m; public int n = 1; public final int o = 500; private String p; private u q; public C0780ya r; public C0766wa s; /* renamed from: com.mitan.sdk.ss.hd$a */ public static class a extends Handler { /* renamed from: a reason: collision with root package name */ public WeakReference<C0655hd> f20282a; public a(C0655hd hdVar) { super(Looper.getMainLooper()); this.f20282a = new WeakReference<>(hdVar); } public void handleMessage(Message message) { C0655hd hdVar; super.handleMessage(message); WeakReference<C0655hd> weakReference = this.f20282a; if (weakReference != null && (hdVar = weakReference.get()) != null) { int i = message.what; if (i == 71) { hdVar.k(); } else if (i == 770) { int i2 = hdVar.n - 1; hdVar.n = i2; hdVar.n = i2; a aVar = hdVar.l; if (aVar != null) { aVar.removeMessages(770); } if (hdVar.f) { hdVar.f(); } else { hdVar.e(); } } } } } public C0655hd(Activity activity, C0780ya yaVar, ViewGroup viewGroup, View view, boolean z, M m2) { super(activity, yaVar, viewGroup, view, z, m2); this.j = new p(activity, yaVar); this.l = new a(this); O o2 = this.i; if (o2 != null) { o2.destroy(); this.i = null; } this.i = i(); this.p = activity.getLocalClassName(); C0595a.b().a(this); if (this.q != null) { this.q = null; } C0780ya yaVar2 = this.c; if (yaVar2.ba == 1) { this.q = new u(yaVar2, this.f20348b); } } /* access modifiers changed from: private */ /* access modifiers changed from: public */ private void a(ViewGroup viewGroup) { try { if (this.c.p != 0 && Build.VERSION.SDK_INT >= 15) { for (int i2 = 0; i2 < viewGroup.getChildCount(); i2++) { if (viewGroup.getChildAt(i2) instanceof ViewGroup) { a((ViewGroup) viewGroup.getChildAt(i2)); } else { View childAt = viewGroup.getChildAt(i2); if (childAt.hasOnClickListeners()) { Rect rect = new Rect(); childAt.getGlobalVisibleRect(rect); if (rect.height() < 70 && (childAt instanceof ImageView)) { if (childAt.getParent() != null) { ((ViewGroup) childAt.getParent()).removeView(childAt); return; } return; } } else { continue; } } } } } catch (Exception unused) { } } /* access modifiers changed from: private */ /* access modifiers changed from: public */ private void g() { ViewGroup viewGroup; C0780ya yaVar = this.c; if (yaVar != null && this.f20348b != null && (viewGroup = this.d) != null && yaVar.ha != 1) { View view = this.m; if ((view == null || viewGroup.indexOfChild(view) < 0) && this.c.T == 1) { if (this.m == null) { this.m = LayoutInflater.from(this.f20348b.getApplicationContext()).inflate(R.layout.o_hot_area, (ViewGroup) null); } ((FrameLayout) this.m.findViewById(R.id.o_h_a)).setBackgroundResource(R.drawable.o_px_splash_area_bg); ((TextView) this.m.findViewById(R.id.o_h_c_area)).setVisibility(0); FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(-1, (int) (Resources.getSystem().getDisplayMetrics().density * 45.0f)); layoutParams.gravity = 80; int i2 = (int) (Resources.getSystem().getDisplayMetrics().density * 30.0f); layoutParams.rightMargin = i2; layoutParams.leftMargin = i2; layoutParams.bottomMargin = (int) (Resources.getSystem().getDisplayMetrics().density * 40.0f); this.d.addView(this.m, layoutParams); } } } /* access modifiers changed from: private */ /* access modifiers changed from: public */ private void h() { ViewGroup viewGroup; if (this.c != null && this.f20348b != null && (viewGroup = this.d) != null) { View view = this.m; if ((view == null || viewGroup.indexOfChild(view) < 0) && this.c.ha == 1) { if (this.m == null) { this.m = LayoutInflater.from(this.f20348b.getApplicationContext()).inflate(R.layout.o_hot_area, (ViewGroup) null); } CompactImageView compactImageView = (CompactImageView) this.m.findViewById(R.id.o_h_s_area); compactImageView.setVisibility(0); int i2 = (int) (Resources.getSystem().getDisplayMetrics().density * 150.0f); FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) compactImageView.getLayoutParams(); layoutParams.gravity = 17; layoutParams.width = i2; layoutParams.height = i2; compactImageView.setLayoutParams(layoutParams); compactImageView.setImageUrl("https://file.xwuad.com/static/activity/shake.gif"); compactImageView.setImageLoadListener(new C0639fd(this, (FrameLayout) this.m.findViewById(R.id.o_h_a))); int i3 = (int) (Resources.getSystem().getDisplayMetrics().density * 205.0f); FrameLayout.LayoutParams layoutParams2 = new FrameLayout.LayoutParams(i3, i3); layoutParams2.gravity = 81; layoutParams2.bottomMargin = (int) (Resources.getSystem().getDisplayMetrics().density * 40.0f); this.d.addView(this.m, layoutParams2); } } } private O i() { Object obj; Class cls = Boolean.TYPE; C0780ya yaVar = this.c; int i2 = yaVar.d; O o2 = null; if (i2 == 1) { o2 = new C0623dd(this.f20348b, yaVar, this.d, null, this.f, this); } else if (i2 == 2) { int i3 = yaVar.h; if (i3 == 1) { obj = Ha.a(B.PKG + ".g.o.a", (Object) null, "s2", new Class[]{Activity.class, C0780ya.class, ViewGroup.class, View.class, cls, M.class}, this.f20348b, this.c, this.d, null, Boolean.valueOf(this.f), this); } else if (i3 == 2) { obj = Ha.a(B.PKG + ".bq.o.a", (Object) null, "s2", new Class[]{Activity.class, C0780ya.class, ViewGroup.class, View.class, cls, M.class}, this.f20348b, this.c, this.d, null, Boolean.valueOf(this.f), this); } else if (i3 == 3) { obj = Ha.a(B.PKG + ".t.o.a", (Object) null, "s2", new Class[]{Activity.class, C0780ya.class, ViewGroup.class, View.class, cls, M.class}, this.f20348b, this.c, this.d, null, Boolean.valueOf(this.f), this); } else if (i3 == 12) { obj = Ha.a(B.PKG + ".k.o.a", (Object) null, "s2", new Class[]{Activity.class, C0780ya.class, ViewGroup.class, View.class, cls, M.class}, this.f20348b, this.c, this.d, null, Boolean.valueOf(this.f), this); } else if (i3 == 21) { obj = Ha.a(B.PKG + ".m.o.a", (Object) null, "s2", new Class[]{Activity.class, C0780ya.class, ViewGroup.class, View.class, cls, M.class}, this.f20348b, this.c, this.d, null, Boolean.valueOf(this.f), this); } o2 = (O) obj; } if (o2 != null) { _a a2 = _a.a(); Activity activity = this.f20348b; C0780ya yaVar2 = this.c; a2.b(activity, yaVar2.f, "2", yaVar2.c); } return o2; } private boolean j() { ViewGroup viewGroup = this.d; if (viewGroup == null || this.f20348b == null) { return false; } if (this.k == null) { this.k = new r(viewGroup.getContext(), 0, this.c); } if (!this.j.b()) { this.f20348b.runOnUiThread(new RunnableC0647gd(this)); return false; } this.k.a(this.d); return true; } /* access modifiers changed from: private */ /* access modifiers changed from: public */ private void k() { C0780ya yaVar = this.c; if (yaVar.S == 1 || yaVar.h == 1) { C0766wa waVar = this.s; if (waVar == null || waVar.a() != 2001 || Build.VERSION.SDK_INT >= 30 || this.n < 0) { if (this.s != null) { C0603b.c("开屏广告 retry end 错误--code-->" + this.s.a() + "--msg-->" + this.s.b()); } this.f20347a = 8; AbstractC0723qa qaVar = this.j; if (qaVar != null) { C0766wa waVar2 = this.s; if (waVar2 == null) { waVar2 = new C0766wa(); } qaVar.a(waVar2); } M m2 = this.g; if (m2 != null) { C0759va b2 = new C0759va().b(71); C0780ya yaVar2 = this.r; if (yaVar2 == null) { yaVar2 = this.c; } C0759va a2 = b2.a(yaVar2); C0766wa waVar3 = this.s; if (waVar3 == null) { waVar3 = new C0766wa(); } m2.a(a2.a(waVar3)); } a aVar = this.l; if (aVar != null) { aVar.removeMessages(71); return; } return; } C0603b.c("开屏广告 retrying 错误--code-->" + this.s.a() + "--msg-->" + this.s.b()); a aVar2 = this.l; if (aVar2 != null) { aVar2.removeMessages(770); this.l.sendEmptyMessageDelayed(770, 500); return; } return; } if (this.s != null) { C0603b.c("开屏广告 not retried 错误--code-->" + this.s.a() + "--msg-->" + this.s.b()); } this.f20347a = 8; AbstractC0723qa qaVar2 = this.j; if (qaVar2 != null) { C0766wa waVar4 = this.s; if (waVar4 == null) { waVar4 = new C0766wa(); } qaVar2.a(waVar4); } M m3 = this.g; if (m3 != null) { C0759va b3 = new C0759va().b(71); C0780ya yaVar3 = this.r; if (yaVar3 == null) { yaVar3 = this.c; } C0759va a3 = b3.a(yaVar3); C0766wa waVar5 = this.s; if (waVar5 == null) { waVar5 = new C0766wa(); } m3.a(a3.a(waVar5)); } a aVar3 = this.l; if (aVar3 != null) { aVar3.removeMessages(71); } } /* access modifiers changed from: private */ /* access modifiers changed from: public */ private void l() { try { if (this.f20348b != null && !TextUtils.isEmpty(this.c.o)) { CompactImageView compactImageView = new CompactImageView(this.f20348b); compactImageView.setScaleType(ImageView.ScaleType.FIT_XY); FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(50, 27); layoutParams.gravity = 83; compactImageView.setLayoutParams(layoutParams); ViewGroup viewGroup = this.d; if (viewGroup != null) { viewGroup.addView(compactImageView); } compactImageView.setImageUrl(this.c.o); } } catch (Exception unused) { } } @Override // com.mitan.sdk.ss.C0707oa, com.mitan.sdk.ss.O public void a() { super.a(); O o2 = this.i; if (o2 != null) { o2.a(); } } @Override // com.mitan.sdk.ss.N public void a(Activity activity) { } @Override // com.mitan.sdk.ss.N public void a(Activity activity, Bundle bundle) { } @Override // com.mitan.sdk.ss.M public void a(M m2) { } @Override // com.mitan.sdk.ss.C0707oa, com.mitan.sdk.ss.O public void a(S s2) { O o2 = this.i; if (o2 != null) { o2.a(s2); } } @Override // com.mitan.sdk.ss.M public void a(C0759va vaVar) { C0759va vaVar2; M m2; int i2; C0759va vaVar3; if (vaVar != null) { switch (vaVar.Aa) { case 70: this.f20347a = 9; m2 = this.g; if (m2 != null) { vaVar3 = new C0759va(); i2 = 70; vaVar2 = vaVar3.b(i2); break; } else { return; } case 71: this.r = vaVar.Ba; this.s = vaVar.Da; a aVar = this.l; if (aVar != null) { aVar.removeMessages(71); this.l.sendEmptyMessage(71); return; } return; case 72: case 73: case 77: case 79: default: return; case 74: this.f20347a = 0; ViewGroup viewGroup = this.d; if (viewGroup != null) { viewGroup.postDelayed(new RunnableC0631ed(this), 300); } AbstractC0723qa qaVar = this.j; if (qaVar != null) { qaVar.a(1); } AbstractC0730ra raVar = this.k; if (raVar != null) { raVar.c(); } m2 = this.g; if (m2 != null) { vaVar3 = new C0759va(); i2 = 74; vaVar2 = vaVar3.b(i2); break; } else { return; } case 75: AbstractC0730ra raVar2 = this.k; if (raVar2 != null) { String b2 = raVar2.b(vaVar.Ca); if (this.g != null && !this.k.b(b2)) { m2 = this.g; vaVar3 = new C0759va(); i2 = 75; vaVar2 = vaVar3.b(i2); break; } else { return; } } else { return; } case 76: AbstractC0730ra raVar3 = this.k; if (raVar3 != null) { String a2 = raVar3.a(vaVar.Ca); if (this.g != null && !this.k.a(a2)) { m2 = this.g; vaVar3 = new C0759va(); i2 = 76; vaVar2 = vaVar3.b(i2); break; } else { return; } } else { return; } case 78: m2 = this.g; if (m2 != null) { vaVar2 = new C0759va().b(78).a(vaVar.Ea); break; } else { return; } case 80: t.a().b(); AbstractC0730ra raVar4 = this.k; if (raVar4 != null) { raVar4.destroy(); } m2 = this.g; if (m2 != null) { vaVar3 = new C0759va(); i2 = 80; vaVar2 = vaVar3.b(i2); break; } else { return; } } m2.a(vaVar2.a(vaVar.Ba)); } } @Override // com.mitan.sdk.ss.C0707oa, com.mitan.sdk.ss.O public void b() { super.b(); this.d.removeAllViews(); this.d = null; this.g = null; AbstractC0723qa qaVar = this.j; if (qaVar != null) { qaVar.a(new C0766wa(1002, C0787za.e)); } } @Override // com.mitan.sdk.ss.N public void b(Activity activity) { } @Override // com.mitan.sdk.ss.N public void c(Activity activity) { u uVar; if (this.p.equals(activity.getLocalClassName()) && (uVar = this.q) != null) { uVar.a(); } } @Override // com.mitan.sdk.ss.C0707oa, com.mitan.sdk.ss.O public void destroy() { super.destroy(); t.a().b(); AbstractC0730ra raVar = this.k; if (raVar != null) { raVar.destroy(); } a aVar = this.l; if (aVar != null) { aVar.removeCallbacksAndMessages(null); } O o2 = this.i; if (o2 != null) { o2.destroy(); this.i = null; } C0595a.b().b(this); } @Override // com.mitan.sdk.ss.C0707oa, com.mitan.sdk.ss.O public void e() { O o2; if (this.f20347a != 1) { super.e(); if (j() && (o2 = this.i) != null) { o2.e(); } } } @Override // com.mitan.sdk.ss.C0707oa, com.mitan.sdk.ss.O public void f() { O o2; if (this.f20347a != 1) { super.f(); if (j() && (o2 = this.i) != null) { o2.f(); } } } @Override // com.mitan.sdk.ss.C0707oa, com.mitan.sdk.ss.O public int getType() { return super.getType(); } @Override // com.mitan.sdk.ss.C0707oa, com.mitan.sdk.ss.O public void setDownloadConfirmListener(M m2) { O o2 = this.i; if (o2 != null) { o2.setDownloadConfirmListener(m2); } } }