package com.bytedance.sdk.openadsdk.activity.single;

import android.R;
import android.annotation.SuppressLint;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.SystemClock;
import android.text.TextUtils;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.DownloadListener;
import android.webkit.WebResourceResponse;
import android.webkit.WebView;
import android.widget.Button;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.Nullable;
import com.bykv.vk.openvk.preload.falconx.loader.ILoader;
import com.bykv.vk.openvk.preload.geckox.model.WebResourceResponseModel;
import com.bytedance.sdk.component.adexpress.dynamic.dynamicview.b;
import com.bytedance.sdk.component.ef.wsy;
import com.bytedance.sdk.component.utils.gzf;
import com.bytedance.sdk.component.utils.maa;
import com.bytedance.sdk.openadsdk.ApmHelper;
import com.bytedance.sdk.openadsdk.BuildConfig;
import com.bytedance.sdk.openadsdk.FilterWord;
import com.bytedance.sdk.openadsdk.common.TTAdDislikeToast;
import com.bytedance.sdk.openadsdk.common.duv;
import com.bytedance.sdk.openadsdk.common.fhx;
import com.bytedance.sdk.openadsdk.common.qhl;
import com.bytedance.sdk.openadsdk.common.sds;
import com.bytedance.sdk.openadsdk.common.vt;
import com.bytedance.sdk.openadsdk.core.ai;
import com.bytedance.sdk.openadsdk.core.gof;
import com.bytedance.sdk.openadsdk.core.hxv;
import com.bytedance.sdk.openadsdk.core.model.lse;
import com.bytedance.sdk.openadsdk.core.widget.fm.wsy;
import com.bytedance.sdk.openadsdk.utils.bx;
import com.bytedance.sdk.openadsdk.utils.ku;
import com.bytedance.sdk.openadsdk.utils.onz;
import com.bytedance.sdk.openadsdk.utils.sds;
import com.bytedance.sdk.openadsdk.utils.wey;
import com.bytedance.sdk.openadsdk.utils.xgn;
import com.bytedance.sdk.openadsdk.utils.zan;
import com.bytedance.sdk.openadsdk.yz.dsz;
import com.bytedance.sdk.openadsdk.yz.lb;
import java.lang.ref.WeakReference;
import java.util.Objects;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import org.json.JSONObject;

/* JADX INFO: loaded from: classes2.dex */
public class TTLandingPageActivity extends TTBaseLandingPageActivity {
    private com.bytedance.sdk.openadsdk.onz.yz bkb;
    private com.bytedance.sdk.openadsdk.core.ajl.ajl dsz;
    private Button duv;

    /* JADX INFO: renamed from: ef, reason: collision with root package name */
    private TextView f6753ef;
    private String fhx;
    dsz fm;

    /* JADX INFO: renamed from: gc, reason: collision with root package name */
    private com.bytedance.sdk.openadsdk.common.jnr f6754gc;
    private String gof;
    private lse gqi;
    private int gzf;

    /* JADX INFO: renamed from: ha, reason: collision with root package name */
    private wsy.fm f6755ha;
    private ILoader hlt;
    private hxv irt;
    private fhx ku;
    private com.bytedance.sdk.openadsdk.onz.fm kwx;

    /* JADX INFO: renamed from: lb, reason: collision with root package name */
    TTAdDislikeToast f6757lb;
    private String lse;
    private ImageView lz;
    private boolean mon;
    private int mq;

    /* JADX INFO: renamed from: ne, reason: collision with root package name */
    private com.bytedance.sdk.openadsdk.onz.fm.fm f6758ne;
    private duv ol;
    private String onz;

    /* JADX INFO: renamed from: qf, reason: collision with root package name */
    private com.bytedance.sdk.openadsdk.common.dsz f6759qf;
    private int qhl;
    qhl ro;
    private String sds;
    private boolean si;
    private ImageView tzk;
    private Context vt;
    private onz wbw;
    private com.bytedance.sdk.openadsdk.sds.fm.fm.lb wey;
    private com.bytedance.sdk.component.ef.wsy wsy;
    private ImageView wu;
    private com.bytedance.sdk.openadsdk.core.widget.fm.ajl xgn;
    private ImageView zan;
    private final AtomicBoolean maa = new AtomicBoolean(true);
    private final AtomicInteger hi = new AtomicInteger(0);
    private final AtomicInteger nt = new AtomicInteger(0);
    private final AtomicInteger ai = new AtomicInteger(0);
    final AtomicBoolean yz = new AtomicBoolean(false);
    final AtomicBoolean jnr = new AtomicBoolean(false);
    private boolean bx = false;

    /* JADX INFO: renamed from: ib, reason: collision with root package name */
    private long f6756ib = 0;
    int ajl = -1;
    private String lmk = "DOWNLOAD";

    public static class fm implements com.bytedance.sdk.openadsdk.yz.duv {
        private final int fm;

        /* JADX INFO: renamed from: lb, reason: collision with root package name */
        private final String f6761lb;
        private final lse ro;
        private final WeakReference<TTLandingPageActivity> yz;

        public fm(int i10, lse lseVar, String str, TTLandingPageActivity tTLandingPageActivity) {
            this.fm = i10;
            this.ro = lseVar;
            this.f6761lb = str;
            this.yz = new WeakReference<>(tTLandingPageActivity);
        }

        @Override // com.bytedance.sdk.openadsdk.yz.duv
        public void fm(int i10) {
            TTLandingPageActivity tTLandingPageActivity = this.yz.get();
            if (tTLandingPageActivity != null) {
                lb.fm.fm(this.fm, tTLandingPageActivity.nt.get(), tTLandingPageActivity.ai.get(), tTLandingPageActivity.hi.get() - tTLandingPageActivity.ai.get(), this.ro, this.f6761lb, i10);
            }
        }
    }

    public static class lb implements View.OnTouchListener {
        private final WeakReference<dsz> fm;
        private final WeakReference<com.bytedance.sdk.openadsdk.common.jnr> ro;

        public lb(dsz dszVar, com.bytedance.sdk.openadsdk.common.jnr jnrVar) {
            this.fm = new WeakReference<>(dszVar);
            this.ro = new WeakReference<>(jnrVar);
        }

        @Override // android.view.View.OnTouchListener
        @SuppressLint({"ClickableViewAccessibility"})
        public boolean onTouch(View view, MotionEvent motionEvent) {
            dsz dszVar = this.fm.get();
            if (dszVar != null) {
                dszVar.fm(motionEvent);
            }
            com.bytedance.sdk.openadsdk.common.jnr jnrVar = this.ro.get();
            if (jnrVar == null) {
                return false;
            }
            jnrVar.fm(motionEvent);
            return false;
        }
    }

