package com.mbridge.msdk.newreward.a;

import android.os.HandlerThread;
import android.text.TextUtils;
import com.iab.omid.library.mmadbridge.adsession.AdEvents;
import com.iab.omid.library.mmadbridge.adsession.AdSession;
import com.iab.omid.library.mmadbridge.adsession.media.MediaEvents;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import com.mbridge.msdk.newout.RewardVideoListener;
import com.mbridge.msdk.newreward.function.common.MBridgeCommon;
import com.mbridge.msdk.out.MBridgeIds;
import java.io.File;
import org.json.JSONArray;
/* compiled from: AdapterModel.java */
/* loaded from: classes5.dex */
public final class e {
    private String A;
    private String B;
    private int D;
    private long E;
    private MBridgeIds O;
    private f P;
    private com.mbridge.msdk.newreward.function.g.c Q;
    private AdSession Z;

    /* renamed from: a  reason: collision with root package name */
    public b f4022a;
    private AdEvents aa;
    private MediaEvents ab;
    private boolean ac;
    private HandlerThread af;
    private RewardVideoListener ag;
    int b;
    private String c;
    private CampaignEx d;
    private boolean e;
    private int f;
    private int g;
    private int h;
    private int i;
    private boolean m;
    private boolean n;
    private long p;
    private long q;
    private String u;
    private boolean v;
    private String x;
    private String y;
    private int z;
    private int j = com.mbridge.msdk.foundation.same.a.F;
    private int k = 2;
    private int l = MBridgeCommon.DEFAULT_LOAD_TIMEOUT;
    private boolean o = false;
    private boolean r = false;
    private int s = 0;
    private int t = 0;
    private boolean w = false;
    private String C = "";
    private boolean F = false;
    private boolean G = false;
    private boolean H = false;
    private com.mbridge.msdk.newreward.function.e.a I = new com.mbridge.msdk.newreward.function.e.a();
    private com.mbridge.msdk.newreward.function.e.e J = new com.mbridge.msdk.newreward.function.e.e();
    private com.mbridge.msdk.newreward.function.e.f K = new com.mbridge.msdk.newreward.function.e.f();
    private com.mbridge.msdk.newreward.function.e.c L = new com.mbridge.msdk.newreward.function.e.c();
    private com.mbridge.msdk.newreward.function.e.d M = new com.mbridge.msdk.newreward.function.e.d();
    private int N = 25000;
    private boolean R = false;
    private boolean S = false;
    private boolean T = false;
    private boolean U = false;
    private boolean V = false;
    private boolean W = false;
    private boolean X = false;
    private boolean Y = false;
    private int ad = 0;
    private JSONArray ae = new JSONArray();

    public final int A() {
        return this.b;
    }

    public final String B() {
        return this.A;
    }

    public final String C() {
        return this.B;
    }

    public final com.mbridge.msdk.newreward.function.e.a D() {
        return this.I;
    }

    public final com.mbridge.msdk.newreward.function.e.d E() {
        return this.M;
    }

    public final com.mbridge.msdk.newreward.function.e.e F() {
        return this.J;
    }

    public final String G() {
        return this.c;
    }

    public final String H() {
        return this.y;
    }

    public final boolean I() {
        return this.e;
    }

    public final String J() {
        return this.x;
    }

    public final RewardVideoListener K() {
        return this.ag;
    }

    public final int L() {
        return this.g;
    }

    public final int M() {
        return this.e ? 2 : 3;
    }

    public final int N() {
        return this.f;
    }

    public final int O() {
        return this.k;
    }

    public final int P() {
        int i = this.N;
        if (i <= 0) {
            return 25000;
        }
        return i;
    }

    public final int Q() {
        return this.l;
    }

    public final boolean R() {
        return this.n;
    }

    public final MBridgeIds S() {
        return this.O;
    }

    public final CampaignEx U() {
        return this.d;
    }

    public final f W() {
        return this.P;
    }

    public final boolean X() {
        return this.R;
    }

    public final boolean Y() {
        return this.S;
    }

    public final boolean Z() {
        return this.U;
    }

    public final HandlerThread a() {
        return this.af;
    }

    public final void a(int i) {
        this.f = i;
    }

    public final void a(int i, int i2, int i3) {
        this.g = i;
        this.h = i2;
        this.i = i3;
    }

    public final void a(long j) {
        this.E = j;
    }

    public final void a(HandlerThread handlerThread) {
        this.af = handlerThread;
    }

    public final void a(AdEvents adEvents) {
        this.aa = adEvents;
    }

    public final void a(AdSession adSession) {
        this.Z = adSession;
    }

    public final void a(MediaEvents mediaEvents) {
        this.ab = mediaEvents;
    }

    public final void a(CampaignEx campaignEx) {
        this.d = campaignEx;
    }

    public final void a(RewardVideoListener rewardVideoListener) {
        this.ag = rewardVideoListener;
    }

    public final void a(f fVar) {
        this.P = fVar;
    }

    public final void a(com.mbridge.msdk.newreward.function.e.a aVar) {
        this.I = aVar;
    }

