导航菜单

页面标题

页面副标题

Handling Master v2 - YSHE.java 源代码

正在查看: Handling Master v2 应用的 YSHE.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.e.o;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.res.Configuration;
import android.os.Bundle;
import android.os.SystemClock;
import android.text.TextUtils;
import android.view.View;
import android.widget.FrameLayout;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import com.mbridge.msdk.playercommon.exoplayer2.text.ttml.TtmlNode;
import com.thinkup.core.common.n.no;
import com.thinkup.core.common.n.o0n;
import com.thinkup.core.common.on.o0o;
import com.thinkup.expressad.atsignalcommon.windvane.WindVaneWebView;
import com.thinkup.expressad.foundation.m0.mn;
import com.thinkup.expressad.foundation.m0.oom;
import com.thinkup.expressad.foundation.o0.o0m;
import com.thinkup.expressad.reward.o.oo;
import com.thinkup.expressad.reward.player.m;
import com.thinkup.expressad.video.bt.module.TUBTContainer;
import com.thinkup.expressad.video.bt.module.TUTempContainer;
import com.thinkup.expressad.video.bt.module.m.m0;
import com.thinkup.expressad.video.module.TUVideoView;
import com.thinkup.expressad.video.signal.activity.AbstractJSActivity;
import com.thinkup.expressad.video.signal.factory.IJSFactory;
import com.thinkup.expressad.videocommon.m.nn;
import com.thinkup.expressad.videocommon.m.o;
import com.thinkup.expressad.videocommon.n.n;
import com.thinkup.expressad.videocommon.o;
import com.thinkup.expressad.videocommon.oo.o0;
import java.io.Serializable;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CopyOnWriteArrayList;

public class YSHE extends AbstractJSActivity {
    public static String m = "userId";
    public static String m0 = "hasRelease";
    public static String mm = "ivRewardValueType";
    public static String mn = "ivRewardValue";
    public static String mo = "ivRewardMode";
    public static String n = "reward";
    public static String n0 = "extraData";
    public static String nm = "lRid";
    public static String nn = "at_intercept_show";
    public static String no = "baserequestInfo";
    public static String o = "unitId";
    public static String o0 = "mute";
    public static String om = "isBid";
    private static final String omm = "TURewardVideoActivity";
    public static String on = "isBigOffer";
    public static String oo = "isIV";
    private int m0n;
    private m0 mm0;
    private o0 mmo;
    private o mn0;
    private List<o> mnm;
    private List<com.thinkup.expressad.foundation.o0.o0> mnn;
    private com.thinkup.expressad.foundation.o0.o0 mno;
    private int mo0;
    private int moo;
    private TUTempContainer n00;
    private WindVaneWebView n0m;
    private com.thinkup.expressad.video.bt.module.o.o n0n;
    private TUBTContainer n0o;
    private com.thinkup.basead.o.o nmo;
    private String no0;
    private boolean nom;
    private String noo;
    o0o o00;
    long o0m;
    long o0n;
    com.thinkup.expressad.foundation.o0.o0 o0o;
    private String omn;
    private String on0;
    private n onm;
    private String ono;
    long oo0;
    private int onn = 2;
    private int m00 = 2;
    private boolean m0o = false;
    private boolean m0m = false;
    private boolean mom = false;
    private boolean mon = false;
    private boolean mmm = false;
    private boolean mmn = false;
    private int non = 1;
    private int nm0 = 0;
    private int nmm = 0;
    private int nmn = 0;
    private int nn0 = 0;
    private int nno = 0;
    private int nnm = 0;
    private com.thinkup.expressad.video.dynview.om.o nnn = new ilLiIi111I1ll();
    private com.thinkup.expressad.video.dynview.om.o0 o000 = new I11lllll1ILI1();
    m ooo = new I1IIiIII();
    com.thinkup.expressad.video.o.o oom = new ILIlil1Lii();
    BroadcastReceiver oon = new Ii1ILILlilI();

    public class I1IIiIII implements m {
        public String o = "1";

        public I1IIiIII() {
        }

        @Override
        public final void m() {
        }

        @Override
        public final void n() {
            this.o = "1";
            YSHE.this.o("4", 0L);
        }

        @Override
        public final String o() {
            return this.o;
        }

        @Override
        public final void o0() {
            if (TextUtils.equals(this.o, "1")) {
                this.o = "2";
            }
            YSHE yshe = YSHE.this;
            StringBuilder sb = new StringBuilder("5-");
            YSHE yshe2 = YSHE.this;
            sb.append(yshe2.o0n <= yshe2.oo0 ? "2" : "1");
            yshe.o(sb.toString(), 0L);
        }

        @Override
        public final void om() {
        }

        @Override
        public final void oo() {
            if (TextUtils.equals(this.o, "1")) {
                this.o = "3";
                YSHE yshe = YSHE.this;
                StringBuilder sb = new StringBuilder("6-");
                YSHE yshe2 = YSHE.this;
                sb.append(yshe2.o0n <= yshe2.oo0 ? "2" : "1");
                yshe.o(sb.toString(), 0L);
            }
        }
    }

    public static final class IL1lI11I implements Runnable {
        private final String m;
        private final String n;
        private final List<o> o;

        public IL1lI11I(List<o> list, String str, String str2) {
            this.o = list;
            this.m = str;
            this.n = str2;
        }