    public static class ro implements View.OnScrollChangeListener {
        private final WeakReference<dsz> fm;

        public ro(dsz dszVar) {
            this.fm = new WeakReference<>(dszVar);
        }

        @Override // android.view.View.OnScrollChangeListener
        public void onScrollChange(View view, int i10, int i11, int i12, int i13) {
            dsz dszVar = this.fm.get();
            if (dszVar != null) {
                dszVar.ro(i11);
            }
        }
    }

    @Override // android.app.Activity
    public void onBackPressed() {
        wu();
    }

    @Override // android.app.Activity, android.content.ComponentCallbacks
    public void onConfigurationChanged(Configuration configuration) {
        try {
            super.onConfigurationChanged(configuration);
        } catch (Throwable unused) {
        }
        lb();
    }

    @Override // com.bytedance.sdk.openadsdk.activity.single.TTBaseActivity, android.app.Activity
    @SuppressLint({"ClickableViewAccessibility"})
    public void onCreate(@Nullable Bundle bundle) {
        super.onCreate(bundle);
        if (!com.bytedance.sdk.openadsdk.core.fhx.jnr()) {
            finish();
            return;
        }
        try {
            gof.ro(this);
        } catch (Throwable unused) {
        }
        long jElapsedRealtime = SystemClock.elapsedRealtime();
        lse lseVarFm = ai.fm().fm(ai.fm(getIntent()));
        this.gqi = lseVarFm;
        if (lseVarFm != null) {
            this.mon = lseVarFm.onz();
            this.gqi.aws(0);
            if (com.bytedance.sdk.openadsdk.hlt.jnr.fm("lp_cache_enable", false)) {
                sds.fm(this.gqi);
            }
        }
        if (bundle != null) {
            try {
                int i10 = bundle.getInt("meta_index", -1);
                this.ajl = i10;
                if (i10 >= 0) {
                    this.gqi = ai.fm().fm(this.ajl);
                }
            } catch (Throwable unused2) {
            }
        }
        com.bytedance.sdk.openadsdk.onz.jnr.fm(this);
        this.sds = "";
        fm(4);
        lse lseVar = this.gqi;
        if (lseVar != null) {
            this.onz = lseVar.eo();
            this.fhx = this.gqi.gt();
            this.lse = this.gqi.kec();
            this.sds = this.gqi.ku();
            this.qhl = this.gqi.dsz();
            this.gof = this.gqi.duv();
        }
        try {
            setContentView(fm(this.sds));
            if (this.gqi == null) {
                finish();
                return;
            }
            if (com.bytedance.sdk.openadsdk.hlt.jnr.fm("lp_cache_enable", false)) {
                ro();
            }
            ajl();
            if (!TextUtils.isEmpty(this.lse)) {
                this.hlt = com.bytedance.sdk.openadsdk.wsy.ro.fm().ro();
                int iFm = com.bytedance.sdk.openadsdk.wsy.ro.fm().fm(this.hlt, this.lse);
                this.mq = iFm;
                this.gzf = iFm > 0 ? 2 : 0;
            }
            this.vt = this;
            if (this.wsy != null) {
                com.bytedance.sdk.openadsdk.core.widget.fm.yz.fm(this).fm(false).ro(false).fm(this.wsy.getWebView());
            }
            if (this.si) {
                this.f6759qf.fm(true);
            }
            com.bytedance.sdk.component.ef.wsy wsyVar = this.wsy;
            if (wsyVar != null && wsyVar.getWebView() != null) {
                dsz dszVarRo = new dsz(this.gqi, this.wsy.getWebView(), new fm(this.mq, this.gqi, "landingpage", this), this.gzf).ro(true);
                this.fm = dszVarRo;
                this.f6755ha = dszVarRo.fm;
                this.f6754gc = bx.fm(this.gqi, this.wsy, this.vt, this.gof);
                this.fm.jnr(this.bx);
                this.bkb = new com.bytedance.sdk.openadsdk.onz.yz(this.fm);
                this.gqi.gqi(this.bx);
            }
            wsy();
            com.bytedance.sdk.component.ef.wsy wsyVar2 = this.wsy;
            if (wsyVar2 != null) {
                wsyVar2.setLandingPage(true);
                this.wsy.setTag("landingpage");
                this.wsy.setMaterialMeta(this.gqi.ooo());
            }
            com.bytedance.sdk.openadsdk.core.widget.fm.ajl ajlVar = new com.bytedance.sdk.openadsdk.core.widget.fm.ajl(this.vt, this.irt, this.onz, this.f6754gc, this.fm, true) { // from class: com.bytedance.sdk.openadsdk.activity.single.TTLandingPageActivity.1
                @Override // com.bytedance.sdk.openadsdk.core.widget.fm.ajl, android.webkit.WebViewClient
                public void onPageFinished(WebView webView, String str) {
                    super.onPageFinished(webView, str);
                    try {
                        if (TTLandingPageActivity.this.dsz != null && !TTLandingPageActivity.this.isFinishing()) {
                            TTLandingPageActivity.this.dsz.setVisibility(8);
                        }
                    } catch (Throwable unused3) {
                    }
                    if (TTLandingPageActivity.this.ol != null) {
                        TTLandingPageActivity.this.ol.ro();
                    }
                }

                @Override // com.bytedance.sdk.openadsdk.core.widget.fm.ajl, android.webkit.WebViewClient
                public void onPageStarted(WebView webView, String str, Bitmap bitmap) {
                    super.onPageStarted(webView, str, bitmap);
                }

                @Override // com.bytedance.sdk.openadsdk.core.widget.fm.ajl, android.webkit.WebViewClient
                public WebResourceResponse shouldInterceptRequest(WebView webView, String str) {
                    try {
                        if (TextUtils.isEmpty(TTLandingPageActivity.this.lse)) {
                            return super.shouldInterceptRequest(webView, str);
                        }
                        TTLandingPageActivity.this.hi.incrementAndGet();
                        WebResourceResponseModel webResourceResponseModelFm = com.bytedance.sdk.openadsdk.wsy.ro.fm().fm(TTLandingPageActivity.this.hlt, TTLandingPageActivity.this.lse, str);
                        if (webResourceResponseModelFm != null && webResourceResponseModelFm.getWebResourceResponse() != null) {
                            TTLandingPageActivity.this.ai.incrementAndGet();
                            return webResourceResponseModelFm.getWebResourceResponse();
                        }
                        if (webResourceResponseModelFm != null && webResourceResponseModelFm.getMsg() == 2) {
                            TTLandingPageActivity.this.nt.incrementAndGet();
                        }
                        return super.shouldInterceptRequest(webView, str);
                    } catch (Throwable unused3) {
                        return super.shouldInterceptRequest(webView, str);
                    }
                }
            };
            this.xgn = ajlVar;
            ajlVar.fm(this.gqi);
            this.xgn.fm("landingpage");
            com.bytedance.sdk.openadsdk.onz.yz yzVar = this.bkb;
            if (yzVar != null) {
                this.xgn.fm(yzVar);
            }
            com.bytedance.sdk.component.ef.wsy wsyVar3 = this.wsy;
            if (wsyVar3 != null) {
                wsyVar3.setWebViewClient(this.xgn);
                com.bytedance.sdk.component.ef.wsy wsyVar4 = this.wsy;
                if (wsyVar4 != null) {
                    wsyVar4.setUserAgentString(wey.fm(wsyVar4.getWebView(), BuildConfig.VERSION_CODE));
                }
                com.bytedance.sdk.component.ef.wsy wsyVar5 = this.wsy;
                if (wsyVar5 != null) {
                    wsyVar5.setMixedContentMode(0);
                }
            }
            com.bytedance.sdk.openadsdk.yz.lb.fm(this.gqi, "landingpage", this.gzf);
            if (this.wsy != null) {
                if (com.bytedance.sdk.openadsdk.hlt.jnr.fm("lp_cache_enable", false) && this.bx) {
                    dsz dszVar = this.fm;
                    if (dszVar != null) {
                        dszVar.lb(this.sds);
                        this.fm.yz(this.sds);
                        this.fm.fm(this.sds, 0L);
                    }
                    duv duvVar = this.ol;
                    if (duvVar != null) {
                        duvVar.ro();
                    }
                } else {
                    com.bytedance.sdk.openadsdk.utils.lse.fm(this.wsy, this.sds);
                }
                this.wsy.setWebChromeClient(new com.bytedance.sdk.openadsdk.core.widget.fm.jnr(this.irt, this.fm, this.f6754gc) { // from class: com.bytedance.sdk.openadsdk.activity.single.TTLandingPageActivity.12
                    @Override // com.bytedance.sdk.openadsdk.core.widget.fm.jnr, android.webkit.WebChromeClient
                    public void onProgressChanged(WebView webView, int i11) {
                        super.onProgressChanged(webView, i11);
                        if (TTLandingPageActivity.this.ol != null) {
                            TTLandingPageActivity.this.ol.fm(i11);
                        }
                        if (TTLandingPageActivity.this.dsz != null && !TTLandingPageActivity.this.isFinishing()) {
                            if (i11 == 100 && TTLandingPageActivity.this.dsz.isShown()) {
                                TTLandingPageActivity.this.dsz.setVisibility(8);
                            } else {
                                TTLandingPageActivity.this.dsz.setProgress(i11);
                            }
                        }
                        if (!TTLandingPageActivity.this.si || TTLandingPageActivity.this.f6759qf == null) {
                            return;
                        }
                        long jCurrentTimeMillis = System.currentTimeMillis();
                        if (jCurrentTimeMillis - TTLandingPageActivity.this.f6756ib >= 200 || i11 == 100) {
                            TTLandingPageActivity.this.f6759qf.fm(webView, TTLandingPageActivity.this.f6755ha);
                            TTLandingPageActivity.this.f6756ib = jCurrentTimeMillis;
                        }
                    }

                    @Override // android.webkit.WebChromeClient
                    public void onReceivedTitle(WebView webView, String str) {
                        super.onReceivedTitle(webView, str);
                        if (!TTLandingPageActivity.this.si) {
                            if (TTLandingPageActivity.this.f6753ef != null) {
                                TextView textView = TTLandingPageActivity.this.f6753ef;
                                if (TextUtils.isEmpty(str)) {
                                    str = maa.fm(TTLandingPageActivity.this, "tt_web_title_default");
                                }
                                textView.setText(str);
                                return;
                            }
                            return;
                        }
                        TTLandingPageActivity.this.f6759qf.fm(str);
                        TTLandingPageActivity.this.f6759qf.ro(webView.getUrl());
                        if (com.bytedance.sdk.openadsdk.hlt.jnr.fm("lp_iab_history", true)) {
                            try {
                                if (TextUtils.isEmpty(str)) {
                                    str = TTLandingPageActivity.this.sds;
                                }
                                TTLandingPageActivity.this.f6758ne = new com.bytedance.sdk.openadsdk.onz.fm.fm();
                                TTLandingPageActivity.this.f6758ne.ro(TTLandingPageActivity.this.gqi.yz().ro());
                                TTLandingPageActivity.this.f6758ne.lb(String.valueOf(System.currentTimeMillis()));
                                TTLandingPageActivity.this.f6758ne.jnr(webView.getUrl());
                                TTLandingPageActivity.this.f6758ne.ro(TTLandingPageActivity.this.gqi.xio());
                                TTLandingPageActivity.this.f6758ne.fm(com.bytedance.sdk.openadsdk.onz.fm.fm.lb.fm().lb(TTLandingPageActivity.this.gqi.lo()));
                                TTLandingPageActivity.this.f6758ne.yz(str);
                                com.bytedance.sdk.openadsdk.onz.fm.fm.lb.fm().fm(TTLandingPageActivity.this.f6758ne);
                            } catch (Exception unused3) {
                                TTLandingPageActivity.this.gqi.xio();
                                Objects.toString(TTLandingPageActivity.this.f6758ne);
                            }
                        }
                    }
                });
                if (this.wsy.getWebView() != null) {
                    this.wsy.getWebView().setOnScrollChangeListener(new ro(this.fm));
                    this.wsy.getWebView().setOnTouchListener(new lb(this.fm, this.f6754gc) { // from class: com.bytedance.sdk.openadsdk.activity.single.TTLandingPageActivity.13
                        private long jnr;

                        /* JADX INFO: renamed from: lb, reason: collision with root package name */
                        private float f6760lb;
                        private float yz;
                        private final int ro = gof.ro();
                        private float ajl = 0.0f;
                        private float wsy = 0.0f;

                        @Override // com.bytedance.sdk.openadsdk.activity.single.TTLandingPageActivity.lb, android.view.View.OnTouchListener
                        public boolean onTouch(View view, MotionEvent motionEvent) {
                            if (TTLandingPageActivity.this.bkb != null) {
                                TTLandingPageActivity.this.bkb.fm();
                            }
                            if (!TTLandingPageActivity.this.si) {
                                return super.onTouch(view, motionEvent);
                            }
                            try {
                                int actionMasked = motionEvent.getActionMasked();
                                if (actionMasked == 0) {
                                    this.f6760lb = motionEvent.getRawX();
                                    this.yz = motionEvent.getRawY();
                                    this.jnr = System.currentTimeMillis();
                                } else if (actionMasked == 2) {
                                    float rawX = motionEvent.getRawX();
                                    float rawY = motionEvent.getRawY();
                                    if (Math.abs(rawX - this.f6760lb) < this.ro) {
                                        Math.abs(rawY - this.yz);
                                    }
                                    this.ajl += Math.abs(motionEvent.getX() - this.f6760lb);
                                    this.wsy += Math.abs(motionEvent.getY() - this.yz);
                                    System.currentTimeMillis();
                                    if (rawY - this.yz > this.ro) {
                                        TTLandingPageActivity.this.f6759qf.fm();
                                    }
                                    if (rawY - this.yz < (-this.ro)) {
                                        TTLandingPageActivity.this.f6759qf.ro();
                                    }
                                }
                            } catch (Throwable unused3) {
                            }
                            return super.onTouch(view, motionEvent);
                        }
                    });
                }
                this.wsy.setDownloadListener(new DownloadListener() { // from class: com.bytedance.sdk.openadsdk.activity.single.TTLandingPageActivity.14
                    @Override // android.webkit.DownloadListener
                    public void onDownloadStart(String str, String str2, String str3, String str4, long j10) {
                        if (TTLandingPageActivity.this.wey != null) {
                            TTLandingPageActivity.this.wey.fm(TTLandingPageActivity.this.gqi);
                        }
                    }
                });
            }
            lb();
            com.bytedance.sdk.openadsdk.onz.fm fmVar = this.kwx;
            if (fmVar != null) {
                fmVar.setOnClickListener(new View.OnClickListener() { // from class: com.bytedance.sdk.openadsdk.activity.single.TTLandingPageActivity.15
                    @Override // android.view.View.OnClickListener
                    public void onClick(View view) {
                        TTLandingPageActivity.this.lb("onSelectPrivacy");
                        TTLandingPageActivity tTLandingPageActivity = TTLandingPageActivity.this;
                        TTWebsiteActivity.fm(tTLandingPageActivity, tTLandingPageActivity.gqi, TTLandingPageActivity.this.gof);
                    }
                });
            }
            lb.fm.fm(SystemClock.elapsedRealtime() - jElapsedRealtime, this.gqi, "landingpage", this.hlt, this.lse);
        } catch (Throwable unused3) {
            finish();
        }
    }

