package f7; import android.app.Activity; import android.app.Application; import android.content.Context; import android.text.TextUtils; import android.view.View; import com.google.android.gms.ads.RequestConfiguration; import com.igaworks.ssp.R; import com.igaworks.ssp.SSPErrorCode; import com.mobon.sdk.e; import com.unity3d.services.ads.gmascar.bridges.mobileads.MobileAdsBridge; import f7.k; import org.json.JSONException; import org.json.JSONObject; /* loaded from: classes2.dex */ public class b { /* renamed from: a, reason: collision with root package name */ private String f9595a; /* renamed from: b, reason: collision with root package name */ private String f9596b; /* renamed from: c, reason: collision with root package name */ private String f9597c; /* renamed from: d, reason: collision with root package name */ private boolean f9598d; /* renamed from: e, reason: collision with root package name */ private boolean f9599e; /* renamed from: f, reason: collision with root package name */ private Object f9600f; /* renamed from: g, reason: collision with root package name */ private Object f9601g; /* renamed from: h, reason: collision with root package name */ private View.OnClickListener f9602h; /* renamed from: i, reason: collision with root package name */ private boolean f9603i; /* renamed from: j, reason: collision with root package name */ private boolean f9604j; /* renamed from: k, reason: collision with root package name */ private String f9605k; /* renamed from: l, reason: collision with root package name */ private String f9606l; /* renamed from: m, reason: collision with root package name */ private int f9607m; /* renamed from: n, reason: collision with root package name */ private String f9608n; class a implements View.OnClickListener { /* renamed from: a, reason: collision with root package name */ final /* synthetic */ g f9609a; a(g gVar) { this.f9609a = gVar; } @Override // android.view.View.OnClickListener public void onClick(View view) { g gVar; if (view.getTag() != null) { try { JSONObject jSONObject = new JSONObject(view.getTag().toString()); int optInt = jSONObject.optInt("code"); String optString = jSONObject.optString("msg"); switch (optInt) { case 100: b.this.f9603i = false; gVar = this.f9609a; break; case R.styleable.AppCompatTheme_switchStyle /* 101 */: b.this.f9603i = true; this.f9609a.h(); return; case 102: this.f9609a.b(); return; case R.styleable.AppCompatTheme_textAppearanceListItem /* 103 */: this.f9609a.g(); return; case 104: return; case 105: b.this.f9603i = false; b.this.f9604j = false; this.f9609a.c(); return; case R.styleable.AppCompatTheme_textAppearancePopupMenuHeader /* 106 */: b.this.f9603i = false; this.f9609a.i(); return; case R.styleable.AppCompatTheme_textAppearanceSearchResultSubtitle /* 107 */: b.this.f9603i = false; b.this.f9604j = false; this.f9609a.a(); return; case R.styleable.AppCompatTheme_textAppearanceSearchResultTitle /* 108 */: case R.styleable.AppCompatTheme_textAppearanceSmallPopupMenu /* 109 */: default: b.this.f9603i = false; gVar = this.f9609a; optString = "wrong data.. check mobon sdk version"; break; case R.styleable.AppCompatTheme_textColorAlertDialogListItem /* 110 */: b.this.f9603i = false; this.f9609a.e(); return; case R.styleable.AppCompatTheme_textColorSearchUrl /* 111 */: b.this.f9603i = false; b.this.f9604j = false; this.f9609a.d(); return; } gVar.f(optString); } catch (JSONException e10) { e10.printStackTrace(); } } } } public b(String str, String str2, String str3, String str4, String str5, boolean z10, boolean z11) { int i10; String str6; this.f9595a = str; if (TextUtils.equals(str, "mobon") || TextUtils.equals(str, "mbadapter") || TextUtils.equals(str, "mbmixadapter")) { this.f9608n = str5; this.f9606l = str3; } else { this.f9598d = z11; if (z11) { if (str.toLowerCase().equals("criteo")) { str6 = "com.criteo.publisher.CriteoAdapter"; } else { str6 = "com.mobon." + str.toLowerCase() + "_sdk." + str + "Adapter"; } this.f9597c = str6; } this.f9603i = false; this.f9605k = str2; this.f9606l = str3; if (!TextUtils.equals(str4, "BANNER_320x50")) { if (TextUtils.equals(str4, "BANNER_320x100")) { i10 = 201; } else if (TextUtils.equals(str4, "BANNER_300x250")) { i10 = 202; } else if (TextUtils.equals(str4, "ENDING")) { i10 = 205; } else if (TextUtils.equals(str4, "INTERSTITIAL") || TextUtils.equals(str4, e.b.FULL.toString())) { i10 = 203; } else if (TextUtils.equals(str4, "INTERSTITIAL_POPUP") || TextUtils.equals(str4, "MEDIATION_ADFIT_SMALL")) { i10 = 213; } else if (TextUtils.equals(str4, "NATIVE_FEED")) { i10 = 207; } this.f9607m = i10; } i10 = SSPErrorCode.EXCEPTION; this.f9607m = i10; } if (z10) { x(z10); } } public void c() { Object obj = this.f9600f; if (obj != null) { try { new k.a(obj, "close").b(); } catch (Exception e10) { System.out.println("AdapterObject setTestMode() : " + e10.getMessage()); } } } public String d() { return this.f9608n; } public Object e() { int i10; k.a aVar; try { i10 = this.f9607m; } catch (Exception e10) { e10.printStackTrace(); } if (i10 != 200 && i10 != 201 && i10 != 202) { if (i10 == 204) { aVar = new k.a(this.f9600f, "getNativeView"); this.f9601g = aVar.b(); } return this.f9601g; } aVar = new k.a(this.f9600f, "getBannerView"); this.f9601g = aVar.b(); return this.f9601g; } public String f() { return this.f9597c; } public String g() { String str = this.f9605k; return str == null ? RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED : str; } public String h() { return this.f9595a; } public Object i() { Object obj = this.f9600f; if (obj != null) { try { this.f9601g = new k.a(obj, "getNativeView").b(); } catch (Exception e10) { System.out.println("AdapterObject getNativeView() : " + e10.getMessage()); } } return this.f9601g; } String j() { return this.f9596b; } public String k() { String str = this.f9606l; return str == null ? RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED : str; } public void l() { Object obj = this.f9600f; if (obj != null) { try { new k.a(obj, MobileAdsBridge.versionMethodName).b(); } catch (Exception e10) { System.out.println("AdapterObject getVersion() : " + e10.getMessage()); } } } public boolean m(String str) { k.a a10; Class cls; Integer valueOf; if (this.f9600f != null) { try { if (!str.toLowerCase().equalsIgnoreCase("admixer") && !str.toLowerCase().equalsIgnoreCase("criteo") && !str.toLowerCase().equalsIgnoreCase("perpl")) { a10 = new k.a(this.f9600f, "init").a(String.class, this.f9606l); cls = Integer.TYPE; valueOf = Integer.valueOf(this.f9607m); a10.a(cls, valueOf).b(); return true; } a10 = new k.a(this.f9600f, "init").a(String.class, this.f9605k).a(String.class, this.f9606l); cls = Integer.TYPE; valueOf = Integer.valueOf(this.f9607m); a10.a(cls, valueOf).b(); return true; } catch (Exception e10) { System.out.println("AdapterObject init() : " + e10.getCause()); e10.printStackTrace(); } } return false; } public boolean n() { Object obj = this.f9600f; if (obj != null) { try { return ((Boolean) new k.a(obj, "isLoaded").b()).booleanValue(); } catch (Exception e10) { System.out.println("AdapterObject show() : " + e10.getMessage()); } } return false; } boolean o() { return this.f9598d; } public boolean p() { return this.f9600f != null; } public void q() { this.f9604j = false; Object obj = this.f9600f; if (obj != null) { try { new k.a(obj, "loadAd").b(); } catch (Exception e10) { System.out.println("AdapterObject load() : " + e10.getMessage()); } } } public void r(Context context, String str) { try { this.f9600f = this.f9595a.toLowerCase().contains("admixer") ? k.b(str, Object.class, new Class[]{Activity.class}, new Object[]{context}) : k.b(str, Object.class, new Class[]{Context.class}, new Object[]{context}); } catch (Exception e10) { System.out.println("AdapterObject oncrete() : " + e10.getMessage()); } } public void s(String str) { this.f9608n = str; } public void t(g gVar) { if (this.f9600f != null) { try { this.f9602h = new a(gVar); new k.a(this.f9600f, "setAdListener").a(View.OnClickListener.class, this.f9602h).b(); } catch (Exception e10) { System.out.println("AdapterObject setAdListner() : " + e10.getMessage()); } } } public boolean u(Application application) { Object obj = this.f9600f; if (obj != null) { try { new k.a(obj, "setApplication").a(Application.class, application).b(); return true; } catch (Exception e10) { System.out.println("AdapterObject setApplication() : " + e10.getCause()); e10.printStackTrace(); } } return false; } public void v(boolean z10) { this.f9599e = z10; } public void w(boolean z10) { Object obj = this.f9600f; if (obj != null) { try { new k.a(obj, "setLog").a(Boolean.TYPE, Boolean.valueOf(z10)).b(); } catch (Exception e10) { System.out.println("AdapterObject setLog() : " + e10.getMessage()); } } } public void x(boolean z10) { Object obj = this.f9600f; if (obj != null) { try { new k.a(obj, "setTestMode").a(Boolean.TYPE, Boolean.valueOf(z10)).b(); } catch (Exception e10) { System.out.println("AdapterObject setTestMode() : " + e10.getMessage()); } } } public boolean y() { Object obj = this.f9600f; if (obj == null) { return false; } try { return ((Boolean) new k.a(obj, "show").b()).booleanValue(); } catch (Exception e10) { System.out.println("AdapterObject show() : " + e10.getMessage()); return false; } } public b(String str, boolean z10) { String str2; this.f9595a = str; this.f9598d = z10; if (z10) { if (str.toLowerCase().equals("criteo")) { str2 = "com.criteo.publisher.CriteoAdapter"; } else { str2 = "com.mobon." + str.toLowerCase() + "_sdk." + str + "Adapter"; } this.f9597c = str2; } this.f9603i = false; } }