        @Override
        public final void run() {
            try {
                List<o> list = this.o;
                if (list == null || list.size() <= 0) {
                    return;
                }
                for (o oVar : this.o) {
                    if (oVar != null && oVar.nm() != null) {
                        com.thinkup.expressad.foundation.o0.o0 nm = oVar.nm();
                        String str = nm.noo() + nm.on00() + nm.mnm();
                        nn n = com.thinkup.expressad.videocommon.m.n.o().n(this.m);
                        if (n != null) {
                            try {
                                n.m(str);
                            } catch (Exception unused) {
                            }
                        }
                        if (nm.mm0() != null) {
                            if (!TextUtils.isEmpty(nm.mm0().oo())) {
                                com.thinkup.expressad.videocommon.o.m(this.m + "_" + nm.on00() + "_" + this.n + "_" + nm.mm0().oo());
                                com.thinkup.expressad.videocommon.o.m(nm.om0(), nm);
                            }
                            if (!TextUtils.isEmpty(nm.o0m0())) {
                                com.thinkup.expressad.videocommon.o.m(this.m + "_" + this.n + "_" + nm.o0m0());
                            }
                        }
                    }
                }
            } catch (Exception e) {
                e.getMessage();
            }
        }
    }

    public class ILIlil1Lii implements com.thinkup.expressad.video.o.o {
        public ILIlil1Lii() {
        }

        @Override
        public final void o(boolean z) {
            if (z) {
                YSHE.this.m00 = 1;
            } else {
                YSHE.this.m00 = 2;
            }
            YSHE.this.on();
        }
    }

    public class Ii1ILILlilI extends BroadcastReceiver {
        public Ii1ILILlilI() {
        }

        @Override
        public final void onReceive(Context context, Intent intent) {
            YSHE.this.finish();
        }
    }

    public class iL1LiI1iii implements com.thinkup.expressad.foundation.om.o {
        public iL1LiI1iii() {
        }

        @Override
        public final void m() {
            YSHE.this.onResume();
        }

        @Override
        public final void n() {
            YSHE.this.onResume();
        }

        @Override
        public final void o() {
            YSHE.this.onPause();
        }
    }

    public class ilLiIi111I1ll implements com.thinkup.expressad.video.dynview.om.o {
        public ilLiIi111I1ll() {
        }

        @Override
        public final void o(Map<String, Object> map) {
            if (map.containsKey(CampaignEx.JSON_NATIVE_VIDEO_MUTE)) {
                YSHE.this.onn = ((Integer) map.get(CampaignEx.JSON_NATIVE_VIDEO_MUTE)).intValue();
            }
            if (map.containsKey("position")) {
                int intValue = ((Integer) map.get("position")).intValue();
                if (YSHE.this.mnn == null || YSHE.this.mnn.size() <= 0 || intValue <= 0) {
                    return;
                }
                YSHE yshe = YSHE.this;
                yshe.mno = (com.thinkup.expressad.foundation.o0.o0) yshe.mnn.get(intValue);
                YSHE.m(YSHE.this);
                int i = intValue - 1;
                if (YSHE.this.mnn.get(i) != null) {
                    YSHE yshe2 = YSHE.this;
                    YSHE.m(yshe2, ((com.thinkup.expressad.foundation.o0.o0) yshe2.mnn.get(i)).onmo());
                }
                YSHE yshe3 = YSHE.this;
                YSHE.this.mno.o0(yshe3.o(yshe3.mno.mo(), YSHE.this.non));
                YSHE.this.mno.o(YSHE.this.non);
                YSHE.this.mno.m(1);
                YSHE yshe4 = YSHE.this;
                yshe4.m(yshe4.mno);
            }
        }
    }

    public static int m(YSHE yshe) {
        int i = yshe.non;
        yshe.non = i + 1;
        return i;
    }

    public static boolean om(YSHE yshe) {
        yshe.mom = true;
        return true;
    }

    @Override
    public void finish() {
        int o2 = mn.o(this, "thinkup_reward_activity_close", "anim");
        int o3 = mn.o(this, "thinkup_reward_activity_stay", "anim");
        if (o2 > 1 && o3 > 1) {
            overridePendingTransition(o3, o2);
        }
        TUTempContainer tUTempContainer = this.n00;
        if (tUTempContainer != null) {
            tUTempContainer.onDestroy();
            this.n00 = null;
        }
        TUBTContainer tUBTContainer = this.n0o;
        if (tUBTContainer != null) {
            tUBTContainer.onDestroy();
            this.n0o = null;
        }
        com.thinkup.expressad.foundation.om.m.o().n(this.omn + "_1");
        com.thinkup.expressad.foundation.om.m.o().n(this.omn + "_2");
        super.finish();
    }

    @Override
    public void onBackPressed() {
        super.onBackPressed();
        TUTempContainer tUTempContainer = this.n00;
        if (tUTempContainer != null) {
            tUTempContainer.onBackPressed();
        }
        TUBTContainer tUBTContainer = this.n0o;
        if (tUBTContainer != null) {
            tUBTContainer.onBackPressed();
        }
    }