    @Override // com.bytedance.sdk.openadsdk.activity.single.TTBaseLandingPageActivity, com.bytedance.sdk.openadsdk.activity.single.TTBaseActivity, android.app.Activity
    public void onDestroy() {
        com.bytedance.sdk.component.ef.wsy wsyVar;
        com.bytedance.sdk.component.ef.wsy wsyVar2;
        super.onDestroy();
        if (com.bytedance.sdk.openadsdk.hlt.jnr.fm("lp_cache_enable", false)) {
            lse lseVar = this.gqi;
            if (lseVar != null) {
                lseVar.aws(0);
            }
            dsz dszVar = this.fm;
            if (dszVar != null && (wsyVar2 = this.wsy) != null) {
                dszVar.fm(wsyVar2);
            }
            if (this.wsy == null || TextUtils.isEmpty(this.sds)) {
                com.bytedance.sdk.component.ef.wsy wsyVar3 = this.wsy;
                if (wsyVar3 != null) {
                    gzf.fm(wsyVar3);
                }
            } else {
                Bundle bundle = new Bundle();
                if (this.wsy.getWebView() != null) {
                    this.wsy.getWebView().saveState(bundle);
                }
                sds.fm(System.identityHashCode(this.gqi) + "_" + this.sds, this.wsy, bundle);
            }
            this.wsy = null;
        } else {
            dsz dszVar2 = this.fm;
            if (dszVar2 != null && (wsyVar = this.wsy) != null) {
                dszVar2.fm(wsyVar);
            }
        }
        try {
            if (getWindow() != null) {
                ((ViewGroup) getWindow().getDecorView()).removeAllViews();
            }
        } catch (Throwable unused) {
        }
        if (!com.bytedance.sdk.openadsdk.hlt.jnr.fm("lp_cache_enable", false)) {
            com.bytedance.sdk.component.ef.wsy wsyVar4 = this.wsy;
            if (wsyVar4 != null) {
                gzf.fm(wsyVar4);
            }
            this.wsy = null;
        }
        hxv hxvVar = this.irt;
        if (hxvVar != null) {
            hxvVar.duv();
        }
        dsz dszVar3 = this.fm;
        if (dszVar3 != null) {
            dszVar3.yz(true);
        }
        com.bytedance.sdk.openadsdk.onz.yz yzVar = this.bkb;
        if (yzVar != null) {
            yzVar.lb();
        }
        if (!TextUtils.isEmpty(this.lse)) {
            lb.fm.fm(this.ai.get(), this.hi.get(), this.gqi);
        }
        com.bytedance.sdk.openadsdk.wsy.ro.fm().fm(this.hlt);
        onz onzVar = this.wbw;
        if (onzVar != null) {
            onzVar.lb();
        }
        if (com.bytedance.sdk.openadsdk.hlt.jnr.fm("lp_iab_history", true) && this.si) {
            com.bytedance.sdk.openadsdk.onz.fm.fm.lb.fm().ro();
        }
    }