    public final void a(com.mbridge.msdk.newreward.function.e.f fVar) {
        this.K = fVar;
    }

    public final void a(com.mbridge.msdk.newreward.function.g.c cVar) {
        this.Q = cVar;
    }

    public final void a(MBridgeIds mBridgeIds) {
        this.O = mBridgeIds;
    }

    public final void a(boolean z) {
        this.H = z;
    }

    public final boolean aa() {
        return this.V;
    }

    public final boolean ab() {
        return this.W;
    }

    public final boolean ac() {
        return this.X;
    }

    public final AdSession ad() {
        return this.Z;
    }

    public final AdEvents ae() {
        return this.aa;
    }

    public final MediaEvents af() {
        return this.ab;
    }

    public final boolean ag() {
        return this.Y;
    }

    public final boolean ah() {
        return this.T;
    }

    public final void b(int i) {
        this.j = i;
    }

    public final void b(long j) {
        this.q = j;
    }

    public final void b(String str) {
        this.C = str;
    }

    public final void b(boolean z) {
        this.G = z;
    }

    public final com.mbridge.msdk.newreward.function.g.c c() {
        return this.Q;
    }

    public final void c(int i) {
        this.D = i;
    }

    public final void c(long j) {
        this.p = j;
    }

    public final void c(String str) {
        this.u = str;
    }

    public final void c(boolean z) {
        this.F = z;
    }

    public final void d(int i) {
        this.b = i;
    }

    public final void d(String str) {
        this.A = str;
    }

    public final void d(boolean z) {
        this.v = z;
    }

    public final boolean d() {
        return this.H;
    }

    public final void e(int i) {
        this.k = i;
    }

    public final void e(String str) {
        this.B = str;
    }

    public final void e(boolean z) {
        this.r = z;
    }

    public final boolean e() {
        return this.G;
    }

    public final void f(int i) {
        this.N = i;
    }

    public final void f(String str) {
        this.c = str;
    }

    public final void f(boolean z) {
        this.o = z;
    }

    public final boolean f() {
        return this.F;
    }

    public final long g() {
        return this.E;
    }

    public final void g(int i) {
        this.l = i;
    }

    public final void g(boolean z) {
        this.m = z;
    }

    public final int h() {
        return this.z;
    }

    public final void h(boolean z) {
        this.w = z;
    }

    public final String i() {
        return this.C;
    }

    public final void i(boolean z) {
        this.R = z;
    }

    public final void j(boolean z) {
        this.S = z;
    }

    public final boolean j() {
        return this.v;
    }

    public final String k() {
        return this.u;
    }

    public final void k(boolean z) {
        this.U = z;
    }

    public final void l() {
        this.s++;
    }

    public final void l(boolean z) {
        this.V = z;
    }

    public final void m() {
        this.t++;
    }

    public final void m(boolean z) {
        this.W = z;
    }

    public final void n(boolean z) {
        this.X = z;
    }

    public final boolean n() {
        return this.r;
    }

    public final long o() {
        return this.q;
    }

    public final void o(boolean z) {
        this.Y = z;
    }

    public final long p() {
        return this.p;
    }

    public final void p(boolean z) {
        this.ac = z;
    }

    public final void q(boolean z) {
        this.T = z;
    }

    public final boolean q() {
        return this.o;
    }

    public final boolean r() {
        return this.m;
    }

    public final boolean s() {
        return this.w;
    }

    public final int t() {
        return this.g;
    }

    public final int u() {
        return this.h;
    }

    public final int v() {
        return this.i;
    }

    public final int w() {
        return this.j;
    }

    public final com.mbridge.msdk.newreward.function.e.f x() {
        return this.K;
    }

    public final int y() {
        return this.D;
    }

    public final com.mbridge.msdk.newreward.function.e.c z() {
        return this.L;
    }

    public final String b() {
        JSONArray jSONArray = this.ae;
        return jSONArray == null ? "" : jSONArray.toString();
    }

    public final void a(String str) {
        if (this.ae == null) {
            this.ae = new JSONArray();
        }
        this.ae.put(str);
    }

    public e(boolean z, int i, String str, String str2, boolean z2) {
        this.e = z;
        this.z = i;
        this.x = str;
        this.y = str2;
        this.n = z2;
    }

    public final long T() {
        com.mbridge.msdk.newreward.function.e.a aVar = this.I;
        if (aVar != null && aVar.b() != null && this.I.b().p() > 0) {
            return this.I.b().p();
        }
        long currentTimeMillis = System.currentTimeMillis();
        com.mbridge.msdk.videocommon.d.a a2 = this.K.a();
        return (a2 == null ? 3600000L : a2.f()) + currentTimeMillis;
    }

    public final String V() {
        CampaignEx campaignEx = this.d;
        return campaignEx == null ? "" : campaignEx.getRequestIdNotice();
    }