    @Override
    public void onConfigurationChanged(Configuration configuration) {
        super.onConfigurationChanged(configuration);
        if (this.n00 != null) {
            o(configuration.orientation);
            this.n00.onConfigurationChanged(configuration);
        }
        TUBTContainer tUBTContainer = this.n0o;
        if (tUBTContainer != null) {
            tUBTContainer.onConfigurationChanged(configuration);
        }
    }

    @Override
    public void onCreate(Bundle bundle) {
        CopyOnWriteArrayList o2;
        List<o> list;
        String str = "";
        try {
            super.onCreate(bundle);
            com.thinkup.expressad.m.omo = true;
            com.thinkup.expressad.foundation.m.m.n().m(this);
            Intent intent = getIntent();
            String stringExtra = intent.getStringExtra(o);
            this.omn = stringExtra;
            if (stringExtra != null) {
                try {
                    o2 = com.thinkup.expressad.videocommon.m.n.o().o(this.omn);
                } catch (Throwable unused) {
                }
            } else {
                o2 = null;
            }
            this.o0o = o2 != null ? (com.thinkup.expressad.foundation.o0.o0) o2.get(0) : null;
            Serializable serializableExtra = intent.getSerializableExtra(no);
            this.o00 = serializableExtra instanceof o0o ? (o0o) serializableExtra : null;
            o("1", 0L);
            this.mm0 = (m0) com.thinkup.expressad.reward.m.o.no.get(this.omn);
            this.on0 = intent.getStringExtra(com.thinkup.expressad.m.omm);
            this.onm = n.m(intent.getStringExtra(n));
            this.ono = intent.getStringExtra(m);
            this.onn = intent.getIntExtra(o0, 2);
            this.m0o = intent.getBooleanExtra(oo, false);
            this.m0m = intent.getBooleanExtra(om, false);
            this.noo = intent.getStringExtra(n0);
            if (this.m0o) {
                this.m0n = intent.getIntExtra(mo, 0);
                this.mo0 = intent.getIntExtra(mm, 0);
                this.moo = intent.getIntExtra(mn, 0);
            }
            this.mom = intent.getBooleanExtra(on, false);
            this.mnm = com.thinkup.expressad.videocommon.m.n.o().m(this.omn);
            this.mnn = com.thinkup.expressad.videocommon.m.n.o().o(this.omn);
            int o3 = mn.o(getApplicationContext(), "thinkup_more_offer_activity", TtmlNode.TAG_LAYOUT);
            if (o3 < 0) {
                m("no thinkup_more_offer_activity layout");
                return;
            }
            setContentView(o3);
            if (TextUtils.isEmpty(this.omn)) {
                m("data empty error");
                return;
            }
            com.thinkup.expressad.video.signal.factory.m mVar = new com.thinkup.expressad.video.signal.factory.m(this);
            this.omo = mVar;
            o((IJSFactory) mVar);
            if (this.mm0 == null) {
                m("showRewardListener is null");
                return;
            }
            o0 o4 = oo.o().o(this.on0, this.omn);
            this.mmo = o4;
            if (o4 == null) {
                o0 o5 = com.thinkup.expressad.videocommon.oo.n.o().o(com.thinkup.expressad.foundation.m.m.n().om(), this.omn);
                this.mmo = o5;
                if (o5 == null) {
                    this.mmo = com.thinkup.expressad.videocommon.oo.n.o().o(com.thinkup.expressad.foundation.m.m.n().om(), this.omn, this.m0o);
                }
            }
            o0 o0Var = this.mmo;
            if (o0Var != null) {
                this.onm.o(o0Var.no());
                this.onm.o(this.mmo.nm());
            }
            n nVar = this.onm;
            if (nVar != null && nVar.m() <= 0) {
                this.onm.o(1);
            }
            int o6 = mn.o(this, "thinkup_reward_activity_open", "anim");
            int o7 = mn.o(this, "thinkup_reward_activity_stay", "anim");
            if (o6 > 1 && o7 > 1) {
                overridePendingTransition(o6, o7);
            }
            if (bundle != null) {
                try {
                    this.mmn = bundle.getBoolean(m0);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
            if (this.oon != null) {
                IntentFilter intentFilter = new IntentFilter();
                String str2 = nn;
                if (this.o00 != null) {
                    str2 = nn + this.o00.o0;
                }
                intentFilter.addAction(str2);
                no.o(this).o(this.oon, intentFilter);
            }
            if (!this.mom) {
                List<o> list2 = this.mnm;
                if (list2 != null && list2.size() > 0) {
                    this.mn0 = this.mnm.get(0);
                }
                o oVar = this.mn0;
                if (oVar != null) {
                    this.mno = oVar.nm();
                    this.mn0.o(true);
                    this.mn0.m(false);
                }
                if (this.mn0 == null || this.mno == null || this.onm == null) {
                    m("data empty error");
                }
                m();
                return;
            }
            this.no0 = "";
            List<com.thinkup.expressad.foundation.o0.o0> list3 = this.mnn;
            if (list3 != null && list3.size() > 0) {
                com.thinkup.expressad.foundation.o0.o0 o0Var2 = this.mnn.get(0);
                str = o0Var2.o0m0();
                this.no0 = o0Var2.noo();
            }
            o.o o8 = com.thinkup.expressad.videocommon.o.o(this.omn + "_" + this.no0 + "_" + str);
            WindVaneWebView o9 = o8 != null ? o8.o() : null;
            this.n0m = o9;
            if (o9 != null) {
                n();
                return;
            }
            if (this.mn0 == null && (list = this.mnm) != null && list.size() > 0) {
                this.mn0 = this.mnm.get(0);
            }
            if (this.mn0 == null) {
                com.thinkup.expressad.videocommon.m.n o10 = com.thinkup.expressad.videocommon.m.n.o();
                int i = this.m0o ? 287 : 94;
                String str3 = this.omn;
                boolean z = this.m0m;
                nn n2 = o10.n(str3);
                this.mn0 = n2 != null ? n2.m(i, z) : null;
            }
            com.thinkup.expressad.videocommon.m.o oVar2 = this.mn0;
            if (oVar2 != null) {
                this.mno = oVar2.nm();
                this.mn0.o(true);
                this.mn0.m(false);
            }
            if (this.mn0 == null || this.mno == null || this.onm == null) {
                m("data empty error");
            }
            this.mom = false;
            com.thinkup.expressad.videocommon.o.o.o();
            List<com.thinkup.expressad.foundation.o0.o0> o11 = com.thinkup.expressad.videocommon.o.o.o(this.mnn);
            if (o11 == null) {
                m("no available campaign");
                return;
            }
            int size = o11.size();
            if (size == 0) {
                m("no available campaign");
                return;
            }
            if (o11.get(0) == null || !o11.get(0).mm()) {
                m();
                return;
            }
            if (size != 1) {
                o(o11);
                return;
            }
            com.thinkup.expressad.foundation.o0.o0 o0Var3 = o11.get(0);
            this.mno = o0Var3;
            if (o0Var3 != null) {
                o0Var3.no();
            }
            m(this.mno);
        } catch (Throwable th) {
            m("onCreate error".concat(String.valueOf(th)));
        }
    }

    @Override
    public void onDestroy() {
        try {
            super.onDestroy();
        } catch (Throwable unused) {
        }
        if (this.oon != null) {
            no.o(this).o(this.oon);
            this.oon = null;
        }
        try {
            com.thinkup.expressad.video.bt.module.m.n nVar = this.mm0;
            if (nVar instanceof com.thinkup.expressad.video.bt.module.m.n) {
                com.thinkup.expressad.video.bt.module.m.n nVar2 = nVar;
                if (!nVar2.m && !nVar2.n) {
                    nVar.o("show fail : unexpected destroy");
                }
            }
        } catch (Throwable th) {
            th.getMessage();
        }
        try {
            List<com.thinkup.expressad.foundation.o0.o0> list = this.mnn;
            if (list != null && list.size() > 0) {
                Iterator<com.thinkup.expressad.foundation.o0.o0> it = this.mnn.iterator();
                while (it.hasNext()) {
                    n(it.next());
                }
            }
            com.thinkup.expressad.foundation.o0.o0 o0Var = this.mno;
            if (o0Var != null) {
                n(o0Var);
            }
        } catch (Throwable th2) {
            th2.getMessage();
        }
        com.thinkup.expressad.video.module.m.o.o(this.omn);
        TUTempContainer tUTempContainer = this.n00;
        if (tUTempContainer != null) {
            tUTempContainer.onDestroy();
            this.n00 = null;
        }
        TUBTContainer tUBTContainer = this.n0o;
        if (tUBTContainer != null) {
            tUBTContainer.onDestroy();
            this.n0o = null;
        }
        this.nnn = null;
        this.o000 = null;
        com.thinkup.expressad.foundation.on.mo.o.o().execute(new IL1lI11I(this.mnm, this.omn, this.no0));
        List<com.thinkup.expressad.foundation.o0.o0> list2 = this.mnn;
        com.thinkup.expressad.foundation.o0.o0 o0Var2 = (list2 == null || list2.size() <= 0) ? null : this.mnn.get(0);
        if (o0Var2 == null) {
            o0Var2 = this.mno;
        }
        if (o0Var2 != null && !TextUtils.isEmpty(o0Var2.mnm())) {
            com.thinkup.core.common.o.nn.o().m();
        }
        this.ooo = null;
        this.oom = null;
        if (this.o00 != null) {
            com.thinkup.core.common.o0n.o.o().o(this.o00.o0 + this.o00.n);
        }
        com.thinkup.basead.o.o oVar = this.nmo;
        if (oVar != null) {
            oVar.m();
            this.nmo = null;
        }
    }

    @Override
    public void onPause() {
        super.onPause();
        long j = this.oo0 + 1;
        this.oo0 = j;
        if (j <= 5) {
            StringBuilder sb = new StringBuilder("3-");
            m mVar = this.ooo;
            sb.append(mVar != null ? mVar.o() : "0");
            o(sb.toString(), SystemClock.elapsedRealtime() - this.o0m);
        }
        TUTempContainer tUTempContainer = this.n00;
        if (tUTempContainer != null) {
            tUTempContainer.onPause();
        }
        TUBTContainer tUBTContainer = this.n0o;
        if (tUBTContainer != null) {
            tUBTContainer.onPause();
        }
    }

    @Override
    public void onRestart() {
        super.onRestart();
        TUTempContainer tUTempContainer = this.n00;
        if (tUTempContainer != null) {
            tUTempContainer.onRestart();
        }
        TUBTContainer tUBTContainer = this.n0o;
        if (tUBTContainer != null) {
            tUBTContainer.onRestart();
        }
    }

    @Override
    public void onResume() {
        TUVideoView tUVideoView;
        super.onResume();
        this.o0m = SystemClock.elapsedRealtime();
        long j = this.o0n + 1;
        this.o0n = j;
        if (j <= 5) {
            StringBuilder sb = new StringBuilder("2-");
            m mVar = this.ooo;
            sb.append(mVar != null ? mVar.o() : "0");
            o(sb.toString(), 0L);
        }
        if (com.thinkup.expressad.foundation.om.m.n) {
            TUTempContainer tUTempContainer = this.n00;
            if (tUTempContainer == null || (tUVideoView = tUTempContainer.mbridgeVideoView) == null) {
                return;
            }
            tUVideoView.setCover(false);
            return;
        }
        com.thinkup.expressad.foundation.m.m.n().m(this);
        TUTempContainer tUTempContainer2 = this.n00;
        if (tUTempContainer2 != null) {
            tUTempContainer2.onResume();
        }
        TUBTContainer tUBTContainer = this.n0o;
        if (tUBTContainer != null) {
            tUBTContainer.onResume();
        }
        on();
    }

    @Override
    public void onSaveInstanceState(Bundle bundle) {
        bundle.putBoolean(m0, this.mmn);
        super.onSaveInstanceState(bundle);
    }

    @Override
    public void onStart() {
        super.onStart();
        new iL1LiI1iii();
        if (com.thinkup.expressad.foundation.om.m.n) {
            return;
        }
        TUTempContainer tUTempContainer = this.n00;
        if (tUTempContainer != null) {
            tUTempContainer.onStart();
            this.mno.n0(this.omn);
            com.thinkup.expressad.foundation.om.m.o().o(this.omn + "_1", this.mno);
        }
        TUBTContainer tUBTContainer = this.n0o;
        if (tUBTContainer != null) {
            tUBTContainer.onStart();
            List<com.thinkup.expressad.foundation.o0.o0> list = this.mnn;
            if (list != null && list.size() > 0) {
                com.thinkup.expressad.foundation.o0.o0 o0Var = this.mnn.get(0);
                o0Var.n0(this.omn);
                com.thinkup.expressad.foundation.om.m.o().o(this.omn + "_1", o0Var);
            }
        }
        if (this.nom) {
            return;
        }
        com.thinkup.expressad.foundation.om.m.o().m(this.omn + "_1", 1);
        com.thinkup.expressad.foundation.om.m.o().n(this.omn + "_2");
        this.nom = true;
    }

    @Override
    public void onStop() {
        com.thinkup.expressad.m.omo = false;
        try {
            try {
                super.onStop();
            } catch (Throwable unused) {
                finish();
            }
        } catch (Throwable unused2) {
        }
        TUTempContainer tUTempContainer = this.n00;
        if (tUTempContainer != null) {
            tUTempContainer.onStop();
        }
        TUBTContainer tUBTContainer = this.n0o;
        if (tUBTContainer != null) {
            tUBTContainer.onStop();
        }
    }

    @Override
    public void setTheme(int i) {
        super.setTheme(mn.o(this, "thinkup_transparent_theme", TtmlNode.TAG_STYLE));
    }

    public class il1IililIi implements com.thinkup.expressad.video.bt.module.o.o {
        public il1IililIi() {
        }

        @Override
        public final void m() {
            if (YSHE.this.mm0 != null) {
                YSHE.this.mm0.m();
            }
        }

        @Override
        public final void n() {
            if (YSHE.this.mm0 != null) {
                YSHE.this.mm0.n();
            }
        }

        @Override
        public final void o() {
            if (YSHE.this.mm0 != null) {
                YSHE.this.mm0.o();
            }
        }

        @Override
        public final void o(boolean z, n nVar) {
            if (YSHE.this.mm0 != null) {
                YSHE.this.mm0.o(z, nVar);
            }
        }

        @Override
        public final void o(boolean z, int i) {
            if (YSHE.this.mm0 != null) {
                YSHE.this.mm0.o(z, i);
            }
        }

        @Override
        public final void o(String str) {
            if (YSHE.this.mm0 != null) {
                YSHE.this.mm0.o(str);
            }
        }

        @Override
        public final void o(com.thinkup.expressad.foundation.o0.o0 o0Var) {
            if (YSHE.this.mm0 != null) {
                YSHE.this.mm0.o(o0Var);
            }
        }
    }

    public static int m(YSHE yshe, int i) {
        int i2 = yshe.nm0 - i;
        yshe.nm0 = i2;
        return i2;
    }

    private void m0() {
        if (mm()) {
            if (this.nmo == null) {
                com.thinkup.basead.o.o oVar = new com.thinkup.basead.o.o();
                this.nmo = oVar;
                oVar.o(this);
            }
            this.nmo.o();
        }
    }

    private boolean mm() {
        com.thinkup.expressad.foundation.o0.o0 o0Var = this.o0o;
        return (o0Var == null || TextUtils.isEmpty(o0Var.mnm())) ? false : true;
    }

    private void mn() {
        if (this.oon != null) {
            IntentFilter intentFilter = new IntentFilter();
            String str = nn;
            if (this.o00 != null) {
                str = nn + this.o00.o0;
            }
            intentFilter.addAction(str);
            no.o(this).o(this.oon, intentFilter);
        }
    }

    private void mo() {
        com.thinkup.basead.o.o oVar = this.nmo;
        if (oVar != null) {
            oVar.m();
            this.nmo = null;
        }
    }

    private void n0() {
        if (this.oon != null) {
            no.o(this).o(this.oon);
            this.oon = null;
        }
    }

    private com.thinkup.expressad.video.bt.module.o.o o0() {
        if (this.n0n == null) {
            this.n0n = new il1IililIi();
        }
        return this.n0n;
    }

    private void om() {
        try {
            List<com.thinkup.expressad.foundation.o0.o0> list = this.mnn;
            if (list != null && list.size() > 0) {
                Iterator<com.thinkup.expressad.foundation.o0.o0> it = this.mnn.iterator();
                while (it.hasNext()) {
                    n(it.next());
                }
            }
            com.thinkup.expressad.foundation.o0.o0 o0Var = this.mno;
            if (o0Var != null) {
                n(o0Var);
            }
        } catch (Throwable th) {
            th.getMessage();
        }
    }

    public void on() {
        if (this.m00 == 2) {
            m0();
        }
    }

    private void oo() {
        try {
            com.thinkup.expressad.video.bt.module.m.n nVar = this.mm0;
            if (nVar instanceof com.thinkup.expressad.video.bt.module.m.n) {
                com.thinkup.expressad.video.bt.module.m.n nVar2 = nVar;
                if (nVar2.m || nVar2.n) {
                    return;
                }
                nVar.o("show fail : unexpected destroy");
            }
        } catch (Throwable th) {
            th.getMessage();
        }
    }

    private void n() {
        o0m o0mVar;
        int n2 = n("thinkup_bt_container");
        if (n2 < 0) {
            m("no thinkup_webview_framelayout in thinkup_more_offer_activity layout");
        }
        TUBTContainer findViewById = findViewById(n2);
        this.n0o = findViewById;
        if (findViewById == null) {
            m("env error");
        }
        this.n0o.setVisibility(0);
        com.thinkup.expressad.video.bt.module.o.o o02 = o0();
        this.n0n = o02;
        this.n0o.setBTContainerCallback(o02);
        this.n0o.setShowRewardVideoListener(this.mm0);
        this.n0o.setChoiceOneCallback(this.o000);
        this.n0o.setSoundListener(this.oom);
        this.n0o.setCampaigns(this.mnn);
        this.n0o.setCampaignDownLoadTasks(this.mnm);
        this.n0o.setRewardUnitSetting(this.mmo);
        this.n0o.setUnitId(this.omn);
        this.n0o.setPlacementId(this.on0);
        this.n0o.setUserId(this.ono);
        this.n0o.setActivity(this);
        this.n0o.setDeveloperExtraData(this.noo);
        com.thinkup.expressad.foundation.o0.o0 o0Var = this.mno;
        if (((o0Var != null && (o0mVar = o0Var.om0o) != null) || (this.mnn.get(0) != null && (o0mVar = this.mnn.get(0).om0o) != null)) && !TextUtils.isEmpty(o0mVar.m()) && o0mVar.o() > 0) {
            n nVar = new n(o0mVar.m(), o0mVar.o());
            if (nVar.m() < 0) {
                nVar.o(1);
            }
            this.onm = nVar;
        }
        this.n0o.setReward(this.onm);
        this.n0o.setIVRewardEnable(this.m0n, this.mo0, this.moo);
        this.n0o.setIV(this.m0o);
        this.n0o.setMute(this.onn);
        this.n0o.setJSFactory(this.omo);
        this.n0o.init(this);
        this.n0o.onCreate();
        this.m00 = this.onn;
    }

    public void m(com.thinkup.expressad.foundation.o0.o0 o0Var) {
        com.thinkup.expressad.foundation.o0.o0 nm2;
        try {
            List<com.thinkup.expressad.videocommon.m.o> list = this.mnm;
            if (list != null && list.size() > 0) {
                for (com.thinkup.expressad.videocommon.m.o oVar : this.mnm) {
                    if (oVar != null && (nm2 = oVar.nm()) != null && TextUtils.equals(nm2.on00(), o0Var.on00()) && TextUtils.equals(nm2.noo(), o0Var.noo())) {
                        this.mn0 = oVar;
                    }
                }
            }
            this.mom = true;
            m();
            TUTempContainer tUTempContainer = this.n00;
            if (tUTempContainer != null) {
                tUTempContainer.setNotchPadding(this.nnm, this.nmm, this.nn0, this.nmn, this.nno);
            }
        } catch (Exception e) {
            e.getMessage();
            m("more offer to one offer exception");
        }
    }

    private int o0(String str) {
        return mn.o(getApplicationContext(), str, TtmlNode.TAG_LAYOUT);
    }

    public class I11lllll1ILI1 implements com.thinkup.expressad.video.dynview.om.o0 {
        public I11lllll1ILI1() {
        }

        @Override
        public final void o(com.thinkup.expressad.foundation.o0.o0 o0Var) {
            if (o0Var == null) {
                YSHE.this.m("campaign is null");
                return;
            }
            if (YSHE.this.n0o != null) {
                new com.thinkup.expressad.video.dynview.m0.m().o0(YSHE.this.n0o);
            }
            YSHE.this.mno = o0Var;
            YSHE.this.mno.m(2);
            YSHE yshe = YSHE.this;
            yshe.m(yshe.mno);
        }

        @Override
        public final void o() {
            if (YSHE.this.n0o != null) {
                new com.thinkup.expressad.video.dynview.m0.m().o0(YSHE.this.n0o);
            }
            YSHE.om(YSHE.this);
            YSHE.this.m();
            if (YSHE.this.n00 != null) {
                YSHE.this.n00.setNotchPadding(YSHE.this.nnm, YSHE.this.nmm, YSHE.this.nn0, YSHE.this.nmn, YSHE.this.nno);
            }
        }
    }

    private void o(List<com.thinkup.expressad.foundation.o0.o0> list) {
        if (list == null) {
            m("no available campaign");
            return;
        }
        if (list.size() == 0) {
            m("no available campaign");
            return;
        }
        if ((list.get(0) != null ? list.get(0).mn() : 0) != 5) {
            n();
            return;
        }
        for (com.thinkup.expressad.foundation.o0.o0 o0Var : list) {
            if (o0Var != null) {
                this.nm0 += o0Var.onmo();
            }
        }
        com.thinkup.expressad.foundation.o0.o0 o0Var2 = list.get(0);
        if (o0Var2 != null) {
            int o2 = o(o0Var2.mo(), this.non);
            this.mno = o0Var2;
            o0Var2.no();
            this.non = 1;
            this.mno.o0(o2);
            this.mno.o(this.non);
            this.mno.m(1);
            m(this.mno);
            return;
        }
        m("campaign is less");
    }

    public void m(String str) {
        m0 m0Var = this.mm0;
        if (m0Var != null) {
            m0Var.o(str);
        }
        finish();
    }

    public void m() {
        List<com.thinkup.expressad.foundation.o0.o0> list;
        o0m o0mVar;
        List<com.thinkup.expressad.foundation.o0.o0> list2;
        int n2 = n("thinkup_temp_container");
        if (n2 < 0) {
            m("no id thinkup_bt_container in thinkup_more_offer_activity layout");
        }
        TUTempContainer findViewById = findViewById(n2);
        this.n00 = findViewById;
        if (findViewById == null) {
            m("env error");
        }
        List<com.thinkup.expressad.foundation.o0.o0> list3 = this.mnn;
        if (list3 != null && list3.size() > 0 && this.mnn.get(0).mm()) {
            new com.thinkup.expressad.video.dynview.m0.m();
            com.thinkup.expressad.video.dynview.m0.m.oo(this.n00);
        } else {
            this.n00.setVisibility(0);
        }
        o(-1);
        this.n00.setVisibility(0);
        this.n00.setActivity(this);
        this.n00.setBidCampaign(this.m0m);
        this.n00.setBigOffer(this.mom);
        this.n00.setUnitId(this.omn);
        this.n00.setCampaign(this.mno);
        if (this.mno.mn() == 5 && (list2 = this.mnn) != null && list2.size() > 1) {
            View findViewById2 = findViewById(n("thinkup_reward_root_container"));
            if (findViewById2 != null) {
                findViewById2.setBackgroundColor(-16777216);
            }
            this.n00.removeAllViews();
            this.n00.setCampOrderViewData(this.mnn, this.nm0);
            this.n00.setCamPlayOrderCallback(this.nnn, this.non);
        }
        this.n00.setCampaignDownLoadTask(this.mn0);
        this.n00.setIV(this.m0o);
        com.thinkup.expressad.foundation.o0.o0 o0Var = this.mno;
        if (o0Var != null && o0Var.oo() == 2) {
            this.n00.setIVRewardEnable(0, 0, 0);
        } else {
            this.n00.setIVRewardEnable(this.m0n, this.mo0, this.moo);
        }
        this.n00.setMute(this.onn);
        this.n00.setDeveloperExtraData(this.noo);
        com.thinkup.expressad.foundation.o0.o0 o0Var2 = this.mno;
        if (((o0Var2 != null && (o0mVar = o0Var2.om0o) != null) || ((list = this.mnn) != null && list.size() > 0 && this.mnn.get(0) != null && (o0mVar = this.mnn.get(0).om0o) != null)) && !TextUtils.isEmpty(o0mVar.m()) && o0mVar.o() > 0) {
            n nVar = new n(o0mVar.m(), o0mVar.o());
            if (nVar.m() < 0) {
                nVar.o(1);
            }
            this.onm = nVar;
        }
        this.n00.setReward(this.onm);
        this.n00.setRewardUnitSetting(this.mmo);
        this.n00.setPlacementId(this.on0);
        this.n00.setUserId(this.ono);
        this.n00.setShowRewardListener(this.mm0);
        this.n00.setTempEventListener(this.ooo);
        this.n00.setSoundListener(this.oom);
        this.n00.init(this);
        this.n00.onCreate();
        this.m00 = this.onn;
    }

    private void o(com.thinkup.expressad.foundation.o0.o0 o0Var) {
        if (o0Var != null) {
            int o2 = o(o0Var.mo(), this.non);
            this.mno = o0Var;
            o0Var.no();
            this.non = 1;
            this.mno.o0(o2);
            this.mno.o(this.non);
            this.mno.m(1);
            m(this.mno);
            return;
        }
        m("campaign is less");
    }

    private static WindVaneWebView o(String str) {
        o.o o2 = com.thinkup.expressad.videocommon.o.o(str);
        if (o2 != null) {
            return o2.o();
        }
        return null;
    }

    public int o(int i, int i2) {
        List<com.thinkup.expressad.foundation.o0.o0> list = this.mnn;
        if (list == null || list.size() == 0) {
            return i;
        }
        int i3 = 0;
        int i4 = 0;
        for (int i5 = 0; i5 < this.mnn.size(); i5++) {
            if (this.mnn.get(0) != null) {
                if (i5 == 0) {
                    i4 = this.mnn.get(0).mo();
                }
                i3 += this.mnn.get(i5).onmo();
            }
        }
        if (i2 == 1) {
            if (i == 0) {
                if (i3 >= 45) {
                    return 45;
                }
            } else if (i3 > i) {
                if (i > 45) {
                    return 45;
                }
                return i;
            }
            return i3;
        }
        int i6 = 0;
        for (int i7 = 0; i7 < i2 - 1; i7++) {
            if (this.mnn.get(i7) != null) {
                i6 += this.mnn.get(i7).onmo();
            }
        }
        if (i4 > i6) {
            return i4 - i6;
        }
        return 0;
    }

    private int n(String str) {
        return mn.o(getApplicationContext(), str, "id");
    }

    private static void n(com.thinkup.expressad.foundation.o0.o0 o0Var) {
        if (o0Var != null) {
            if (!TextUtils.isEmpty(o0Var.onoo())) {
                com.thinkup.expressad.foundation.on.o0.m.o(o0n.m().on()).n(o0Var.onoo());
            }
            if (TextUtils.isEmpty(o0Var.ono0())) {
                return;
            }
            com.thinkup.expressad.foundation.on.o0.m.o(o0n.m().on()).n(o0Var.ono0());
        }
    }

    @Override
    public final void o(int i, int i2, int i3, int i4, int i5) {
        this.nmm = i2;
        this.nn0 = i3;
        this.nmn = i4;
        this.nno = i5;
        this.nnm = i;
        TUTempContainer tUTempContainer = this.n00;
        if (tUTempContainer != null) {
            tUTempContainer.setNotchPadding(i, i2, i3, i4, i5);
        }
        TUBTContainer tUBTContainer = this.n0o;
        if (tUBTContainer != null) {
            tUBTContainer.setNotchPadding(i, i2, i3, i4, i5);
        }
        com.thinkup.expressad.video.dynview.o.m.oo = i;
        com.thinkup.expressad.video.dynview.o.m.o = i2;
        com.thinkup.expressad.video.dynview.o.m.m = i3;
        com.thinkup.expressad.video.dynview.o.m.n = i4;
        com.thinkup.expressad.video.dynview.o.m.o0 = i5;
    }

    private void o(int i) {
        int oo2;
        int om2;
        int om3;
        float f;
        try {
            com.thinkup.expressad.foundation.o0.o0 o0Var = this.mno;
            if (o0Var == null || o0Var.oo() != 2) {
                return;
            }
            getWindow().getDecorView().setBackgroundColor(-1728053248);
            FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) this.n00.getLayoutParams();
            layoutParams.gravity = 17;
            if (this.mno.mm0().n() == 0) {
                if (i == 2) {
                    oo2 = (int) (oom.oo(this) * 0.6f);
                    om3 = oom.om(this);
                    f = om3 * 0.6f;
                } else {
                    oo2 = (int) (oom.oo(this) * 0.6f);
                    om2 = oom.om(this);
                    f = om2 * 0.7f;
                }
            } else if (this.mno.mm0().n() == 2) {
                oo2 = (int) (oom.oo(this) * 0.6f);
                om3 = oom.om(this);
                f = om3 * 0.6f;
            } else {
                oo2 = (int) (oom.oo(this) * 0.6f);
                om2 = oom.om(this);
                f = om2 * 0.7f;
            }
            int i2 = (int) f;
            layoutParams.height = oo2;
            layoutParams.width = i2;
            this.n00.setLayoutParams(layoutParams);
        } catch (Throwable th) {
            th.getMessage();
        }
    }

    public void o(String str, long j) {
        String str2;
        String str3;
        try {
            o0o o0oVar = this.o00;
            String str4 = o0oVar != null ? o0oVar.n : "";
            if (o0oVar != null) {
                StringBuilder sb = new StringBuilder();
                sb.append(this.o00.mm);
                str2 = sb.toString();
            } else {
                str2 = "";
            }
            if (this.o00 != null) {
                StringBuilder sb2 = new StringBuilder();
                sb2.append(this.o00.om);
                str3 = sb2.toString();
            } else {
                str3 = "";
            }
            com.thinkup.expressad.foundation.o0.o0 o0Var = this.o0o;
            String on00 = o0Var != null ? o0Var.on00() : "";
            com.thinkup.expressad.foundation.o0.o0 o0Var2 = this.o0o;
            com.thinkup.core.common.o0n.oo.o(str, o0oVar, str4, str2, str3, 2, 1, on00, "20", !TextUtils.isEmpty(o0Var2 != null ? o0Var2.mnm() : ""), j);
        } catch (Throwable unused) {
        }
    }
}