    @Override // com.bytedance.sdk.openadsdk.activity.single.TTBaseLandingPageActivity, com.bytedance.sdk.openadsdk.activity.single.TTBaseActivity, android.app.Activity
    public void onPause() {
        super.onPause();
        onz onzVar = this.wbw;
        if (onzVar != null) {
            onzVar.ro();
        }
        lse lseVar = this.gqi;
        if (lseVar != null) {
            lseVar.wsy(SystemClock.elapsedRealtime());
            this.gqi.aws(0);
        }
    }

    @Override // com.bytedance.sdk.openadsdk.activity.single.TTBaseLandingPageActivity, com.bytedance.sdk.openadsdk.activity.single.TTBaseActivity, android.app.Activity
    public void onResume() {
        super.onResume();
        lse lseVar = this.gqi;
        if (lseVar != null) {
            lseVar.aws(1);
        }
        hxv hxvVar = this.irt;
        if (hxvVar != null) {
            hxvVar.ku();
        }
        dsz dszVar = this.fm;
        if (dszVar != null) {
            dszVar.wsy();
        }
        onz onzVar = this.wbw;
        if (onzVar != null) {
            onzVar.fm();
        }
        com.bytedance.sdk.component.ef.wsy wsyVar = this.wsy;
        if (wsyVar != null) {
            wsyVar.duv();
            final com.bytedance.sdk.component.ef.wsy wsyVar2 = this.wsy;
            if (wsyVar2 != null) {
                wsyVar2.postDelayed(new Runnable() { // from class: com.bytedance.sdk.openadsdk.activity.single.TTLandingPageActivity.8
                    @Override // java.lang.Runnable
                    public void run() {
                        wsyVar2.scrollBy(0, 1);
                        wsyVar2.postDelayed(new Runnable() { // from class: com.bytedance.sdk.openadsdk.activity.single.TTLandingPageActivity.8.1
                            @Override // java.lang.Runnable
                            public void run() {
                                AnonymousClass8 anonymousClass8 = AnonymousClass8.this;
                                if (wsyVar2 == null || TTLandingPageActivity.this.isFinishing()) {
                                    return;
                                }
                                wsyVar2.scrollBy(0, -1);
                            }
                        }, 10L);
                    }
                }, 200L);
            }
        }
    }