    public final String ai() {
        CampaignEx campaignEx = this.d;
        if (campaignEx == null || campaignEx.getRewardTemplateMode() == null) {
            return "904";
        }
        String e = this.d.getRewardTemplateMode().e();
        if (TextUtils.isEmpty(e)) {
            return "904";
        }
        if (this.d.getAdSpaceT() == 2) {
            return "HALF_TEMPLATE";
        }
        boolean b = com.mbridge.msdk.newreward.function.h.c.b(e);
        String valueOf = String.valueOf(this.d.getRewardTemplateMode().f());
        return (!b && this.ac) ? "WEB_TEMPLATE" : valueOf;
    }

    public final String aj() {
        CampaignEx campaignEx = this.d;
        if (campaignEx == null) {
            return "404";
        }
        boolean z = this.d.isMraid() || !com.mbridge.msdk.newreward.function.h.c.b(campaignEx.getendcard_url());
        long ecTemplateId = this.d.getEcTemplateId();
        if (ecTemplateId == 0) {
            ecTemplateId = 404;
        }
        return (z && this.ac) ? "WEB_EC" : String.valueOf(ecTemplateId);
    }

    public final boolean ak() {
        CampaignEx campaignEx = this.d;
        return campaignEx != null && campaignEx.getPlayable_ads_without_video() == 2;
    }

    public final String al() {
        CampaignEx campaignEx = this.d;
        if (campaignEx == null) {
            return "ONLY_PLAYABLE";
        }
        return ((campaignEx.getPlayable_ads_without_video() == 2) && (this.d.getAdSpaceT() == 2)) ? "HALF_END_CARD" : this.ac ? "ONLY_PLAYABLE" : "404";
    }

    public final File g(String str) {
        for (com.mbridge.msdk.newreward.function.c.a.a aVar : this.I.b().u()) {
            if (aVar.g().equals(str)) {
                return aVar.d().g();
            }
        }
        return null;
    }

    /* JADX WARN: Removed duplicated region for block: B:33:0x005e  */
    /* JADX WARN: Removed duplicated region for block: B:36:0x0063  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final int am() {
        /*
            r5 = this;
            r0 = 0
            com.mbridge.msdk.newreward.function.e.a r1 = r5.I     // Catch: java.lang.Exception -> L51
            if (r1 == 0) goto L34
            java.util.List r1 = r1.a()     // Catch: java.lang.Exception -> L51
            if (r1 == 0) goto L34
            com.mbridge.msdk.newreward.function.e.a r1 = r5.I     // Catch: java.lang.Exception -> L51
            java.util.List r1 = r1.a()     // Catch: java.lang.Exception -> L51
            boolean r1 = r1.isEmpty()     // Catch: java.lang.Exception -> L51
            if (r1 != 0) goto L34
            com.mbridge.msdk.newreward.function.e.a r1 = r5.I     // Catch: java.lang.Exception -> L51
            java.util.List r1 = r1.a()     // Catch: java.lang.Exception -> L51
            java.lang.Object r1 = r1.get(r0)     // Catch: java.lang.Exception -> L51
            com.mbridge.msdk.foundation.entity.CampaignEx r1 = (com.mbridge.msdk.foundation.entity.CampaignEx) r1     // Catch: java.lang.Exception -> L51
            if (r1 == 0) goto L34
            com.mbridge.msdk.foundation.entity.CampaignEx$c r2 = r1.getRewardTemplateMode()     // Catch: java.lang.Exception -> L51
            if (r2 == 0) goto L34
            com.mbridge.msdk.foundation.entity.CampaignEx$c r1 = r1.getRewardTemplateMode()     // Catch: java.lang.Exception -> L51
            int r1 = r1.b()     // Catch: java.lang.Exception -> L51
            goto L35
        L34:
            r1 = r0
        L35:
            if (r1 != 0) goto L5b
            com.mbridge.msdk.newreward.function.e.f r2 = r5.K     // Catch: java.lang.Exception -> L4c
            if (r2 == 0) goto L5b
            com.mbridge.msdk.videocommon.d.c r2 = r2.b()     // Catch: java.lang.Exception -> L4c
            if (r2 == 0) goto L5b
            com.mbridge.msdk.newreward.function.e.f r2 = r5.K     // Catch: java.lang.Exception -> L4c
            com.mbridge.msdk.videocommon.d.c r2 = r2.b()     // Catch: java.lang.Exception -> L4c
            int r1 = r2.c()     // Catch: java.lang.Exception -> L4c
            goto L5b
        L4c:
            r2 = move-exception
            r4 = r2
            r2 = r1
            r1 = r4
            goto L53
        L51:
            r1 = move-exception
            r2 = r0
        L53:
            boolean r3 = com.mbridge.msdk.MBridgeConstans.DEBUG
            if (r3 == 0) goto L5a
            r1.printStackTrace()
        L5a:
            r1 = r2
        L5b:
            r2 = 1
            if (r1 == r2) goto L63
            r2 = 2
            if (r1 == r2) goto L64
            r0 = -1
            goto L64
        L63:
            r0 = r2
        L64:
            return r0
        */
        throw new UnsupportedOperationException("Method not decompiled: com.mbridge.msdk.newreward.a.e.am():int");
    }
}