    @Override // android.app.Activity
    public void onSaveInstanceState(Bundle bundle) {
        if (bundle == null) {
            bundle = new Bundle();
        }
        try {
            int iFm = this.gqi != null ? ai.fm().fm(this.gqi) : -1;
            this.ajl = iFm;
            bundle.putInt("meta_index", iFm);
        } catch (Throwable unused) {
        }
        super.onSaveInstanceState(bundle);
    }

    @Override // android.app.Activity
    public void onStart() {
        super.onStart();
        if (this.ajl >= 0) {
            ai.fm().lb(this.ajl);
            this.ajl = -1;
        }
        com.bytedance.sdk.openadsdk.utils.yz.fm(this, this.gqi);
        lse lseVar = this.gqi;
        if (lseVar != null) {
            lseVar.aws(1);
        }
    }

    @Override // android.app.Activity
    public void onStop() {
        super.onStop();
        lse lseVar = this.gqi;
        if (lseVar != null) {
            lseVar.aws(0);
        }
        dsz dszVar = this.fm;
        if (dszVar != null) {
            dszVar.wu();
        }
    }

    @Override // com.bytedance.sdk.openadsdk.activity.single.TTBaseActivity
    public boolean yz() {
        return true;
    }

    private void ajl() {
        com.bytedance.sdk.component.ef.wsy wsyVar = (com.bytedance.sdk.component.ef.wsy) findViewById(com.bytedance.sdk.openadsdk.utils.qhl.f7557ib);
        this.wsy = wsyVar;
        bx.fm(this.gqi, wsyVar);
        this.ku = (fhx) findViewById(com.bytedance.sdk.openadsdk.utils.qhl.ado);
        fhx fhxVar = (fhx) findViewById(com.bytedance.sdk.openadsdk.utils.qhl.ywr);
        duv duvVar = (duv) findViewById(520093721);
        this.ol = duvVar;
        if (duvVar != null) {
            duvVar.fm(this.gqi);
            this.ol.fm();
        }
        if (fhxVar != null) {
            fhxVar.setVisibility(0);
        }
        if (this.si) {
            this.zan = (ImageView) findViewById(com.bytedance.sdk.openadsdk.utils.qhl.zjk);
        } else {
            this.zan = (ImageView) findViewById(520093720);
        }
        ImageView imageView = this.zan;
        if (imageView != null) {
            imageView.setOnClickListener(new View.OnClickListener() { // from class: com.bytedance.sdk.openadsdk.activity.single.TTLandingPageActivity.3
                @Override // android.view.View.OnClickListener
                public void onClick(View view) {
                    if (TTLandingPageActivity.this.wsy != null) {
                        if (TTLandingPageActivity.this.f6755ha != null) {
                            TTLandingPageActivity.this.f6755ha.fm();
                        }
                        if (!TTLandingPageActivity.this.wsy.wu()) {
                            if (TTLandingPageActivity.this.si) {
                                return;
                            }
                            TTLandingPageActivity.this.finish();
                            return;
                        }
                        TTLandingPageActivity.this.wsy.ef();
                        if (!TTLandingPageActivity.this.si || TTLandingPageActivity.this.f6759qf == null) {
                            return;
                        }
                        WebView webView = TTLandingPageActivity.this.wsy.getWebView();
                        if (TTLandingPageActivity.this.f6759qf == null || webView == null) {
                            return;
                        }
                        TTLandingPageActivity.this.f6759qf.fm(webView, TTLandingPageActivity.this.f6755ha);
                    }
                }
            });
        }
        ImageView imageView2 = (ImageView) findViewById(com.bytedance.sdk.openadsdk.utils.qhl.grs);
        this.tzk = imageView2;
        if (imageView2 != null) {
            imageView2.setOnClickListener(new View.OnClickListener() { // from class: com.bytedance.sdk.openadsdk.activity.single.TTLandingPageActivity.4
                @Override // android.view.View.OnClickListener
                public void onClick(View view) {
                    if (TTLandingPageActivity.this.wsy == null || !TTLandingPageActivity.this.wsy.vt()) {
                        return;
                    }
                    TTLandingPageActivity.this.wsy.ku();
                    if (!TTLandingPageActivity.this.si || TTLandingPageActivity.this.f6759qf == null) {
                        return;
                    }
                    WebView webView = TTLandingPageActivity.this.wsy.getWebView();
                    if (TTLandingPageActivity.this.f6759qf == null || webView == null) {
                        return;
                    }
                    TTLandingPageActivity.this.f6759qf.fm(webView, TTLandingPageActivity.this.f6755ha);
                }
            });
        }
        ImageView imageView3 = (ImageView) findViewById(520093716);
        this.wu = imageView3;
        if (imageView3 != null) {
            imageView3.setOnClickListener(new View.OnClickListener() { // from class: com.bytedance.sdk.openadsdk.activity.single.TTLandingPageActivity.5
                @Override // android.view.View.OnClickListener
                public void onClick(View view) {
                    TTLandingPageActivity.this.finish();
                }
            });
        }
        this.f6753ef = (TextView) findViewById(com.bytedance.sdk.openadsdk.utils.qhl.cyr);
        com.bytedance.sdk.openadsdk.core.ajl.ajl ajlVar = (com.bytedance.sdk.openadsdk.core.ajl.ajl) findViewById(com.bytedance.sdk.openadsdk.utils.qhl.cg);
        this.dsz = ajlVar;
        if (ajlVar != null) {
            ajlVar.setVisibility(0);
        }
        this.lz = (ImageView) findViewById(520093740);
        if (this.si) {
            final com.bytedance.sdk.openadsdk.common.sds sdsVar = new com.bytedance.sdk.openadsdk.common.sds(this, false);
            ImageView imageView4 = this.lz;
            if (imageView4 != null) {
                imageView4.setOnClickListener(new View.OnClickListener() { // from class: com.bytedance.sdk.openadsdk.activity.single.TTLandingPageActivity.6
                    @Override // android.view.View.OnClickListener
                    public void onClick(View view) {
                        sdsVar.setOnMenuItemClickListener(new sds.fm() { // from class: com.bytedance.sdk.openadsdk.activity.single.TTLandingPageActivity.6.1
                            @Override // com.bytedance.sdk.openadsdk.common.sds.fm
                            public void ajl() {
                                TTLandingPageActivity.this.lb("onSelectPrivacy");
                                if (com.bytedance.sdk.openadsdk.utils.ro.jnr()) {
                                    TTLandingPageActivity tTLandingPageActivity = TTLandingPageActivity.this;
                                    IABLandingPageActivity.fm(tTLandingPageActivity, tTLandingPageActivity.gqi, TTLandingPageActivity.this.gof);
                                } else {
                                    TTLandingPageActivity tTLandingPageActivity2 = TTLandingPageActivity.this;
                                    TTWebsiteActivity.fm(tTLandingPageActivity2, tTLandingPageActivity2.gqi, TTLandingPageActivity.this.gof);
                                }
                                sdsVar.fm();
                            }

                            @Override // com.bytedance.sdk.openadsdk.common.sds.fm
                            public void fm() {
                                if (TTLandingPageActivity.this.gqi != null) {
                                    com.bytedance.sdk.openadsdk.onz.fm.fm.lb.fm().fm(TTLandingPageActivity.this.gqi);
                                }
                                com.bytedance.sdk.component.utils.ro.fm(TTLandingPageActivity.this, new Intent(TTLandingPageActivity.this, (Class<?>) TTHistoryActivity.class), null);
                                TTLandingPageActivity.this.lb("onSelectHistory");
                                sdsVar.fm();
                            }

                            @Override // com.bytedance.sdk.openadsdk.common.sds.fm
                            public void jnr() {
                                TTLandingPageActivity.this.fm();
                                TTLandingPageActivity.this.lb("onSelectReport");
                                sdsVar.fm();
                            }

                            @Override // com.bytedance.sdk.openadsdk.common.sds.fm
                            public void lb() {
                                ClipboardManager clipboardManager;
                                if (TTLandingPageActivity.this.wsy != null) {
                                    String url = TTLandingPageActivity.this.wsy.getUrl();
                                    if (!TextUtils.isEmpty(url) && (clipboardManager = (ClipboardManager) TTLandingPageActivity.this.getSystemService("clipboard")) != null) {
                                        clipboardManager.setPrimaryClip(ClipData.newPlainText("URL", url));
                                    }
                                }
                                TTLandingPageActivity.this.lb("onSelectCopyLink");
                                sdsVar.fm();
                            }

                            @Override // com.bytedance.sdk.openadsdk.common.sds.fm
                            public void ro() {
                                com.bytedance.sdk.component.ef.wsy wsyVar2 = TTLandingPageActivity.this.wsy;
                                if (wsyVar2 == null || wsyVar2.getUrl() == null) {
                                    return;
                                }
                                if (TTLandingPageActivity.this.dsz != null) {
                                    TTLandingPageActivity.this.dsz.setVisibility(0);
                                    TTLandingPageActivity.this.dsz.setProgress(0);
                                }
                                wsyVar2.wsy();
                                String url = wsyVar2.getUrl();
                                if (url != null) {
                                    wsyVar2.a_(url);
                                }
                                TTLandingPageActivity.this.lb("onSelectRetry");
                                sdsVar.fm();
                            }

                            @Override // com.bytedance.sdk.openadsdk.common.sds.fm
                            public void yz() {
                                if (TTLandingPageActivity.this.wsy != null) {
                                    Intent intent = new Intent("android.intent.action.VIEW");
                                    String url = TTLandingPageActivity.this.wsy.getUrl();
                                    if (!TextUtils.isEmpty(url)) {
                                        intent.setData(Uri.parse(url));
                                        com.bytedance.sdk.component.utils.ro.fm(TTLandingPageActivity.this, intent, null);
                                    }
                                    TTLandingPageActivity.this.lb("onSelectOpenInBrowser");
                                    sdsVar.fm();
                                }
                            }
                        });
                        sdsVar.fm(view);
                    }
                });
            }
        }
        View viewFindViewById = findViewById(com.bytedance.sdk.openadsdk.utils.qhl.hm);
        if (viewFindViewById != null) {
            viewFindViewById.setOnClickListener(new View.OnClickListener() { // from class: com.bytedance.sdk.openadsdk.activity.single.TTLandingPageActivity.7
                @Override // android.view.View.OnClickListener
                public void onClick(View view) {
                    TTLandingPageActivity.this.fm();
                }
            });
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    public void dsz() {
        TTAdDislikeToast tTAdDislikeToast;
        if (isFinishing() || (tTAdDislikeToast = this.f6757lb) == null) {
            return;
        }
        tTAdDislikeToast.show(TTAdDislikeToast.getDislikeSendTip());
    }

    private void duv() {
        TTAdDislikeToast tTAdDislikeToast = this.f6757lb;
        if (tTAdDislikeToast == null) {
            return;
        }
        tTAdDislikeToast.show(TTAdDislikeToast.getDislikeTip());
    }

    private boolean ef() {
        return !TextUtils.isEmpty(this.sds) && this.sds.contains("__luban_sdk");
    }

    private String jnr() {
        lse lseVar = this.gqi;
        if (lseVar != null && !TextUtils.isEmpty(lseVar.eys())) {
            this.lmk = this.gqi.eys();
        }
        return this.lmk;
    }

    private void ku() {
        try {
            if (this.ro == null) {
                qhl qhlVar = new qhl(this.vt, this.gqi);
                this.ro = qhlVar;
                qhlVar.setDislikeSource("landing_page");
                this.ro.setCallback(new qhl.fm() { // from class: com.bytedance.sdk.openadsdk.activity.single.TTLandingPageActivity.10
                    @Override // com.bytedance.sdk.openadsdk.common.qhl.fm
                    public void fm(View view) {
                        TTLandingPageActivity.this.yz.set(true);
                    }

                    @Override // com.bytedance.sdk.openadsdk.common.qhl.fm
                    public void ro(View view) {
                        TTLandingPageActivity.this.yz.set(false);
                    }

                    @Override // com.bytedance.sdk.openadsdk.common.qhl.fm
                    public void fm(FilterWord filterWord) {
                        if (TTLandingPageActivity.this.jnr.get() || filterWord == null || filterWord.hasSecondOptions()) {
                            return;
                        }
                        TTLandingPageActivity.this.jnr.set(true);
                        TTLandingPageActivity.this.dsz();
                    }
                });
            }
            FrameLayout frameLayout = (FrameLayout) findViewById(R.id.content);
            frameLayout.addView(this.ro);
            if (this.f6757lb == null) {
                TTAdDislikeToast tTAdDislikeToast = new TTAdDislikeToast(this.vt);
                this.f6757lb = tTAdDislikeToast;
                frameLayout.addView(tTAdDislikeToast);
            }
        } catch (Throwable th) {
            ApmHelper.reportCustomError("initDislike error", "LandingPageActivity", th);
        }
    }

    @SuppressLint({"ClickableViewAccessibility"})
    private void lb() {
        lse lseVar = this.gqi;
        if (lseVar == null || lseVar.oy() != 4) {
            return;
        }
        fhx fhxVar = this.ku;
        if (fhxVar != null) {
            fhxVar.setVisibility(0);
        }
        Button button = (Button) findViewById(com.bytedance.sdk.openadsdk.utils.qhl.zzn);
        this.duv = button;
        if (button != null) {
            ro(jnr());
            if (this.wey == null) {
                this.wey = com.bytedance.sdk.openadsdk.sds.fm.fm.yz.fm(this, TextUtils.isEmpty(this.gof) ? bx.ro(this.qhl) : this.gof);
            }
            com.bytedance.sdk.openadsdk.core.lb.fm fmVar = new com.bytedance.sdk.openadsdk.core.lb.fm(this, this.gqi, this.gof, this.qhl);
            fmVar.fm(false);
            this.duv.setOnClickListener(fmVar);
            this.duv.setOnTouchListener(fmVar);
            fmVar.lb(true);
            fmVar.fm(this.wey);
        }
    }

    private void ro() {
        if (TextUtils.isEmpty(this.sds)) {
            return;
        }
        com.bytedance.sdk.openadsdk.gof.lb.fm(new com.bytedance.sdk.openadsdk.gof.yz() { // from class: com.bytedance.sdk.openadsdk.activity.single.TTLandingPageActivity.16
            @Override // com.bytedance.sdk.openadsdk.gof.yz
            public com.bytedance.sdk.openadsdk.gof.ro.fm fm() {
                com.bytedance.sdk.openadsdk.gof.ro.fm fmVarD = b.d("lp_reuse");
                fmVarD.yz(TTLandingPageActivity.this.gof);
                return fmVarD;
            }
        });
        if (!this.bx) {
            this.bx = false;
            com.bytedance.sdk.openadsdk.irt.yz.fm(false);
            com.bytedance.sdk.openadsdk.gof.lb.lb(new com.bytedance.sdk.openadsdk.gof.yz() { // from class: com.bytedance.sdk.openadsdk.activity.single.TTLandingPageActivity.18
                @Override // com.bytedance.sdk.openadsdk.gof.yz
                public com.bytedance.sdk.openadsdk.gof.ro.fm fm() {
                    com.bytedance.sdk.openadsdk.gof.ro.fm fmVarD = b.d("lp_reuse");
                    fmVarD.yz(TTLandingPageActivity.this.gof);
                    return fmVarD;
                }
            });
        } else {
            dsz dszVar = this.fm;
            if (dszVar != null) {
                dszVar.jnr(true);
                this.gqi.gqi(true);
            }
            com.bytedance.sdk.openadsdk.gof.lb.ro(new com.bytedance.sdk.openadsdk.gof.yz() { // from class: com.bytedance.sdk.openadsdk.activity.single.TTLandingPageActivity.17
                @Override // com.bytedance.sdk.openadsdk.gof.yz
                public com.bytedance.sdk.openadsdk.gof.ro.fm fm() {
                    com.bytedance.sdk.openadsdk.gof.ro.fm fmVarD = b.d("lp_reuse");
                    fmVarD.yz(TTLandingPageActivity.this.gof);
                    return fmVarD;
                }
            });
            com.bytedance.sdk.openadsdk.irt.yz.fm(true);
        }
    }

    private void vt() {
        try {
            JSONObject jSONObject = new JSONObject();
            jSONObject.put("isBackIntercept", true);
            this.irt.fm("temai_back_event", jSONObject);
        } catch (Exception unused) {
        }
    }

    private void wsy() {
        hxv hxvVar = new hxv(this);
        this.irt = hxvVar;
        hxvVar.ro(this.wsy).lb(this.onz).yz(this.fhx).fm(this.gqi).ro(this.qhl).fm(this.gqi.zh()).jnr(this.gqi.uuz()).fm(this.wsy).ro("landingpage");
    }

    private void wu() {
        if (ef() && !this.maa.getAndSet(true)) {
            vt();
            fm(0);
        } else {
            try {
                super.onBackPressed();
            } catch (Throwable th) {
                th.getMessage();
            }
        }
    }

    @Override // com.bytedance.sdk.openadsdk.activity.single.TTBaseActivity
    public void onz() {
        wu();
    }

    private View fm(String str) {
        Bundle bundleFm;
        com.bytedance.sdk.component.ef.wsy wsyVar;
        com.bytedance.sdk.openadsdk.core.model.ro roVarDwu;
        com.bytedance.sdk.openadsdk.core.ajl.lb lbVar = new com.bytedance.sdk.openadsdk.core.ajl.lb(this);
        if (Build.VERSION.SDK_INT >= 35) {
            lbVar.setFitsSystemWindows(true);
        }
        com.bytedance.sdk.openadsdk.core.ajl.jnr jnrVar = new com.bytedance.sdk.openadsdk.core.ajl.jnr(this);
        jnrVar.setOrientation(1);
        lbVar.addView(jnrVar, new FrameLayout.LayoutParams(-1, -1));
        boolean zAi = gof.yz().ai();
        this.si = zAi;
        lse lseVar = this.gqi;
        if (lseVar != null && zAi) {
            this.f6759qf = new com.bytedance.sdk.openadsdk.common.dsz(this, lseVar, this.gof, false);
        }
        View fhxVar = new fhx(this, new fhx.fm() { // from class: com.bytedance.sdk.openadsdk.activity.single.TTLandingPageActivity.19
            @Override // com.bytedance.sdk.openadsdk.common.fhx.fm
            public View fm(Context context) {
                return (TTLandingPageActivity.this.gqi == null || !TTLandingPageActivity.this.si) ? new vt(context) : TTLandingPageActivity.this.f6759qf.yz();
            }
        });
        fhxVar.setId(com.bytedance.sdk.openadsdk.utils.qhl.ywr);
        jnrVar.addView(fhxVar, new LinearLayout.LayoutParams(-1, this.si ? -2 : zan.ro(this, 44.0f)));
        com.bytedance.sdk.openadsdk.core.ajl.lb lbVar2 = new com.bytedance.sdk.openadsdk.core.ajl.lb(this);
        LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(-1, 0);
        layoutParams.weight = 1.0f;
        jnrVar.addView(lbVar2, layoutParams);
        if (!com.bytedance.sdk.openadsdk.hlt.jnr.fm("lp_cache_enable", false) || TextUtils.isEmpty(str)) {
            bundleFm = null;
            wsyVar = null;
        } else {
            String str2 = System.identityHashCode(this.gqi) + "_" + str;
            wsyVar = com.bytedance.sdk.openadsdk.utils.sds.fm(this, str2);
            bundleFm = com.bytedance.sdk.openadsdk.utils.sds.fm(str2);
        }
        if (wsyVar == null) {
            wsyVar = new com.bytedance.sdk.component.ef.wsy(this, wsy.lb.LANDING_PAGE);
        } else {
            if (bundleFm != null && wsyVar.getWebView() != null) {
                wsyVar.getWebView().restoreState(bundleFm);
            }
            this.bx = true;
        }
        wsyVar.setId(com.bytedance.sdk.openadsdk.utils.qhl.f7557ib);
        lbVar2.addView(wsyVar, new FrameLayout.LayoutParams(-1, -1));
        fhx fhxVar2 = new fhx(this, new fhx.fm() { // from class: com.bytedance.sdk.openadsdk.activity.single.TTLandingPageActivity.2
            @Override // com.bytedance.sdk.openadsdk.common.fhx.fm
            public View fm(Context context) {
                return new com.bytedance.sdk.openadsdk.common.wu(context);
            }
        });
        fhxVar2.setId(com.bytedance.sdk.openadsdk.utils.qhl.ado);
        FrameLayout.LayoutParams layoutParams2 = new FrameLayout.LayoutParams(-1, -2);
        layoutParams2.gravity = 81;
        lbVar2.addView(fhxVar2, layoutParams2);
        com.bytedance.sdk.openadsdk.core.ajl.ajl ajlVar = new com.bytedance.sdk.openadsdk.core.ajl.ajl(this, null, R.style.Widget.ProgressBar.Horizontal);
        ajlVar.setId(com.bytedance.sdk.openadsdk.utils.qhl.cg);
        ajlVar.setProgress(1);
        ajlVar.setVisibility(8);
        ajlVar.setProgressDrawable(ku.fm(this, "tt_browser_progress_style"));
        FrameLayout.LayoutParams layoutParams3 = new FrameLayout.LayoutParams(-1, zan.ro(this, 3.0f));
        layoutParams3.gravity = 49;
        lbVar2.addView(ajlVar, layoutParams3);
        lse lseVar2 = this.gqi;
        if (lseVar2 != null && (roVarDwu = lseVar2.dwu()) != null) {
            String strYz = roVarDwu.yz();
            if (!TextUtils.isEmpty(strYz)) {
                com.bytedance.sdk.openadsdk.onz.fm fmVar = new com.bytedance.sdk.openadsdk.onz.fm(this);
                this.kwx = fmVar;
                fmVar.setId(com.bytedance.sdk.openadsdk.utils.qhl.zow);
                FrameLayout.LayoutParams layoutParams4 = new FrameLayout.LayoutParams(-1, -2);
                this.kwx.setPadding(zan.ro(this, 16.0f), zan.ro(this, 16.0f), zan.ro(this, 16.0f), zan.ro(this, 16.0f));
                this.kwx.setPrivacyText(strYz);
                layoutParams4.gravity = 80;
                lbVar2.addView(this.kwx, layoutParams4);
            }
        }
        duv duvVar = new duv(this);
        duvVar.setOnlyLoading(this.mon);
        duvVar.setId(520093721);
        lbVar.addView(duvVar, new FrameLayout.LayoutParams(-1, -1));
        return lbVar;
    }

    private void ro(String str) {
        if (TextUtils.isEmpty(str) || this.duv == null || isFinishing()) {
            return;
        }
        this.duv.setText(str);
    }

    /* JADX INFO: Access modifiers changed from: private */
    public void lb(final String str) {
        com.bytedance.sdk.openadsdk.irt.yz.fm("iab_more_options", false, new com.bytedance.sdk.openadsdk.irt.ro() { // from class: com.bytedance.sdk.openadsdk.activity.single.TTLandingPageActivity.11
            @Override // com.bytedance.sdk.openadsdk.irt.ro
            @Nullable
            public com.bytedance.sdk.openadsdk.irt.fm.lb fm() throws Exception {
                JSONObject jSONObject = new JSONObject();
                jSONObject.put("scene", str);
                return com.bytedance.sdk.openadsdk.irt.fm.yz.ro().fm("iab_more_options").ro(jSONObject.toString());
            }
        });
    }

    private void fm(final int i10) {
        if (this.wu == null || !ef()) {
            return;
        }
        xgn.fm(new Runnable() { // from class: com.bytedance.sdk.openadsdk.activity.single.TTLandingPageActivity.9
            @Override // java.lang.Runnable
            public void run() {
                zan.fm((View) TTLandingPageActivity.this.wu, i10);
            }
        });
    }

    public void fm() {
        if (isFinishing()) {
            return;
        }
        if (this.jnr.get()) {
            duv();
            return;
        }
        if (this.ro == null) {
            ku();
        }
        qhl qhlVar = this.ro;
        if (qhlVar != null) {
            qhlVar.fm();
        }
    }
}
