package com.tencent.mm.plugin.webview.ui.tools;

import android.annotation.TargetApi;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.ServiceConnection;
import android.content.SharedPreferences.Editor;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.PorterDuff.Mode;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.net.http.SslError;
import android.os.Build.VERSION;
import android.os.Bundle;
import android.os.Looper;
import android.os.Parcelable;
import android.os.Process;
import android.os.RemoteException;
import android.text.TextUtils;
import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.MenuItem.OnMenuItemClickListener;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnCreateContextMenuListener;
import android.view.View.OnLongClickListener;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.view.ViewGroup.MarginLayoutParams;
import android.view.Window;
import android.view.WindowInsets;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.webkit.WebChromeClient.CustomViewCallback;
import android.webkit.WebSettings.RenderPriority;
import android.widget.CheckBox;
import android.widget.FrameLayout;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.TextView;
import com.google.android.gms.common.internal.ImagesContract;
import com.google.android.gms.common.util.CrashUtils.ErrorDialogData;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.ci.g;
import com.tencent.mm.g.a.qg;
import com.tencent.mm.g.a.vp;
import com.tencent.mm.modelsns.SnsAdClick;
import com.tencent.mm.platformtools.ae;
import com.tencent.mm.plugin.appbrand.compat.b.a.1;
import com.tencent.mm.plugin.appbrand.jsapi.h5_interact.SendDataToH5FromMiniProgramEvent;
import com.tencent.mm.plugin.websearch.api.aa;
import com.tencent.mm.plugin.webview.e.d$1;
import com.tencent.mm.plugin.webview.model.af;
import com.tencent.mm.plugin.webview.model.af$b;
import com.tencent.mm.plugin.webview.model.af$d;
import com.tencent.mm.plugin.webview.model.af.c.2;
import com.tencent.mm.plugin.webview.model.af.c.3;
import com.tencent.mm.plugin.webview.model.af.c.4;
import com.tencent.mm.plugin.webview.model.af.c.5;
import com.tencent.mm.plugin.webview.model.an;
import com.tencent.mm.plugin.webview.model.aq;
import com.tencent.mm.plugin.webview.model.aq$a;
import com.tencent.mm.plugin.webview.model.aq$h;
import com.tencent.mm.plugin.webview.modeltools.WebViewClipBoardHelper;
import com.tencent.mm.plugin.webview.modeltools.a;
import com.tencent.mm.plugin.webview.modeltools.d;
import com.tencent.mm.plugin.webview.modeltools.k;
import com.tencent.mm.plugin.webview.stub.WebViewStubService;
import com.tencent.mm.plugin.webview.stub.e;
import com.tencent.mm.plugin.webview.ui.tools.jsapi.d.63;
import com.tencent.mm.plugin.webview.ui.tools.jsapi.i;
import com.tencent.mm.plugin.webview.ui.tools.widget.FontChooserView;
import com.tencent.mm.plugin.webview.ui.tools.widget.MovingImageButton;
import com.tencent.mm.plugin.webview.ui.tools.widget.WebViewSearchContentInputFooter;
import com.tencent.mm.plugin.webview.ui.tools.widget.input.WebViewInputFooter;
import com.tencent.mm.pluginsdk.model.v;
import com.tencent.mm.pluginsdk.ui.tools.m;
import com.tencent.mm.pluginsdk.ui.tools.u;
import com.tencent.mm.protocal.GeneralControlWrapper;
import com.tencent.mm.protocal.JsapiPermissionWrapper;
import com.tencent.mm.sdk.b.c;
import com.tencent.mm.sdk.platformtools.BackwardSupportUtil;
import com.tencent.mm.sdk.platformtools.ab;
import com.tencent.mm.sdk.platformtools.ah;
import com.tencent.mm.sdk.platformtools.ak;
import com.tencent.mm.sdk.platformtools.al;
import com.tencent.mm.sdk.platformtools.ap;
import com.tencent.mm.sdk.platformtools.at;
import com.tencent.mm.sdk.platformtools.bo;
import com.tencent.mm.ui.MMActivity;
import com.tencent.mm.ui.base.MMFalseProgressBar;
import com.tencent.mm.ui.base.p;
import com.tencent.mm.ui.tools.j;
import com.tencent.mm.ui.widget.MMWebView;
import com.tencent.mm.ui.widget.MMWebView$d;
import com.tencent.mm.ui.widget.SwipeBackLayout;
import com.tencent.mm.ui.widget.snackbar.a.b;
import com.tencent.qqvideo.proxy.api.FactoryProxyManager;
import com.tencent.qqvideo.proxy.api.IUtils;
import com.tencent.smtt.sdk.TbsMediaPlayer$TbsMediaPlayerListener;
import com.tencent.sqlitelint.config.SharePluginInfo;
import com.tencent.ttpic.baseutils.ApiHelper$VERSION_CODES;
import com.tencent.xweb.WebView;
import com.tencent.xweb.l;
import com.tencent.xweb.o;
import com.tencent.xweb.r;
import com.tencent.xweb.s;
import com.tencent.ytcommon.BuildConfig;
import java.io.File;
import java.io.UnsupportedEncodingException;
import java.net.InetAddress;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.UnknownHostException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import junit.framework.Assert;

public class WebViewUI extends MMActivity implements OnCreateContextMenuListener, MMWebView$d {
    private static final Pattern uiv = Pattern.compile("\"\\s*rgba\\(\\s*[0-9]+\\s*,\\s*[0-9]+\\s*,\\s*[0-9]+\\s*,\\s*[0-9]+\\s*\\)\\s*\"");
    private static final Pattern uiw = Pattern.compile("\"\\s*rgb\\(\\s*[0-9]+\\s*,\\s*[0-9]+\\s*,\\s*[0-9]+\\s*\\)\\s*\"");
    private static final Set<String> ums;
    private static final ArrayList<z> uvK = new ArrayList();
    private static RenderPriority uvQ = RenderPriority.NORMAL;
    protected static int uwz = 0;
    protected String cMm;
    public volatile String cOG = null;
    protected int cSQ;
    protected String cvF = BuildConfig.FLAVOR;
    private int fromScene;
    public ak handler;
    private long iBE = 0;
    private String iCz;
    private int iJp;
    j icA;
    private final d icH = new d();
    public com.tencent.mm.plugin.webview.stub.d icy = null;
    public k icz = null;
    protected String ium = BuildConfig.FLAVOR;
    protected int jLX;
    protected int jLY;
    private int jQp = 0;
    public String jUg;
    public int jYe = -1;
    private ServiceConnection ktl = new 33(this);
    protected b mUw = new b() {
        public final void aIu() {
            AppMethodBeat.i(7880);
            try {
                WebViewUI.this.icy.favEditTag();
                AppMethodBeat.o(7880);
            } catch (Exception e) {
                ab.e("MicroMsg.WebViewUI", "favorite edittag fail, ex = " + e.getMessage());
                AppMethodBeat.o(7880);
            }
        }
    };
    private int networkType;
    public int nfs = 0;
    public String nft = null;
    private long oes = 0;
    public MMWebView pzf;
    protected boolean rpm = true;
    protected int screenOrientation = -1;
    public com.tencent.mm.plugin.webview.ui.tools.jsapi.d uhz = null;
    private d uic;
    protected com.tencent.mm.plugin.webview.ui.tools.bag.h uie;
    public aq ulI = new aq();
    protected e umI;
    protected volatile String unr;
    private final a utt = new a();
    protected boolean uuW = false;
    public MMFalseProgressBar uuX;
    public ProgressBar uuY;
    private ImageButton uuZ;
    private boolean uvA = true;
    protected int uvB;
    private String uvC = null;
    protected byte[] uvD = new byte[0];
    private boolean uvE = false;
    private boolean uvF = false;
    public boolean uvG = false;
    private View uvH;
    private ap uvI;
    private List<com.tencent.mm.plugin.webview.ui.tools.jsapi.b> uvJ = new ArrayList();
    private boolean uvL = false;
    private CustomViewCallback uvM;
    private View uvN;
    protected l uvO;
    private ProgressBar uvP;
    protected l uvR = new l(null);
    protected m uvS = new m(this);
    protected o uvT = new o(this);
    protected q uvU = new q();
    private final c<SendDataToH5FromMiniProgramEvent> uvV = new c<SendDataToH5FromMiniProgramEvent>() {
        {
            AppMethodBeat.i(7807);
            this.xxI = SendDataToH5FromMiniProgramEvent.class.getName().hashCode();
            AppMethodBeat.o(7807);
        }

        public final /* synthetic */ boolean a(com.tencent.mm.sdk.b.b bVar) {
            AppMethodBeat.i(7808);
            SendDataToH5FromMiniProgramEvent sendDataToH5FromMiniProgramEvent = (SendDataToH5FromMiniProgramEvent) bVar;
            if (WebViewUI.this.hashCode() == sendDataToH5FromMiniProgramEvent.hJV && WebViewUI.this.uhz != null) {
                HashMap hashMap = new HashMap(2);
                hashMap.put("miniprogramAppID", sendDataToH5FromMiniProgramEvent.hJU);
                hashMap.put("data", sendDataToH5FromMiniProgramEvent.data);
                com.tencent.mm.plugin.webview.ui.tools.jsapi.d dVar = WebViewUI.this.uhz;
                al.d(new 63(dVar, i.a.b("onMiniProgramData", hashMap, dVar.uFv, dVar.uFw)));
            }
            AppMethodBeat.o(7808);
            return false;
        }
    };
    private boolean uvW = false;
    private int uvX = 0;
    public com.tencent.mm.plugin.webview.ui.tools.jsapi.f uvY;
    protected boolean uvZ = false;
    private ImageButton uva;
    protected View uvb;
    protected FrameLayout uvc;
    public FrameLayout uvd;
    protected MovingImageButton uve;
    protected boolean uvf = false;
    private boolean uvg = false;
    protected com.tencent.mm.bm.a uvh;
    private WebViewInputFooter uvi;
    protected WebViewSearchContentInputFooter uvj;
    private boolean uvk;
    private boolean uvl;
    public String uvm = null;
    protected boolean uvn = true;
    protected long uvo = 0;
    private boolean uvp = false;
    int uvq = -1;
    public boolean uvr = false;
    private boolean uvs = false;
    private boolean uvt = false;
    protected boolean uvu = true;
    private boolean uvv = false;
    private boolean uvw = false;
    private boolean uvx = false;
    private boolean uvy = false;
    protected boolean uvz = false;
    public boolean uwA = false;
    private boolean uwB = false;
    private boolean uwC = false;
    protected volatile boolean uwD = false;
    private com.tencent.mm.plugin.webview.e.d uwE = new com.tencent.mm.plugin.webview.e.d();
    private com.tencent.mm.plugin.webview.model.b uwF = new com.tencent.mm.plugin.webview.model.b(this.ulI);
    protected com.tencent.mm.plugin.webview.modeltools.n uwG = new com.tencent.mm.plugin.webview.modeltools.n();
    protected i uwH;
    public j uwI;
    protected IUtils uwJ = null;
    private WebViewClipBoardHelper uwK;
    protected com.tencent.mm.plugin.webview.b uwL;
    protected volatile String uwM;
    protected volatile long uwN;
    private o uwO;
    protected an uwP = new an(this);
    protected r uwQ = new 12(this);
    private c<qg> uwR = new 23(this);
    private boolean uwS = true;
    protected View uwT;
    private View uwU;
    private com.tencent.mm.bm.a.b uwV = new 4(this);
    private boolean uwW = false;
    protected final l uwX = new l();
    private boolean uwY;
    private OnLongClickListener uwZ = new 25(this);
    protected HashMap<String, Boolean> uwa = new HashMap();
    protected HashMap<String, String> uwb = new HashMap();
    protected HashMap<String, ArrayList<com.tencent.mm.m.d.b>> uwc = new HashMap();
    protected HashMap<String, Boolean> uwd = new HashMap();
    protected d uwe;
    protected com.tencent.mm.ui.widget.a.c uwf = null;
    private View uwg;
    public View uwh = null;
    protected String uwi = null;
    private boolean uwj = false;
    private volatile boolean uwk = false;
    private final boolean uwl = true;
    private boolean uwm = false;
    protected volatile boolean uwn = false;
    private final Set<String> uwo = new HashSet();
    public boolean uwp = false;
    protected boolean uwq = false;
    private final Map<String, Map<String, String>> uwr = new ConcurrentHashMap();
    protected Map<String, String> uws;
    private Map uwt;
    private int uwu = 0;
    private String uwv = BuildConfig.FLAVOR;
    private boolean uww = false;
    private final Map<String, String> uwx = new HashMap();
    private final Set<String> uwy = new HashSet();
    String[] uxa;
    protected boolean uxb = false;
    public OnLongClickListener uxc = new 30(this);
    private String uxd = BuildConfig.FLAVOR;
    protected volatile String uxe = BuildConfig.FLAVOR;
    protected volatile String uxf = null;
    private volatile String uxg = BuildConfig.FLAVOR;
    protected volatile String uxh = BuildConfig.FLAVOR;
    private long uxi = 0;
    private p uxj;
    private af$d uxk = new 43(this);
    protected af$b uxl = new 45(this);
    private com.tencent.mm.ui.base.i uxm;
    private long uxn = 0;
    private String[] uxo = null;

    class f implements com.tencent.mm.plugin.webview.ui.tools.jsapi.b {
        private f() {
        }

        /* synthetic */ f(WebViewUI webViewUI, byte b) {
            this();
        }

        public final boolean afS(String str) {
            AppMethodBeat.i(7899);
            if (bo.isNullOrNil(str)) {
                AppMethodBeat.o(7899);
                return false;
            }
            boolean t = u.t(str, "weixin://");
            AppMethodBeat.o(7899);
            return t;
        }

        public final boolean afM(String str) {
            boolean z = true;
            AppMethodBeat.i(7900);
            int afH = WebViewUI.this.afH(bo.nullAsNil(WebViewUI.this.uwi));
            if (com.tencent.mm.pluginsdk.e.aH(str, WebViewUI.this.uxn)) {
                try {
                    if ("weixin://dl/shopping".equals(str)) {
                        String cZh = WebViewUI.this.icy.cZh();
                        if (!bo.isNullOrNil(cZh)) {
                            WebViewUI.this.loadUrl(cZh);
                        }
                    } else if ("weixin://dl/faq".equals(str)) {
                        int cZj = WebViewUI.this.icy.cZj();
                        int cZk = WebViewUI.this.icy.cZk();
                        WebViewUI.this.loadUrl(ah.getContext().getString(2131303297, new Object[]{Integer.valueOf(cZj), Integer.valueOf(cZk)}));
                    } else if ("weixin://dl/posts".equals(str)) {
                        WebViewUI.this.icy.cZl();
                    } else if ("weixin://dl/moments".equals(str)) {
                        WebViewUI.this.icy.cZm();
                    } else if (str.startsWith("weixin://dl/feedback")) {
                        WebViewUI.this.icy.afp(str);
                    } else if ("weixin://dl/scan".equals(str)) {
                        com.tencent.mm.bp.d.c(WebViewUI.this, "scanner", ".ui.SingleTopScanUI", new Intent());
                    } else {
                        com.tencent.mm.pluginsdk.e.aiq(str);
                    }
                    ArrayList arrayList = new ArrayList();
                    arrayList.add(str);
                    arrayList.add("1");
                    arrayList.add(String.valueOf(afH));
                    arrayList.add(bo.nullAsNil(WebViewUI.this.uwi));
                    arrayList.add(bo.nullAsNil(WebViewUI.this.cOG));
                    WebViewUI.this.icy.k(11405, arrayList);
                } catch (Exception e) {
                    ab.e("MicroMsg.WebViewUI", "kv report fail, ex = %s", new Object[]{e.getMessage()});
                }
            } else {
                z = false;
            }
            AppMethodBeat.o(7900);
            return z;
        }
    }

    public class h extends s {
        protected h() {
        }

        public boolean aft(String str) {
            AppMethodBeat.i(7931);
            ab.i("MicroMsg.WebViewUI", "edw mmShouldOverride");
            if (str.startsWith("weixinping://iframe") || str.startsWith("weixinpreinject://iframe")) {
                AppMethodBeat.o(7931);
                return true;
            } else if (WebViewUI.d(WebViewUI.this, str)) {
                ab.i("MicroMsg.WebViewUI", "custom scheme url deal success, url = ".concat(String.valueOf(str)));
                AppMethodBeat.o(7931);
                return true;
            } else {
                WebViewUI.this.uxf = str;
                AppMethodBeat.o(7931);
                return false;
            }
        }

        public final boolean a(WebView webView, String str) {
            AppMethodBeat.i(7932);
            boolean i = i(webView, str);
            if (i) {
                WebViewUI.this.uvG = false;
            }
            AppMethodBeat.o(7932);
            return i;
        }

        /* JADX WARNING: Removed duplicated region for block: B:58:0x01cd  */
        /* JADX WARNING: Removed duplicated region for block: B:34:0x0137  */
        /* JADX WARNING: Removed duplicated region for block: B:34:0x0137  */
        /* JADX WARNING: Removed duplicated region for block: B:58:0x01cd  */
        private boolean i(com.tencent.xweb.WebView r12, final java.lang.String r13) {
            /*
            r11 = this;
            r10 = 2;
            r9 = 0;
            r5 = -1;
            r8 = 138039; // 0x21b37 float:1.93434E-40 double:6.82003E-319;
            r0 = 1;
            com.tencent.matrix.trace.core.AppMethodBeat.i(r8);
            r1 = "MicroMsg.WebViewUI";
            r2 = "edw opt, shouldOverride url = ";
            r3 = java.lang.String.valueOf(r13);
            r2 = r2.concat(r3);
            com.tencent.mm.sdk.platformtools.ab.i(r1, r2);
            r1 = com.tencent.mm.plugin.webview.ui.tools.WebViewUI.this;
            r1.uvG = r0;
            r1 = com.tencent.mm.plugin.webview.ui.tools.WebViewUI.this;
            r1 = com.tencent.mm.plugin.webview.ui.tools.WebViewUI.c(r1, r13);
            if (r1 != 0) goto L_0x0041;
        L_0x0027:
            r1 = "MicroMsg.WebViewUI";
            r2 = "shouldOverrideUrlLoading, canLoadUrl fail, url = ";
            r3 = java.lang.String.valueOf(r13);
            r2 = r2.concat(r3);
            com.tencent.mm.sdk.platformtools.ab.f(r1, r2);
            r1 = com.tencent.mm.plugin.webview.ui.tools.WebViewUI.this;
            com.tencent.mm.plugin.webview.ui.tools.WebViewUI.k(r1);
            com.tencent.matrix.trace.core.AppMethodBeat.o(r8);
        L_0x0040:
            return r0;
        L_0x0041:
            r1 = "about:blank";
            r1 = com.tencent.mm.pluginsdk.ui.tools.u.t(r13, r1);
            if (r1 == 0) goto L_0x0057;
        L_0x004a:
            r1 = "MicroMsg.WebViewUI";
            r2 = "shouldOverride, url is about:blank";
            com.tencent.mm.sdk.platformtools.ab.e(r1, r2);
            com.tencent.matrix.trace.core.AppMethodBeat.o(r8);
            goto L_0x0040;
        L_0x0057:
            r1 = com.tencent.mm.plugin.webview.ui.tools.WebViewUI.this;
            r1 = r1.cMm;
            r1 = com.tencent.mm.plugin.downloader.model.DownloadChecker.a(r13, r1, r12);
            if (r1 == 0) goto L_0x006e;
        L_0x0061:
            r1 = "MicroMsg.WebViewUI";
            r2 = "use the downloader to download";
            com.tencent.mm.sdk.platformtools.ab.i(r1, r2);
            com.tencent.matrix.trace.core.AppMethodBeat.o(r8);
            goto L_0x0040;
        L_0x006e:
            r1 = "weixin://jump/";
            r1 = r13.startsWith(r1);	 Catch:{ Exception -> 0x019e }
            if (r1 != 0) goto L_0x0080;
        L_0x0077:
            r1 = "weixin://scanqrcode/";
            r1 = r13.startsWith(r1);	 Catch:{ Exception -> 0x019e }
            if (r1 == 0) goto L_0x0089;
        L_0x0080:
            r1 = com.tencent.mm.plugin.webview.ui.tools.WebViewUI.this;	 Catch:{ Exception -> 0x019e }
            r1.afL(r13);	 Catch:{ Exception -> 0x019e }
            com.tencent.matrix.trace.core.AppMethodBeat.o(r8);
            goto L_0x0040;
        L_0x0089:
            r1 = "weixin://dl/business";
            r1 = r13.startsWith(r1);	 Catch:{ Exception -> 0x019e }
            if (r1 == 0) goto L_0x0113;
        L_0x0092:
            r1 = android.net.Uri.parse(r13);	 Catch:{ Exception -> 0x019e }
            r1 = com.tencent.mm.pluginsdk.e.s(r1);	 Catch:{ Exception -> 0x019e }
            if (r1 == 0) goto L_0x0113;
        L_0x009c:
            r1 = com.tencent.mm.plugin.webview.ui.tools.WebViewUI.this;	 Catch:{ Exception -> 0x019e }
            r1 = r1.cOG;	 Catch:{ Exception -> 0x019e }
            r1 = android.net.Uri.parse(r1);	 Catch:{ Exception -> 0x019e }
            r1 = r1.getHost();	 Catch:{ Exception -> 0x019e }
            r2 = new android.content.Intent;	 Catch:{ Exception -> 0x019e }
            r3 = "android.intent.action.VIEW";
            r2.<init>(r3);	 Catch:{ Exception -> 0x019e }
            r3 = "android.intent.category.BROWSABLE";
            r2.addCategory(r3);	 Catch:{ Exception -> 0x019e }
            r3 = new java.lang.StringBuilder;	 Catch:{ Exception -> 0x019e }
            r3.<init>();	 Catch:{ Exception -> 0x019e }
            r3 = r3.append(r13);	 Catch:{ Exception -> 0x019e }
            r4 = "&domain=";
            r3 = r3.append(r4);	 Catch:{ Exception -> 0x019e }
            r1 = r3.append(r1);	 Catch:{ Exception -> 0x019e }
            r1 = r1.toString();	 Catch:{ Exception -> 0x019e }
            r1 = android.net.Uri.parse(r1);	 Catch:{ Exception -> 0x019e }
            r2.setData(r1);	 Catch:{ Exception -> 0x019e }
            r1 = com.tencent.mm.plugin.webview.ui.tools.WebViewUI.this;	 Catch:{ Exception -> 0x019e }
            r1 = r1.getIntent();	 Catch:{ Exception -> 0x019e }
            r3 = "pay_channel";
            r4 = -1;
            r1 = r1.getIntExtra(r3, r4);	 Catch:{ Exception -> 0x019e }
            if (r1 == r5) goto L_0x0101;
        L_0x00e5:
            r3 = "MicroMsg.WebViewUI";
            r4 = "%s do deeplink, bypass pay channel: %s";
            r5 = 2;
            r5 = new java.lang.Object[r5];	 Catch:{ Exception -> 0x019e }
            r6 = 0;
            r5[r6] = r13;	 Catch:{ Exception -> 0x019e }
            r6 = 1;
            r7 = java.lang.Integer.valueOf(r1);	 Catch:{ Exception -> 0x019e }
            r5[r6] = r7;	 Catch:{ Exception -> 0x019e }
            com.tencent.mm.sdk.platformtools.ab.i(r3, r4, r5);	 Catch:{ Exception -> 0x019e }
            r3 = "pay_channel";
            r2.putExtra(r3, r1);	 Catch:{ Exception -> 0x019e }
        L_0x0101:
            r1 = "translate_link_scene";
            r3 = 13;
            r2.putExtra(r1, r3);	 Catch:{ Exception -> 0x019e }
            r1 = com.tencent.mm.plugin.webview.ui.tools.WebViewUI.this;	 Catch:{ Exception -> 0x019e }
            r1.startActivity(r2);	 Catch:{ Exception -> 0x019e }
            com.tencent.matrix.trace.core.AppMethodBeat.o(r8);
            goto L_0x0040;
        L_0x0113:
            r1 = "weixinpreinject://iframe";
            r1 = r13.startsWith(r1);	 Catch:{ Exception -> 0x019e }
            if (r1 == 0) goto L_0x0144;
        L_0x011c:
            r1 = com.tencent.mm.plugin.webview.ui.tools.WebViewUI.this;	 Catch:{ Exception -> 0x019e }
            r1 = r1.uvY;	 Catch:{ Exception -> 0x019e }
            if (r1 == 0) goto L_0x0144;
        L_0x0122:
            r1 = "MicroMsg.WebViewUI";
            r2 = "preInjectJsBridge,accept preinject_Iframe and continue preinjectjsbridge";
            com.tencent.mm.sdk.platformtools.ab.i(r1, r2);	 Catch:{ Exception -> 0x019e }
        L_0x012b:
            r1 = com.tencent.mm.plugin.webview.ui.tools.WebViewUI.this;
            r1 = r1.uxd;
            r1 = r13.equals(r1);
            if (r1 == 0) goto L_0x01cd;
        L_0x0137:
            r1 = com.tencent.mm.plugin.webview.ui.tools.WebViewUI.this;
            r2 = "";
            r1.uxd = r2;
            com.tencent.matrix.trace.core.AppMethodBeat.o(r8);
            goto L_0x0040;
        L_0x0144:
            r1 = "weixin://dl/login/common_view";
            r1 = r13.startsWith(r1);	 Catch:{ Exception -> 0x019e }
            if (r1 != 0) goto L_0x0156;
        L_0x014d:
            r1 = "weixin://dl/login/phone_view";
            r1 = r13.startsWith(r1);	 Catch:{ Exception -> 0x019e }
            if (r1 == 0) goto L_0x0187;
        L_0x0156:
            r1 = com.tencent.mm.plugin.webview.ui.tools.WebViewUI.this;	 Catch:{ Exception -> 0x019e }
            r1 = r1.cOG;	 Catch:{ Exception -> 0x019e }
            r2 = "https://support.weixin.qq.com/security";
            r1 = r1.startsWith(r2);	 Catch:{ Exception -> 0x019e }
            if (r1 != 0) goto L_0x016c;
        L_0x0163:
            r1 = "https://support.wechat.com/security";
            r1 = r13.startsWith(r1);	 Catch:{ Exception -> 0x019e }
            if (r1 == 0) goto L_0x012b;
        L_0x016c:
            r1 = com.tencent.mm.plugin.webview.ui.tools.WebViewUI.this;	 Catch:{ Exception -> 0x019e }
            r1 = r1.uvw;	 Catch:{ Exception -> 0x019e }
            if (r1 == 0) goto L_0x012b;
        L_0x0174:
            r1 = com.tencent.mm.plugin.webview.ui.tools.WebViewUI.this;	 Catch:{ Exception -> 0x019e }
            r1 = r1.mController;	 Catch:{ Exception -> 0x019e }
            r1 = r1.ylL;	 Catch:{ Exception -> 0x019e }
            com.tencent.mm.pluginsdk.e.bu(r1, r13);	 Catch:{ Exception -> 0x019e }
            r1 = com.tencent.mm.plugin.webview.ui.tools.WebViewUI.this;	 Catch:{ Exception -> 0x019e }
            r1.finish();	 Catch:{ Exception -> 0x019e }
            com.tencent.matrix.trace.core.AppMethodBeat.o(r8);
            goto L_0x0040;
        L_0x0187:
            r1 = "weixin://webview/initReady/";
            r1 = r13.startsWith(r1);	 Catch:{ Exception -> 0x019e }
            if (r1 != 0) goto L_0x0199;
        L_0x0190:
            r1 = "weixin://webview/preInjectJSBridge/";
            r1 = r13.startsWith(r1);	 Catch:{ Exception -> 0x019e }
            if (r1 == 0) goto L_0x012b;
        L_0x0199:
            com.tencent.matrix.trace.core.AppMethodBeat.o(r8);
            goto L_0x0040;
        L_0x019e:
            r1 = move-exception;
            r2 = "MicroMsg.WebViewUI";
            r3 = new java.lang.StringBuilder;
            r4 = "shouldOverride, jumpToActivity, ex = ";
            r3.<init>(r4);
            r1 = r1.getMessage();
            r1 = r3.append(r1);
            r1 = r1.toString();
            com.tencent.mm.sdk.platformtools.ab.w(r2, r1);
            r1 = com.tencent.mm.plugin.webview.ui.tools.WebViewUI.this;
            r1 = r1.icz;
            if (r1 != 0) goto L_0x012b;
        L_0x01bf:
            r1 = "MicroMsg.WebViewUI";
            r2 = "wvPerm is null, maybe has detach";
            com.tencent.mm.sdk.platformtools.ab.e(r1, r2);
            com.tencent.matrix.trace.core.AppMethodBeat.o(r8);
            goto L_0x0040;
        L_0x01cd:
            r1 = com.tencent.mm.plugin.webview.ui.tools.WebViewUI.this;
            r1 = r1.afM(r13);
            if (r1 == 0) goto L_0x01da;
        L_0x01d5:
            com.tencent.matrix.trace.core.AppMethodBeat.o(r8);
            goto L_0x0040;
        L_0x01da:
            r1 = "weixin://";
            r1 = r13.startsWith(r1);
            if (r1 == 0) goto L_0x01f5;
        L_0x01e3:
            r1 = "MicroMsg.WebViewUI";
            r2 = "shouldOverrideUrlLoading, can not deal with this weixin scheme, stop directly, url = %s";
            r3 = new java.lang.Object[r0];
            r3[r9] = r13;
            com.tencent.mm.sdk.platformtools.ab.e(r1, r2, r3);
            com.tencent.matrix.trace.core.AppMethodBeat.o(r8);
            goto L_0x0040;
        L_0x01f5:
            r1 = com.tencent.mm.plugin.webview.ui.tools.WebViewUI.this;
            r1 = r1.uvR;
            r1 = r1.ael(r13);
            if (r1 == 0) goto L_0x0205;
        L_0x01ff:
            if (r1 == r10) goto L_0x0205;
        L_0x0201:
            r2 = 8;
            if (r1 != r2) goto L_0x0275;
        L_0x0205:
            r2 = com.tencent.mm.plugin.webview.ui.tools.WebViewUI.this;
            r2 = r2.uvs;
            if (r2 != 0) goto L_0x0275;
        L_0x020d:
            r2 = "MicroMsg.WebViewUI";
            r3 = "edw shouldOverride, should not continue, reason = ";
            r4 = java.lang.String.valueOf(r1);
            r3 = r3.concat(r4);
            com.tencent.mm.sdk.platformtools.ab.i(r2, r3);
            r2 = com.tencent.mm.plugin.webview.ui.tools.WebViewUI.this;
            r2 = r2.afI(r13);
            if (r2 == 0) goto L_0x0257;
        L_0x0226:
            r2 = com.tencent.mm.plugin.webview.ui.tools.WebViewUI.this;
            r2 = r2.pzf;
            r2.stopLoading();
            r2 = com.tencent.mm.plugin.webview.ui.tools.WebViewUI.this;
            r2 = r2.pzf;
            r3 = new com.tencent.mm.plugin.webview.ui.tools.WebViewUI$h$1;
            r3.<init>(r13);
            r2.post(r3);
        L_0x0239:
            r2 = com.tencent.mm.plugin.webview.ui.tools.WebViewUI.this;
            r2 = r2.uvC;
            r2 = r13.equals(r2);
            if (r2 == 0) goto L_0x026b;
        L_0x0245:
            r0 = "MicroMsg.WebViewUI";
            r1 = "shouldOverride, url equals lastGetA8KeyUrl, not trigger geta8key";
            com.tencent.mm.sdk.platformtools.ab.w(r0, r1);
            r0 = r11.aft(r13);
            com.tencent.matrix.trace.core.AppMethodBeat.o(r8);
            goto L_0x0040;
        L_0x0257:
            r2 = com.tencent.mm.plugin.webview.ui.tools.WebViewUI.this;
            r2 = r2.uvC;
            r2 = r13.equals(r2);
            if (r2 != 0) goto L_0x0239;
        L_0x0263:
            r2 = com.tencent.mm.plugin.webview.ui.tools.WebViewUI.this;
            r2 = r2.pzf;
            r2.stopLoading();
            goto L_0x0239;
        L_0x026b:
            r2 = com.tencent.mm.plugin.webview.ui.tools.WebViewUI.this;
            com.tencent.mm.plugin.webview.ui.tools.WebViewUI.a(r2, r13, r0, r1);
            com.tencent.matrix.trace.core.AppMethodBeat.o(r8);
            goto L_0x0040;
        L_0x0275:
            r0 = r11.aft(r13);
            com.tencent.matrix.trace.core.AppMethodBeat.o(r8);
            goto L_0x0040;
            */
            throw new UnsupportedOperationException("Method not decompiled: com.tencent.mm.plugin.webview.ui.tools.WebViewUI$h.i(com.tencent.xweb.WebView, java.lang.String):boolean");
        }

        public void a(WebView webView, String str, boolean z) {
            AppMethodBeat.i(7933);
            ab.i("MicroMsg.WebViewUI", "doUpdateVisitedHistory, url = %s, isReload = %b", new Object[]{str, Boolean.valueOf(z)});
            super.a(webView, str, z);
            if (u.t(str, "about:blank")) {
                ab.e("MicroMsg.WebViewUI", "doUpdateVisitedHistory, url is about:blank");
                AppMethodBeat.o(7933);
                return;
            }
            String url = webView.getUrl();
            if (WebViewUI.this.uvs) {
                WebViewUI.this.as(url, false);
            }
            boolean z2 = WebViewUI.A(WebViewUI.this) && (WebViewUI.this.unr == null || bo.isEqual(url, WebViewUI.this.unr));
            if (z2 || !(WebViewUI.this.icz == null || WebViewUI.this.icz.has(url) || bo.isEqual(url, WebViewUI.this.uvC))) {
                ab.i("MicroMsg.WebViewUI", "doUpdateVisitedHistory start geta8key, url = %s", new Object[]{url});
                WebViewUI.this.as(url, z2);
                WebViewUI.this.X(true, false);
                WebViewUI.this.uww = true;
            }
            WebViewUI.this.uwX.cZU();
            WebViewUI.this.uxf = str;
            WebViewUI.this.uie.afY(str);
            AppMethodBeat.o(7933);
        }

        public void b(WebView webView, String str, Bitmap bitmap) {
            AppMethodBeat.i(7934);
            super.b(webView, str, bitmap);
            WebViewUI.this.uvG = true;
            WebViewUI.this.uwE.aI("onPageStarted", System.currentTimeMillis());
            com.tencent.mm.plugin.webview.model.a.c(WebViewUI.this.pzf);
            com.tencent.mm.plugin.webview.e.e.h(str, WebViewUI.this.mController.ylL);
            ab.i("MicroMsg.WebViewUI", "edw onPageStarted opt, url = ".concat(String.valueOf(str)));
            com.tencent.mm.plugin.report.service.h.pYm.a(155, 0, 1, false);
            if (!WebViewUI.this.uxb) {
                WebViewUI.this.uwI.cZL();
            }
            com.tencent.mm.plugin.topstory.a.h.do(WebViewUI.this.cMm, 0);
            if (WebViewUI.this.aYd()) {
                if (TextUtils.isEmpty(str) || !str.equals(webView.getUrl())) {
                    ab.v("MicroMsg.WebViewUI", "onPageStarted call when preload url %s, webview.url %s", new Object[]{str, webView.getUrl()});
                } else {
                    ab.i("MicroMsg.WebViewUI", "onPageStarted call with same url when preload");
                    WebViewUI.this.daq();
                    if (WebViewUI.this.uvY != null) {
                        WebViewUI.this.uvY.uCf = false;
                    }
                    WebViewUI.this.daF();
                }
            }
            if (com.tencent.mm.sdk.a.b.dnO() && "http://www.dktest-mmcrash.com/".equals(str)) {
                Assert.assertTrue("test errlog in tools " + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()), false);
            }
            WebViewUI.this.unr = WebViewUI.this.uxf;
            WebViewUI.this.l(str, bo.anT(), 1);
            WebViewUI.this.ulI.cXX().unr = WebViewUI.this.unr;
            WebViewUI.this.uxf = str;
            m mVar = m.uuj;
            ab.v("MicroMsg.WebViewReportUtil", "onPageStarted url %s, currUrl %s, traceid %s", new Object[]{str, mVar.uuk, mVar.qTK});
            String str2 = mVar.uuk;
            mVar.uuk = str;
            if (!bo.isNullOrNil(mVar.qTK)) {
                mVar.h(1, str2, 0);
            }
            ab.d("MicroMsg.WebViewUI", "onPageStarted preUrl : %s, curUrl : %s.", new Object[]{WebViewUI.this.unr, WebViewUI.this.uxf});
            if (WebViewUI.c(WebViewUI.this, str)) {
                WebViewUI.this.uwX.cZU();
                WebViewUI.this.uwX.setCurrentURL(str);
                if (WebViewUI.this.afM(str)) {
                    WebViewUI.this.uxd = str;
                    AppMethodBeat.o(7934);
                    return;
                }
                if (WebViewUI.this.uvY != null) {
                    WebViewUI.this.uvY.dbY();
                }
                WebViewUI.this.setProgressBarIndeterminateVisibility(false);
                if (WebViewUI.this.afI(str)) {
                    WebViewUI.this.uwn = true;
                    WebViewUI.this.uuX.finish();
                    WebViewUI.this.pzf.evaluateJavascript("javascript:(function(){ window.isWeixinCached=true; })()", null);
                    if (WebViewUI.this.uhz != null) {
                        WebViewUI.this.uhz.z((String) WebViewUI.this.uwx.get(str), (Map) WebViewUI.this.uwr.get(str));
                    }
                } else {
                    WebViewUI.this.uwn = false;
                    if (!WebViewUI.this.uwp) {
                        WebViewUI.this.uuX.start();
                    }
                }
                WebViewUI.this.uwI.afE(str);
                if (w.uxS.equals(WebViewUI.this.as(str, false))) {
                    WebViewUI.this.uwG.wy(str);
                    if (!WebViewUI.this.uxb) {
                        WebViewUI.this.uwI.utI = true;
                    }
                }
                WebViewUI.this.X(true, false);
                WebViewUI.this.uww = false;
                com.tencent.mm.plugin.webview.model.aq.n cXV = WebViewUI.this.ulI.cXV();
                int i = WebViewUI.this.cSQ;
                String str3 = WebViewUI.this.cMm;
                cXV.cSQ = i;
                cXV.uni = str3;
                if (bo.isNullOrNil(str)) {
                    ab.e("MicroMsg.WebviewReporter", "WebviewOpenUrl.startLoadUrl failed, url is null");
                } else if (!cXV.unv.containsKey(str)) {
                    cXV.unv.put(str, Long.valueOf(bo.anU()));
                }
                Bundle bundle = (Bundle) WebViewUI.this.getIntent().getParcelableExtra("jsapiargs");
                if (bundle != null) {
                    Parcelable parcelable = bundle.getParcelable("KSnsAdTag");
                    if (parcelable != null && (parcelable instanceof SnsAdClick)) {
                        WebViewUI.this.ulI.cYg().pmI = (SnsAdClick) parcelable;
                        WebViewUI.this.ulI.cYg().L(new String[]{str, "0", System.currentTimeMillis()});
                        WebViewUI.this.ulI.cYg().b(WebViewUI.this.icy);
                    }
                }
                WebViewUI.this.uwu = 0;
                if (!(WebViewUI.this.uwO == null || WebViewUI.this.uwO.uxW)) {
                    o F = WebViewUI.this.uwO;
                    ab.i("MicroMsg.WebViewUIStyleHelper", "onWebViewPageStart, url:%s", new Object[]{str});
                    F.iCz = str;
                    F.daR();
                }
                AppMethodBeat.o(7934);
                return;
            }
            ab.f("MicroMsg.WebViewUI", "onPageStarted, canLoadUrl fail, url = ".concat(String.valueOf(str)));
            WebViewUI.k(WebViewUI.this);
            AppMethodBeat.o(7934);
        }

        public void b(WebView webView, String str) {
            AppMethodBeat.i(7935);
            super.b(webView, str);
            WebViewUI.this.uvG = false;
            WebViewUI.this.uwE.aI("onPageFinished", System.currentTimeMillis());
            WebViewUI.this.uvF = true;
            com.tencent.mm.plugin.webview.model.a.c(WebViewUI.this.pzf);
            WebViewUI.this.uie.afY(str);
            if (!WebViewUI.this.uwj) {
                WebViewUI.this.uwj = true;
                WebViewUI.this.ulI.cYa().loadFinished = true;
            }
            ab.i("MicroMsg.WebViewUI", "edw onPageFinished opt, url = %s", new Object[]{str});
            aq.d cYf = WebViewUI.this.ulI.cYf();
            if (cYf.mlA && !cYf.und) {
                try {
                    Uri parse = Uri.parse(str);
                    if (str.startsWith("http")) {
                        String host = parse.getHost();
                        if (host != null && host.equalsIgnoreCase("v.html5.qq.com")) {
                            com.tencent.mm.plugin.report.service.h.pYm.a(283, 0, 1, true);
                            cYf.und = true;
                            ab.i("MicroMsg.WebviewReporter.DomainReporter", "onPageFinished, domain visit reported, url = %s", new Object[]{str});
                        }
                    } else {
                        ab.i("MicroMsg.WebviewReporter.DomainReporter", "onPageFinished, url not startswith http");
                    }
                } catch (Exception e) {
                    ab.e("MicroMsg.WebviewReporter.DomainReporter", "onPageFinished, parse url fail, url = %s", new Object[]{str});
                }
            }
            m mVar = m.uuj;
            ab.v("MicroMsg.WebViewReportUtil", "onPageFinished traceid %s", new Object[]{mVar.qTK});
            if (!bo.isNullOrNil(mVar.qTK)) {
                mVar.kT(2);
            }
            if (WebViewUI.this.pzf == null) {
                ab.w("MicroMsg.WebViewUI", "onPageFinished, webview has been destroyed, skip");
                AppMethodBeat.o(7935);
                return;
            }
            WebViewUI.this.uwG.wy(str);
            String title = WebViewUI.this.pzf.getTitle();
            ab.i("MicroMsg.WebViewUI", "onPageFinished, old title = %s, new title = %s, fixedTitle = %b, showTitle = %b, loadUrl = %s", new Object[]{WebViewUI.this.mController.getMMTitle(), title, Boolean.valueOf(WebViewUI.this.uuW), Boolean.valueOf(WebViewUI.this.rpm), WebViewUI.this.uxf});
            if (WebViewUI.this.pzf.getIsX5Kernel() && !bo.isNullOrNil(title) && title.length() > 0 && !title.equals(WebViewUI.this.mController.getMMTitle()) && !title.startsWith("http") && ((WebViewUI.this.uxf == null || !WebViewUI.this.uxf.equals(title)) && !WebViewUI.this.uuW && WebViewUI.this.rpm)) {
                ab.d("MicroMsg.WebViewUI", "onPageFinished, update old title while goback");
                WebViewUI.this.setMMTitle(title);
            }
            WebViewUI.this.uwX.setCurrentURL(WebViewUI.this.dae());
            boolean booleanExtra = WebViewUI.this.getIntent().getBooleanExtra("shouldForceViewPort", false);
            ab.d("MicroMsg.WebViewUI", "hy: shouldForceViewPort: ".concat(String.valueOf(booleanExtra)));
            if (booleanExtra) {
                webView.evaluateJavascript(WebViewUI.this.getIntent().getStringExtra("view_port_code"), null);
            }
            WebViewUI.J(WebViewUI.this);
            if (WebViewUI.c(WebViewUI.this, str)) {
                WebViewUI.this.setProgressBarIndeterminateVisibility(false);
                WebViewUI.this.uuX.finish();
                WebViewUI.this.uxd = BuildConfig.FLAVOR;
                if (str.equals("file:///android_asset/jsapi/wxjs.js")) {
                    ab.i("MicroMsg.WebViewUI", "onPageFinished, js is finished loaded");
                    AppMethodBeat.o(7935);
                    return;
                }
                ab.i("MicroMsg.WebViewUI", "onPageFinished, inject url" + WebViewUI.this.uwv);
                if (WebViewUI.this.uvY != null) {
                    WebViewUI.this.uvY.uFU = WebViewUI.this.getIntent().getBooleanExtra("inject_city_service_js", false);
                    WebViewUI.this.uvY.uFV = WebViewUI.this.getIntent().getStringExtra("city_service_ext_info");
                    WebViewUI.this.uvY.dbZ();
                }
                if (!(WebViewUI.this.icz == null || WebViewUI.this.icz.aei(str) == null)) {
                    WebViewUI.a(WebViewUI.this, WebViewUI.this.icz.aei(str).jB(34), WebViewUI.this.icz.aei(str).jB(75));
                }
                WebViewUI.this.nP(false);
                com.tencent.mm.plugin.webview.model.aq.n cXV = WebViewUI.this.ulI.cXV();
                if (bo.isNullOrNil(str)) {
                    ab.e("MicroMsg.WebviewReporter", "WebviewOpenUrl.stopLoadUrl failed, url is null");
                } else if (cXV.unv.containsKey(str)) {
                    cXV.unv.put(str, Long.valueOf(bo.anU() - ((Long) cXV.unv.get(str)).longValue()));
                }
                com.tencent.mm.plugin.webview.model.aq.f cXW = WebViewUI.this.ulI.cXW();
                if (bo.isNullOrNil(str)) {
                    ab.e("MicroMsg.WebviewReporter", "WebViewRenderReporter.onPageFinish failed, url is null");
                } else if (cXW.ung.containsKey(str)) {
                    cXW.ung.put(str, Long.valueOf(bo.anU() - ((Long) cXW.ung.get(str)).longValue()));
                }
                aq$h cXZ = WebViewUI.this.ulI.cXZ();
                com.tencent.mm.plugin.webview.stub.d dVar = WebViewUI.this.icy;
                if (!(dVar == null || cXZ.cph)) {
                    cXZ.cph = true;
                    int aEn = aq.aEn();
                    long anU = bo.anU() - cXZ.startTime;
                    if (anU >= 0 && anU <= 180000) {
                        String str2 = cXZ.uni;
                        Object[] objArr = new Object[11];
                        objArr[0] = Integer.valueOf(4);
                        objArr[1] = Long.valueOf(anU);
                        objArr[2] = Integer.valueOf(aEn);
                        if (cXZ.url == null) {
                            title = cXZ.url;
                        } else {
                            title = cXZ.url.replace(",", "!");
                        }
                        objArr[3] = title;
                        objArr[4] = Integer.valueOf(0);
                        objArr[5] = Integer.valueOf(0);
                        objArr[6] = Integer.valueOf(0);
                        objArr[7] = Integer.valueOf(aq.access$000());
                        objArr[8] = Integer.valueOf(aq.access$100());
                        objArr[9] = Integer.valueOf(cXZ.cSQ);
                        objArr[10] = cXZ.uni;
                        aq.b(dVar, str2, objArr);
                        ab.i("MicroMsg.WebviewReporter", "WebViewTotalTimeReporter.report url : %s, cost time : %d, netType : %d, %d, %d, getA8KeyScene:%d, prePublishid:%s", new Object[]{cXZ.url, Long.valueOf(anU), Integer.valueOf(aEn), Integer.valueOf(aq.access$000()), Integer.valueOf(aq.access$100()), Integer.valueOf(cXZ.cSQ), cXZ.uni});
                    }
                }
                if (!WebViewUI.this.uwa.containsKey(str)) {
                    WebViewUI.this.uwa.put(str, Boolean.valueOf(WebViewUI.this.dxY()));
                }
                Bundle bundle = (Bundle) WebViewUI.this.getIntent().getParcelableExtra("jsapiargs");
                if (bundle != null) {
                    Parcelable parcelable = bundle.getParcelable("KSnsAdTag");
                    if (parcelable != null && (parcelable instanceof SnsAdClick)) {
                        WebViewUI.this.ulI.cYg().pmI = (SnsAdClick) parcelable;
                        WebViewUI.this.ulI.cYg().L(new String[]{str, "1", System.currentTimeMillis()});
                        WebViewUI.this.ulI.cYg().b(WebViewUI.this.icy);
                    }
                }
                WebViewUI.this.nO(((Boolean) WebViewUI.this.uwa.get(str)).booleanValue());
                Boolean bool = (Boolean) WebViewUI.this.uwd.get(str);
                if (bool == null || !bool.booleanValue()) {
                    WebViewUI.this.showOptionMenu(0, true);
                } else {
                    WebViewUI.this.showOptionMenu(0, false);
                }
                if (WebViewUI.this.uvu && bo.isNullOrNil(WebViewUI.this.uxe)) {
                    WebViewUI.this.uxe = WebViewUI.this.uxf;
                }
                WebViewUI.this.uxi = bo.anT();
                com.tencent.mm.sdk.b.a.xxA.m(new vp());
                if (!(WebViewUI.this.uwO == null || WebViewUI.this.uwO.uxW)) {
                    o F = WebViewUI.this.uwO;
                    ab.i("MicroMsg.WebViewUIStyleHelper", "onWebViewPageFinished, url:%s", new Object[]{str});
                    F.iCz = str;
                }
                com.tencent.mm.plugin.webview.e.d B = WebViewUI.this.uwE;
                MMWebView mMWebView = WebViewUI.this.pzf;
                if (mMWebView != null) {
                    mMWebView.evaluateJavascript("JSON.stringify({timing:((window.performance && window.performance.timing) ? window.performance.timing : null)});", new d$1(B));
                }
                if (com.tencent.mm.sdk.platformtools.f.IS_FLAVOR_RED) {
                    g.dOW().b(new 1(webView)).a(new 2(this, str));
                }
                AppMethodBeat.o(7935);
                return;
            }
            ab.f("MicroMsg.WebViewUI", "onPageFinished, canLoadUrl fail, url = ".concat(String.valueOf(str)));
            WebViewUI.k(WebViewUI.this);
            AppMethodBeat.o(7935);
        }

        public final void a(WebView webView, com.tencent.xweb.j jVar, SslError sslError) {
            String str;
            AppMethodBeat.i(7936);
            com.tencent.xweb.util.f.rB(true);
            String url = webView.getUrl() == null ? WebViewUI.this.uxf : webView.getUrl();
            if (url == null || !url.startsWith(((com.tencent.mm.plugin.brandservice.a.b) com.tencent.mm.kernel.g.K(com.tencent.mm.plugin.brandservice.a.b.class)).aVQ())) {
                str = url;
            } else {
                str = WebViewUI.this.cWL();
            }
            com.tencent.mm.plugin.report.service.h.pYm.a(155, 1, 1, false);
            com.tencent.mm.plugin.report.service.h.pYm.a(155, 30, 1, false);
            com.tencent.mm.plugin.topstory.a.h.do(WebViewUI.this.cMm, 1);
            com.tencent.mm.plugin.topstory.a.h.do(WebViewUI.this.cMm, 30);
            com.tencent.mm.plugin.topstory.a.h.c(WebViewUI.this.cMm, WebViewUI.this.cOG, 30, WebViewUI.this.ulI.cXY().edh);
            if (WebViewUI.this.uic == null) {
                WebViewUI.this.uic = new d(WebViewUI.this, WebViewUI.this.pzf);
            }
            WebViewUI.this.uic.a(str, jVar, sslError);
            AppMethodBeat.o(7936);
        }

        public void a(WebView webView, int i, String str, String str2) {
            AppMethodBeat.i(7937);
            com.tencent.xweb.util.f.rB(false);
            boolean isConnected = at.isConnected(WebViewUI.this);
            ab.e("MicroMsg.WebViewUI", "edw onReceivedError, failingUrl = %s, errorCode = %d, desc = %s, isNetworkConnected = %b", new Object[]{str2, Integer.valueOf(i), str, Boolean.valueOf(isConnected)});
            com.tencent.mm.plugin.report.service.h.pYm.a(155, 1, 1, false);
            com.tencent.mm.plugin.report.service.h.pYm.a(155, (long) b.Jf(i), 1, false);
            com.tencent.mm.plugin.topstory.a.h.do(WebViewUI.this.cMm, 1);
            com.tencent.mm.plugin.topstory.a.h.do(WebViewUI.this.cMm, b.Jf(i));
            com.tencent.mm.plugin.topstory.a.h.c(WebViewUI.this.cMm, WebViewUI.this.cOG, b.Jf(i), WebViewUI.this.ulI.cXY().edh);
            super.a(webView, i, str, str2);
            m.uuj.Jq(i);
            WebViewUI.this.ulI.cYg().errCode = i;
            WebViewUI.this.uwI.utI = false;
            if (WebViewUI.this.uvy) {
                WebViewUI.this.finish();
            }
            try {
                if (new URL(str2).getHost().equals("mp.weixin.qq.com")) {
                    com.tencent.mm.sdk.g.d.xDG.b(new 3(this, str2, i), "WebViewUI.CheckDNS");
                }
                AppMethodBeat.o(7937);
            } catch (MalformedURLException e) {
                ab.printErrStackTrace("MicroMsg.WebViewUI", e, "check mp url", new Object[0]);
                AppMethodBeat.o(7937);
            }
        }

        public static String afT(String str) {
            AppMethodBeat.i(7938);
            StringBuilder stringBuilder = new StringBuilder();
            try {
                InetAddress[] allByName = InetAddress.getAllByName(str);
                if (allByName != null && allByName.length > 0) {
                    for (InetAddress hostAddress : allByName) {
                        stringBuilder.append(hostAddress.getHostAddress());
                        stringBuilder.append(";");
                    }
                }
                String stringBuilder2 = stringBuilder.toString();
                AppMethodBeat.o(7938);
                return stringBuilder2;
            } catch (UnknownHostException e) {
                ab.printErrStackTrace("MicroMsg.WebViewUI", e, "dnsIps", new Object[0]);
                AppMethodBeat.o(7938);
                return null;
            }
        }

        public final void h(WebView webView, String str) {
            AppMethodBeat.i(7939);
            ab.i("MicroMsg.WebViewUI", "edw onLoadResource opt, url = ".concat(String.valueOf(str)));
            if (WebViewUI.c(WebViewUI.this, str)) {
                com.tencent.mm.plugin.webview.model.aq.f cXW = WebViewUI.this.ulI.cXW();
                if (bo.isNullOrNil(str)) {
                    ab.e("MicroMsg.WebviewReporter", "WebViewRenderReporter.onLoadResource failed, url is null");
                } else if (!(bo.isNullOrNil(cXW.iCz) || str.equals(cXW.iCz) || !cXW.unh)) {
                    if (cXW.unf.containsKey(cXW.iCz)) {
                        cXW.unf.put(cXW.iCz, Long.valueOf(bo.anU() - ((Long) cXW.unf.get(cXW.iCz)).longValue()));
                    }
                    cXW.unh = false;
                }
                super.h(webView, str);
                AppMethodBeat.o(7939);
                return;
            }
            ab.f("MicroMsg.WebViewUI", "onLoadResource, canLoadUrl fail, url = ".concat(String.valueOf(str)));
            super.h(webView, str);
            WebViewUI.k(WebViewUI.this);
            AppMethodBeat.o(7939);
        }

        public o c(WebView webView, String str) {
            AppMethodBeat.i(7940);
            ab.i("MicroMsg.WebViewUI", "shouldInterceptRequest, url = %s", new Object[]{str});
            if (afU(str)) {
                AppMethodBeat.o(7940);
                return null;
            }
            o afV = afV(str);
            AppMethodBeat.o(7940);
            return afV;
        }

        public o a(WebView webView, com.tencent.xweb.n nVar) {
            AppMethodBeat.i(7941);
            o a;
            if (nVar == null || nVar.getUrl() == null || bo.isNullOrNil(nVar.getUrl().toString())) {
                a = super.a(webView, nVar);
                AppMethodBeat.o(7941);
                return a;
            }
            ab.i("MicroMsg.WebViewUI", "shouldInterceptRequest, url = %s, method = %s, isForMainFrame = %b", new Object[]{nVar.getUrl(), nVar.getMethod(), Boolean.valueOf(nVar.isForMainFrame())});
            if (afU(nVar.getUrl().toString())) {
                AppMethodBeat.o(7941);
                return null;
            }
            a = afV(nVar.getUrl().toString());
            AppMethodBeat.o(7941);
            return a;
        }

        public o a(WebView webView, com.tencent.xweb.n nVar, Bundle bundle) {
            AppMethodBeat.i(7942);
            o a;
            if (nVar == null || nVar.getUrl() == null || bo.isNullOrNil(nVar.getUrl().toString())) {
                a = super.a(webView, nVar);
                AppMethodBeat.o(7942);
                return a;
            }
            ab.i("MicroMsg.WebViewUI", "shouldInterceptRequest, url = %s, method = %s, isForMainFrame = %b", new Object[]{nVar.getUrl(), nVar.getMethod(), Boolean.valueOf(nVar.isForMainFrame())});
            if (afU(nVar.getUrl().toString())) {
                AppMethodBeat.o(7942);
                return null;
            }
            if (com.tencent.mm.cj.c.iv(WebViewUI.this)) {
                try {
                    int i = bundle.getInt("resourceType");
                    if ((i == 1 || i == 7) && !WebViewUI.this.uvE) {
                        ab.i("MicroMsg.WebViewUI", "get resoutce type is iframe : %d, start geta8key", new Object[]{Integer.valueOf(i)});
                        WebViewUI.a(WebViewUI.this, nVar.getUrl().toString(), false, 5);
                    }
                } catch (Exception e) {
                    ab.w("MicroMsg.WebViewUI", "get resource type failed Exception ; %s", new Object[]{e.getMessage()});
                } catch (Throwable th) {
                    ab.w("MicroMsg.WebViewUI", "get resource type failed Throwable ; %s", new Object[]{th.getMessage()});
                }
            }
            a = afV(nVar.getUrl().toString());
            AppMethodBeat.o(7942);
            return a;
        }

        private boolean afU(String str) {
            AppMethodBeat.i(7943);
            if (WebViewUI.c(WebViewUI.this, str)) {
                AppMethodBeat.o(7943);
                return false;
            }
            ab.f("MicroMsg.WebViewUI", "shouldOverrideUrlLoading, canLoadUrl fail, url = ".concat(String.valueOf(str)));
            WebViewUI.k(WebViewUI.this);
            AppMethodBeat.o(7943);
            return true;
        }

        private o afV(String str) {
            AppMethodBeat.i(7944);
            String dae = WebViewUI.this.dae();
            o a = WebViewUI.this.uwP.a(str, !WebViewUI.this.uwk, WebViewUI.this.icy);
            if (a != null) {
                hi(dae, str);
                AppMethodBeat.o(7944);
                return a;
            }
            AppMethodBeat.o(7944);
            return null;
        }

        private void hi(String str, String str2) {
            AppMethodBeat.i(7945);
            if (str2.equals(str) || WebViewUI.a(WebViewUI.this, str, str2)) {
                WebViewUI.this.handler.post(new 4(this));
            }
            AppMethodBeat.o(7945);
        }
    }

    class n implements com.tencent.mm.plugin.webview.ui.tools.jsapi.b {
        private n() {
        }

        /* synthetic */ n(WebViewUI webViewUI, byte b) {
            this();
        }

        public final boolean afS(String str) {
            AppMethodBeat.i(7958);
            if (bo.isNullOrNil(str)) {
                AppMethodBeat.o(7958);
                return false;
            }
            boolean t = u.t(str, "weixin://gethtml/");
            AppMethodBeat.o(7958);
            return t;
        }

        public final boolean afM(String str) {
            AppMethodBeat.i(7959);
            if (!bo.isNullOrNil(str)) {
                String substring = str.substring(17);
                ab.i("MicroMsg.WebViewUI", "[oneliang]get html content :".concat(String.valueOf(substring)));
                WebViewUI.this.afG(substring);
            }
            AppMethodBeat.o(7959);
            return false;
        }
    }

    protected class q {
        int uxP = 0;

        protected q() {
        }

        public final boolean daP() {
            return this.uxP > 0;
        }
    }

    public WebViewUI() {
        AppMethodBeat.i(7981);
        AppMethodBeat.o(7981);
    }

    static /* synthetic */ boolean A(WebViewUI webViewUI) {
        AppMethodBeat.i(8127);
        boolean dav = webViewUI.dav();
        AppMethodBeat.o(8127);
        return dav;
    }

    static /* synthetic */ void J(WebViewUI webViewUI) {
        AppMethodBeat.i(8128);
        webViewUI.daA();
        AppMethodBeat.o(8128);
    }

    static /* synthetic */ String afR(String str) {
        AppMethodBeat.i(8113);
        String afJ = afJ(str);
        AppMethodBeat.o(8113);
        return afJ;
    }

    static /* synthetic */ void eq(View view) {
        AppMethodBeat.i(8108);
        af(view, 5894);
        AppMethodBeat.o(8108);
    }

    static /* synthetic */ boolean f(WebViewUI webViewUI) {
        AppMethodBeat.i(8112);
        boolean cZs = webViewUI.cZs();
        AppMethodBeat.o(8112);
        return cZs;
    }

    static /* synthetic */ int i(WebViewUI webViewUI) {
        AppMethodBeat.i(8116);
        int daz = webViewUI.daz();
        AppMethodBeat.o(8116);
        return daz;
    }

    static /* synthetic */ void k(WebViewUI webViewUI) {
        AppMethodBeat.i(8119);
        webViewUI.dah();
        AppMethodBeat.o(8119);
    }

    static /* synthetic */ void o(WebViewUI webViewUI) {
        AppMethodBeat.i(8122);
        webViewUI.dau();
        AppMethodBeat.o(8122);
    }

    static /* synthetic */ int r(WebViewUI webViewUI) {
        AppMethodBeat.i(8124);
        int daa = webViewUI.daa();
        AppMethodBeat.o(8124);
        return daa;
    }

    static {
        AppMethodBeat.i(8134);
        HashSet hashSet = new HashSet();
        ums = hashSet;
        hashSet.add("file:///android_asset/");
        String str = com.tencent.mm.compatible.util.e.eSk;
        if (!bo.isNullOrNil(str)) {
            str = com.tencent.mm.compatible.util.e.eSk.replace("/data/user/0", "/data/data");
        }
        ums.add("file://" + new File(aa.Ia(0)).getAbsolutePath());
        ums.add("file://" + new File(com.tencent.mm.compatible.util.e.eSn, "fts/res").getAbsolutePath());
        ums.add("file://" + new File(str, "wenote/res").getAbsolutePath());
        ums.add("file://" + new File(com.tencent.mm.compatible.util.e.eSn, "wenote/res").getAbsolutePath());
        ums.add("file://" + new File(str, "wxa_fts/res").getAbsolutePath());
        ab.i("MicroMsg.WebViewUI", "add webview UI FILE URL WHITE LIST data: %s sdcard:%s, wxapp : %s", new Object[]{r1.getAbsolutePath(), r2.getAbsolutePath(), r3.getAbsolutePath()});
        ums.add("file://" + new File(str, "emoji/res").getAbsolutePath());
        ums.add("file://" + new File(com.tencent.mm.compatible.util.e.eSn, "emoji/res").getAbsolutePath());
        ab.i("MicroMsg.WebViewUI", "add webview UI FILE URL WHITE LIST data: %s sdcard:%s", new Object[]{r1.getAbsolutePath(), r0.getAbsolutePath()});
        ums.add("file://" + new File(aa.Ia(1)).getAbsolutePath());
        ums.add("file://" + new File(com.tencent.mm.compatible.util.e.eSn, "fts_browse/res").getAbsolutePath());
        ab.i("MicroMsg.WebViewUI", "add browse UI FILE URL WHITE LIST data: %s sdcard:%s", new Object[]{r0.getAbsolutePath(), r1.getAbsolutePath()});
        Iterator it = ums.iterator();
        while (it.hasNext()) {
            ab.i("MicroMsg.WebViewUI", "albie: WebViewUI white list path : %s", new Object[]{(String) it.next()});
        }
        AppMethodBeat.o(8134);
    }

    public final com.tencent.mm.plugin.webview.e.d cZW() {
        return this.uwE;
    }

    /* Access modifiers changed, original: protected */
    public void b(String str, String str2, Map<String, String> map) {
    }

    /* Access modifiers changed, original: protected */
    public void FY(String str) {
        AppMethodBeat.i(7982);
        ab.i("MicroMsg.WebViewUI", "[notifyPageInfo]pageInfo:%s", new Object[]{str});
        AppMethodBeat.o(7982);
    }

    /* Access modifiers changed, original: protected */
    public void ab(Bundle bundle) {
    }

    /* Access modifiers changed, original: protected */
    public boolean aMj() {
        return false;
    }

    /* Access modifiers changed, original: protected */
    public void ac(Bundle bundle) {
        int color;
        int i;
        AppMethodBeat.i(7983);
        if (bundle.getBoolean("set_navigation_bar_color_reset", false)) {
            color = this.uwO == null ? getResources().getColor(2131690674) : this.uwO.daW();
            i = 255;
        } else {
            color = bundle.getInt("set_navigation_bar_color_color");
            i = bundle.getInt("set_navigation_bar_color_alpha");
        }
        xE((color & 16777215) | (i << 24));
        AppMethodBeat.o(7983);
    }

    public final void xE(int i) {
        AppMethodBeat.i(7984);
        super.xE(i);
        if (this.uwl) {
            setStatusBarColor(i);
        }
        AppMethodBeat.o(7984);
    }

    public void initSwipeBack() {
        AppMethodBeat.i(7985);
        super.initSwipeBack();
        if (getSwipeBackLayout() == null) {
            AppMethodBeat.o(7985);
        } else if (this.uwl) {
            View childAt = getSwipeBackLayout().getChildAt(0);
            getSwipeBackLayout().removeView(childAt);
            com.tencent.mm.ui.statusbar.b bVar = new com.tencent.mm.ui.statusbar.b(this);
            if (childAt instanceof FrameLayout) {
                View childAt2 = ((FrameLayout) childAt).getChildAt(0);
                LayoutParams layoutParams = childAt2.getLayoutParams();
                ((FrameLayout) childAt).removeView(childAt2);
                bVar.addView(childAt2, layoutParams);
            } else {
                bVar.addView(childAt);
            }
            getSwipeBackLayout().addView(bVar);
            getSwipeBackLayout().setContentView(bVar);
            this.uwm = true;
            AppMethodBeat.o(7985);
        } else {
            AppMethodBeat.o(7985);
        }
    }

    private void nN(boolean z) {
        if (!z) {
            this.uvL = true;
        }
    }

    public void onResume() {
        Bundle bundle;
        AppMethodBeat.i(7986);
        super.onResume();
        if (dae() != null) {
            com.tencent.mm.plugin.webview.e.e.h(dae(), this);
        } else {
            com.tencent.mm.plugin.webview.e.e.h(cWL(), this);
        }
        this.ulI.cXX().lastResumeTime = bo.yz();
        this.ulI.cXY().lastResumeTime = bo.yz();
        m mVar = m.uuj;
        ab.v("MicroMsg.WebViewReportUtil", "onResume traceid %s", new Object[]{mVar.qTK});
        if (!bo.isNullOrNil(mVar.qTK)) {
            mVar.kT(7);
        }
        if (!this.uwS) {
            int hashCode = hashCode();
            for (int size = uvK.size() - 1; size >= 0; size--) {
                if (((z) uvK.get(size)).id == hashCode) {
                    uvK.remove(size);
                    break;
                }
            }
            uvK.add(new z(this));
        }
        this.uwS = false;
        if (this.uvL) {
            nN(true);
            this.uvL = false;
        }
        dak();
        if (this.icy != null) {
            try {
                bundle = new Bundle();
                bundle.putInt("screen_orientation", this.screenOrientation);
                this.icy.g(83, bundle);
            } catch (Exception e) {
                ab.e("MicroMsg.WebViewUI", "ac_set_screen_orientation : " + e.getMessage());
            }
        }
        if (getIntent().getBooleanExtra("disable_swipe_back", false) && getSwipeBackLayout() != null) {
            getSwipeBackLayout().setEnableGesture(false);
        }
        IB("onResume");
        try {
            if (this.icy != null) {
                bundle = this.icy.g(19, null);
                if (bundle != null) {
                    ab.i("MicroMsg.WebViewUI", "onResume, has init = %b", new Object[]{Boolean.valueOf(bundle.getBoolean("webview_video_proxy_init"))});
                    if (bundle.getBoolean("webview_video_proxy_init")) {
                        FactoryProxyManager.getPlayManager().appToFront();
                    }
                }
            }
        } catch (Exception e2) {
            ab.e("MicroMsg.WebViewUI", "notify app tofront failed : %s", new Object[]{e2.getMessage()});
        }
        this.oes = bo.anT();
        this.uwF.aNS().aa(new 44(this));
        if (this.uwD) {
            finish();
        }
        AppMethodBeat.o(7986);
    }

    public void onPause() {
        AppMethodBeat.i(7987);
        super.onPause();
        com.tencent.mm.modelstat.d.b(4, "WebViewUI_" + afH(bo.nullAsNil(this.uwi)), hashCode());
        com.tencent.mm.modelstat.d.h("WebViewUI_" + afH(bo.nullAsNil(this.uwi)), this.oes, bo.anT());
        aq.l cXX = this.ulI.cXX();
        if (cXX.lastResumeTime != -1) {
            cXX.iBA += bo.az(cXX.lastResumeTime) / 1000;
        }
        aq$a cXY = this.ulI.cXY();
        if (cXY.lastResumeTime != -1) {
            cXY.iBA += bo.az(cXY.lastResumeTime);
        }
        m mVar = m.uuj;
        ab.v("MicroMsg.WebViewReportUtil", "onPause traceid %s", new Object[]{mVar.qTK});
        if (mVar.foa) {
            ab.i("MicroMsg.WebViewReportUtil", "isFinish is true");
        } else if (!bo.isNullOrNil(mVar.qTK)) {
            mVar.kT(6);
        }
        try {
            if (this.icy != null) {
                Bundle g = this.icy.g(19, null);
                if (g != null) {
                    ab.i("MicroMsg.WebViewUI", "onPause, has init = %b", new Object[]{Boolean.valueOf(g.getBoolean("webview_video_proxy_init"))});
                    if (g.getBoolean("webview_video_proxy_init")) {
                        FactoryProxyManager.getPlayManager().appToBack();
                    }
                }
            }
        } catch (Exception e) {
            ab.e("MicroMsg.WebViewUI", "notify app toback failed : %s", new Object[]{e.getMessage()});
        }
        dau();
        IB("onPause");
        if (this.uvO != null) {
            ab.i("MicroMsg.WebViewUI", "onPause, now try to hide customview");
            try {
                this.uvO.onHideCustomView();
                AppMethodBeat.o(7987);
                return;
            } catch (Exception e2) {
                ab.printErrStackTrace("MicroMsg.WebViewUI", e2, "onPause", new Object[0]);
            }
        }
        AppMethodBeat.o(7987);
    }

    public void finish() {
        AppMethodBeat.i(7988);
        if (this.uvt) {
            setResult(-1);
        }
        try {
            if (this.icy != null) {
                this.icy.Jc(hashCode());
                this.icy.IP(hashCode());
                this.umI = null;
            }
            ab.w("MicroMsg.WebViewUI", "invoke onWebViewUIDestroy");
        } catch (Exception e) {
            ab.w("MicroMsg.WebViewUI", "onDestroy, remove callback and invoke event on webview destroy, ex = ".concat(String.valueOf(e)));
        }
        if (this.handler != null) {
            this.handler.removeCallbacksAndMessages(null);
        }
        this.uwB = true;
        super.finish();
        AppMethodBeat.o(7988);
    }

    public int getLayoutId() {
        return 2130971207;
    }

    public boolean convertActivityFromTranslucent() {
        AppMethodBeat.i(7989);
        boolean booleanExtra = getIntent().getBooleanExtra("convertActivityFromTranslucent", true);
        AppMethodBeat.o(7989);
        return booleanExtra;
    }

    public void setMMTitle(String str) {
        AppMethodBeat.i(7990);
        if (this.uvx) {
            super.setMMTitle(2131305579);
            AppMethodBeat.o(7990);
            return;
        }
        super.setMMTitle(str);
        AppMethodBeat.o(7990);
    }

    public final void M(CharSequence charSequence) {
        AppMethodBeat.i(7991);
        if (this.uvx) {
            super.setMMTitle(2131305579);
            AppMethodBeat.o(7991);
            return;
        }
        super.M(charSequence);
        AppMethodBeat.o(7991);
    }

    private void IB(String str) {
        AppMethodBeat.i(7992);
        if (this.uhz != null) {
            this.uhz.agn(str);
            try {
                if (str.equals("onPause")) {
                    this.icy.Je(hashCode());
                    AppMethodBeat.o(7992);
                    return;
                }
                if (str.equals("onResume")) {
                    this.icy.Jd(hashCode());
                }
                AppMethodBeat.o(7992);
                return;
            } catch (Exception e) {
                ab.w("MicroMsg.WebViewUI", "onResume, ex = " + e.getMessage());
            }
        }
        AppMethodBeat.o(7992);
    }

    /* Access modifiers changed, original: protected */
    public boolean cZA() {
        return false;
    }

    private void cZX() {
        AppMethodBeat.i(7993);
        this.uwE.aI("onTryBindServiceStart", System.currentTimeMillis());
        ab.i("MicroMsg.WebViewUI", "edw tryBindService");
        bindService(new Intent(this, WebViewStubService.class), this.ktl, 1);
        this.uwE.aI("onTryBindServiceEnd", System.currentTimeMillis());
        AppMethodBeat.o(7993);
    }

    public void onRequestPermissionsResult(int i, String[] strArr, int[] iArr) {
        int i2 = 0;
        AppMethodBeat.i(7994);
        d dVar = this.icH;
        if (dVar.uoE == null) {
            dVar.cYx();
        } else {
            if (119 == i) {
                if (iArr[0] == 0) {
                    Intent intent = (Intent) dVar.uoE.first;
                    int intValue = ((Integer) dVar.uoE.second).intValue();
                    dVar.uoE = null;
                    startActivityForResult(intent, intValue);
                } else {
                    dVar.uoE = null;
                    dVar.b(this, 0, null);
                }
            }
            i2 = 1;
        }
        if (i2 != 0) {
            AppMethodBeat.o(7994);
        } else {
            AppMethodBeat.o(7994);
        }
    }

    public final void onCreateBeforeSetContentView() {
        AppMethodBeat.i(7995);
        supportRequestWindowFeature(5);
        supportRequestWindowFeature(9);
        setProgressBarIndeterminateVisibility(false);
        AppMethodBeat.o(7995);
    }

    /* JADX WARNING: Removed duplicated region for block: B:89:0x0629 A:{Catch:{ Exception -> 0x079b }} */
    /* JADX WARNING: Removed duplicated region for block: B:137:0x07af  */
    /* JADX WARNING: Removed duplicated region for block: B:93:0x0649 A:{Catch:{ Exception -> 0x07d2 }} */
    /* JADX WARNING: Removed duplicated region for block: B:98:0x0682  */
    /* JADX WARNING: Removed duplicated region for block: B:89:0x0629 A:{Catch:{ Exception -> 0x079b }} */
    /* JADX WARNING: Removed duplicated region for block: B:93:0x0649 A:{Catch:{ Exception -> 0x07d2 }} */
    /* JADX WARNING: Removed duplicated region for block: B:137:0x07af  */
    /* JADX WARNING: Removed duplicated region for block: B:98:0x0682  */
    /* JADX WARNING: Missing block: B:109:0x06ec, code skipped:
            if (com.tencent.mm.sdk.platformtools.bo.isNullOrNil(r0) == false) goto L_0x0123;
     */
    public void onCreate(android.os.Bundle r12) {
        /*
        r11 = this;
        r8 = -1;
        r9 = 2;
        r4 = 0;
        r2 = 0;
        r3 = 1;
        r0 = 7996; // 0x1f3c float:1.1205E-41 double:3.9505E-320;
        com.tencent.matrix.trace.core.AppMethodBeat.i(r0);
        r0 = r11.uwE;
        r6 = java.lang.System.currentTimeMillis();
        r0.startTime = r6;
        r1 = "onCreate";
        r6 = r0.startTime;
        r0.aI(r1, r6);
        r0 = r11.uwl;
        if (r0 == 0) goto L_0x0020;
    L_0x001e:
        r11.yll = r2;
    L_0x0020:
        super.onCreate(r12);
        r0 = r11.uwE;
        r1 = "onUIInitStart";
        r6 = java.lang.System.currentTimeMillis();
        r0.aI(r1, r6);
        r0 = "MicroMsg.WebViewUI";
        r1 = new java.lang.StringBuilder;
        r5 = "onCreate";
        r1.<init>(r5);
        r5 = r11.hashCode();
        r1 = r1.append(r5);
        r1 = r1.toString();
        com.tencent.mm.sdk.platformtools.ab.i(r0, r1);
        r0 = new com.tencent.mm.plugin.webview.ui.tools.n;
        r0.<init>(r11);
        r11.umI = r0;
        r0 = new com.tencent.mm.plugin.webview.ui.tools.i;
        r0.<init>(r11);
        r11.uwH = r0;
        r0 = new com.tencent.mm.plugin.webview.ui.tools.j;
        r0.<init>(r11);
        r11.uwI = r0;
        r0 = r11.cWL();
        com.tencent.mm.plugin.webview.e.e.h(r0, r11);
        r0 = new com.tencent.mm.plugin.webview.ui.tools.o;
        r0.<init>(r11);
        r11.uwO = r0;
        r0 = r11.uwO;
        r1 = r0.uxX;
        if (r1 == 0) goto L_0x0091;
    L_0x0072:
        r1 = r0.daQ();
        if (r1 == 0) goto L_0x06ca;
    L_0x0078:
        r0.uxW = r3;
    L_0x007a:
        r1 = "MicroMsg.WebViewUIStyleHelper";
        r5 = "initNewWebViewUIStyleParams, webViewUI#%s, disableLightActionbarStyle:%b";
        r6 = new java.lang.Object[r9];
        r7 = r0.uxX;
        r6[r2] = r7;
        r0 = r0.uxW;
        r0 = java.lang.Boolean.valueOf(r0);
        r6[r3] = r0;
        com.tencent.mm.sdk.platformtools.ab.i(r1, r5, r6);
    L_0x0091:
        r11.uxb = r3;
        r0 = r11.getIntent();
        r1 = "geta8key_session_id";
        r6 = java.lang.System.currentTimeMillis();
        r5 = (int) r6;
        r0 = r0.getIntExtra(r1, r5);
        r11.uvB = r0;
        r0 = r11.getIntent();
        r1 = "geta8key_cookie";
        r0 = r0.getByteArrayExtra(r1);
        r11.uvD = r0;
        r0 = r11.cWL();
        r11.uvm = r0;
        r0 = r11.getIntent();
        r1 = "screen_orientation";
        r0 = r0.getIntExtra(r1, r8);
        r11.screenOrientation = r0;
        r0 = r11.getIntent();
        r1 = "from_shortcut";
        r0 = r0.getBooleanExtra(r1, r2);
        r11.uvz = r0;
        r0 = r11.getIntent();
        r1 = com.tencent.mm.ui.e.m.ygo;
        r0 = r0.getIntExtra(r1, r8);
        r11.uvq = r0;
        r0 = r11.getIntent();
        r1 = "status_bar_style";
        r0 = r0.getStringExtra(r1);
        r11.nft = r0;
        r0 = r11.getIntent();
        r1 = "customize_status_bar_color";
        r0 = r0.getIntExtra(r1, r2);
        r11.nfs = r0;
        r0 = r11.getIntent();
        if (r0 != 0) goto L_0x06ce;
    L_0x00fe:
        r0 = "";
    L_0x0101:
        r1 = r11.getIntent();
        if (r1 != 0) goto L_0x06db;
    L_0x0107:
        r1 = r2;
    L_0x0108:
        r5 = "MicroMsg.WebViewUI";
        r6 = "initCustomActionBarColorIfNeed isNativeStyle is %b";
        r7 = new java.lang.Object[r3];
        r8 = java.lang.Boolean.valueOf(r1);
        r7[r2] = r8;
        com.tencent.mm.sdk.platformtools.ab.i(r5, r6, r7);
        if (r1 == 0) goto L_0x06e8;
    L_0x011b:
        r0 = "white";
        r1 = -16777216; // 0xffffffffff000000 float:-1.7014118E38 double:NaN;
        r11.Jt(r1);
    L_0x0123:
        r0 = android.graphics.Color.parseColor(r0);	 Catch:{ Exception -> 0x06f0 }
        r0 = java.lang.Integer.valueOf(r0);	 Catch:{ Exception -> 0x06f0 }
    L_0x012b:
        if (r0 == 0) goto L_0x015a;
    L_0x012d:
        r1 = new android.os.Bundle;
        r1.<init>(r3);
        r5 = "set_navigation_bar_color_color";
        r6 = r0.intValue();
        r1.putInt(r5, r6);
        r5 = "set_navigation_bar_color_alpha";
        r6 = 255; // 0xff float:3.57E-43 double:1.26E-321;
        r1.putInt(r5, r6);
        r11.ac(r1);
        r1 = r11.getIntent();
        r5 = "customize_status_bar_color";
        r1 = r1.hasExtra(r5);
        if (r1 != 0) goto L_0x015a;
    L_0x0154:
        r0 = r0.intValue();
        r11.nfs = r0;
    L_0x015a:
        r0 = r11.cWL();
        r11.cOG = r0;
        r0 = r11.getIntent();
        r1 = "show_native_web_view";
        r0 = r0.getBooleanExtra(r1, r2);
        r11.uwp = r0;
        r0 = r11.getIntent();
        r1 = "key_trust_url";
        r0 = r0.getBooleanExtra(r1, r2);
        r11.uvl = r0;
        r0 = uwz;
        r0 = r0 + 1;
        uwz = r0;
        r0 = uvK;
        r1 = new com.tencent.mm.plugin.webview.ui.tools.WebViewUI$z;
        r1.<init>(r11);
        r0.add(r1);
        r0 = uvK;
        r0 = r0.size();
        if (r0 <= r3) goto L_0x01b7;
    L_0x0192:
        r0 = uvK;
        r1 = r0.size();
        r1 = r1 + -2;
        r0 = r0.get(r1);
        r0 = (com.tencent.mm.plugin.webview.ui.tools.WebViewUI.z) r0;
        r1 = r0.hiC;
        if (r1 == 0) goto L_0x01b7;
    L_0x01a4:
        r1 = r0.hiC;
        r1 = r1.get();
        if (r1 == 0) goto L_0x01b7;
    L_0x01ac:
        r0 = r0.hiC;
        r0 = r0.get();
        r0 = (com.tencent.mm.plugin.webview.ui.tools.WebViewUI) r0;
        r0.nN(r2);
    L_0x01b7:
        r0 = "MicroMsg.WebViewUI";
        r1 = "initView trust:%b, rawUrl = %s ";
        r5 = new java.lang.Object[r9];
        r6 = r11.uvl;
        r6 = java.lang.Boolean.valueOf(r6);
        r5[r2] = r6;
        r6 = r11.cOG;
        r5[r3] = r6;
        com.tencent.mm.sdk.platformtools.ab.i(r0, r1, r5);
        r0 = r11.getIntent();
        r1 = "KPublisherId";
        r0 = r0.getStringExtra(r1);
        r0 = com.tencent.mm.sdk.platformtools.bo.nullAsNil(r0);
        r11.cMm = r0;
        r0 = r11.getIntent();
        r1 = "geta8key_username";
        r0 = r0.getStringExtra(r1);
        r0 = r11.afH(r0);
        r11.cSQ = r0;
        r0 = r11.ulI;
        r0 = r0.cXT();
        r1 = r11.cSQ;
        r5 = r11.cMm;
        r0.cSQ = r1;
        r0.uni = r5;
        r0 = new com.tencent.mm.sdk.platformtools.ak;
        r0.<init>();
        r11.handler = r0;
        r0 = r11.ulI;
        if (r0 == 0) goto L_0x06f7;
    L_0x0209:
        r0 = r11.ulI;
        r1 = r11.getIntent();
        r5 = "mm_report_bundle";
        r1 = r1.getBundleExtra(r5);
        if (r1 == 0) goto L_0x06f4;
    L_0x0218:
        r5 = r0.umW;
        if (r5 == 0) goto L_0x0220;
    L_0x021c:
        r5 = r0.umW;
        r5.mqu = r4;
    L_0x0220:
        r4 = new com.tencent.mm.plugin.webview.model.aq$b;
        r4.<init>(r0, r1);
        r0.umW = r4;
        r0 = r3;
    L_0x0228:
        r11.uvp = r0;
        r0 = r11.getIntent();
        r1 = "close_window_confirm_info";
        r0 = r0.getBundleExtra(r1);
        if (r0 == 0) goto L_0x023d;
    L_0x0237:
        r0 = com.tencent.mm.plugin.webview.ui.tools.WebViewUI.d.ad(r0);
        r11.uwe = r0;
    L_0x023d:
        r0 = r11.getWindow();
        r1 = 16777216; // 0x1000000 float:2.3509887E-38 double:8.289046E-317;
        r4 = 16777216; // 0x1000000 float:2.3509887E-38 double:8.289046E-317;
        r0.setFlags(r1, r4);
        r0 = r11.getWindow();
        r1 = -3;
        r0.setFormat(r1);
        r0 = r11.uwI;
        r0.cZI();
        com.tencent.mm.pluginsdk.model.v.a.fH(r11);
        r0 = r11.getIntent();
        r1 = "usePlugin";
        r1 = r0.getBooleanExtra(r1, r3);
        r0 = r11.getIntent();
        r4 = "zoom";
        r4 = r0.getBooleanExtra(r4, r3);
        r0 = r11.getIntent();
        r5 = "useJs";
        r5 = r0.getBooleanExtra(r5, r3);
        r0 = r11.cWL();
        r6 = com.tencent.xweb.WebView.isX5();
        if (r6 == 0) goto L_0x06fa;
    L_0x0283:
        r0 = com.tencent.mm.plugin.webview.e.e.agF(r0);
        if (r0 == 0) goto L_0x06fa;
    L_0x0289:
        r0 = "true";
        r6 = "disable_apk_hook";
        r7 = "tools";
        r6 = com.tencent.xweb.a.iG(r6, r7);
        r0 = r0.equals(r6);
        if (r0 != 0) goto L_0x06fa;
    L_0x029c:
        r0 = r3;
    L_0x029d:
        if (r0 == 0) goto L_0x06fd;
    L_0x029f:
        r0 = com.tencent.mm.ui.widget.MMWebView.a.im(r11);
        r11.pzf = r0;
        r6 = 173; // 0xad float:2.42E-43 double:8.55E-322;
        com.tencent.xweb.util.f.nI(r6);
        r0 = r11.pzf;
        if (r0 != 0) goto L_0x02b4;
    L_0x02ae:
        r0 = r11.aXX();
        r11.pzf = r0;
    L_0x02b4:
        r0 = r11.pzf;
        r0.zNv = r11;
        r0 = r11.pzf;
        if (r0 == 0) goto L_0x0396;
    L_0x02bc:
        r6 = r0.getIsX5Kernel();
        if (r6 != 0) goto L_0x0396;
    L_0x02c2:
        r6 = 19;
        r6 = com.tencent.mm.compatible.util.d.iW(r6);
        if (r6 != 0) goto L_0x0396;
    L_0x02ca:
        r6 = new com.tencent.mm.compatible.loader.c;	 Catch:{ Exception -> 0x0705 }
        r7 = "mSysWebView";
        r8 = 0;
        r6.<init>(r0, r7, r8);	 Catch:{ Exception -> 0x0705 }
        r0 = r6.get();	 Catch:{ Exception -> 0x0705 }
        r6 = "MicroMsg.WebViewUIUtil";
        r7 = "tryInterruptAwaitingWebCoreThread, mSysWebView = %s";
        r8 = 1;
        r8 = new java.lang.Object[r8];	 Catch:{ Exception -> 0x0705 }
        r9 = 0;
        r8[r9] = r0;	 Catch:{ Exception -> 0x0705 }
        com.tencent.mm.sdk.platformtools.ab.d(r6, r7, r8);	 Catch:{ Exception -> 0x0705 }
        r6 = new com.tencent.mm.compatible.loader.c;	 Catch:{ Exception -> 0x0705 }
        r7 = "mProvider";
        r8 = 0;
        r6.<init>(r0, r7, r8);	 Catch:{ Exception -> 0x0705 }
        r0 = r6.get();	 Catch:{ Exception -> 0x0705 }
        r6 = "MicroMsg.WebViewUIUtil";
        r7 = "tryInterruptAwaitingWebCoreThread, mWebViewClassic = %s";
        r8 = 1;
        r8 = new java.lang.Object[r8];	 Catch:{ Exception -> 0x0705 }
        r9 = 0;
        r8[r9] = r0;	 Catch:{ Exception -> 0x0705 }
        com.tencent.mm.sdk.platformtools.ab.d(r6, r7, r8);	 Catch:{ Exception -> 0x0705 }
        r6 = new com.tencent.mm.compatible.loader.c;	 Catch:{ Exception -> 0x0705 }
        r7 = "mWebViewCore";
        r8 = 0;
        r6.<init>(r0, r7, r8);	 Catch:{ Exception -> 0x0705 }
        r0 = r6.get();	 Catch:{ Exception -> 0x0705 }
        r6 = "MicroMsg.WebViewUIUtil";
        r7 = "tryInterruptAwaitingWebCoreThread, mWebViewCore = %s";
        r8 = 1;
        r8 = new java.lang.Object[r8];	 Catch:{ Exception -> 0x0705 }
        r9 = 0;
        r8[r9] = r0;	 Catch:{ Exception -> 0x0705 }
        com.tencent.mm.sdk.platformtools.ab.d(r6, r7, r8);	 Catch:{ Exception -> 0x0705 }
        r6 = new com.tencent.mm.compatible.loader.c;	 Catch:{ Exception -> 0x0705 }
        r7 = "sWebCoreHandler";
        r8 = 0;
        r6.<init>(r0, r7, r8);	 Catch:{ Exception -> 0x0705 }
        r0 = r6.get();	 Catch:{ Exception -> 0x0705 }
        r6 = "MicroMsg.WebViewUIUtil";
        r7 = "tryInterruptAwaitingWebCoreThread, sWebCoreHandler = %s";
        r8 = 1;
        r8 = new java.lang.Object[r8];	 Catch:{ Exception -> 0x0705 }
        r9 = 0;
        r8[r9] = r0;	 Catch:{ Exception -> 0x0705 }
        com.tencent.mm.sdk.platformtools.ab.d(r6, r7, r8);	 Catch:{ Exception -> 0x0705 }
        r6 = new com.tencent.mm.compatible.loader.c;	 Catch:{ Exception -> 0x0705 }
        r7 = "mLooper";
        r8 = 0;
        r6.<init>(r0, r7, r8);	 Catch:{ Exception -> 0x0705 }
        r0 = r6.get();	 Catch:{ Exception -> 0x0705 }
        r6 = "MicroMsg.WebViewUIUtil";
        r7 = "tryInterruptAwaitingWebCoreThread, mLooper = %s";
        r8 = 1;
        r8 = new java.lang.Object[r8];	 Catch:{ Exception -> 0x0705 }
        r9 = 0;
        r8[r9] = r0;	 Catch:{ Exception -> 0x0705 }
        com.tencent.mm.sdk.platformtools.ab.d(r6, r7, r8);	 Catch:{ Exception -> 0x0705 }
        r6 = new com.tencent.mm.compatible.loader.c;	 Catch:{ Exception -> 0x0705 }
        r7 = "mThread";
        r8 = 0;
        r6.<init>(r0, r7, r8);	 Catch:{ Exception -> 0x0705 }
        r0 = r6.get();	 Catch:{ Exception -> 0x0705 }
        r6 = "MicroMsg.WebViewUIUtil";
        r7 = "tryInterruptAwaitingWebCoreThread, mThread = %s";
        r8 = 1;
        r8 = new java.lang.Object[r8];	 Catch:{ Exception -> 0x0705 }
        r9 = 0;
        r8[r9] = r0;	 Catch:{ Exception -> 0x0705 }
        com.tencent.mm.sdk.platformtools.ab.d(r6, r7, r8);	 Catch:{ Exception -> 0x0705 }
        r6 = r0 instanceof java.lang.Thread;	 Catch:{ Exception -> 0x0705 }
        if (r6 == 0) goto L_0x0396;
    L_0x0376:
        r0 = (java.lang.Thread) r0;	 Catch:{ Exception -> 0x0705 }
        r6 = "MicroMsg.WebViewUIUtil";
        r7 = "tryInterruptAwaitingWebCoreThread, webCoreThread.getState = %s";
        r8 = 1;
        r8 = new java.lang.Object[r8];	 Catch:{ Exception -> 0x0705 }
        r9 = 0;
        r10 = r0.getState();	 Catch:{ Exception -> 0x0705 }
        r8[r9] = r10;	 Catch:{ Exception -> 0x0705 }
        com.tencent.mm.sdk.platformtools.ab.i(r6, r7, r8);	 Catch:{ Exception -> 0x0705 }
        r6 = r0.getState();	 Catch:{ Exception -> 0x0705 }
        r7 = java.lang.Thread.State.WAITING;	 Catch:{ Exception -> 0x0705 }
        if (r6 != r7) goto L_0x0396;
    L_0x0393:
        r0.interrupt();	 Catch:{ Exception -> 0x0705 }
    L_0x0396:
        r0 = r11.pzf;
        r0 = r0.getSettings();
        r0.setJavaScriptEnabled(r5);
        r0 = r11.pzf;
        r0 = r0.getSettings();
        r0.setPluginsEnabled(r1);
        r0 = r11.pzf;
        r0 = r0.getSettings();
        r0.dUh();
        r0 = r11.pzf;
        r0 = r0.getSettings();
        r0.setBuiltInZoomControls(r4);
        r0 = r11.pzf;
        r0 = r0.getSettings();
        r0.setUseWideViewPort(r3);
        r0 = r11.pzf;
        r0 = r0.getSettings();
        r0.setLoadWithOverviewMode(r3);
        r0 = r11.pzf;
        r0 = r0.getSettings();
        r0.dUc();
        r0 = r11.pzf;
        r0 = r0.getSettings();
        r0.dUb();
        r0 = r11.pzf;
        r0 = r0.getSettings();
        r0.setGeolocationEnabled(r3);
        r0 = r11.pzf;
        r0 = r0.getSettings();
        r0.setJavaScriptCanOpenWindowsAutomatically(r3);
        r0 = r11.pzf;
        r0 = r0.getSettings();
        r0.dUj();
        r0 = r11.pzf;
        r0 = r0.getSettings();
        r0.dUf();
        r0 = r11.pzf;
        r0 = r0.getSettings();
        r1 = "webviewcache";
        r1 = r11.getDir(r1, r2);
        r1 = r1.getAbsolutePath();
        r0.setAppCachePath(r1);
        r0 = r11.pzf;
        r0 = r0.getSettings();
        r0.dUe();
        r0 = r11.pzf;
        r0 = r0.getSettings();
        r0.dUg();
        r0 = r11.pzf;
        r0 = r0.getSettings();
        r1 = new java.lang.StringBuilder;
        r1.<init>();
        r4 = com.tencent.mm.compatible.util.e.eSi;
        r1 = r1.append(r4);
        r4 = "databases/";
        r1 = r1.append(r4);
        r1 = r1.toString();
        r0.setDatabasePath(r1);
        r0 = com.tencent.xweb.b.dTR();
        r0.dTS();
        r0 = com.tencent.xweb.b.dTR();
        r1 = r11.pzf;
        r0.f(r1);
        r0 = r11.getApplicationContext();
        r1 = "window";
        r0 = r0.getSystemService(r1);
        r0 = (android.view.WindowManager) r0;
        r1 = com.tencent.xweb.WebView.class;
        r4 = "mWebViewCore";
        r1 = r1.getDeclaredField(r4);	 Catch:{ Exception -> 0x0729 }
        r1 = r1.getType();	 Catch:{ Exception -> 0x0729 }
        r4 = "mBrowserFrame";
        r1 = r1.getDeclaredField(r4);	 Catch:{ Exception -> 0x0729 }
        r1 = r1.getType();	 Catch:{ Exception -> 0x0729 }
        r4 = "sConfigCallback";
        r1 = r1.getDeclaredField(r4);	 Catch:{ Exception -> 0x0729 }
        r4 = 1;
        r1.setAccessible(r4);	 Catch:{ Exception -> 0x0729 }
        r4 = 0;
        r4 = r1.get(r4);	 Catch:{ Exception -> 0x0729 }
        if (r4 != 0) goto L_0x0715;
    L_0x048e:
        r0 = r11.uwI;
        r1 = r0.cZv();
        r1 = r1 instanceof com.tencent.mm.plugin.webview.ui.tools.game.GameWebViewUI;
        if (r1 == 0) goto L_0x072c;
    L_0x0498:
        r1 = r0.utK;
        r4 = 11;
        r4 = java.lang.Integer.valueOf(r4);
        r1.add(r4);
        r0 = r0.utK;
        r1 = 28;
        r1 = java.lang.Integer.valueOf(r1);
        r0.add(r1);
    L_0x04ae:
        r0 = new com.tencent.mm.plugin.webview.b;
        r0.<init>();
        r11.uwL = r0;
        r0 = r11.getIntent();
        r1 = "translate_webview";
        r0 = r0.getBooleanExtra(r1, r2);
        if (r0 == 0) goto L_0x052a;
    L_0x04c2:
        r11.uvx = r3;
        r0 = 2131305579; // 0x7f09246b float:1.8229333E38 double:1.0530048674E-314;
        r11.setMMTitle(r0);
        r0 = r11.pzf;
        r1 = r11.cOG;
        r4 = r0.getX5WebViewExtension();
        if (r4 == 0) goto L_0x052a;
    L_0x04d4:
        r4 = new android.os.Bundle;
        r4.<init>();
        r5 = com.tencent.mm.sdk.platformtools.aa.dor();
        r6 = "destLanguage";
        r4.putString(r6, r5);
        r5 = "url";
        r4.putString(r5, r1);
        r1 = "translateTips";
        r5 = 2131305584; // 0x7f092470 float:1.8229343E38 double:1.05300487E-314;
        r5 = r11.getString(r5);
        r4.putString(r1, r5);
        r1 = "translateFinish";
        r5 = 2131305581; // 0x7f09246d float:1.8229337E38 double:1.0530048684E-314;
        r5 = r11.getString(r5);
        r4.putString(r1, r5);
        r1 = "errorWording";
        r5 = 2131305580; // 0x7f09246c float:1.8229335E38 double:1.053004868E-314;
        r5 = r11.getString(r5);
        r4.putString(r1, r5);
        r0 = r0.getX5WebViewExtension();	 Catch:{ Exception -> 0x074e }
        r0 = org.a.a.ep(r0);	 Catch:{ Exception -> 0x074e }
        r1 = "invokeMiscMethod";
        r5 = 2;
        r5 = new java.lang.Object[r5];	 Catch:{ Exception -> 0x074e }
        r6 = 0;
        r7 = "translateWebSite";
        r5[r6] = r7;	 Catch:{ Exception -> 0x074e }
        r6 = 1;
        r5[r6] = r4;	 Catch:{ Exception -> 0x074e }
        r0.u(r1, r5);	 Catch:{ Exception -> 0x074e }
    L_0x052a:
        r0 = new com.tencent.mm.plugin.webview.ui.tools.bag.q;
        r1 = r11.pzf;
        r0.<init>(r11, r1);
        r1 = r11.cWO();
        r0 = com.tencent.mm.plugin.webview.ui.tools.bag.o.a(r0, r1);
        r11.uie = r0;
        r0 = r11.uie;
        r1 = r11.cOG;
        r0.afY(r1);
        r11.cZX();
        r4 = new com.tencent.mm.plugin.webview.ui.tools.k;
        r0 = r11.getIntent();
        r1 = "hardcode_jspermission";
        r0 = r0.getParcelableExtra(r1);
        r0 = (com.tencent.mm.protocal.JsapiPermissionWrapper) r0;
        r1 = r11.getIntent();
        r5 = "hardcode_general_ctrl";
        r1 = r1.getParcelableExtra(r5);
        r1 = (com.tencent.mm.protocal.GeneralControlWrapper) r1;
        r5 = new com.tencent.mm.plugin.webview.ui.tools.WebViewUI$52;
        r5.<init>(r11);
        r4.<init>(r0, r1, r5);
        r11.icz = r4;
        r11.initView();
        r0 = "onCreate";
        r11.IB(r0);
        r0 = r11.pzf;
        r0 = r0.getSettings();
        r0 = r0.getUserAgentString();
        r11.ium = r0;
        r0 = r11.getIntent();
        r1 = "from_scence";
        r0 = r0.getIntExtra(r1, r2);
        r11.fromScene = r0;
        r0 = "MicroMsg.WebViewUI";
        r1 = " onCreate fromScene %d";
        r4 = new java.lang.Object[r3];
        r5 = r11.fromScene;
        r5 = java.lang.Integer.valueOf(r5);
        r4[r2] = r5;
        com.tencent.mm.sdk.platformtools.ab.d(r0, r1, r4);
        r0 = new java.lang.StringBuilder;
        r0.<init>();
        r1 = r11.hashCode();
        r0 = r0.append(r1);
        r0 = r0.toString();
        r0 = com.tencent.mm.sdk.platformtools.bo.nullAsNil(r0);
        r0 = com.tencent.mm.model.v.nW(r0);
        r11.cvF = r0;
        r0 = "MicroMsg.WebViewUI";
        r1 = " onCreate sessionId %s";
        r4 = new java.lang.Object[r3];
        r5 = r11.cvF;
        r4[r2] = r5;
        com.tencent.mm.sdk.platformtools.ab.i(r0, r1, r4);
        r0 = r11.ulI;
        r0 = r0.cXZ();
        r1 = r11.cSQ;
        r4 = r11.cMm;
        r0.cSQ = r1;
        r0.uni = r4;
        r1 = r11.cOG;
        r0.url = r1;
        r0 = r11.ulI;
        r0 = r0.cYf();
        r1 = r11.cOG;
        r4 = "MicroMsg.WebviewReporter.DomainReporter";
        r5 = "setRawUrl, value = %s";
        r6 = new java.lang.Object[r3];
        r6[r2] = r1;
        com.tencent.mm.sdk.platformtools.ab.i(r4, r5, r6);
        r4 = android.net.Uri.parse(r1);	 Catch:{ Exception -> 0x0786 }
        r5 = r4.getScheme();	 Catch:{ Exception -> 0x0786 }
        if (r5 == 0) goto L_0x0762;
    L_0x05fb:
        r5 = r4.getScheme();	 Catch:{ Exception -> 0x0786 }
        r5 = r5.toLowerCase();	 Catch:{ Exception -> 0x0786 }
        r6 = "http";
        r5 = r5.startsWith(r6);	 Catch:{ Exception -> 0x0786 }
        if (r5 != 0) goto L_0x0762;
    L_0x060c:
        r0 = "MicroMsg.WebviewReporter.DomainReporter";
        r5 = "rawUrl scheme is not http/https, skip, scheme = %s";
        r6 = 1;
        r6 = new java.lang.Object[r6];	 Catch:{ Exception -> 0x0786 }
        r7 = 0;
        r4 = r4.getScheme();	 Catch:{ Exception -> 0x0786 }
        r6[r7] = r4;	 Catch:{ Exception -> 0x0786 }
        com.tencent.mm.sdk.platformtools.ab.i(r0, r5, r6);	 Catch:{ Exception -> 0x0786 }
    L_0x061f:
        r0 = r11.mController;	 Catch:{ Exception -> 0x079b }
        r0 = r0.contentView;	 Catch:{ Exception -> 0x079b }
        r11.uwT = r0;	 Catch:{ Exception -> 0x079b }
        r0 = r11.uwT;	 Catch:{ Exception -> 0x079b }
        if (r0 == 0) goto L_0x0645;
    L_0x0629:
        r11.cZY();	 Catch:{ Exception -> 0x079b }
        r0 = r11.getWindow();	 Catch:{ Exception -> 0x079b }
        r0 = r0.getDecorView();	 Catch:{ Exception -> 0x079b }
        r0 = (android.view.ViewGroup) r0;	 Catch:{ Exception -> 0x079b }
        r1 = 0;
        r0 = r0.getChildAt(r1);	 Catch:{ Exception -> 0x079b }
        r0 = (android.view.ViewGroup) r0;	 Catch:{ Exception -> 0x079b }
        r1 = new com.tencent.mm.plugin.webview.ui.tools.WebViewUI$54;	 Catch:{ Exception -> 0x079b }
        r1.<init>(r11);	 Catch:{ Exception -> 0x079b }
        r0.addOnLayoutChangeListener(r1);	 Catch:{ Exception -> 0x079b }
    L_0x0645:
        r0 = r11.uwl;	 Catch:{ Exception -> 0x07d2 }
        if (r0 == 0) goto L_0x07af;
    L_0x0649:
        r0 = r11.dab();	 Catch:{ Exception -> 0x07d2 }
        if (r0 == 0) goto L_0x0652;
    L_0x064f:
        r11.dad();	 Catch:{ Exception -> 0x07d2 }
    L_0x0652:
        r0 = new com.tencent.mm.bm.a;
        r1 = r11.mController;
        r1 = r1.ylL;
        r2 = r11.uwV;
        r0.<init>(r1, r2);
        r11.uvh = r0;
        r0 = r11.uwF;
        r0 = r0.aNS();
        r1 = new com.tencent.mm.plugin.webview.ui.tools.WebViewUI$53;
        r1.<init>(r11);
        r0.aa(r1);
        r0 = new com.tencent.mm.plugin.webview.modeltools.WebViewClipBoardHelper;
        r0.<init>(r11);
        r11.uwK = r0;
        r0 = r11.uwR;
        r0.dnU();
        r0 = r11.uvV;
        r0.dnU();
        r0 = r11.uwO;
        if (r0 == 0) goto L_0x069b;
    L_0x0682:
        r0 = r11.uwO;
        r1 = r0.uxX;
        if (r1 == 0) goto L_0x069b;
    L_0x0688:
        r1 = r0.uxX;
        r1 = r1.pzf;
        r0.pzp = r1;
        r1 = r0.uxW;
        if (r1 == 0) goto L_0x07f6;
    L_0x0692:
        r0 = "MicroMsg.WebViewUIStyleHelper";
        r1 = "initNewWebViewUIStyleIfNeed, disableLightActionbarStyle true";
        com.tencent.mm.sdk.platformtools.ab.i(r0, r1);
    L_0x069b:
        r0 = r11.getWindow();
        r0 = r0.getDecorView();
        r1 = 256; // 0x100 float:3.59E-43 double:1.265E-321;
        af(r0, r1);
        r0 = r11.getIntent();
        r1 = "start_activity_time";
        r2 = 0;
        r0 = r0.getLongExtra(r1, r2);
        com.tencent.mm.plugin.webview.model.aq.lP(r0);
        r0 = r11.uwE;
        r1 = "onUIInitEnd";
        r2 = java.lang.System.currentTimeMillis();
        r0.aI(r1, r2);
        r0 = 7996; // 0x1f3c float:1.1205E-41 double:3.9505E-320;
        com.tencent.matrix.trace.core.AppMethodBeat.o(r0);
        return;
    L_0x06ca:
        r0.uxW = r2;
        goto L_0x007a;
    L_0x06ce:
        r0 = r11.getIntent();
        r1 = "custom_action_bar_color";
        r0 = r0.getStringExtra(r1);
        goto L_0x0101;
    L_0x06db:
        r1 = r11.getIntent();
        r5 = "open_custom_style_url";
        r1 = r1.getBooleanExtra(r5, r2);
        goto L_0x0108;
    L_0x06e8:
        r1 = com.tencent.mm.sdk.platformtools.bo.isNullOrNil(r0);
        if (r1 != 0) goto L_0x015a;
    L_0x06ee:
        goto L_0x0123;
    L_0x06f0:
        r0 = move-exception;
        r0 = r4;
        goto L_0x012b;
    L_0x06f4:
        r0 = r2;
        goto L_0x0228;
    L_0x06f7:
        r0 = r2;
        goto L_0x0228;
    L_0x06fa:
        r0 = r2;
        goto L_0x029d;
    L_0x06fd:
        r0 = r11.aXX();
        r11.pzf = r0;
        goto L_0x02b4;
    L_0x0705:
        r0 = move-exception;
        r6 = "MicroMsg.WebViewUIUtil";
        r7 = "tryInterruptAwaitingWebCoreThread, exception = %s";
        r8 = new java.lang.Object[r3];
        r8[r2] = r0;
        com.tencent.mm.sdk.platformtools.ab.e(r6, r7, r8);
        goto L_0x0396;
    L_0x0715:
        r1 = r1.getType();	 Catch:{ Exception -> 0x0729 }
        r5 = "mWindowManager";
        r1 = r1.getDeclaredField(r5);	 Catch:{ Exception -> 0x0729 }
        r5 = 1;
        r1.setAccessible(r5);	 Catch:{ Exception -> 0x0729 }
        r1.set(r4, r0);	 Catch:{ Exception -> 0x0729 }
        goto L_0x048e;
    L_0x0729:
        r0 = move-exception;
        goto L_0x048e;
    L_0x072c:
        r1 = r0.utK;
        r4 = 7;
        r4 = java.lang.Integer.valueOf(r4);
        r1.add(r4);
        r1 = r0.utK;
        r4 = 11;
        r4 = java.lang.Integer.valueOf(r4);
        r1.add(r4);
        r0 = r0.utK;
        r1 = 28;
        r1 = java.lang.Integer.valueOf(r1);
        r0.add(r1);
        goto L_0x04ae;
    L_0x074e:
        r0 = move-exception;
        r1 = "MicroMsg.WebViewTranslateHelper";
        r4 = "detectTranslateWebSiteIsNeeded error %s";
        r5 = new java.lang.Object[r3];
        r0 = r0.getMessage();
        r5[r2] = r0;
        com.tencent.mm.sdk.platformtools.ab.e(r1, r4, r5);
        goto L_0x052a;
    L_0x0762:
        r4 = r4.getHost();	 Catch:{ Exception -> 0x0786 }
        if (r4 == 0) goto L_0x0775;
    L_0x0768:
        r5 = r4.toLowerCase();	 Catch:{ Exception -> 0x0786 }
        r6 = ".qq.com";
        r5 = r5.endsWith(r6);	 Catch:{ Exception -> 0x0786 }
        if (r5 == 0) goto L_0x0796;
    L_0x0775:
        r0 = "MicroMsg.WebviewReporter.DomainReporter";
        r5 = "rawUrl, host is .qq.com, skip, host = %s";
        r6 = 1;
        r6 = new java.lang.Object[r6];	 Catch:{ Exception -> 0x0786 }
        r7 = 0;
        r6[r7] = r4;	 Catch:{ Exception -> 0x0786 }
        com.tencent.mm.sdk.platformtools.ab.i(r0, r5, r6);	 Catch:{ Exception -> 0x0786 }
        goto L_0x061f;
    L_0x0786:
        r0 = move-exception;
        r0 = "MicroMsg.WebviewReporter.DomainReporter";
        r4 = "parse rawUrl fail, rawUrl = %s";
        r5 = new java.lang.Object[r3];
        r5[r2] = r1;
        com.tencent.mm.sdk.platformtools.ab.e(r0, r4, r5);
        goto L_0x061f;
    L_0x0796:
        r4 = 1;
        r0.mlA = r4;	 Catch:{ Exception -> 0x0786 }
        goto L_0x061f;
    L_0x079b:
        r0 = move-exception;
        r1 = "MicroMsg.WebViewUI";
        r4 = "fixContentMargin error : %s";
        r5 = new java.lang.Object[r3];
        r0 = r0.getMessage();
        r5[r2] = r0;
        com.tencent.mm.sdk.platformtools.ab.e(r1, r4, r5);
        goto L_0x0645;
    L_0x07af:
        r0 = 21;
        r0 = com.tencent.mm.compatible.util.d.iW(r0);	 Catch:{ Exception -> 0x07d2 }
        if (r0 == 0) goto L_0x07e6;
    L_0x07b7:
        r0 = r11.getWindow();	 Catch:{ Exception -> 0x07d2 }
        r0 = r0.getDecorView();	 Catch:{ Exception -> 0x07d2 }
        r0 = (android.view.ViewGroup) r0;	 Catch:{ Exception -> 0x07d2 }
        r1 = 0;
        r0 = r0.getChildAt(r1);	 Catch:{ Exception -> 0x07d2 }
        r0 = (android.view.ViewGroup) r0;	 Catch:{ Exception -> 0x07d2 }
        r1 = new com.tencent.mm.plugin.webview.ui.tools.WebViewUI$55;	 Catch:{ Exception -> 0x07d2 }
        r1.<init>(r11, r0);	 Catch:{ Exception -> 0x07d2 }
        r0.setOnApplyWindowInsetsListener(r1);	 Catch:{ Exception -> 0x07d2 }
        goto L_0x0652;
    L_0x07d2:
        r0 = move-exception;
        r1 = "MicroMsg.WebViewUI";
        r4 = "tryToExpandToStatusBar error : %s";
        r3 = new java.lang.Object[r3];
        r0 = r0.getMessage();
        r3[r2] = r0;
        com.tencent.mm.sdk.platformtools.ab.e(r1, r4, r3);
        goto L_0x0652;
    L_0x07e6:
        r0 = r11.getWindow();	 Catch:{ Exception -> 0x07d2 }
        r0 = r0.getDecorView();	 Catch:{ Exception -> 0x07d2 }
        r0 = (android.view.ViewGroup) r0;	 Catch:{ Exception -> 0x07d2 }
        r1 = 1;
        r0.setFitsSystemWindows(r1);	 Catch:{ Exception -> 0x07d2 }
        goto L_0x0652;
    L_0x07f6:
        r1 = "MicroMsg.WebViewUIStyleHelper";
        r2 = "initNewWebViewUIStyleIfNeed, disableLightActionbarStyle false";
        com.tencent.mm.sdk.platformtools.ab.i(r1, r2);
        r0.daR();
        goto L_0x069b;
        */
        throw new UnsupportedOperationException("Method not decompiled: com.tencent.mm.plugin.webview.ui.tools.WebViewUI.onCreate(android.os.Bundle):void");
    }

    /* Access modifiers changed, original: protected|final */
    public final int getActionBarHeight() {
        AppMethodBeat.i(7997);
        int dimensionPixelSize;
        if (getResources().getDimensionPixelSize(2131427360) > com.tencent.mm.bz.a.fromDPToPix(this, 48)) {
            dimensionPixelSize = getResources().getDimensionPixelSize(2131427360);
            AppMethodBeat.o(7997);
            return dimensionPixelSize;
        } else if (com.tencent.mm.compatible.util.j.gu(this)) {
            dimensionPixelSize = getResources().getDimensionPixelSize(2131427563);
            AppMethodBeat.o(7997);
            return dimensionPixelSize;
        } else {
            dimensionPixelSize = getResources().getDimensionPixelSize(2131427562);
            AppMethodBeat.o(7997);
            return dimensionPixelSize;
        }
    }

    /* Access modifiers changed, original: protected|final */
    public final void cZY() {
        AppMethodBeat.i(7998);
        if (this.uwT == null || cZZ()) {
            AppMethodBeat.o(7998);
            return;
        }
        MarginLayoutParams marginLayoutParams = (MarginLayoutParams) this.uwT.getLayoutParams();
        int daa = daa();
        if (daa != marginLayoutParams.topMargin) {
            marginLayoutParams.topMargin = daa;
            this.uwT.setLayoutParams(marginLayoutParams);
        }
        AppMethodBeat.o(7998);
    }

    private int daa() {
        AppMethodBeat.i(7999);
        int i = this.uwl ? 0 : this.iJp;
        if (getSupportActionBar() == null || !getSupportActionBar().isShowing()) {
            AppMethodBeat.o(7999);
            return i;
        }
        i += getActionBarHeight();
        AppMethodBeat.o(7999);
        return i;
    }

    /* Access modifiers changed, original: protected|final */
    @TargetApi(21)
    public final void a(ViewGroup viewGroup, WindowInsets windowInsets) {
        AppMethodBeat.i(8000);
        if (this.iJp == windowInsets.getSystemWindowInsetTop()) {
            AppMethodBeat.o(8000);
            return;
        }
        View viewGroup2;
        this.iJp = windowInsets.getSystemWindowInsetTop();
        cZY();
        if (viewGroup2 instanceof SwipeBackLayout) {
            viewGroup2 = viewGroup2.getChildAt(0);
        }
        View findViewById = viewGroup2.findViewById(2131820940);
        if (findViewById != null) {
            MarginLayoutParams marginLayoutParams = (MarginLayoutParams) findViewById.getLayoutParams();
            marginLayoutParams.topMargin = windowInsets.getSystemWindowInsetTop();
            findViewById.setLayoutParams(marginLayoutParams);
            findViewById.requestLayout();
        }
        if (dab()) {
            dad();
        }
        AppMethodBeat.o(8000);
    }

    /* Access modifiers changed, original: protected */
    public boolean dab() {
        return true;
    }

    /* Access modifiers changed, original: final */
    public final boolean dac() {
        AppMethodBeat.i(8002);
        if (bo.isNullOrNil(this.nft) || !this.nft.equals("black")) {
            AppMethodBeat.o(8002);
            return false;
        }
        AppMethodBeat.o(8002);
        return true;
    }

    public final void at(int i, boolean z) {
        AppMethodBeat.i(8004);
        if (VERSION.SDK_INT < 23 || com.tencent.mm.sdk.h.b.Mt()) {
            if (VERSION.SDK_INT >= 21) {
                if (z) {
                    i = g.Jj(i);
                }
                setStatusBarColor(i);
            }
            AppMethodBeat.o(8004);
            return;
        }
        setStatusBarColor(i);
        Window window = getWindow();
        int systemUiVisibility = window.getDecorView().getSystemUiVisibility();
        if (z) {
            systemUiVisibility |= 8192;
        } else {
            systemUiVisibility &= -8193;
        }
        window.getDecorView().setSystemUiVisibility(systemUiVisibility);
        AppMethodBeat.o(8004);
    }

    @TargetApi(21)
    public final void setStatusBarColor(int i) {
        boolean z = false;
        AppMethodBeat.i(8005);
        if (this.uwl) {
            View view = this.mController.contentView;
            if (!com.tencent.mm.ui.ah.Nw(i)) {
                z = true;
            }
            com.tencent.mm.ui.statusbar.a.d(view, i, z);
            AppMethodBeat.o(8005);
        } else if (this.iJp <= 0 || com.tencent.mm.compatible.util.d.fP(21)) {
            AppMethodBeat.o(8005);
        } else {
            getWindow().setStatusBarColor(0);
            if (this.uwU == null) {
                this.uwU = new View(this);
                ((ViewGroup) findViewById(16908290)).addView(this.uwU, new LayoutParams(-1, this.iJp));
            } else {
                LayoutParams layoutParams = this.uwU.getLayoutParams();
                if (layoutParams.height != this.iJp) {
                    layoutParams.height = this.iJp;
                    this.uwU.setLayoutParams(layoutParams);
                }
            }
            this.uwU.setBackgroundColor(i);
            AppMethodBeat.o(8005);
        }
    }

    public final String dae() {
        AppMethodBeat.i(8006);
        String str;
        if (this.handler == null) {
            str = this.uxf;
            AppMethodBeat.o(8006);
            return str;
        } else if (Thread.currentThread().getId() == this.handler.getLooper().getThread().getId()) {
            if (this.pzf == null) {
                str = BuildConfig.FLAVOR;
                AppMethodBeat.o(8006);
                return str;
            }
            str = this.pzf.getUrl();
            AppMethodBeat.o(8006);
            return str;
        } else if (bo.isNullOrNil(this.uxf)) {
            this.uxf = (String) new 3(this, BuildConfig.FLAVOR).b(this.handler);
            str = this.uxf;
            AppMethodBeat.o(8006);
            return str;
        } else {
            str = this.uxf;
            AppMethodBeat.o(8006);
            return str;
        }
    }

    public void onWebViewScrollChanged(int i, int i2, int i3, int i4) {
        AppMethodBeat.i(8008);
        ab.v("MicroMsg.WebViewUI", "l=%d t=%d oldl=%d oldt=%d", new Object[]{Integer.valueOf(i), Integer.valueOf(i2), Integer.valueOf(i3), Integer.valueOf(i4)});
        if (!(this.uwO == null || this.uwO.uxW)) {
            this.uwO.daU();
        }
        AppMethodBeat.o(8008);
    }

    public final void daf() {
        AppMethodBeat.i(138437);
        v.a.fH(this);
        AppMethodBeat.o(138437);
    }

    public void aBS() {
        AppMethodBeat.i(8010);
        if (VERSION.SDK_INT <= 10) {
            super.aBS();
            AppMethodBeat.o(8010);
        } else if (getForceOrientation() == -1) {
            this.ylk = getSharedPreferences(ah.doA(), 4).getBoolean("settings_landscape_mode", false);
            if (this.ylk) {
                setRequestedOrientation(-1);
                AppMethodBeat.o(8010);
                return;
            }
            setRequestedOrientation(1);
            AppMethodBeat.o(8010);
        } else {
            setRequestedOrientation(getForceOrientation());
            AppMethodBeat.o(8010);
        }
    }

    public int getForceOrientation() {
        return this.screenOrientation;
    }

    private View dag() {
        int identifier;
        AppMethodBeat.i(8011);
        View view = null;
        try {
            identifier = Resources.getSystem().getIdentifier("action_bar_container", SharePluginInfo.ISSUE_KEY_ID, "android");
        } catch (Exception e) {
            ab.e("MicroMsg.WebViewUI", "get resId action_bar_container, exp = %s", new Object[]{e});
            identifier = -1;
        }
        if (identifier > 0) {
            view = findViewById(identifier);
        }
        ab.i("MicroMsg.WebViewUI", "getActionBarContainer, viewResId = %d, get view = %s", new Object[]{Integer.valueOf(identifier), view});
        AppMethodBeat.o(8011);
        return view;
    }

    public void onConfigurationChanged(Configuration configuration) {
        AppMethodBeat.i(8012);
        super.onConfigurationChanged(configuration);
        if (this.jQp != configuration.orientation) {
            View dag = dag();
            if (dag == null) {
                dag = null;
            } else {
                dag = (View) dag.getParent();
            }
            if (dag == null) {
                AppMethodBeat.o(8012);
                return;
            }
            dag.dispatchConfigurationChanged(configuration);
            dag.requestLayout();
            this.jQp = configuration.orientation;
        }
        AppMethodBeat.o(8012);
    }

    public void onStart() {
        AppMethodBeat.i(8013);
        super.onStart();
        ab.i("MicroMsg.WebViewUI", "edw onStart");
        AppMethodBeat.o(8013);
    }

    public void onStop() {
        AppMethodBeat.i(8014);
        ab.i("MicroMsg.WebViewUI", "edw onStop");
        X(true, true);
        super.onStop();
        AppMethodBeat.o(8014);
    }

    private void Jr(int i) {
        AppMethodBeat.i(8015);
        try {
            Bundle bundle = new Bundle();
            bundle.putInt("scene_end_type", i);
            bundle.putInt("scene_end_listener_hash_code", hashCode());
            this.icy.a(5, bundle, hashCode());
            AppMethodBeat.o(8015);
        } catch (Exception e) {
            ab.e("MicroMsg.WebViewUI", "addSceneEnd, ex = " + e.getMessage());
            AppMethodBeat.o(8015);
        }
    }

    private void Js(int i) {
        AppMethodBeat.i(8016);
        try {
            if (this.icy != null) {
                Bundle bundle = new Bundle();
                bundle.putInt("scene_end_type", i);
                bundle.putInt("scene_end_listener_hash_code", hashCode());
                this.icy.a(6, bundle, hashCode());
            }
            AppMethodBeat.o(8016);
        } catch (Exception e) {
            ab.e("MicroMsg.WebViewUI", "removeSceneEnd, ex = " + e.getMessage());
            AppMethodBeat.o(8016);
        }
    }

    public void onDestroy() {
        Bundle bundle;
        AppMethodBeat.i(8017);
        ab.i("MicroMsg.WebViewUI", "onDestroy " + hashCode());
        super.onDestroy();
        com.tencent.mm.plugin.webview.modeltools.c.cYw();
        String dae = dae();
        if (dae != null) {
            String string = getSharedPreferences("webview_url_prefs", 4).getString(ImagesContract.URL, null);
            if (string != null && dae.equals(string)) {
                Editor edit = getSharedPreferences("webview_url_prefs", 4).edit();
                edit.remove(ImagesContract.URL);
                edit.apply();
            }
        } else {
            ab.w("MicroMsg.WebViewUI", "currentURL == null, qbrowser.url may be not accurate");
        }
        this.uie.dbc();
        if (!this.uwB) {
            try {
                if (this.icy != null) {
                    this.icy.Jc(hashCode());
                    this.icy.IP(hashCode());
                }
                ab.w("MicroMsg.WebViewUI", "invoke onWebViewUIDestroy");
            } catch (Exception e) {
                ab.w("MicroMsg.WebViewUI", "onDestroy, remove callback and invoke event on webview destroy, ex = ".concat(String.valueOf(e)));
            }
        }
        if (this.uvh != null) {
            this.uvh.disable();
        }
        this.uwA = true;
        uwz--;
        int hashCode = hashCode();
        for (int size = uvK.size() - 1; size >= 0; size--) {
            if (((z) uvK.get(size)).id == hashCode) {
                uvK.remove(size);
                break;
            }
        }
        l(BuildConfig.FLAVOR, bo.anT(), 0);
        com.tencent.mm.plugin.webview.modelcache.p cYp = com.tencent.mm.plugin.webview.modelcache.p.a.cYp();
        cYp.uoa.put(hashCode(), Boolean.FALSE);
        aq.i cYb = this.ulI.cYb();
        cYb.une = new Object[]{this.cOG, Integer.valueOf(2)};
        cYb.b(this.icy);
        this.ulI.b(this.icy);
        aq aqVar = this.ulI;
        aqVar.umM = null;
        aqVar.umK = null;
        aqVar.umL = null;
        aqVar.umJ = null;
        aqVar.umO = null;
        aqVar.umP = null;
        aqVar.umQ = null;
        aqVar.umR = null;
        if (aqVar.umW != null) {
            aqVar.umW.mqu = null;
            aqVar.umW = null;
        }
        IB("onDestroy");
        this.uwa.clear();
        com.tencent.mm.plugin.webview.model.b bVar = this.uwF;
        if (!(bVar.ulH == null || bVar.ulH.oAl.getLooper() == null)) {
            bVar.ulH.oAl.getLooper().quit();
        }
        bVar.ulH = null;
        an anVar = this.uwP;
        anVar.umD.clear();
        anVar.umE.clear();
        anVar.umF.clear();
        anVar.umB.clear();
        anVar.umC.clear();
        if (this.uxm != null) {
            this.uxm.dismiss();
            this.uxm = null;
        }
        if (this.uxj != null) {
            this.uxj.dismiss();
            this.uxj = null;
        }
        if (this.uwf != null) {
            this.uwf.dismiss();
            this.uwf = null;
        }
        if (this.uvi != null) {
            this.uvi.setOnTextSendListener(null);
        }
        if (this.uvS.daP()) {
            Js(233);
        }
        if (this.uvT.daP()) {
            Js(673);
        }
        if (this.uvU.daP()) {
            Js(666);
        }
        this.uwb.clear();
        this.uwI.onDestroy();
        this.uwR.dead();
        this.uvV.dead();
        if (com.tencent.xweb.c.jx(ah.getContext()) != null) {
            ab.i("MicroMsg.WebViewUI", "now force sync the cookie between ram and db");
            com.tencent.xweb.c.sync();
        }
        if (das()) {
            try {
                if (this.icy != null) {
                    bundle = new Bundle();
                    bundle.putString("srcUsername", getIntent().getStringExtra("srcUsername"));
                    this.icy.a(30, bundle, hashCode());
                }
            } catch (Exception e2) {
            }
        }
        ab.v("MicroMsg.WebViewUI", "on destroy isNeedCallbackMMRpt[%b]", new Object[]{Boolean.valueOf(this.uvp)});
        if (this.uvp) {
            try {
                bundle = getIntent().getBundleExtra("mm_report_bundle");
                if (bo.isNullOrNil(bundle.getString("mm_event_class"))) {
                    ab.w("MicroMsg.WebViewUI", "webview on destroy callback mm but eventclass is null");
                } else if (this.icy != null) {
                    bundle.putLong("key_activity_browse_time", dyi());
                    this.icy.g(250, bundle);
                }
            } catch (Exception e3) {
                ab.e("MicroMsg.WebViewUI", "webview on destroy callback mm exception [%s]", new Object[]{e3.toString()});
            }
        }
        try {
            if (this.icy != null) {
                bundle = new Bundle();
                bundle.putLong("key_activity_browse_time", dyi());
                this.icy.g(251, bundle);
            }
        } catch (Exception e32) {
            ab.e("MicroMsg.WebViewUI", "webview on destroy callback mm exception [%s]", new Object[]{e32.toString()});
        }
        try {
            if (this.icy != null) {
                bundle = this.icy.g(19, null);
                if (bundle != null) {
                    ab.i("MicroMsg.WebViewUI", "onDestroy, has init = %b, webviewHoldingCounter = %d", new Object[]{Boolean.valueOf(bundle.getBoolean("webview_video_proxy_init")), Integer.valueOf(uwz)});
                    if (bundle.getBoolean("webview_video_proxy_init") && uwz <= 0) {
                        FactoryProxyManager.getPlayManager().deinit();
                        this.icy.g(75, null);
                    }
                }
            }
        } catch (Exception e322) {
            ab.e("MicroMsg.WebViewUI", "deinit video player failed : %s", new Object[]{e322.getMessage()});
        }
        if (this.ktl != null) {
            try {
                unbindService(this.ktl);
            } catch (Exception e3222) {
                ab.printErrStackTrace("MicroMsg.WebViewUI", e3222, "unbindService", new Object[0]);
            }
        }
        boolean a = k.a(this.uhz, this.pzf);
        if (this.uhz != null) {
            this.uhz.detach();
        }
        this.uvJ.clear();
        if (this.uic != null) {
            d dVar = this.uic;
            ab.i("MicroMsg.WebView.MMSslErrorHandler", "detach");
            dVar.context = null;
            dVar.urJ = null;
            dVar.urK.clear();
            dVar.urL.clear();
        }
        if (this.uvY != null) {
            this.uvY.detach();
        }
        this.pzf.removeJavascriptInterface("MicroMsg");
        this.pzf.removeJavascriptInterface("JsApi");
        this.pzf.removeJavascriptInterface("__wx");
        try {
            this.pzf.setWebChromeClient(null);
            this.pzf.setWebViewClient(null);
            this.pzf.setOnTouchListener(null);
            this.pzf.setOnLongClickListener(null);
            this.pzf.setVisibility(8);
            this.pzf.removeAllViews();
            this.pzf.clearView();
        } catch (Exception e32222) {
            ab.e("MicroMsg.WebViewUI", "onDestroy, set web infos to null,  ex = %s", new Object[]{e32222.getMessage()});
        }
        this.uwG.cYP();
        if (this.icz != null) {
            k kVar = this.icz;
            ab.i("MicroMsg.WebViewPermission", "detach");
            kVar.ulm.clear();
            kVar.ulm = null;
            this.icz = null;
        }
        try {
            this.uwX.release();
        } catch (Exception e322222) {
            ab.e("MicroMsg.WebViewUI", "onDestroy, remove view,  ex = " + e322222.getMessage());
        }
        if (!a) {
            try {
                this.pzf.destroy();
            } catch (Exception e3222222) {
                ab.w("MicroMsg.WebViewUI", "onDestroy, viewWV destroy, ex = %s", new Object[]{e3222222.getMessage()});
            }
        }
        try {
            if (this.mController.contentView instanceof ViewGroup) {
                ((ViewGroup) this.mController.contentView).removeAllViews();
            }
        } catch (Throwable th) {
            ab.w("MicroMsg.WebViewUI", "onDestroy contentView removeAllViews %s", new Object[]{th});
        }
        WebViewClipBoardHelper webViewClipBoardHelper = this.uwK;
        try {
            webViewClipBoardHelper.upx.removePrimaryClipChangedListener(webViewClipBoardHelper);
            webViewClipBoardHelper.upx = null;
        } catch (Exception e4) {
        }
        com.tencent.mm.plugin.webview.b bVar2 = this.uwL;
        if (bVar2.tipDialog != null && bVar2.tipDialog.isShowing()) {
            bVar2.tipDialog.dismiss();
            bVar2.tipDialog = null;
        }
        this.pzf = null;
        if (this.uwJ != null) {
            this.uwJ = null;
            FactoryProxyManager.getPlayManager().setUtilsObject(null);
        }
        System.gc();
        if (this.uvc != null) {
            this.uvc.removeAllViews();
            this.uvc = null;
        }
        AppMethodBeat.o(8017);
    }

    private void dah() {
        AppMethodBeat.i(8018);
        try {
            this.uwX.release();
            this.pzf.stopLoading();
            this.uvG = false;
            this.pzf.removeAllViews();
            this.pzf.clearView();
        } catch (Exception e) {
            ab.e("MicroMsg.WebViewUI", "forceQuit, ex = " + e.getMessage());
        }
        if (this.uhz != null) {
            this.uhz.detach();
        }
        try {
            this.pzf.destroy();
        } catch (Exception e2) {
            ab.w("MicroMsg.WebViewUI", "forceQuit, viewWV destroy, ex = %s", new Object[]{e2.getMessage()});
        }
        this.pzf = null;
        finish();
        ab.dot();
        Process.killProcess(Process.myPid());
        AppMethodBeat.o(8018);
    }

    public boolean onKeyUp(int i, KeyEvent keyEvent) {
        AppMethodBeat.i(8019);
        if (i != 82 || this.uwW) {
            boolean onKeyUp = super.onKeyUp(i, keyEvent);
            AppMethodBeat.o(8019);
            return onKeyUp;
        }
        AppMethodBeat.o(8019);
        return true;
    }

    public boolean onKeyDown(int i, KeyEvent keyEvent) {
        AppMethodBeat.i(8020);
        ab.i("MicroMsg.WebViewUI", "onKeyDown keyCode %d", new Object[]{Integer.valueOf(i)});
        aq.i cYb;
        if (i == 4 && this.pzf != null && this.pzf.hasEnteredFullscreen()) {
            this.pzf.leaveFullscreen();
            AppMethodBeat.o(8020);
            return true;
        } else if (i != 4 || this.uvN == null || this.uvM == null || this.uvO == null) {
            if (i == 4) {
                boolean z;
                if (this.uvi == null || !this.uvi.isShown()) {
                    z = false;
                } else {
                    this.uvi.hide();
                    dau();
                    z = true;
                }
                if (z) {
                    AppMethodBeat.o(8020);
                    return true;
                }
            }
            if (i == 4) {
                if (this.pzf != null && this.pzf.canGoBack() && this.uvn) {
                    dai();
                    cYb = this.ulI.cYb();
                    cYb.une = new Object[]{this.cOG, Integer.valueOf(1)};
                    cYb.b(this.icy);
                    AppMethodBeat.o(8020);
                    return true;
                }
                m.uuj.close();
            }
            if (i == 4 && daB() && cWG()) {
                AppMethodBeat.o(8020);
                return true;
            } else if (i == 4 && this.uie.Jx(22)) {
                AppMethodBeat.o(8020);
                return true;
            } else {
                if (i == 4) {
                    daD();
                }
                boolean onKeyDown = super.onKeyDown(i, keyEvent);
                AppMethodBeat.o(8020);
                return onKeyDown;
            }
        } else {
            try {
                this.uvO.onHideCustomView();
            } catch (Exception e) {
                ab.printErrStackTrace("MicroMsg.WebViewUI", e, "onkeydown", new Object[0]);
            }
            cYb = this.ulI.cYb();
            cYb.une = new Object[]{this.cOG, Integer.valueOf(1)};
            cYb.b(this.icy);
            AppMethodBeat.o(8020);
            return true;
        }
    }

    /* Access modifiers changed, original: protected */
    public void dai() {
        AppMethodBeat.i(8021);
        this.uvo = System.currentTimeMillis();
        this.pzf.goBack();
        this.uvC = null;
        if (this.uvZ) {
            this.uvZ = false;
        }
        m mVar = m.uuj;
        ab.v("MicroMsg.WebViewReportUtil", "goBack traceid %s", new Object[]{mVar.qTK});
        if (!bo.isNullOrNil(mVar.qTK)) {
            mVar.kT(5);
        }
        AppMethodBeat.o(8021);
    }

    /* Access modifiers changed, original: protected */
    public void dE(String str, int i) {
        AppMethodBeat.i(8022);
        if (this.uvi == null) {
            AppMethodBeat.o(8022);
            return;
        }
        WebViewInputFooter webViewInputFooter = this.uvi;
        webViewInputFooter.setVisibility(0);
        if (webViewInputFooter.uKu != null) {
            webViewInputFooter.uKu.setVisibility(0);
        }
        if (webViewInputFooter.uKt != null) {
            webViewInputFooter.uKt.setEnabled(true);
            webViewInputFooter.uKt.setBackgroundResource(2130839104);
        }
        if (webViewInputFooter.uKq != null) {
            webViewInputFooter.uKq.setVisibility(0);
        }
        webViewInputFooter.uKv = false;
        if (webViewInputFooter.uKt != null) {
            webViewInputFooter.uKt.setFocusable(true);
            webViewInputFooter.uKt.setFocusableInTouchMode(true);
            webViewInputFooter.uKt.requestFocus();
        }
        if (webViewInputFooter.crP != null) {
            webViewInputFooter.crP.showVKB();
        }
        webViewInputFooter.state = 0;
        if (!bo.isNullOrNil(str)) {
            this.uvi.setText(str);
        }
        if (i >= 0) {
            this.uvi.setMaxCount(i);
        }
        AppMethodBeat.o(8022);
    }

    /* Access modifiers changed, original: protected */
    public int cWF() {
        AppMethodBeat.i(8023);
        if (this.uvi == null) {
            AppMethodBeat.o(8023);
            return 0;
        }
        int dcZ = this.uvi.dcZ();
        AppMethodBeat.o(8023);
        return dcZ;
    }

    /* Access modifiers changed, original: protected|final */
    public final void daj() {
        AppMethodBeat.i(8024);
        this.uwX.utS = new 5(this);
        l lVar = this.uwX;
        lVar.hfA = true;
        if (lVar.utU != null) {
            lVar.utU.setVisibility(0);
            lVar.utU.setMMOverScrollOffsetListener(lVar);
            lVar.utU.setFastScrollBack(true);
            lVar.utU.nM(false);
            lVar.utU.setReleaseTargetHeight(lVar.utV);
        }
        if (lVar.utT != null) {
            lVar.utT.setWillNotDraw(true);
            lVar.utT.setImageResource(l.utW);
            lVar.utT.setVisibility(0);
            lVar.utT.setAlpha(0.0f);
            lVar.utT.setWillNotDraw(false);
            lVar.utT.invalidate();
        }
        if (lVar.uue != null) {
            lVar.uue.setVisibility(8);
        }
        AppMethodBeat.o(8024);
    }

    /* Access modifiers changed, original: protected */
    public void cZH() {
        AppMethodBeat.i(8025);
        int intExtra = getIntent().getIntExtra("webview_bg_color_rsID", -1);
        if (intExtra == -1 || this.mController.contentView == null) {
            this.pzf.setBackgroundColor(getResources().getColor(2131689496));
            AppMethodBeat.o(8025);
            return;
        }
        setBackGroundColorResource(intExtra);
        this.mController.contentView.setBackgroundResource(intExtra);
        this.pzf.setBackgroundResource(17170445);
        findViewById(2131823600).setBackgroundResource(17170445);
        AppMethodBeat.o(8025);
    }

    /* Access modifiers changed, original: protected */
    public void dak() {
        AppMethodBeat.i(8026);
        if (getIntent() == null) {
            AppMethodBeat.o(8026);
            return;
        }
        if (getIntent().hasExtra("show_full_screen")) {
            W(getIntent().getBooleanExtra("show_full_screen", false), true);
        }
        AppMethodBeat.o(8026);
    }

    /* Access modifiers changed, original: protected|final */
    public final void W(boolean z, boolean z2) {
        AppMethodBeat.i(8027);
        this.uvf = z;
        MarginLayoutParams marginLayoutParams;
        if (z) {
            if (getSupportActionBar() != null) {
                getSupportActionBar().hide();
            }
            if (this.uwT != null) {
                marginLayoutParams = (MarginLayoutParams) this.uwT.getLayoutParams();
                marginLayoutParams.topMargin = 0;
                this.uwT.setLayoutParams(marginLayoutParams);
            }
            if (this.uwl) {
                com.tencent.mm.ui.statusbar.a.D(this.uwT, true);
            } else if (this.uwU != null) {
                this.uwU.setVisibility(8);
            }
            getWindow().addFlags(1024);
            View decorView = getWindow().getDecorView();
            decorView.setOnSystemUiVisibilityChangeListener(new 7(this, decorView));
            af(decorView, 5894);
            if (z2) {
                this.uve.setOnClickListener(new 8(this));
                this.uve.setVisibility(0);
                AppMethodBeat.o(8027);
                return;
            }
            this.uve.setVisibility(8);
            AppMethodBeat.o(8027);
            return;
        }
        this.uve.setVisibility(8);
        getWindow().clearFlags(1024);
        ep(getWindow().getDecorView());
        if (getSupportActionBar() != null) {
            getSupportActionBar().show();
            if (this.uwT != null) {
                marginLayoutParams = (MarginLayoutParams) this.uwT.getLayoutParams();
                marginLayoutParams.topMargin = daa();
                this.uwT.setLayoutParams(marginLayoutParams);
            }
        }
        if (this.uwl) {
            com.tencent.mm.ui.statusbar.a.D(this.uwT, false);
            AppMethodBeat.o(8027);
            return;
        }
        if (this.uwU != null) {
            this.uwU.setVisibility(0);
        }
        AppMethodBeat.o(8027);
    }

    private static void af(View view, int i) {
        AppMethodBeat.i(8028);
        if (view == null) {
            AppMethodBeat.o(8028);
            return;
        }
        view.setSystemUiVisibility(view.getSystemUiVisibility() | i);
        AppMethodBeat.o(8028);
    }

    private static void ep(View view) {
        AppMethodBeat.i(8029);
        if (view == null) {
            AppMethodBeat.o(8029);
            return;
        }
        view.setSystemUiVisibility(view.getSystemUiVisibility() & -5895);
        AppMethodBeat.o(8029);
    }

    public void onWindowFocusChanged(boolean z) {
        AppMethodBeat.i(8030);
        super.onWindowFocusChanged(z);
        if (z && this.uvf) {
            af(getWindow().getDecorView(), 5894);
        }
        AppMethodBeat.at(this, z);
        AppMethodBeat.o(8030);
    }

    public void initView() {
        String str;
        AppMethodBeat.i(8031);
        boolean booleanExtra = getIntent().getBooleanExtra("vertical_scroll", true);
        this.uvy = getIntent().getBooleanExtra("finishviewifloadfailed", false);
        this.uvu = getIntent().getBooleanExtra("is_favorite_item", false);
        this.rpm = getIntent().getBooleanExtra("isWebwx", true);
        this.uvs = getIntent().getBooleanExtra("neverGetA8Key", false);
        this.uwk = getIntent().getBooleanExtra("neverBlockLocalRequest", false);
        this.uvw = getIntent().getBooleanExtra("KFromLoginHistory", false);
        this.uwg = LayoutInflater.from(this.mController.ylL).inflate(2130970906, null);
        boolean booleanExtra2 = getIntent().getBooleanExtra("show_feedback", false);
        this.uwi = bo.nullAsNil(getIntent().getStringExtra("sentUsername"));
        if (booleanExtra2) {
            addTextOptionMenu(1, getString(2131303094), new 9(this));
        }
        this.uuY = (ProgressBar) findViewById(2131824558);
        this.uwh = findViewById(2131823604);
        this.uwh.setOnClickListener(new 10(this));
        if (this.rpm) {
            CharSequence nullAsNil = bo.nullAsNil(getIntent().getStringExtra("title"));
            if (nullAsNil.length() > 0) {
                this.uuW = true;
            }
            M(nullAsNil);
        } else {
            setMMTitle(BuildConfig.FLAVOR);
        }
        nP(false);
        nQ(false);
        if (uvQ == RenderPriority.NORMAL) {
            ab.i("MicroMsg.WebViewUI", "initView, set render priority to HIGH");
            this.pzf.getSettings().setRenderPriority(RenderPriority.HIGH);
            uvQ = RenderPriority.HIGH;
        }
        l lVar = this.uwX;
        View view = this.mController.contentView;
        lVar.utU = (LogoWebViewWrapper) view.findViewById(2131823602);
        lVar.utT = (ImageView) view.findViewById(2131824657);
        lVar.uud = view.findViewById(2131824656);
        if (lVar.uud != null) {
            lVar.uue = lVar.uud.findViewById(2131829178);
            lVar.uuf = (TextView) lVar.uue.findViewById(2131829179);
        }
        lVar.utV = BackwardSupportUtil.b.b(lVar.utU.getContext(), 72.0f);
        String str2 = "MicroMsg.WebViewPullDownLogoDelegate";
        String str3 = "refreshImage.id = %s, logoWrapper.id = %s";
        Object[] objArr = new Object[2];
        if (lVar.utT == null) {
            str = "null";
        } else {
            str = String.valueOf(lVar.utT.getId());
        }
        objArr[0] = str;
        if (lVar.utU == null) {
            str = "null";
        } else {
            str = String.valueOf(lVar.utU.getId());
        }
        objArr[1] = str;
        ab.d(str2, str3, objArr);
        ab.d("MicroMsg.WebViewPullDownLogoDelegate", "LOADING_LOGO_HEIGHT = %d", new Object[]{Integer.valueOf(lVar.utV)});
        lVar = this.uwX;
        MMWebView mMWebView = this.pzf;
        mMWebView.setCompetitorView(lVar.utU);
        mMWebView.dKJ();
        if (VERSION.SDK_INT <= 10) {
            lVar.utU.getWebViewContainer().setBackgroundColor(lVar.utU.getResources().getColor(2131690677));
        }
        LogoWebViewWrapper logoWebViewWrapper = lVar.utU;
        logoWebViewWrapper.getWebViewContainer();
        if (logoWebViewWrapper.uro != null) {
            logoWebViewWrapper.ejN = mMWebView;
            logoWebViewWrapper.uro.addView(logoWebViewWrapper.ejN);
        }
        str2 = BuildConfig.FLAVOR;
        if (mMWebView.isXWalkKernel() || mMWebView.getIsX5Kernel()) {
            lVar.uug = true;
        } else {
            lVar.uug = false;
        }
        if (!(lVar.uue == null || mMWebView.getIsX5Kernel())) {
            ((ImageView) lVar.uue.findViewById(2131829180)).setVisibility(8);
            ((TextView) lVar.uue.findViewById(2131829181)).setText(str2);
        }
        if (!lVar.uug || lVar.uuh) {
            lVar.nM(true);
        } else {
            lVar.nM(false);
            if (lVar.uue != null) {
                lVar.uue.setVisibility(0);
            }
        }
        cZH();
        this.uvc = (FrameLayout) findViewById(2131823601);
        this.uvd = (FrameLayout) findViewById(2131821064);
        ab.i("MicroMsg.WebViewUI", "Is the current broswer kernel X5, " + this.pzf.getIsX5Kernel());
        this.pzf.setWebViewClientExtension(new c(this));
        if (this.pzf.getIsX5Kernel()) {
            this.pzf.setWebViewCallbackClient(this.uwQ);
            l lVar2 = this.uwX;
            11 11 = new 11(this);
            if (lVar2.utU != null) {
                lVar2.utU.setMMOverScrollListener(11);
            }
        }
        this.uvi = (WebViewInputFooter) findViewById(2131824560);
        if (this.uvi != null) {
            this.uvi.hide();
            this.uvi.setOnTextSendListener(new 13(this));
            this.uvi.setOnSmileyChosenListener(new 14(this));
            this.uvi.setOnSmileyPanelVisibilityChangedListener(new 15(this));
        }
        this.uvj = (WebViewSearchContentInputFooter) findViewById(2131824561);
        if (this.uvj != null) {
            this.uvj.setActionDelegate(new 16(this));
            this.pzf.setFindListener(new 17(this));
        }
        this.uve = (MovingImageButton) findViewById(2131824562);
        this.uvH = findViewById(2131829160);
        if (this.uvH != null) {
            this.uvH.setVisibility(8);
        }
        if (!booleanExtra) {
            this.pzf.setVerticalScrollBarEnabled(false);
        }
        this.pzf.setWebChromeClient(dal());
        this.pzf.setWebViewClient(aXZ());
        this.pzf.setDownloadListener(new 18(this));
        this.pzf.requestFocus(130);
        this.pzf.setOnTouchListener(new 19(this));
        this.pzf.getSettings().setUserAgentString(u.bh(this, this.pzf.getSettings().getUserAgentString()));
        this.pzf.dKH();
        this.icA = new j(this.mController.ylL);
        this.icA.a(this.pzf, this, null);
        this.icA.e(new 20(this));
        setBackBtn(new 21(this), dam());
        if (dan()) {
            WebViewKeyboardLinearLayout webViewKeyboardLinearLayout = (WebViewKeyboardLinearLayout) findViewById(2131823600);
            webViewKeyboardLinearLayout.setOnkbdStateListener(new 34(this, webViewKeyboardLinearLayout));
        }
        this.uuX = (MMFalseProgressBar) findViewById(2131823605);
        super.setTitleBarDoubleClickListener(new 22(this));
        AppMethodBeat.o(8031);
    }

    /* Access modifiers changed, original: protected */
    public s aXZ() {
        AppMethodBeat.i(8032);
        h hVar = new h();
        AppMethodBeat.o(8032);
        return hVar;
    }

    /* Access modifiers changed, original: protected|declared_synchronized */
    public synchronized l dal() {
        l lVar;
        AppMethodBeat.i(8033);
        if (this.uvO == null) {
            this.uvO = new g(this);
        }
        lVar = this.uvO;
        AppMethodBeat.o(8033);
        return lVar;
    }

    /* Access modifiers changed, original: protected */
    public int dam() {
        AppMethodBeat.i(8034);
        if (aXL()) {
            AppMethodBeat.o(8034);
            return 0;
        }
        AppMethodBeat.o(8034);
        return 2131230739;
    }

    /* Access modifiers changed, original: protected */
    public boolean aXL() {
        return this.uwp;
    }

    /* Access modifiers changed, original: protected|final */
    public final void Jt(int i) {
        AppMethodBeat.i(8035);
        Drawable mutate = getResources().getDrawable(2131230739).mutate();
        mutate.setColorFilter(i, Mode.SRC_IN);
        x(mutate);
        AppMethodBeat.o(8035);
    }

    /* Access modifiers changed, original: protected */
    public boolean dan() {
        return true;
    }

    public void onActivityResult(int i, int i2, Intent intent) {
        AppMethodBeat.i(8036);
        super.onActivityResult(i, i2, intent);
        if (this.icH.b(this, i, i2, intent)) {
            AppMethodBeat.o(8036);
        } else if (a.d(this, i, i2, intent)) {
            AppMethodBeat.o(8036);
        } else {
            if (i == 777) {
                Bundle bundle = null;
                if (intent != null) {
                    bundle = intent.getBundleExtra("result_data");
                }
                if (bundle == null || !bundle.getString("go_next", BuildConfig.FLAVOR).equals("gdpr_confirm_continue")) {
                    ab.i("MicroMsg.WebViewUI", "gdpr continue:false");
                    Intent intent2 = new Intent();
                    Bundle bundle2 = new Bundle();
                    bundle2.putString("go_next", "gdpr_confirm_logout");
                    intent2.putExtra("result_data", bundle2);
                    this.uwA = true;
                    m.uuj.close();
                    setResult(-1, intent2);
                    finish();
                } else {
                    ab.i("MicroMsg.WebViewUI", "gdpr continue:true");
                    AppMethodBeat.o(8036);
                    return;
                }
            }
            AppMethodBeat.o(8036);
        }
    }

    public void onSwipeBack() {
        AppMethodBeat.i(8037);
        if (this.pzf != null) {
            if (this.uwY) {
                this.pzf.setOnLongClickListener(this.uwZ);
            } else {
                this.pzf.setOnLongClickListener(null);
            }
        }
        aqX();
        super.onSwipeBack();
        AppMethodBeat.o(8037);
    }

    public void onCancel() {
        AppMethodBeat.i(8038);
        if (this.pzf != null) {
            if (this.uwY) {
                this.pzf.setOnLongClickListener(this.uwZ);
            } else {
                this.pzf.setOnLongClickListener(null);
            }
        }
        super.onCancel();
        AppMethodBeat.o(8038);
    }

    public void onDrag() {
        AppMethodBeat.i(8039);
        if (this.pzf != null) {
            this.pzf.setOnLongClickListener(new 24(this));
        }
        super.onDrag();
        AppMethodBeat.o(8039);
    }

    public final boolean apx() {
        String url;
        AppMethodBeat.i(8040);
        this.uwC = true;
        aq.i cYb = this.ulI.cYb();
        Object[] objArr = new Object[2];
        if (this.pzf != null) {
            url = this.pzf.getUrl();
        } else {
            url = this.cOG;
        }
        objArr[0] = url;
        objArr[1] = Integer.valueOf(15);
        cYb.une = objArr;
        cYb.b(this.icy);
        boolean apx = super.apx();
        AppMethodBeat.o(8040);
        return apx;
    }

    private static boolean a(com.tencent.mm.plugin.webview.ui.tools.jsapi.b bVar, String str) {
        AppMethodBeat.i(8041);
        if (bo.isNullOrNil(str) || bVar == null) {
            AppMethodBeat.o(8041);
            return false;
        }
        boolean afS = bVar.afS(str);
        AppMethodBeat.o(8041);
        return afS;
    }

    /* Access modifiers changed, original: protected */
    public void aMh() {
        String afk;
        boolean z;
        int cZr;
        Map hashMap;
        AppMethodBeat.i(8042);
        this.uwE.aI("onPostBindedStart", System.currentTimeMillis());
        ab.i("MicroMsg.WebViewUI", "edw postBinded");
        this.uie.a(new com.tencent.mm.plugin.webview.ui.tools.bag.p(this.icy));
        daA();
        com.tencent.mm.plugin.webview.model.b bVar = this.uwF;
        com.tencent.mm.plugin.webview.stub.d dVar = this.icy;
        try {
            afk = dVar.afk("DNSAdvanceOpen");
            ab.i("MicroMsg.DNSPreGetOptimize", "switch open value : %s", new Object[]{afk});
            if (bo.isNullOrNil(afk)) {
                ab.e("MicroMsg.DNSPreGetOptimize", "get switch value is null or nil");
                z = false;
            } else {
                z = afk.equalsIgnoreCase("1");
            }
            if (z) {
                try {
                    afk = dVar.afk("DNSAdvanceRelateDomain");
                    if (bo.isNullOrNil(afk)) {
                        ab.e("MicroMsg.DNSPreGetOptimize", "domain list is null, just return");
                    } else {
                        bVar.aNS().aa(new com.tencent.mm.plugin.webview.model.b.1(bVar, afk, dVar));
                    }
                } catch (Exception e) {
                    ab.printErrStackTrace("MicroMsg.DNSPreGetOptimize", e, BuildConfig.FLAVOR, new Object[0]);
                }
            } else {
                ab.i("MicroMsg.DNSPreGetOptimize", "server closed the switch");
            }
        } catch (Exception e2) {
            ab.e("MicroMsg.DNSPreGetOptimize", "get dns pre get switch failed");
        }
        if (aYd() && aYa()) {
            al.d(new 26(this));
        }
        this.uwE.aI("onJSAPIStart", System.currentTimeMillis());
        Bundle bundle = new Bundle();
        Bundle bundleExtra = getIntent().getBundleExtra("jsapiargs");
        if (bundleExtra == null) {
            bundleExtra = new Bundle();
        }
        bundleExtra.putInt("key_download_restrict", getIntent().getIntExtra("key_download_restrict", 0));
        bundleExtra.putString("key_function_id", getIntent().getStringExtra("key_function_id"));
        ab.i("MicroMsg.WebViewUI", "KDownloadRestrict = %d, KFunctionID = %s", new Object[]{Integer.valueOf(bundleExtra.getInt("key_download_restrict", 0)), bundleExtra.getString("key_function_id", BuildConfig.FLAVOR)});
        bundle.putBundle("jsapiargs", bundleExtra);
        bundle.putCharSequence("bizofstartfrom", getIntent().getStringExtra("bizofstartfrom"));
        bundle.putBundle("startwebviewparams", getIntent().getBundleExtra("startwebviewparams"));
        bundle.putInt("screen_orientation", this.screenOrientation);
        try {
            this.icy.a(20, bundle, hashCode());
        } catch (RemoteException e3) {
            ab.e("MicroMsg.WebViewUI", "postBinded, invoke AC_SET_INITIAL_ARGS, ex = " + e3.getMessage());
        }
        String stringExtra = getIntent().getStringExtra("geta8key_username");
        int intExtra = getIntent().getIntExtra("preChatTYPE", 0);
        String stringExtra2 = getIntent().getStringExtra("srcUsername");
        long longExtra = getIntent().getLongExtra("message_id", 0);
        int intExtra2 = getIntent().getIntExtra("message_index", 0);
        String stringExtra3 = getIntent().getStringExtra("KsnsViewId");
        String stringExtra4 = getIntent().getStringExtra("KPublisherId");
        String stringExtra5 = getIntent().getStringExtra("KAppId");
        String stringExtra6 = getIntent().getStringExtra("pre_username");
        String stringExtra7 = getIntent().getStringExtra("expid_str");
        String string = bundleExtra.getString("key_snsad_statextstr");
        afk = null;
        if (this.pzf != null) {
            afk = this.pzf.getTitle();
        }
        if (bo.isNullOrNil(afk)) {
            afk = getIntent().getStringExtra("title");
        }
        if (bo.isNullOrNil(afk)) {
            afk = getIntent().getStringExtra("webpageTitle");
        }
        aq.l cXX = this.ulI.cXX();
        cXX.username = stringExtra;
        cXX.uns = intExtra;
        cXX.cOG = this.cOG;
        cXX.uno = intExtra2;
        cXX.scene = afH(stringExtra);
        cXX.unn = longExtra;
        cXX.unp = new com.tencent.mm.a.p(longExtra).toString();
        cXX.unl = stringExtra2;
        cXX.unm = stringExtra3;
        cXX.fjS = stringExtra4;
        cXX.appId = stringExtra5;
        cXX.unq = stringExtra6;
        cXX.unr = this.unr;
        cXX.rjC = string;
        cXX.title = bo.bc(afk, BuildConfig.FLAVOR);
        cXX.dJE = stringExtra7;
        aq$a cXY = this.ulI.cXY();
        cXY.fjS = stringExtra4;
        cXY.scene = afH(stringExtra);
        this.ulI.cYa().cOG = this.cOG;
        if (das()) {
            try {
                bundleExtra = new Bundle();
                bundleExtra.putString("srcUsername", getIntent().getStringExtra("srcUsername"));
                this.icy.a(29, bundleExtra, hashCode());
            } catch (Exception e4) {
            }
        }
        if (!bo.isNullOrNil(stringExtra2)) {
            try {
                this.icy.afl(stringExtra2);
            } catch (Exception e5) {
                ab.e("MicroMsg.WebViewUI", "postBinded, fail triggerGetContact, ex = " + e5.getMessage());
            }
        }
        try {
            if (getIntent().getIntExtra("pay_channel", -1) != -1) {
                ab.i("MicroMsg.WebViewUI", "hy: found channel in intent. pay channel: %d", new Object[]{Integer.valueOf(getIntent().getIntExtra("pay_channel", -1))});
            } else {
                cZr = this.icy.cZr();
                if (cZr != -1) {
                    ab.i("MicroMsg.WebViewUI", "hy: found channel in channel helper. pay channel: %d", new Object[]{Integer.valueOf(cZr)});
                    getIntent().putExtra("pay_channel", cZr);
                }
            }
        } catch (Exception e6) {
            ab.e("MicroMsg.WebViewUI", "hy: init pay channel failed");
        }
        this.uvJ.clear();
        this.uhz = aXY();
        com.tencent.mm.plugin.webview.ui.tools.jsapi.d dVar2 = this.uhz;
        stringExtra = getIntent().getStringExtra("geta8key_username");
        if (!bo.isNullOrNil(getIntent().getStringExtra("srcUsername"))) {
            hashMap = new HashMap();
            hashMap.put("srcUsername", getIntent().getStringExtra("srcUsername"));
            hashMap.put("srcDisplayname", getIntent().getStringExtra("srcDisplayname"));
        } else if (bo.isNullOrNil(stringExtra)) {
            hashMap = new HashMap();
        } else {
            hashMap = new HashMap();
            hashMap.put("srcUsername", stringExtra);
        }
        hashMap.put("message_id", Long.valueOf(getIntent().getLongExtra("message_id", 0)));
        hashMap.put("message_index", Integer.valueOf(getIntent().getIntExtra("message_index", 0)));
        hashMap.put("scene", Integer.valueOf(afH(stringExtra)));
        hashMap.put("pay_channel", Integer.valueOf(getIntent().getIntExtra("pay_channel", 0)));
        hashMap.put("stastic_scene", Integer.valueOf(getIntent().getIntExtra("stastic_scene", 0)));
        hashMap.put("from_scence", Integer.valueOf(getIntent().getIntExtra("from_scence", 0)));
        if (!bo.isNullOrNil(getIntent().getStringExtra("KTemplateId"))) {
            hashMap.put("KTemplateId", getIntent().getStringExtra("KTemplateId"));
        }
        int intExtra3 = getIntent().getIntExtra("pay_scene", -1);
        if (intExtra3 != -1) {
            ab.i("MicroMsg.WebViewUI", "get pay scene from extra: %s", new Object[]{Integer.valueOf(intExtra3)});
        } else {
            intExtra3 = 3;
            ab.i("MicroMsg.WebViewUI", "default pay scene to: %s", new Object[]{Integer.valueOf(3)});
        }
        hashMap.put("pay_scene", Integer.valueOf(intExtra3));
        dVar2.uFt = hashMap;
        if (dap() != null) {
            dap().uaz = this.uhz;
        }
        this.pzf.addJavascriptInterface(this.uhz, "__wx");
        this.uvJ.add(this.uhz);
        this.uvJ.add(new s(this, (byte) 0));
        this.uvJ.add(new p(this, (byte) 0));
        this.uvJ.add(new e(this, (byte) 0));
        this.uvJ.add(new r(this, (byte) 0));
        this.uvJ.add(new u(this, (byte) 0));
        this.uvJ.add(new a(this, (byte) 0));
        this.uvJ.add(new y(this, (byte) 0));
        this.uvJ.add(new t(this, (byte) 0));
        this.uvJ.add(new i(this, (byte) 0));
        this.uvJ.add(new b(this, (byte) 0));
        this.uvJ.add(new c(this, (byte) 0));
        this.uvJ.add(new com.tencent.mm.plugin.webview.ui.tools.jsapi.e(this.pzf, this.uhz));
        this.uvJ.add(new x(this, (byte) 0));
        this.uvJ.add(new v(this, (byte) 0));
        this.uvJ.add(new n(this, (byte) 0));
        if (getIntent().getBooleanExtra("allow_wx_schema_url", false)) {
            this.uvJ.add(new k(this, (byte) 0));
        }
        this.uvJ.add(new f(this, (byte) 0));
        try {
            cZr = bo.getInt(this.icy.afk("WebviewDisableX5Logo"), 0);
        } catch (Exception e52) {
            ab.w("MicroMsg.WebViewUI", "getting flag of x5 logo state failed, ex = " + e52.getMessage());
            cZr = 0;
        }
        ab.i("MicroMsg.WebViewUI", "getting flag of x5 logo state, disableX5Logo = %d, disableBounceScroll = %b", new Object[]{Integer.valueOf(cZr), Boolean.valueOf(getIntent().getBooleanExtra("disable_bounce_scroll", false))});
        if (cZr == 1 || r1) {
            this.uwX.nM(true);
        }
        if (getSharedPreferences("com.tencent.mm_webview_x5_preferences", 4).getBoolean("tbs_disable_over_scroll", false)) {
            this.uwX.nM(true);
        }
        try {
            this.uvX = bo.getInt(this.icy.afk("OpenJSReadySpeedy"), 0);
        } catch (Exception e522) {
            ab.w("MicroMsg.WebViewUI", "postBinded, openJSReadySpeedy, ex = " + e522.getMessage());
        }
        ab.i("MicroMsg.WebViewUI", "postBinded, openJSReadySpeedy = %d", new Object[]{Integer.valueOf(this.uvX)});
        this.uwE.aI("onJSAPIEnd", System.currentTimeMillis());
        aq.V(this.pzf.getIsX5Kernel(), bo.nullAsNil(this.cOG).startsWith("https://"));
        if (this.pzf.getIsX5Kernel()) {
            m.kT(7);
            com.tencent.mm.plugin.report.service.h.pYm.a(64, 64, 1, 0, 1, 1, false);
        } else {
            com.tencent.mm.plugin.report.service.h.pYm.a(64, 0, 1, false);
        }
        this.uvY = new com.tencent.mm.plugin.webview.ui.tools.jsapi.f(this.pzf, this.icy, this.uhz, new 27(this), getIntent().getBooleanExtra("key_load_js_without_delay", false), aYd());
        try {
            cZr = bo.getInt(this.icy.afk("WebviewDisableDigestVerify"), 0);
        } catch (Exception e5222) {
            ab.w("MicroMsg.WebViewUI", "getting js digest verification config fails, ex = " + e5222.getMessage());
            cZr = 0;
        }
        ab.i("MicroMsg.WebViewUI", "js digest verification config = %d", new Object[]{Integer.valueOf(cZr)});
        if (cZr == 0 && getSharedPreferences("com.tencent.mm_webview_x5_preferences", 4).getBoolean("wvsha1", true) && aYb()) {
            this.uhz.dch();
            this.uwP.aey(this.uhz.uFw);
        }
        if (getIntent().getBooleanExtra("forceHideShare", false)) {
            nO(false);
            ab.d("MicroMsg.WebViewUI", "[hakon] postBinded :%d: force hide", new Object[]{Long.valueOf(System.currentTimeMillis())});
        } else {
            nO(getIntent().getBooleanExtra("showShare", true));
            ab.d("MicroMsg.WebViewUI", "[cpan] postBinded :%d: show:%b", new Object[]{Long.valueOf(System.currentTimeMillis()), Boolean.valueOf(z)});
        }
        this.uvb = LayoutInflater.from(this).inflate(2130971202, null);
        FontChooserView fontChooserView = (FontChooserView) this.uvb.findViewById(2131829157);
        View findViewById = this.uvb.findViewById(2131829158);
        if (!this.pzf.getIsX5Kernel()) {
            findViewById.setVisibility(0);
            findViewById.setOnClickListener(new OnClickListener() {
                public final void onClick(View view) {
                    AppMethodBeat.i(7876);
                    Animation loadAnimation = AnimationUtils.loadAnimation(WebViewUI.this, 2131034185);
                    loadAnimation.setAnimationListener(new 1(this));
                    WebViewUI.this.uvb.startAnimation(loadAnimation);
                    WebViewUI.this.uvb.setVisibility(8);
                    AppMethodBeat.o(7876);
                }
            });
        }
        fontChooserView.setOnChangeListener(new j(this, (byte) 0));
        this.uvb.setLayoutParams(new FrameLayout.LayoutParams(-1, -2, 80));
        this.uvc.addView(this.uvb);
        this.uvb.setVisibility(8);
        cZr = 2;
        try {
            if (this.icy.cZd()) {
                cZr = (dax() || day()) ? daz() : (bo.isNullOrNil(this.cOG) || !com.tencent.mm.plugin.webview.a.uet.matcher(this.cOG).matches()) ? this.icy.gw(16384, 0) : this.icy.gw(16388, 0);
            }
        } catch (Exception e7) {
            ab.w("MicroMsg.WebViewUI", "initFontChooserView, ex = " + e7.getMessage());
        }
        if (cZr <= 0 || cZr > 4) {
            cZr = 2;
        }
        Jv(cZr);
        Jw(cZr);
        try {
            this.icy.a(this.cOG, true, null);
        } catch (Exception e52222) {
            ab.w("MicroMsg.WebViewUI", "postBinded, jumpToActivity, ex = " + e52222.getMessage());
        }
        for (com.tencent.mm.plugin.webview.ui.tools.jsapi.b bVar2 : this.uvJ) {
            if (a(bVar2, this.cOG)) {
                ab.i("MicroMsg.WebViewUI", "initView, url handled, result = " + bVar2.afM(this.cOG) + ", url = " + this.cOG);
                AppMethodBeat.o(8042);
                return;
            }
        }
        if (cZA()) {
            ab.w("MicroMsg.WebViewUI", "needDelayLoadUrl is true, do nothing");
            AppMethodBeat.o(8042);
            return;
        }
        String stringExtra8 = getIntent().getStringExtra("data");
        if (stringExtra8 != null) {
            ab.i("MicroMsg.WebViewUI", stringExtra8);
            if (getIntent().getBooleanExtra("QRDataFlag", true)) {
                try {
                    stringExtra8 = this.icy.afg(stringExtra8);
                } catch (Exception e522222) {
                    ab.w("MicroMsg.WebViewUI", "postBinded, formatQRString, ex = " + e522222.getMessage());
                }
            }
            this.pzf.setOnLongClickListener(this.uwZ);
            this.uwY = true;
            this.pzf.getSettings().setUseWideViewPort(false);
            this.pzf.getSettings().setLoadWithOverviewMode(false);
            if (afQ(null)) {
                this.pzf.getSettings().setJavaScriptEnabled(false);
                this.pzf.loadDataWithBaseURL(null, stringExtra8, "text/html", "utf-8", null);
                ab.i("MicroMsg.WebViewUI", "loadDataWithBaseUrl, data = ".concat(String.valueOf(stringExtra8)));
            } else {
                ab.f("MicroMsg.WebViewUI", "postBinded baseUrl, canLoadUrl fail, url = " + null);
                dah();
                AppMethodBeat.o(8042);
                return;
            }
        }
        if (bo.isNullOrNil(this.cOG)) {
            jD(false);
        }
        if (this.cOG == null || this.cOG.length() == 0) {
            ab.e("MicroMsg.WebViewUI", "initView, rawUrl is null, no data or getStringExtra(\"data\") is null");
            AppMethodBeat.o(8042);
            return;
        }
        Uri parse = Uri.parse(this.cOG);
        if (parse == null) {
            ab.e("MicroMsg.WebViewUI", "initView uri is null");
            AppMethodBeat.o(8042);
            return;
        }
        if (parse.getScheme() == null) {
            this.cOG = "http://" + this.cOG;
        } else if (!parse.getScheme().startsWith("http")) {
            ab.i("MicroMsg.WebViewUI", "uri scheme not startwith http, scheme = " + parse.getScheme());
            if (!afQ(this.cOG)) {
                ab.f("MicroMsg.WebViewUI", "postBinded, canLoadUrl fail, url = " + this.cOG);
                dah();
                AppMethodBeat.o(8042);
                return;
            } else if (aYd()) {
                ab.i("MicroMsg.WebViewUI", "webview ispreloaded , do not reload url");
                AppMethodBeat.o(8042);
                return;
            } else {
                b(this.cOG, null, false);
                AppMethodBeat.o(8042);
                return;
            }
        }
        this.uvR = new l(this.cOG);
        try {
            bundleExtra = this.icy.g(100000, null);
            if (!(bundleExtra == null || bundleExtra.getString("force_geta8key_host_path") == null)) {
                this.uxa = bundleExtra.getString("force_geta8key_host_path").split(";");
                this.uvR.uxa = this.uxa;
            }
        } catch (Exception e5222222) {
            ab.e("MicroMsg.WebViewUI", "get force geta8key paths failed : %s", new Object[]{e5222222.getMessage()});
        }
        if (this.uvs || this.icz.has(this.cOG)) {
            ab.i("MicroMsg.WebViewUI", "initView, no need to geta8key, loadUrl directly, neverGetA8Key = " + this.uvs);
            if (!afQ(this.cOG)) {
                ab.f("MicroMsg.WebViewUI", "postBinded 2, canLoadUrl fail, url = " + this.cOG);
                dah();
                AppMethodBeat.o(8042);
                return;
            } else if (afI(this.cOG)) {
                this.uwn = true;
                this.uuX.finish();
                this.uuX.setVisibility(8);
                b(this.cOG, null, true);
            } else {
                b(this.cOG, null, false);
            }
        } else {
            if (afI(this.cOG)) {
                b(this.cOG, null, true);
                this.uxf = this.cOG;
                this.uwn = true;
                this.uuX.finish();
                this.uuX.setVisibility(8);
            }
            if (this.uwA || this.uwB || isFinishing()) {
                AppMethodBeat.o(8042);
                return;
            }
            ab.i("MicroMsg.WebViewUI", "not call onDestory, try to geta8key again");
            as(this.cOG, false);
            ab.i("MicroMsg.WebViewUI", "before geta8key, rawUrl = " + this.cOG);
        }
        this.uwE.aI("onPostBindedEnd", System.currentTimeMillis());
        AppMethodBeat.o(8042);
    }

    /* Access modifiers changed, original: protected */
    public boolean afI(String str) {
        AppMethodBeat.i(8043);
        hashCode();
        boolean aeI = com.tencent.mm.plugin.webview.modelcache.p.aeI(str);
        AppMethodBeat.o(8043);
        return aeI;
    }

    public final void loadUrl(String str) {
        AppMethodBeat.i(138438);
        b(str, null, false);
        AppMethodBeat.o(138438);
    }

    /* Access modifiers changed, original: protected */
    public void b(String str, Map<String, String> map, boolean z) {
        AppMethodBeat.i(8045);
        if (z) {
            HashMap hashMap = new HashMap(2);
            hashMap.put("Pragma", "no-cache");
            hashMap.put("Cache-Control", "no-cache");
            if (this.pzf != null) {
                this.pzf.loadUrl(str, hashMap);
            }
            AppMethodBeat.o(8045);
            return;
        }
        if (this.pzf != null) {
            if (map != null) {
                this.pzf.loadUrl(str, map);
                AppMethodBeat.o(8045);
                return;
            }
            this.pzf.loadUrl(str);
        }
        AppMethodBeat.o(8045);
    }

    /* Access modifiers changed, original: protected|final */
    public final l dao() {
        return this.uwX;
    }

    public final boolean needShowIdcError() {
        return false;
    }

    private boolean cZs() {
        boolean z = false;
        AppMethodBeat.i(8046);
        try {
            if (this.icy == null) {
                ab.w("MicroMsg.WebViewUI", "invoker is null");
                AppMethodBeat.o(8046);
                return z;
            }
            z = this.icy.cZs();
            AppMethodBeat.o(8046);
            return z;
        } catch (RemoteException e) {
            ab.e("MicroMsg.WebViewUI", "unable get config for WebViewDownLoadFile" + e.getMessage());
        }
    }

    private static String afJ(String str) {
        String str2 = null;
        AppMethodBeat.i(8047);
        try {
            Matcher matcher = Pattern.compile("(?i)^.*filename=\"?([^\"]+)\"?.*$").matcher(str);
            if (matcher.find() && matcher.groupCount() == 1) {
                str2 = matcher.group(1);
                AppMethodBeat.o(8047);
                return str2;
            }
            AppMethodBeat.o(8047);
            return str2;
        } catch (Exception e) {
            ab.e("MicroMsg.WebViewUI", "getFileNameFromContentDisposition error " + e.getMessage());
            AppMethodBeat.o(8047);
        }
    }

    public void onCreateContextMenu(ContextMenu contextMenu, View view, ContextMenuInfo contextMenuInfo) {
        AppMethodBeat.i(8048);
        super.onCreateContextMenu(contextMenu, view, contextMenuInfo);
        this.uwH.onCreateContextMenu(contextMenu, view, contextMenuInfo);
        AppMethodBeat.o(8048);
    }

    public final String cWL() {
        String str = null;
        AppMethodBeat.i(8049);
        try {
            str = getIntent().getStringExtra("rawUrl");
        } catch (Exception e) {
            ab.e("MicroMsg.WebViewUI", "getRawUrl exception:%s", new Object[]{e.getMessage()});
            if (e instanceof ClassNotFoundException) {
                finish();
                AppMethodBeat.o(8049);
                return str;
            }
        }
        if (str == null || str.length() <= 0) {
            Uri data = getIntent().getData();
            if (data == null) {
                str = BuildConfig.FLAVOR;
                AppMethodBeat.o(8049);
                return str;
            }
            str = data.toString();
            AppMethodBeat.o(8049);
            return str;
        }
        AppMethodBeat.o(8049);
        return str;
    }

    /* Access modifiers changed, original: protected */
    public com.tencent.mm.plugin.webview.ui.tools.jsapi.d aXY() {
        AppMethodBeat.i(8050);
        MMWebView mMWebView = this.pzf;
        k kVar = this.icz;
        HashMap hashMap = new HashMap();
        hashMap.put("webview_type", "1");
        hashMap.put("init_url", this.cOG);
        hashMap.put("init_font_size", "1");
        hashMap.put("short_url", bo.nullAsNil(getIntent().getStringExtra("shortUrl")));
        com.tencent.mm.plugin.webview.ui.tools.jsapi.d dVar = new com.tencent.mm.plugin.webview.ui.tools.jsapi.d(mMWebView, kVar, hashMap, this.icy, hashCode());
        AppMethodBeat.o(8050);
        return dVar;
    }

    /* Access modifiers changed, original: protected */
    public com.tencent.mm.plugin.websearch.api.ah dap() {
        return null;
    }

    /* Access modifiers changed, original: protected */
    public boolean aYa() {
        return true;
    }

    /* Access modifiers changed, original: protected */
    public boolean aYd() {
        return false;
    }

    /* Access modifiers changed, original: protected */
    public void daq() {
    }

    public final void cZR() {
        AppMethodBeat.i(8051);
        this.uwI.cZR();
        AppMethodBeat.o(8051);
    }

    /* Access modifiers changed, original: protected */
    public void cZM() {
        AppMethodBeat.i(8052);
        this.uwI.cZM();
        AppMethodBeat.o(8052);
    }

    /* Access modifiers changed, original: protected */
    public void aYe() {
        AppMethodBeat.i(8053);
        if (this.pzf != null) {
            this.pzf.reload();
        }
        AppMethodBeat.o(8053);
    }

    public final void cZO() {
        AppMethodBeat.i(8054);
        this.uwI.cZO();
        AppMethodBeat.o(8054);
    }

    public final void afG(String str) {
        AppMethodBeat.i(8055);
        this.uwI.afG(str);
        AppMethodBeat.o(8055);
    }

    /* Access modifiers changed, original: protected|final */
    /* JADX WARNING: Missing block: B:7:0x0029, code skipped:
            if (com.tencent.mm.sdk.platformtools.bo.isNullOrNil(r1) == false) goto L_0x002b;
     */
    public final java.util.LinkedList<com.tencent.mm.m.d.a> dar() {
        /*
        r13 = this;
        r0 = 0;
        r2 = 1;
        r3 = 0;
        r12 = 8056; // 0x1f78 float:1.1289E-41 double:3.98E-320;
        com.tencent.matrix.trace.core.AppMethodBeat.i(r12);
        r1 = r13.pzf;
        if (r1 != 0) goto L_0x0019;
    L_0x000c:
        r1 = "MicroMsg.WebViewUI";
        r2 = "viewwv is null, maybe has destroyed";
        com.tencent.mm.sdk.platformtools.ab.e(r1, r2);
        com.tencent.matrix.trace.core.AppMethodBeat.o(r12);
    L_0x0018:
        return r0;
    L_0x0019:
        r4 = r13.cOG;
        r1 = r13.pzf;
        if (r1 == 0) goto L_0x00dd;
    L_0x001f:
        r1 = r13.pzf;
        r1 = r1.getUrl();
        r5 = com.tencent.mm.sdk.platformtools.bo.isNullOrNil(r1);
        if (r5 != 0) goto L_0x00dd;
    L_0x002b:
        if (r1 != 0) goto L_0x0031;
    L_0x002d:
        com.tencent.matrix.trace.core.AppMethodBeat.o(r12);
        goto L_0x0018;
    L_0x0031:
        r4 = new java.net.URL;	 Catch:{ Exception -> 0x00c6 }
        r4.<init>(r1);	 Catch:{ Exception -> 0x00c6 }
        r1 = ".*(\\.wanggou\\.com|\\.jd\\.com)";
        r5 = java.util.regex.Pattern.compile(r1);	 Catch:{ Exception -> 0x00c6 }
        r1 = r4.getHost();	 Catch:{ Exception -> 0x00c6 }
        r4 = com.tencent.mm.sdk.platformtools.bo.isNullOrNil(r1);	 Catch:{ Exception -> 0x00c6 }
        if (r4 == 0) goto L_0x004b;
    L_0x0047:
        com.tencent.matrix.trace.core.AppMethodBeat.o(r12);
        goto L_0x0018;
    L_0x004b:
        r4 = ".";
        r4 = r1.startsWith(r4);	 Catch:{ Exception -> 0x00c6 }
        if (r4 != 0) goto L_0x005f;
    L_0x0054:
        r4 = ".";
        r1 = java.lang.String.valueOf(r1);	 Catch:{ Exception -> 0x00c6 }
        r1 = r4.concat(r1);	 Catch:{ Exception -> 0x00c6 }
    L_0x005f:
        r4 = "MicroMsg.WebViewUI";
        r6 = "host = %s";
        r7 = 1;
        r7 = new java.lang.Object[r7];	 Catch:{ Exception -> 0x00c6 }
        r8 = 0;
        r7[r8] = r1;	 Catch:{ Exception -> 0x00c6 }
        com.tencent.mm.sdk.platformtools.ab.d(r4, r6, r7);	 Catch:{ Exception -> 0x00c6 }
        r1 = r5.matcher(r1);	 Catch:{ Exception -> 0x00c6 }
        r1 = r1.matches();	 Catch:{ Exception -> 0x00c6 }
        if (r1 == 0) goto L_0x00d8;
    L_0x0078:
        r1 = r13.uwt;	 Catch:{ Exception -> 0x00c6 }
        if (r1 != 0) goto L_0x00ad;
    L_0x007c:
        r4 = java.lang.System.currentTimeMillis();	 Catch:{ Exception -> 0x00c6 }
        r1 = r13.icy;	 Catch:{ Exception -> 0x00c6 }
        r1 = r1.cZi();	 Catch:{ Exception -> 0x00c6 }
        r13.uwt = r1;	 Catch:{ Exception -> 0x00c6 }
        r6 = "MicroMsg.WebViewUI";
        r7 = "[hakon] getConfigListMap %b, cost %d";
        r1 = 2;
        r8 = new java.lang.Object[r1];	 Catch:{ Exception -> 0x00c6 }
        r9 = 0;
        r1 = r13.uwt;	 Catch:{ Exception -> 0x00c6 }
        if (r1 == 0) goto L_0x00c4;
    L_0x0096:
        r1 = r2;
    L_0x0097:
        r1 = java.lang.Boolean.valueOf(r1);	 Catch:{ Exception -> 0x00c6 }
        r8[r9] = r1;	 Catch:{ Exception -> 0x00c6 }
        r1 = 1;
        r10 = java.lang.System.currentTimeMillis();	 Catch:{ Exception -> 0x00c6 }
        r4 = r10 - r4;
        r4 = java.lang.Long.valueOf(r4);	 Catch:{ Exception -> 0x00c6 }
        r8[r1] = r4;	 Catch:{ Exception -> 0x00c6 }
        com.tencent.mm.sdk.platformtools.ab.d(r6, r7, r8);	 Catch:{ Exception -> 0x00c6 }
    L_0x00ad:
        r1 = r13.uwt;	 Catch:{ Exception -> 0x00c6 }
        if (r1 == 0) goto L_0x00d8;
    L_0x00b1:
        r1 = r13.uwt;	 Catch:{ Exception -> 0x00c6 }
        r1 = r1.size();	 Catch:{ Exception -> 0x00c6 }
        if (r1 <= 0) goto L_0x00d8;
    L_0x00b9:
        r1 = r13.uwt;	 Catch:{ Exception -> 0x00c6 }
        r0 = com.tencent.mm.m.d.g(r1);	 Catch:{ Exception -> 0x00c6 }
        com.tencent.matrix.trace.core.AppMethodBeat.o(r12);
        goto L_0x0018;
    L_0x00c4:
        r1 = r3;
        goto L_0x0097;
    L_0x00c6:
        r1 = move-exception;
        r4 = "MicroMsg.WebViewUI";
        r5 = "[hakon] getJDMenuItems, ex = ";
        r2 = new java.lang.Object[r2];
        r1 = r1.getMessage();
        r2[r3] = r1;
        com.tencent.mm.sdk.platformtools.ab.d(r4, r5, r2);
    L_0x00d8:
        com.tencent.matrix.trace.core.AppMethodBeat.o(r12);
        goto L_0x0018;
    L_0x00dd:
        r1 = r4;
        goto L_0x002b;
        */
        throw new UnsupportedOperationException("Method not decompiled: com.tencent.mm.plugin.webview.ui.tools.WebViewUI.dar():java.util.LinkedList");
    }

    /* Access modifiers changed, original: protected|final */
    public final boolean das() {
        AppMethodBeat.i(8057);
        String stringExtra = getIntent().getStringExtra("srcUsername");
        String stringExtra2 = getIntent().getStringExtra("bizofstartfrom");
        if (stringExtra == null || stringExtra2 == null || !"enterpriseHomeSubBrand".equals(stringExtra2)) {
            AppMethodBeat.o(8057);
            return false;
        }
        AppMethodBeat.o(8057);
        return true;
    }

    /* Access modifiers changed, original: protected|final */
    public final void c(String str, Drawable drawable) {
        AppMethodBeat.i(8058);
        final boolean das = das();
        final String stringExtra = getIntent().getStringExtra("srcUsername");
        a(0, str, drawable, new OnMenuItemClickListener() {
            public final boolean onMenuItemClick(MenuItem menuItem) {
                AppMethodBeat.i(7851);
                if (das) {
                    WebViewUI.this.afK(stringExtra);
                } else {
                    WebViewUI.this.cZM();
                }
                AppMethodBeat.o(7851);
                return true;
            }
        });
        AppMethodBeat.o(8058);
    }

    /* Access modifiers changed, original: protected */
    public void nO(boolean z) {
        AppMethodBeat.i(8059);
        this.uwW = z;
        if (this.pzf == null) {
            ab.e("MicroMsg.WebViewUI", "viewwv is null, maybe has destroyed");
            AppMethodBeat.o(8059);
            return;
        }
        enableOptionMenu(z);
        showOptionMenu(z);
        boolean booleanExtra = getIntent().getBooleanExtra("show_feedback", false);
        if (booleanExtra) {
            showOptionMenu(booleanExtra);
        }
        int dat = dat();
        if (dar() != null) {
            dat = 2131231598;
        }
        ab.i("MicroMsg.WebViewUI", "banRightBtn:%b, showFixToolsBtn:%b", new Object[]{Boolean.valueOf(getIntent().getBooleanExtra("KRightBtn", false)), Boolean.valueOf(getIntent().getBooleanExtra("KShowFixToolsBtn", false))});
        if (!getIntent().getBooleanExtra("KRightBtn", false)) {
            if (r4) {
                addIconOptionMenu(1, 2131231302, new 31(this));
            }
            a(dat, new 32(this), this.uxc);
        }
        if (z) {
            booleanExtra = false;
        } else {
            booleanExtra = true;
        }
        nR(booleanExtra);
        AppMethodBeat.o(8059);
    }

    public final void showOptionMenu(boolean z) {
        AppMethodBeat.i(8060);
        if (getIntent().getBooleanExtra("hide_option_menu", false)) {
            super.showOptionMenu(false);
            AppMethodBeat.o(8060);
            return;
        }
        super.showOptionMenu(z);
        AppMethodBeat.o(8060);
    }

    public final void showOptionMenu(int i, boolean z) {
        AppMethodBeat.i(8061);
        if (getIntent().getBooleanExtra("hide_option_menu", false)) {
            super.showOptionMenu(i, false);
            AppMethodBeat.o(8061);
            return;
        }
        super.showOptionMenu(i, z);
        AppMethodBeat.o(8061);
    }

    /* Access modifiers changed, original: protected|final */
    public final int dat() {
        AppMethodBeat.i(8063);
        int i = 2130839555;
        if (dar() != null) {
            i = 2131231598;
        }
        AppMethodBeat.o(8063);
        return i;
    }

    /* Access modifiers changed, original: protected|final */
    public final void Ju(int i) {
        AppMethodBeat.i(8064);
        if (i != -3) {
            AppMethodBeat.o(8064);
        } else if (this.uvH == null) {
            AppMethodBeat.o(8064);
        } else {
            boolean z = (this.icz.cZT().vxG & 1) > 0;
            ab.d("MicroMsg.GeneralControlWrapper", "needShowInputAlertTips, ret = ".concat(String.valueOf(z)));
            if (z) {
                if (this.uvH.getVisibility() == 0 || this.uvj.isShown()) {
                    AppMethodBeat.o(8064);
                    return;
                }
                if (this.uvI == null) {
                    this.uvI = new ap(Looper.getMainLooper(), new 37(this), false);
                }
                this.uvI.ae(4000, 4000);
                View view = this.uvH;
                ((ImageView) view.findViewById(2131825261)).setImageResource(2131231709);
                TextView textView = (TextView) view.findViewById(2131825262);
                textView.setTextSize(14.0f);
                textView.setText(2131305690);
                ((ImageButton) view.findViewById(2131825263)).setOnClickListener(new 38(this));
                this.uvH.setVisibility(0);
                com.tencent.mm.plugin.report.service.h.pYm.X(13125, cWL());
            }
            AppMethodBeat.o(8064);
        }
    }

    private void dau() {
        AppMethodBeat.i(8065);
        if (this.uvH != null) {
            this.uvH.setVisibility(8);
        }
        if (this.uvI != null) {
            this.uvI.stopTimer();
        }
        AppMethodBeat.o(8065);
    }

    /* Access modifiers changed, original: protected|final */
    public final void afK(String str) {
        AppMethodBeat.i(8066);
        this.uhz.bJ("profile", true);
        this.uhz.ago(str);
        AppMethodBeat.o(8066);
    }

    public final void clH() {
        AppMethodBeat.i(8067);
        this.uhz.bJ("sendAppMessage", true);
        this.uhz.q(this.uwI.cZP());
        this.ulI.aeG("mm_send_friend_count");
        AppMethodBeat.o(8067);
    }

    /* Access modifiers changed, original: protected|final */
    public final void nP(boolean z) {
        AppMethodBeat.i(8068);
        if (findViewById(2131823606) == null) {
            AppMethodBeat.o(8068);
            return;
        }
        boolean z2;
        if (findViewById(2131823606).getVisibility() == 0) {
            z2 = true;
        } else {
            z2 = false;
        }
        if (z2 != z) {
            findViewById(2131823606).startAnimation(AnimationUtils.loadAnimation(this.mController.ylL, z ? 2131034125 : 2131034126));
        }
        if (z) {
            findViewById(2131823606).setVisibility(0);
            this.uuZ = (ImageButton) findViewById(2131823607);
            ImageButton imageButton = this.uuZ;
            z2 = this.pzf != null && this.pzf.canGoBack();
            imageButton.setEnabled(z2);
            this.uuZ.setOnClickListener(new 39(this));
            this.uva = (ImageButton) findViewById(2131823608);
            this.uva.setOnClickListener(new 40(this));
            AppMethodBeat.o(8068);
            return;
        }
        findViewById(2131823606).setVisibility(8);
        AppMethodBeat.o(8068);
    }

    private void nQ(boolean z) {
        AppMethodBeat.i(8069);
        if (this.uva != null) {
            this.uva.setEnabled(z);
        }
        AppMethodBeat.o(8069);
    }

    /* Access modifiers changed, original: protected|final */
    public final void X(boolean z, boolean z2) {
        AppMethodBeat.i(8070);
        enableOptionMenu(z);
        ab.d("MicroMsg.WebViewUI", "[cpan] set title enable:%b", new Object[]{Boolean.valueOf(z)});
        setProgressBarIndeterminateVisibility(false);
        if (z2) {
            this.uuX.finish();
            this.uwI.cZJ();
            AppMethodBeat.o(8070);
            return;
        }
        if (!(this.uwn || this.uwp)) {
            this.uuX.start();
        }
        AppMethodBeat.o(8070);
    }

    /* Access modifiers changed, original: protected */
    public void afL(String str) {
        AppMethodBeat.i(8071);
        if (this.icz.cZT().dmk()) {
            Bundle bundle = new Bundle();
            bundle.putInt("fromScene", 100);
            if (this.icy.a(str, this.icz.cZS().jB(7), bundle)) {
                ab.i("MicroMsg.WebViewUI", "shouldOverride, built in url handled, url = ".concat(String.valueOf(str)));
            }
            AppMethodBeat.o(8071);
            return;
        }
        ab.w("MicroMsg.WebViewUI", "shouldOverride, allow inner open url, not allow");
        AppMethodBeat.o(8071);
    }

    /* Access modifiers changed, original: protected */
    public boolean afM(String str) {
        AppMethodBeat.i(8072);
        for (com.tencent.mm.plugin.webview.ui.tools.jsapi.b bVar : this.uvJ) {
            if (a(bVar, str)) {
                ab.i("MicroMsg.WebViewUI", "url handled, url = ".concat(String.valueOf(str)));
                if (this.uxd.equals(str)) {
                    ab.i("MicroMsg.WebViewUI", "url " + str + " has been handle");
                    AppMethodBeat.o(8072);
                    return true;
                }
                ab.i("MicroMsg.WebViewUI", "url handled, ret = " + bVar.afM(str) + ", url = " + str);
                AppMethodBeat.o(8072);
                return true;
            }
        }
        AppMethodBeat.o(8072);
        return false;
    }

    public final String afN(String str) {
        AppMethodBeat.i(8073);
        String str2 = BuildConfig.FLAVOR;
        if (!(TextUtils.isEmpty(str) || this.icy == null)) {
            Bundle bundle = new Bundle();
            bundle.putInt("webview_binder_id", hashCode());
            bundle.putString("rawUrl", str);
            try {
                str2 = bo.nullAsNil(this.icy.g(76, bundle).getString("appId"));
                ab.i("MicroMsg.WebViewUI", "stev cachedAppId %s", new Object[]{str2});
            } catch (RemoteException e) {
                ab.w("MicroMsg.WebViewUI", "get cachedAppId error ", new Object[]{e.getMessage()});
            }
        }
        AppMethodBeat.o(8073);
        return str2;
    }

    public final void l(String str, long j, int i) {
        AppMethodBeat.i(8074);
        Looper.myQueue().addIdleHandler(new 41(this, str, j, i));
        AppMethodBeat.o(8074);
    }

    private boolean dav() {
        AppMethodBeat.i(8076);
        if (System.currentTimeMillis() - this.uvo < 300) {
            AppMethodBeat.o(8076);
            return true;
        }
        AppMethodBeat.o(8076);
        return false;
    }

    /* Access modifiers changed, original: protected */
    public w as(String str, boolean z) {
        AppMethodBeat.i(8077);
        w j = j(str, z, -1);
        AppMethodBeat.o(8077);
        return j;
    }

    private w j(String str, boolean z, int i) {
        AppMethodBeat.i(8078);
        w wVar;
        if (this.uwA || this.uwB || isFinishing()) {
            wVar = w.uxU;
            AppMethodBeat.o(8078);
            return wVar;
        }
        int i2 = -1;
        if (this.uvo > 0) {
            if (dav()) {
                i2 = 4;
            }
            this.uvo = 0;
        }
        if (this.uwh != null) {
            this.uwh.setVisibility(8);
        }
        if (this.icz == null) {
            ab.e("MicroMsg.WebViewUI", "startGetA8Key fail, after onDestroy");
            wVar = w.uxU;
            AppMethodBeat.o(8078);
            return wVar;
        } else if (this.uvs) {
            ab.i("MicroMsg.WebViewUI", "edw startGetA8Key, nevergeta8key");
            this.icz.a(str, null, null);
            wVar = w.uxS;
            AppMethodBeat.o(8078);
            return wVar;
        } else {
            Object obj = (this.icy != null && this.uwo.contains(str) && afI(str)) ? 1 : null;
            if ((this.icz.has(str) || obj != null) && !z) {
                ab.i("MicroMsg.WebViewUI", "edw startGetA8Key no need, wvPerm already has value, url = ".concat(String.valueOf(str)));
                this.uvW = this.icz.cZS().jB(24);
                wVar = w.uxS;
                AppMethodBeat.o(8078);
                return wVar;
            }
            int ael;
            String stringExtra = getIntent().getStringExtra("geta8key_username");
            int afH = afH(stringExtra);
            if (i == -1) {
                ael = this.uvR.ael(str);
            } else {
                ael = i;
            }
            ab.i("MicroMsg.WebViewUI", "edw startGetA8Key, url = %s, scene = %d, subScene = %d, username = %s, reason = %d, force = %b, functionid = %s, walletRegion = %d", new Object[]{str, Integer.valueOf(afH), Integer.valueOf(i2), stringExtra, Integer.valueOf(ael), Boolean.valueOf(z), getIntent().getStringExtra("key_function_id"), Integer.valueOf(getIntent().getIntExtra("key_wallet_region", 0))});
            if (i != 5) {
                X(true, false);
            }
            this.uwo.add(str);
            this.icz.a(str, null, null);
            this.uvW = this.icz.cZS().jB(24);
            if (!(ael == 5 || ael == 1)) {
                this.uwq = true;
            }
            this.uvS.daN();
            Bundle bundle = new Bundle();
            bundle.putString("geta8key_data_req_url", str);
            bundle.putString("geta8key_data_username", stringExtra);
            bundle.putInt("geta8key_data_scene", afH);
            bundle.putInt("geta8key_data_subscene", i2);
            bundle.putInt("geta8key_data_reason", ael);
            if (this.pzf.getIsX5Kernel()) {
                bundle.putInt("geta8key_data_flag", 1);
            } else {
                bundle.putInt("geta8key_data_flag", 0);
            }
            bundle.putString("geta8key_data_net_type", aq.cXS());
            bundle.putInt("geta8key_session_id", this.uvB);
            if (!bo.isNullOrNil(getIntent().getStringExtra("k_share_url"))) {
                bundle.putString("k_share_url", getIntent().getStringExtra("k_share_url"));
                getIntent().putExtra("k_share_url", BuildConfig.FLAVOR);
            }
            bundle.putInt("key_wallet_region", r5);
            bundle.putString("key_function_id", r4);
            bundle.putInt("webview_binder_id", hashCode());
            bundle.putByteArray("k_a8key_cookie", this.uvD);
            bundle.putString("geta8key_data_appid", getIntent().getStringExtra("geta8key_open_webview_appid"));
            this.uvC = str;
            boolean z2 = false;
            try {
                z2 = this.icy.s(233, bundle);
            } catch (Exception e) {
                ab.w("MicroMsg.WebViewUI", "startGetA8Key, ex = " + e.getMessage());
            }
            ab.i("MicroMsg.WebViewUI", "startGetA8Key, doScene ret = ".concat(String.valueOf(z2)));
            aq.m cXU = this.ulI.cXU();
            ael = this.cSQ;
            stringExtra = this.cMm;
            cXU.cSQ = ael;
            cXU.uni = stringExtra;
            if (bo.isNullOrNil(str)) {
                ab.e("MicroMsg.WebviewReporter", "WebviewGetA8keyReporter.startGetA8Key failed, url is null");
            } else if (!cXU.unu.containsKey(str)) {
                cXU.unu.put(str, Long.valueOf(bo.anU()));
            }
            com.tencent.mm.plugin.report.service.h.pYm.a(154, 11, 1, false);
            this.uwE.aI("getA8KeyStart", System.currentTimeMillis());
            wVar = w.uxT;
            AppMethodBeat.o(8078);
            return wVar;
        }
    }

    /* Access modifiers changed, original: protected|final */
    public final int afH(String str) {
        AppMethodBeat.i(8079);
        int intExtra = getIntent().getIntExtra("geta8key_scene", 0);
        if (intExtra == 0) {
            if (str == null || str.length() <= 0) {
                intExtra = 0;
            } else if (this.icy == null) {
                intExtra = 1;
            } else {
                try {
                    if (this.icy.nI(str)) {
                        intExtra = 8;
                    } else if (this.icy.mZ(str)) {
                        intExtra = 7;
                        Bundle bundle = new Bundle();
                        bundle.putString("enterprise_biz_username", str);
                        try {
                            bundle = this.icy.g(TbsMediaPlayer$TbsMediaPlayerListener.MEDIA_EXTRA_SUBTITLE_INDEX, bundle);
                            if (bundle != null && bundle.getBoolean("is_enterprise_username")) {
                                intExtra = 51;
                            }
                        } catch (RemoteException e) {
                            ab.e("MicroMsg.WebViewUI", "invoke the check enterprise failed");
                        }
                    } else {
                        intExtra = 1;
                    }
                } catch (Exception e2) {
                    ab.e("MicroMsg.WebViewUI", "getScene fail, ex = " + e2.getMessage());
                    intExtra = 1;
                }
            }
        }
        ab.i("MicroMsg.WebViewUI", "KGetA8KeyScene = %s", new Object[]{Integer.valueOf(intExtra)});
        AppMethodBeat.o(8079);
        return intExtra;
    }

    private boolean afO(String str) {
        AppMethodBeat.i(8080);
        if (bo.isNullOrNil(str)) {
            ab.e("MicroMsg.WebViewUI", "search contact err: null or nill url");
            AppMethodBeat.o(8080);
            return false;
        }
        Jr(106);
        Bundle bundle = new Bundle();
        bundle.putString("search_contact_data_url", str);
        bundle.putInt("webview_binder_id", hashCode());
        try {
            this.icy.s(106, bundle);
        } catch (Exception e) {
            ab.w("MicroMsg.WebViewUI", "startSearchContact, ex = " + e.getMessage());
        }
        AppMethodBeat.o(8080);
        return true;
    }

    private boolean afP(String str) {
        AppMethodBeat.i(8081);
        ab.i("MicroMsg.WebViewUI", "dealCustomScheme, url = ".concat(String.valueOf(str)));
        if (str == null || str.length() == 0) {
            AppMethodBeat.o(8081);
            return false;
        }
        try {
            if (this.icy.dq(str)) {
                ab.i("MicroMsg.WebViewUI", "dealCustomScheme, url is handled by QrCodeURLHelper, url = ".concat(String.valueOf(str)));
                this.icy.dB(str, hashCode());
                AppMethodBeat.o(8081);
                return true;
            }
        } catch (Exception e) {
            ab.w("MicroMsg.WebViewUI", "dealCustomScheme, tryHandleEvents, ex = " + e.getMessage());
        }
        Uri parse = Uri.parse(str);
        if (!(parse == null || str.startsWith("weixin://") || str.startsWith("http"))) {
            String replace;
            Intent intent;
            if (str.startsWith("tel:")) {
                replace = str.replace("tel:", BuildConfig.FLAVOR);
                if (!bo.isNullOrNil(replace)) {
                    try {
                        this.icy.dD(replace, hashCode());
                    } catch (Exception e2) {
                        ab.w("MicroMsg.WebViewUI", "showPhoneSpanDialog, ex = %s", new Object[]{e2.getMessage()});
                    }
                }
                AppMethodBeat.o(8081);
                return true;
            } else if (str.startsWith("sms:") || str.startsWith("smsto:")) {
                intent = new Intent("android.intent.action.SENDTO", parse);
                intent.addFlags(ErrorDialogData.BINDER_CRASH);
                try {
                    startActivity(intent);
                } catch (Exception e22) {
                    ab.e("MicroMsg.WebViewUI", "start sms app failed:[%s]", new Object[]{e22.getMessage()});
                }
                AppMethodBeat.o(8081);
                return true;
            } else if (str.startsWith("mailto:")) {
                intent = new Intent("android.intent.action.SENDTO");
                intent.addFlags(ErrorDialogData.BINDER_CRASH);
                intent.setData(parse);
                try {
                    startActivity(intent);
                } catch (Exception e222) {
                    ab.e("MicroMsg.WebViewUI", "start mailto app failed:[%s]", new Object[]{e222.getMessage()});
                }
                AppMethodBeat.o(8081);
                return true;
            } else {
                try {
                    boolean z = (this.icz.cZT().vxG & 8192) != 0;
                    ab.d("MicroMsg.GeneralControlWrapper", "allowOuterOpenUrl, ret = ".concat(String.valueOf(z)));
                    if (z || this.icy == null || !this.icy.cZd()) {
                        int intExtra = getIntent().getIntExtra("key_download_restrict", 0);
                        if (!bo.isNullOrNil(getIntent().getStringExtra("key_function_id"))) {
                            com.tencent.mm.plugin.report.service.h.pYm.e(14596, new Object[]{getIntent().getStringExtra("key_function_id"), Integer.valueOf(intExtra), Integer.valueOf(1)});
                        }
                        if (intExtra == 1) {
                            ab.e("MicroMsg.WebViewUI", "not allow launch app by custom scheme : %s", new Object[]{str});
                            AppMethodBeat.o(8081);
                            return true;
                        }
                        ab.i("MicroMsg.WebViewUI", "scheme launch interval ; %d", new Object[]{Long.valueOf(bo.anT() - this.uxi)});
                        if (bo.anT() - this.uxi <= 2) {
                            replace = dae();
                            try {
                                replace = com.tencent.mm.compatible.util.q.encode(replace, "UTF-8");
                                str = com.tencent.mm.compatible.util.q.encode(str, "UTF-8");
                            } catch (Exception e3) {
                                ab.i("MicroMsg.WebViewUI", "formate url failed");
                            }
                            com.tencent.mm.plugin.report.service.h.pYm.e(13983, new Object[]{Integer.valueOf(4), replace, str});
                        }
                        if (getIntent().getBooleanExtra("show_openapp_dialog", true)) {
                            z = com.tencent.mm.ce.a.post(new 42(this, parse));
                            AppMethodBeat.o(8081);
                            return z;
                        }
                        intent = new Intent("android.intent.action.VIEW", parse);
                        intent.addFlags(ErrorDialogData.BINDER_CRASH);
                        if (bo.k(this, intent)) {
                            startActivity(intent);
                            AppMethodBeat.o(8081);
                            return true;
                        }
                    }
                    ab.e("MicroMsg.WebViewUI", "dealCustomScheme, not allow outer open url");
                    AppMethodBeat.o(8081);
                    return true;
                } catch (RemoteException e4) {
                    ab.printErrStackTrace("MicroMsg.WebViewUI", e4, BuildConfig.FLAVOR, new Object[0]);
                }
            }
        }
        AppMethodBeat.o(8081);
        return false;
    }

    private void a(String str, String str2, JsapiPermissionWrapper jsapiPermissionWrapper, GeneralControlWrapper generalControlWrapper) {
        AppMethodBeat.i(8082);
        if (!bo.isNullOrNil(str2)) {
            this.icz.a(str2, jsapiPermissionWrapper, generalControlWrapper);
            this.uwo.remove(str2);
            this.uwq = false;
            this.jUg = str2;
        }
        if (hh(str, str2)) {
            this.icz.a(str, jsapiPermissionWrapper, generalControlWrapper);
            this.uwo.remove(str);
            AppMethodBeat.o(8082);
        } else if (this.icy == null || bo.isNullOrNil(str) || !afI(str)) {
            AppMethodBeat.o(8082);
        } else {
            this.icz.a(str, jsapiPermissionWrapper, generalControlWrapper);
            this.uwo.remove(str);
            AppMethodBeat.o(8082);
        }
    }

    /* Access modifiers changed, original: protected */
    public void daw() {
    }

    /* Access modifiers changed, original: protected */
    public void b(com.tencent.mm.plugin.webview.stub.c cVar) {
        AppMethodBeat.i(8083);
        ab.i("MicroMsg.WebViewUI", "onSceneEnd, instance hashcode = " + hashCode());
        if (this.pzf == null) {
            ab.w("MicroMsg.WebViewUI", "onSceneEnd, viewWV is null, do nothing");
            AppMethodBeat.o(8083);
        } else if (isFinishing() || this.icz == null) {
            ab.w("MicroMsg.WebViewUI", "onSceneEnd, isFinishing, do nothing");
            AppMethodBeat.o(8083);
        } else {
            int i;
            int i2;
            int i3 = 0;
            int i4 = -1;
            int i5 = -1;
            String str = null;
            Bundle bundle = null;
            try {
                i3 = cVar.getType();
                i4 = cVar.cYW();
                i5 = cVar.cYX();
                str = cVar.adx();
                bundle = cVar.getData();
                i = i5;
                i2 = i4;
            } catch (Exception e) {
                ab.e("MicroMsg.WebViewUI", "onSceneEnd, ex = " + e.getMessage());
                i = i5;
                i2 = i4;
            }
            if (bundle == null) {
                bundle = new Bundle();
            }
            ab.i("MicroMsg.WebViewUI", "get hash code = %d, self hash code = %d", new Object[]{Integer.valueOf(bundle.getInt("scene_end_listener_hash_code")), Integer.valueOf(hashCode())});
            ab.i("MicroMsg.WebViewUI", "edw onSceneEnd, type = " + i3 + ", errCode = " + i + ", errType = " + i2);
            if (bundle.getInt("scene_end_listener_hash_code") != hashCode()) {
                ab.e("MicroMsg.WebViewUI", "hash code not equal");
                AppMethodBeat.o(8083);
            } else if (i3 == 233 || i3 == 131 || i3 == 106 || i3 == 673 || i3 == 666 || i3 == 1254 || i3 == 1373) {
                String str2;
                boolean z;
                switch (i3) {
                    case 106:
                        finish();
                        AppMethodBeat.o(8083);
                        return;
                    case 233:
                        this.uvS.daO();
                        JsapiPermissionWrapper jsapiPermissionWrapper = new JsapiPermissionWrapper(bundle.getByteArray("geta8key_result_jsapi_perm_control_bytes"));
                        GeneralControlWrapper generalControlWrapper = new GeneralControlWrapper(bundle.getInt("geta8key_result_general_ctrl_b1"));
                        this.uxn = bundle.getLong("geta8key_result_deep_link_bit_set", 0);
                        this.uwI.utF = bundle.getString("geta8key_result_menu_wording");
                        int i6 = bundle.getInt("geta8key_result_reason");
                        ab.i("MicroMsg.WebViewUI", "edw geta8key onSceneEnd, req reason = ".concat(String.valueOf(i6)));
                        if (this.pzf != null) {
                            this.pzf.setA8keyReason(i6);
                        }
                        str2 = null;
                        switch (i6) {
                            case 0:
                            case 2:
                            case 8:
                            case 9:
                                if ((i2 != 0 || i != 0) && (i2 != 4 || i != -2005)) {
                                    m.uuj.Jq(i2);
                                    str = bundle.getString("geta8key_result_req_url");
                                    if (!(this.uwh == null || afI(str))) {
                                        this.uwh.setVisibility(0);
                                        X(true, true);
                                    }
                                    this.ulI.cYa().unc = false;
                                    this.ulI.cXU().bE(str, false);
                                    com.tencent.mm.plugin.report.service.h.pYm.a(154, 12, 1, false);
                                    i3 = b.Jh(i6);
                                    if (-1 != i3) {
                                        com.tencent.mm.plugin.report.service.h.pYm.a(154, (long) i3, 1, false);
                                    }
                                    G(bundle);
                                    if (this.uvy) {
                                        finish();
                                        break;
                                    }
                                }
                                str2 = bundle.getString("geta8key_result_full_url");
                                a(bundle.getString("geta8key_result_req_url"), str2, jsapiPermissionWrapper, generalControlWrapper);
                                H(bundle);
                                this.uvW = jsapiPermissionWrapper.jB(24);
                                this.ulI.cYa().unc = true;
                                this.uvD = bundle.getByteArray("geta8key_result_cookie");
                                ab.d("MicroMsg.WebViewUI", "processGetA8Key, getA8Key = %s", new Object[]{bo.cd(this.uvD)});
                                break;
                                break;
                            case 1:
                            case 5:
                                if (i2 != 0 || i != 0) {
                                    if (i2 != 4 || i != -2005) {
                                        if (i2 != 0 && i == -3300) {
                                            ab.e("MicroMsg.WebViewUI", "onSceneEnd errType:%d, errCode:%d, disable iframe getA8Key", new Object[]{Integer.valueOf(i2), Integer.valueOf(i)});
                                            this.uvE = true;
                                            break;
                                        }
                                        com.tencent.mm.plugin.report.service.h.pYm.a(154, 12, 1, false);
                                        com.tencent.mm.plugin.report.service.h.pYm.a(154, (long) b.Jh(i6), 1, false);
                                        X(true, true);
                                        break;
                                    }
                                    this.pzf.stopLoading();
                                    this.uvG = false;
                                    str2 = bundle.getString("geta8key_result_full_url");
                                    a(bundle.getString("geta8key_result_req_url"), str2, jsapiPermissionWrapper, generalControlWrapper);
                                    H(bundle);
                                    this.uvD = bundle.getByteArray("geta8key_result_cookie");
                                    ab.d("MicroMsg.WebViewUI", "processGetA8Key, getA8Key = %s", new Object[]{bo.cd(this.uvD)});
                                    break;
                                }
                                str2 = bundle.getString("geta8key_result_req_url");
                                this.icz.a(str2, jsapiPermissionWrapper, generalControlWrapper);
                                this.uwo.remove(str2);
                                if (this.uww) {
                                    X(true, true);
                                    this.uww = false;
                                }
                                if (i6 != 5) {
                                    this.uvW = jsapiPermissionWrapper.jB(24);
                                }
                                this.uvD = bundle.getByteArray("geta8key_result_cookie");
                                ab.d("MicroMsg.WebViewUI", "processGetA8Key, getA8Key = %s", new Object[]{bo.cd(this.uvD)});
                                break;
                                break;
                        }
                        Y(this.icz.aei(str2).jB(34), this.icz.aei(str2).jB(75));
                        if (i2 == 0 && i == 0) {
                            j jVar = this.uwI;
                            jVar.utK.add(Integer.valueOf(6));
                            jVar.utK.add(Integer.valueOf(1));
                            jVar.utK.add(Integer.valueOf(3));
                            jVar.utK.add(Integer.valueOf(2));
                            this.uwI.utI = true;
                            if (this.uwI.utJ) {
                                cZM();
                            }
                        } else {
                            this.uwI.utI = false;
                        }
                        this.uwE.aI("getA8KeyEnd", System.currentTimeMillis());
                        daw();
                        AppMethodBeat.o(8083);
                        return;
                    case 666:
                        q qVar = this.uvU;
                        qVar.uxP--;
                        if (qVar.uxP <= 0) {
                            WebViewUI.this.Js(666);
                        }
                        finish();
                        AppMethodBeat.o(8083);
                        return;
                    case 673:
                        o oVar = this.uvT;
                        oVar.uxO--;
                        if (oVar.uxO <= 0) {
                            oVar.uxp.Js(673);
                        }
                        if (i2 == 0 && i == 0) {
                            str2 = bundle != null ? bundle.getString("reading_mode_result_url") : null;
                            ab.i("MicroMsg.WebViewUI", "[cpan] onsceneend url:%s", new Object[]{str2});
                            if (bo.isNullOrNil(str2)) {
                                ab.i("MicroMsg.WebViewUI", "[cpan] onsceneend failed");
                                AppMethodBeat.o(8083);
                                return;
                            }
                            b(str2, null, false);
                            AppMethodBeat.o(8083);
                            return;
                        }
                        ab.i("MicroMsg.WebViewUI", "[cpan] onsceneend failed");
                        AppMethodBeat.o(8083);
                        return;
                    case 1254:
                        z = i2 == 0 && i == 0;
                        com.tencent.mm.plugin.webview.stub.d dVar = this.icy;
                        af$d af_d = this.uxk;
                        af$b af_b = this.uxl;
                        int hashCode = hashCode();
                        ab.i("MicroMsg.OauthAuthorizeLogic", "onOauthAuthorizeSceneEnd suc: %b", new Object[]{Boolean.valueOf(z)});
                        af_d.blb();
                        af_b.remove(1254);
                        long currentTimeMillis = System.currentTimeMillis();
                        String aep = bundle == null ? BuildConfig.FLAVOR : af.c.aep(bundle.getString("oauth_url"));
                        ab.i("MicroMsg.OauthAuthorizeLogic", "parse appID:%s", new Object[]{aep});
                        if (!z) {
                            com.tencent.mm.ui.base.h.a(this, str, ah.getContext().getString(2131305621), new 2(af_d));
                            com.tencent.mm.plugin.webview.e.a aVar = com.tencent.mm.plugin.webview.e.a.uKJ;
                            if (aep == null) {
                                str = BuildConfig.FLAVOR;
                            } else {
                                str = aep;
                            }
                            com.tencent.mm.plugin.webview.e.a.a(str, currentTimeMillis, 2, 1, 0, 0, i);
                            AppMethodBeat.o(8083);
                            return;
                        } else if (bundle == null) {
                            ab.e("MicroMsg.OauthAuthorizeLogic", "onOauthAuthorizeSceneEnd_Tools resp null");
                            AppMethodBeat.o(8083);
                            return;
                        } else {
                            z = bundle.getBoolean("is_recent_has_auth");
                            boolean z2 = bundle.getBoolean("is_silence_auth");
                            if (z || z2) {
                                String string = bundle.getString("redirect_url");
                                if (bo.isNullOrNil(string)) {
                                    ab.e("MicroMsg.OauthAuthorizeLogic", "onOauthAuthorizeSceneEnd redirect null");
                                    AppMethodBeat.o(8083);
                                    return;
                                }
                                ab.i("MicroMsg.OauthAuthorizeLogic", "onOauthAuthorizeSceneEnd isRecentHasAuth:%b isSilenceAuth:%b redirectUrl:%s", new Object[]{Boolean.valueOf(z), Boolean.valueOf(z2), string});
                                com.tencent.mm.model.gdpr.c.a(this, com.tencent.mm.model.gdpr.a.fom, aep, new 3(af_d, aep, currentTimeMillis, i, string));
                                AppMethodBeat.o(8083);
                                return;
                            }
                            4 4 = new 4(this, aep, af_d, currentTimeMillis, i, bundle, dVar, af_b, hashCode);
                            if ((this instanceof WebViewUI) && isFinishing()) {
                                ab.i("MicroMsg.OauthAuthorizeLogic", "showWebAuthorizeDialog isFinishing");
                                AppMethodBeat.o(8083);
                                return;
                            }
                            new com.tencent.mm.plugin.webview.ui.tools.widget.n(this).a(af.aa((ArrayList) bundle.getSerializable("scope_list")), bundle.getString("appname"), bundle.getString("appicon_url"), getString(2131305632), 4);
                            AppMethodBeat.o(8083);
                            return;
                        }
                    case 1373:
                        z = i2 == 0 && i == 0;
                        af$d af_d2 = this.uxk;
                        af$b af_b2 = this.uxl;
                        ab.i("MicroMsg.OauthAuthorizeLogic", "onOauthAuthorizeConfirmSceneEnd suc: %b", new Object[]{Boolean.valueOf(z)});
                        af_b2.remove(1373);
                        if (z) {
                            if (bundle != null) {
                                str2 = bundle.getString("redirect_url");
                                if (!bo.isNullOrNil(str2)) {
                                    af_d2.aeq(str2);
                                    ab.i("MicroMsg.OauthAuthorizeLogic", "onOauthAuthorizeConfirmSceneEnd redirectUrl: %s", new Object[]{str2});
                                    break;
                                }
                                ab.e("MicroMsg.OauthAuthorizeLogic", "onOauthAuthorizeConfirmSceneEnd redirect null");
                                AppMethodBeat.o(8083);
                                return;
                            }
                            ab.e("MicroMsg.OauthAuthorizeLogic", "onOauthAuthorizeConfirmSceneEnd resp null");
                            AppMethodBeat.o(8083);
                            return;
                        }
                        com.tencent.mm.ui.base.h.a(this, str, ah.getContext().getString(2131305621), new 5(af_d2));
                        AppMethodBeat.o(8083);
                        return;
                }
                AppMethodBeat.o(8083);
            } else {
                AppMethodBeat.o(8083);
            }
        }
    }

    private void Y(boolean z, boolean z2) {
        AppMethodBeat.i(8084);
        if (z) {
            setMMSubTitle(2131305624);
            if (!this.uvv) {
                this.uvv = true;
                AppMethodBeat.o(8084);
                return;
            }
        } else if (z2) {
            setMMSubTitle(2131305636);
            AppMethodBeat.o(8084);
            return;
        } else {
            setMMSubTitle(null);
        }
        AppMethodBeat.o(8084);
    }

    /* Access modifiers changed, original: protected */
    public void c(String str, String str2, Map<String, String> map) {
        AppMethodBeat.i(8085);
        String bc = bo.bc(dae(), this.cOG);
        if (bo.isNullOrNil(bc)) {
            ab.e("MicroMsg.WebViewUI", "after getA8Key, currentURL is null or nil, wtf");
            b(str2, null, false);
            AppMethodBeat.o(8085);
        } else if (this.uhz == null) {
            if (map == null || map.size() <= 0) {
                b(str2, null, false);
                AppMethodBeat.o(8085);
                return;
            }
            b(str2, (Map) map, false);
            AppMethodBeat.o(8085);
        } else if (!bo.nullAsNil(str2).contains("#wechat_redirect") && !bo.nullAsNil(str).contains("#wechat_redirect")) {
            if (!hh(bc, str2)) {
                boolean z;
                String aeN = com.tencent.mm.plugin.webview.modelcache.q.aeN(bc);
                String aeN2 = com.tencent.mm.plugin.webview.modelcache.q.aeN(str2);
                if (bo.isNullOrNil(aeN2) || bo.isNullOrNil(aeN) || !aeN2.equals(aeN) || this.icy == null || !afI(bc)) {
                    z = false;
                } else {
                    z = true;
                }
                if (!z) {
                    if (map == null || map.size() <= 0) {
                        b(str2, null, false);
                        AppMethodBeat.o(8085);
                        return;
                    }
                    b(str2, (Map) map, false);
                    AppMethodBeat.o(8085);
                    return;
                }
            }
            this.uwx.put(bc, str2);
            this.uwr.put(bc, map);
            this.uwx.put(str, str2);
            this.uwr.put(str, map);
            this.uhz.z(str2, map);
            AppMethodBeat.o(8085);
        } else if (map == null || map.size() <= 0) {
            b(str2, null, false);
            AppMethodBeat.o(8085);
        } else {
            b(str2, (Map) map, false);
            AppMethodBeat.o(8085);
        }
    }

    private boolean hh(String str, String str2) {
        AppMethodBeat.i(8086);
        if (bo.isNullOrNil(str) || bo.isNullOrNil(str2)) {
            AppMethodBeat.o(8086);
            return false;
        }
        if (com.tencent.mm.plugin.webview.a.uet.matcher(str).matches() && com.tencent.mm.plugin.webview.a.uet.matcher(str2).matches()) {
            String replaceFirst = str.replaceFirst("http://", BuildConfig.FLAVOR).replaceFirst("https://", BuildConfig.FLAVOR);
            int indexOf = replaceFirst.indexOf(35);
            if (indexOf > 0) {
                replaceFirst = replaceFirst.substring(0, indexOf);
            }
            if (str2.replaceFirst("http://", BuildConfig.FLAVOR).replaceFirst("https://", BuildConfig.FLAVOR).startsWith(replaceFirst) && this.icy != null && afI(str)) {
                AppMethodBeat.o(8086);
                return true;
            }
        }
        AppMethodBeat.o(8086);
        return false;
    }

    /* Access modifiers changed, original: protected */
    public boolean H(Bundle bundle) {
        String str;
        AppMethodBeat.i(8087);
        ab.d("MicroMsg.WebViewUI", "[cpan] process a8 key:%d", new Object[]{Long.valueOf(System.currentTimeMillis())});
        int i = bundle.getInt("geta8key_result_action_code");
        String string = bundle.getString("geta8key_result_title");
        String string2 = bundle.getString("geta8key_result_full_url");
        String string3 = bundle.getString("geta8key_result_content");
        String string4 = bundle.getString("geta8key_result_req_url");
        String[] stringArray = bundle.getStringArray("geta8key_result_http_header_key_list");
        String[] stringArray2 = bundle.getStringArray("geta8key_result_http_header_value_list");
        if (getIntent().getBooleanExtra("k_has_http_header", false) && (stringArray == null || stringArray.length == 0 || stringArray2 == null || stringArray2.length == 0)) {
            ab.i("MicroMsg.WebViewUI", "use intent httpheader info");
            getIntent().putExtra("k_has_http_header", false);
            stringArray = getIntent().getStringArrayExtra("geta8key_result_http_header_key_list");
            stringArray2 = getIntent().getStringArrayExtra("geta8key_result_http_header_value_list");
            getIntent().putStringArrayListExtra("geta8key_result_http_header_key_list", null);
            getIntent().putStringArrayListExtra("geta8key_result_http_header_value_list", null);
        }
        ab.i("MicroMsg.WebViewUI", "processGetA8Key, actionCode = %d, title = %s, fullUrl = %s, content = %s", new Object[]{Integer.valueOf(i), string, string2, string3});
        HashMap hashMap = new HashMap();
        if (stringArray != null && stringArray2 != null && stringArray.length > 0 && stringArray2.length > 0 && stringArray.length == stringArray2.length) {
            for (int i2 = 0; i2 < stringArray.length; i2++) {
                hashMap.put(stringArray[i2], stringArray2[i2]);
            }
        }
        this.uws = hashMap;
        if (bo.isNullOrNil(string2)) {
            str = string4;
        } else {
            str = string2;
        }
        aq.V(this.pzf.getIsX5Kernel(), bo.nullAsNil(str).startsWith("https://"));
        this.ulI.cXU().bE(string4, true);
        com.tencent.mm.plugin.webview.model.aq.f cXW = this.ulI.cXW();
        int i3 = this.cSQ;
        String str2 = this.cMm;
        cXW.cSQ = i3;
        cXW.uni = str2;
        if (bo.isNullOrNil(string2)) {
            ab.e("MicroMsg.WebviewReporter", "WebViewRenderReporter.onPageStart failed, url is null");
        } else {
            cXW.iCz = string2;
            cXW.unh = true;
            if (!cXW.unf.containsKey(string2)) {
                cXW.unf.put(string2, Long.valueOf(bo.anU()));
            }
            if (!cXW.ung.containsKey(string2)) {
                cXW.ung.put(string2, Long.valueOf(bo.anU()));
            }
        }
        boolean afP;
        switch (i) {
            case 1:
                ab.i("MicroMsg.WebViewUI", "getA8key-text: ".concat(String.valueOf(string3)));
                if (string3 == null || string3.length() == 0) {
                    ab.e("MicroMsg.WebViewUI", "getA8key-text fail, invalid content");
                    AppMethodBeat.o(8087);
                    return false;
                }
                this.pzf.getSettings().setJavaScriptEnabled(false);
                this.pzf.loadData(string3, "text/html", "utf-8");
                AppMethodBeat.o(8087);
                return true;
            case 2:
                ab.i("MicroMsg.WebViewUI", "getA8key-webview: title = " + string + ", fullUrl = " + string2);
                if (string2 == null || string2.length() == 0) {
                    ab.e("MicroMsg.WebViewUI", "getA8key-webview fail, invalid fullUrl");
                    AppMethodBeat.o(8087);
                    return false;
                }
                if (string != null && string.length() > 0) {
                    setMMTitle(string);
                }
                if (afQ(string2)) {
                    c(string4, string2, hashMap);
                    AppMethodBeat.o(8087);
                    return true;
                }
                ab.f("MicroMsg.WebViewUI", "processGetA8Key qrcode, canLoadUrl fail, url = ".concat(String.valueOf(string2)));
                dah();
                AppMethodBeat.o(8087);
                return true;
            case 3:
                ab.i("MicroMsg.WebViewUI", "getA8key-app: ".concat(String.valueOf(string2)));
                if (string2 == null || string2.length() == 0) {
                    ab.e("MicroMsg.WebViewUI", "getA8key-app, fullUrl is null");
                    AppMethodBeat.o(8087);
                    return false;
                }
                afP = afP(string2);
                AppMethodBeat.o(8087);
                return afP;
            case 4:
                afP = afO(string2);
                AppMethodBeat.o(8087);
                return afP;
            case 6:
                ab.i("MicroMsg.WebViewUI", "getA8key-special_webview: fullUrl = ".concat(String.valueOf(string2)));
                if (string2 == null || string2.length() == 0) {
                    ab.e("MicroMsg.WebViewUI", "getA8key-special_webview fail, invalid fullUrl");
                    AppMethodBeat.o(8087);
                    return false;
                } else if (afQ(string2)) {
                    b(string2, null, false);
                    nO(false);
                    AppMethodBeat.o(8087);
                    return true;
                } else {
                    ab.f("MicroMsg.WebViewUI", "processGetA8Key special, canLoadUrl fail, url = ".concat(String.valueOf(string2)));
                    dah();
                    AppMethodBeat.o(8087);
                    return true;
                }
            case 7:
            case 30:
                ab.i("MicroMsg.WebViewUI", "getA8key-webview_no_notice: title = " + string + ", fullUrl = " + string2);
                if (string2 == null || string2.length() == 0) {
                    ab.e("MicroMsg.WebViewUI", "getA8key-webview_no_notice fail, invalid fullUrl");
                    AppMethodBeat.o(8087);
                    return false;
                }
                if (string != null && string.length() > 0) {
                    setMMTitle(string);
                }
                if (afQ(string2)) {
                    c(string4, string2, hashMap);
                    AppMethodBeat.o(8087);
                    return true;
                }
                ab.f("MicroMsg.WebViewUI", "processGetA8Key qrcode no notice, canLoadUrl fail, url = ".concat(String.valueOf(string2)));
                dah();
                AppMethodBeat.o(8087);
                return true;
            case ApiHelper$VERSION_CODES.KITKAT_WATCH /*20*/:
                if (bo.isNullOrNil(string2)) {
                    ab.e("MicroMsg.WebViewUI", "doJumpEmotionDetailUrlScene err: null or nill url");
                } else {
                    q qVar = this.uvU;
                    if (qVar.uxP == 0) {
                        WebViewUI.this.Jr(666);
                    }
                    qVar.uxP++;
                    Bundle bundle2 = new Bundle();
                    bundle2.putString("emoji_store_jump_url", string2);
                    bundle2.putInt("webview_binder_id", hashCode());
                    try {
                        this.icy.s(666, bundle2);
                    } catch (Exception e) {
                        ab.w("MicroMsg.WebViewUI", "startSearchContact, ex = " + e.getMessage());
                    }
                }
                AppMethodBeat.o(8087);
                return true;
            default:
                ab.i("MicroMsg.WebViewUI", "qrcode-getA8key-not_catch: action code = ".concat(String.valueOf(i)));
                AppMethodBeat.o(8087);
                return false;
        }
    }

    /* Access modifiers changed, original: protected */
    public void G(Bundle bundle) {
    }

    /* Access modifiers changed, original: protected */
    public boolean dax() {
        return false;
    }

    /* Access modifiers changed, original: protected */
    public boolean day() {
        return false;
    }

    private void Jv(int i) {
        AppMethodBeat.i(8089);
        if (i <= 0 || i > 4) {
            i = 2;
        }
        if (this.uhz != null) {
            this.uhz.JK(i);
        }
        FontChooserView fontChooserView = (FontChooserView) this.uvb.findViewById(2131829157);
        if (fontChooserView != null) {
            fontChooserView.setSliderIndex(i - 1);
        }
        AppMethodBeat.o(8089);
    }

    /* Access modifiers changed, original: protected */
    public void Jw(int i) {
        AppMethodBeat.i(8090);
        if (this.pzf == null || this.pzf.getSettings() == null) {
            AppMethodBeat.o(8090);
            return;
        }
        ab.i("MicroMsg.WebViewUI", "localSetFontSize, fontSize = ".concat(String.valueOf(i)));
        switch (i) {
            case 1:
                this.pzf.getSettings().a(com.tencent.xweb.p.a.AMF);
                AppMethodBeat.o(8090);
                return;
            case 3:
                this.pzf.getSettings().a(com.tencent.xweb.p.a.AMH);
                AppMethodBeat.o(8090);
                return;
            case 4:
                this.pzf.getSettings().a(com.tencent.xweb.p.a.AMI);
                AppMethodBeat.o(8090);
                return;
            default:
                this.pzf.getSettings().a(com.tencent.xweb.p.a.AMG);
                AppMethodBeat.o(8090);
                return;
        }
    }

    private final boolean afQ(String str) {
        AppMethodBeat.i(8091);
        if (ae.giw) {
            ab.w("MicroMsg.WebViewUI", "skipLoadUrlCheck");
            AppMethodBeat.o(8091);
            return true;
        } else if (bo.isNullOrNil(str)) {
            AppMethodBeat.o(8091);
            return true;
        } else if (this.uvl) {
            ab.i("MicroMsg.WebViewUI", "albie: trust this url(%s)", new Object[]{str});
            AppMethodBeat.o(8091);
            return true;
        } else {
            String toLowerCase = str.toLowerCase();
            if (toLowerCase.startsWith("file://")) {
                for (String t : ums) {
                    if (u.t(toLowerCase, t)) {
                        AppMethodBeat.o(8091);
                        return true;
                    }
                }
                AppMethodBeat.o(8091);
                return false;
            }
            AppMethodBeat.o(8091);
            return true;
        }
    }

    private void daA() {
        AppMethodBeat.i(8092);
        if (this.pzf == null || this.icy == null) {
            ab.i("MicroMsg.WebViewUI", "viewwv is null or invoker is null");
            AppMethodBeat.o(8092);
            return;
        }
        try {
            this.pzf.removeJavascriptInterface("searchBoxJavaBridge_");
        } catch (Exception e) {
            ab.e("MicroMsg.WebViewUI", "removeConfigJsInterface, ex = %s", new Object[]{e.getMessage()});
        }
        if (this.uxo == null) {
            try {
                if (this.icy.cZd()) {
                    this.uxo = this.icy.cZe();
                }
            } catch (Exception e2) {
                ab.e("MicroMsg.WebViewUI", "getRemoveJsInterfaceList, ex = %s", new Object[]{e2.getMessage()});
            }
        }
        String str = "MicroMsg.WebViewUI";
        String str2 = "removeConfigJsInterface, to remove list size = %d";
        Object[] objArr = new Object[1];
        objArr[0] = Integer.valueOf(this.uxo == null ? 0 : this.uxo.length);
        ab.i(str, str2, objArr);
        if (this.uxo == null || this.uxo.length == 0) {
            AppMethodBeat.o(8092);
            return;
        }
        try {
            for (String str3 : this.uxo) {
                ab.i("MicroMsg.WebViewUI", "removeConfigJsInterface, js interface name = %s", new Object[]{str3});
                this.pzf.removeJavascriptInterface(str3);
            }
            AppMethodBeat.o(8092);
        } catch (Exception e22) {
            ab.e("MicroMsg.WebViewUI", "removeConfigJsInterface, ex = %s", new Object[]{e22.getMessage()});
            AppMethodBeat.o(8092);
        }
    }

    public final boolean cWG() {
        AppMethodBeat.i(8093);
        if (this.uwe == null || !this.uwe.cXi() || bo.isNullOrNil(this.uwe.daM()) || bo.isNullOrNil(this.uwe.cXk()) || bo.isNullOrNil(this.uwe.cXl())) {
            AppMethodBeat.o(8093);
            return false;
        }
        ab.i("MicroMsg.WebViewUI", "use js api close window confirm info : %s, %s, %s", new Object[]{this.uwe.daM(), this.uwe.cXk(), this.uwe.cXl()});
        View inflate = View.inflate(this.mController.ylL, 2130970090, null);
        final CheckBox checkBox = (CheckBox) inflate.findViewById(2131825970);
        checkBox.setChecked(false);
        checkBox.setVisibility(8);
        TextView textView = (TextView) inflate.findViewById(2131825969);
        textView.setText(r6);
        textView.setTextColor(getResources().getColor(2131690316));
        textView = (TextView) inflate.findViewById(2131825971);
        textView.setTextColor(getResources().getColor(2131690316));
        textView.setVisibility(8);
        this.uwf = com.tencent.mm.ui.base.h.a(this.mController.ylL, true, BuildConfig.FLAVOR, inflate, r4, r5, new DialogInterface.OnClickListener() {
            public final void onClick(DialogInterface dialogInterface, int i) {
                AppMethodBeat.i(7877);
                if (checkBox != null && checkBox.isChecked()) {
                    try {
                        if (WebViewUI.this.icy.cZd()) {
                            WebViewUI.this.icy.gx(327792, 1);
                        }
                    } catch (Exception e) {
                        ab.e("MicroMsg.WebViewUI", "tryShowCloseWindowConfirmInfo, ex = " + e.getMessage());
                    }
                }
                WebViewUI.this.uwA = true;
                WebViewUI.this.uwf = null;
                m.uuj.close();
                WebViewUI.this.finish();
                AppMethodBeat.o(7877);
            }
        }, new 48(this));
        AppMethodBeat.o(8093);
        return true;
    }

    private boolean daB() {
        AppMethodBeat.i(8094);
        int intExtra = getIntent().getIntExtra("key_close_action", 0);
        Bundle bundleExtra = getIntent().getBundleExtra("key_close_data");
        ab.i("MicroMsg.WebViewUI", "close action %s", new Object[]{Integer.valueOf(intExtra)});
        switch (intExtra) {
            case 1:
                if (bundleExtra != null) {
                    String string = bundleExtra.getString("close_dialog_title");
                    String string2 = bundleExtra.getString("close_dialog_msg");
                    String string3 = bundleExtra.getString("close_dialog_ok");
                    String string4 = bundleExtra.getString("close_dialog_cancel");
                    boolean z = bundleExtra.getBoolean("close_dialog_ok_close", true);
                    if (!bo.Q(new String[]{string2, string3, string4})) {
                        if (z) {
                            com.tencent.mm.ui.base.h.a(this, string, string2, string3, string4, false, new DialogInterface.OnClickListener() {
                                public final void onClick(DialogInterface dialogInterface, int i) {
                                    AppMethodBeat.i(7878);
                                    WebViewUI.this.uwA = true;
                                    m.uuj.close();
                                    WebViewUI.this.finish();
                                    AppMethodBeat.o(7878);
                                }
                            }, null);
                        } else {
                            com.tencent.mm.ui.base.h.a(this, string, string2, string3, string4, false, null, new 50(this));
                        }
                        AppMethodBeat.o(8094);
                        return true;
                    }
                }
                break;
            case 2:
                if (bundleExtra != null) {
                    String string5 = bundleExtra.getString("close_jump_url");
                    int i = bundleExtra.getInt("close_jump_url_request_code", 0);
                    if (!bo.isNullOrNil(string5)) {
                        Intent intent = new Intent(this, WebViewUI.class);
                        intent.putExtra("rawUrl", string5);
                        intent.putExtra("showShare", false);
                        intent.putExtra("show_bottom", false);
                        intent.putExtra("needRedirect", false);
                        intent.putExtra("hardcode_jspermission", JsapiPermissionWrapper.vxI);
                        intent.putExtra("hardcode_general_ctrl", GeneralControlWrapper.vxE);
                        startActivityForResult(intent, i);
                        com.tencent.mm.ui.base.b.hN(this);
                        AppMethodBeat.o(8094);
                        return true;
                    }
                }
                break;
        }
        AppMethodBeat.o(8094);
        return false;
    }

    /* Access modifiers changed, original: protected */
    public void daC() {
        AppMethodBeat.i(8095);
        if (daB()) {
            AppMethodBeat.o(8095);
            return;
        }
        daD();
        if (!cWG()) {
            this.uwA = true;
            m.uuj.close();
            if (this.uie.Jx(20)) {
                AppMethodBeat.o(8095);
                return;
            }
            finish();
        }
        AppMethodBeat.o(8095);
    }

    private void daD() {
        AppMethodBeat.i(8096);
        if (this.uwC) {
            ab.d("MicroMsg.WebViewUI", "SwipeBackFinish, do not LaunchOuterApp");
            AppMethodBeat.o(8096);
            return;
        }
        Intent intent = getIntent();
        boolean booleanExtra = intent.getBooleanExtra("webview_invoke_launch_app_when_back", false);
        String stringExtra = intent.getStringExtra("KAppId");
        String stringExtra2 = intent.getStringExtra("webview_invoke_launch_app_ext_info_when_back");
        if (booleanExtra && stringExtra != null && stringExtra.length() > 0 && stringExtra2 != null && stringExtra2.length() > 0) {
            Bundle bundle = new Bundle();
            bundle.putString("appId", stringExtra);
            bundle.putString("extInfo", stringExtra2);
            com.tencent.mm.ipcinvoker.f.a("com.tencent.mm", bundle, com.tencent.mm.pluginsdk.model.app.u.class, null);
        }
        AppMethodBeat.o(8096);
    }

    /* Access modifiers changed, original: protected */
    public void jD(boolean z) {
    }

    /* Access modifiers changed, original: protected */
    public void j(int i, Bundle bundle) {
    }

    /* Access modifiers changed, original: protected */
    public boolean aYb() {
        return true;
    }

    /* Access modifiers changed, original: protected */
    public void t(int i, Bundle bundle) {
        AppMethodBeat.i(8097);
        ab.i("MicroMsg.WebViewUI", "handleEmojiStoreAction");
        AppMethodBeat.o(8097);
    }

    public final void nR(boolean z) {
        AppMethodBeat.i(8098);
        String url = this.pzf.getUrl();
        if (z) {
            showOptionMenu(0, false);
            this.uwd.put(url, Boolean.TRUE);
            AppMethodBeat.o(8098);
            return;
        }
        showOptionMenu(0, true);
        if (this.uwd.containsKey(url)) {
            this.uwd.remove(url);
        }
        AppMethodBeat.o(8098);
    }

    /* Access modifiers changed, original: protected|final */
    public final boolean daE() {
        AppMethodBeat.i(8099);
        if (this.jYe != -3) {
            showVKB();
            AppMethodBeat.o(8099);
            return true;
        }
        AppMethodBeat.o(8099);
        return false;
    }

    public final void aqX() {
        AppMethodBeat.i(8100);
        super.aqX();
        this.jYe = -2;
        AppMethodBeat.o(8100);
    }

    public final void showVKB() {
        AppMethodBeat.i(8101);
        super.showVKB();
        if (this.jYe == -3) {
            this.jYe = -2;
            AppMethodBeat.o(8101);
            return;
        }
        this.jYe = -3;
        AppMethodBeat.o(8101);
    }

    public final void setBackBtn(OnMenuItemClickListener onMenuItemClickListener, int i) {
        AppMethodBeat.i(8102);
        super.setBackBtn(onMenuItemClickListener, i);
        if (com.tencent.mm.compatible.util.d.iW(21) && dac()) {
            dxZ();
        }
        AppMethodBeat.o(8102);
    }

    /* Access modifiers changed, original: protected|final */
    public final boolean cWO() {
        AppMethodBeat.i(8103);
        ab.i("MicroMsg.WebViewUI", "forceHideShare:%b showShareBtn:%b enableMinimize:%b", new Object[]{Boolean.valueOf(getIntent().getBooleanExtra("forceHideShare", false)), Boolean.valueOf(getIntent().getBooleanExtra("showShare", true)), Boolean.valueOf(aYc())});
        if (!getIntent().getBooleanExtra("forceHideShare", false) && r3 && aYc()) {
            AppMethodBeat.o(8103);
            return true;
        }
        AppMethodBeat.o(8103);
        return false;
    }

    /* Access modifiers changed, original: protected */
    public boolean aYc() {
        boolean z;
        AppMethodBeat.i(8104);
        if (!getClass().equals(WebViewUI.class) || getIntent().getBooleanExtra("disable_minimize", false)) {
            z = false;
        } else {
            z = true;
        }
        ab.i("MicroMsg.WebViewUI", "enableMinimize class:%s enable:%b", new Object[]{getClass(), Boolean.valueOf(z)});
        AppMethodBeat.o(8104);
        return z;
    }

    /* Access modifiers changed, original: protected */
    public void daF() {
    }

    /* Access modifiers changed, original: protected */
    public boolean aYf() {
        return false;
    }

    public void startActivity(Intent intent) {
        AppMethodBeat.i(8105);
        if (bo.isEqual(intent.getType(), "application/vnd.android.package-archive")) {
            com.tencent.mm.pluginsdk.model.app.q.a(ah.getContext(), intent.getData(), null);
            AppMethodBeat.o(8105);
            return;
        }
        super.startActivity(intent);
        AppMethodBeat.o(8105);
    }

    /* Access modifiers changed, original: protected|final */
    public final void daG() {
        AppMethodBeat.i(8106);
        overridePendingTransition(2131034228, 2131034227);
        AppMethodBeat.o(8106);
    }

    private boolean cZZ() {
        return this.uvf || this.uvg;
    }

    /* Access modifiers changed, original: protected */
    public int aMi() {
        AppMethodBeat.i(8001);
        int dyj = this.mController.dyj();
        AppMethodBeat.o(8001);
        return dyj;
    }

    /* Access modifiers changed, original: protected|final */
    public final void dad() {
        AppMethodBeat.i(8003);
        if (!com.tencent.mm.compatible.util.d.iW(21) || this.nfs == 0) {
            setStatusBarColor(aMi());
            AppMethodBeat.o(8003);
            return;
        }
        xE(this.nfs);
        if (dac()) {
            dxZ();
            ta(-16777216);
        }
        at(this.nfs, dac());
        AppMethodBeat.o(8003);
    }

    /* Access modifiers changed, original: protected */
    public MMWebView aXX() {
        AppMethodBeat.i(8007);
        MMWebView in = MMWebView.a.in(this);
        AppMethodBeat.o(8007);
        return in;
    }

    public void addIconOptionMenu(int i, int i2, OnMenuItemClickListener onMenuItemClickListener) {
        AppMethodBeat.i(8062);
        if (com.tencent.mm.compatible.util.d.iW(21)) {
            Drawable g = android.support.v4.content.b.g(this, i2);
            if (g == null) {
                AppMethodBeat.o(8062);
                return;
            }
            if (dac()) {
                g.setColorFilter(-16777216, Mode.SRC_ATOP);
            } else if (this.uwO == null || this.uwO.uxW) {
                g.clearColorFilter();
            } else {
                g.setColorFilter(-16777216, Mode.SRC_ATOP);
            }
            a(i, getString(2131296975), g, onMenuItemClickListener);
            AppMethodBeat.o(8062);
            return;
        }
        super.addIconOptionMenu(i, i2, onMenuItemClickListener);
        AppMethodBeat.o(8062);
    }

    public final void m(String str, long j, int i) {
        AppMethodBeat.i(8075);
        if (at.isConnected(getApplicationContext())) {
            if (at.isWifi(getApplicationContext())) {
                this.networkType = 1;
            } else if (at.is4G(getApplicationContext())) {
                this.networkType = 4;
            } else if (at.is3G(getApplicationContext())) {
                this.networkType = 3;
            } else if (at.is2G(getApplicationContext())) {
                this.networkType = 2;
            }
            ab.i("MicroMsg.WebViewUI", "get networkType %d", new Object[]{Integer.valueOf(this.networkType)});
        }
        String afN = afN(this.uxh);
        if (this.fromScene != 0) {
            this.uxg = " ";
        }
        if (this.icz == null) {
            ab.w("MicroMsg.WebViewUI", "webpageVisitInfoReport wvPerm is null");
            AppMethodBeat.o(8075);
            return;
        }
        GeneralControlWrapper cZT = this.icz.cZT();
        ab.d("MicroMsg.WebViewUI", "webpageVisitInfoReport enableReportPageEvent %s", new Object[]{Boolean.valueOf(cZT != null ? cZT.dmm() : false)});
        if (this.iBE > 0 && this.uxi > this.iBE && j > this.uxi && !TextUtils.isEmpty(afN) && r4) {
            long j2 = this.uxi - this.iBE;
            long j3 = j - this.uxi;
            ab.d("MicroMsg.WebViewUI", "report(%s), clickTimestamp : %d, appID : %s, usedTime : %s, stayTime : %s, networkType : %s, userAgent : %s, url : %s, sessionID : %s, targetAction : %s, targetUrl : %s,scene : %s, refererUrl : %s", new Object[]{Integer.valueOf(13376), Long.valueOf(this.iBE), afN, Long.valueOf(j2), Long.valueOf(j3), Integer.valueOf(this.networkType), this.ium, this.uxh, this.cvF, Integer.valueOf(i), str, Integer.valueOf(this.fromScene), this.uxg});
            String str2 = BuildConfig.FLAVOR;
            String str3 = BuildConfig.FLAVOR;
            String str4 = BuildConfig.FLAVOR;
            String str5 = BuildConfig.FLAVOR;
            try {
                str2 = com.tencent.mm.compatible.util.q.encode(bo.nullAsNil(this.ium), "UTF-8");
                str3 = com.tencent.mm.compatible.util.q.encode(bo.nullAsNil(this.uxh), "UTF-8");
                str4 = com.tencent.mm.compatible.util.q.encode(bo.nullAsNil(str), "UTF-8");
                str5 = com.tencent.mm.compatible.util.q.encode(bo.nullAsNil(this.uxg), "UTF-8");
            } catch (UnsupportedEncodingException e) {
                ab.printErrStackTrace("MicroMsg.WebViewUI", e, BuildConfig.FLAVOR, new Object[0]);
            }
            com.tencent.mm.plugin.report.service.h.pYm.e(13376, new Object[]{Long.valueOf(this.iBE), afN, Long.valueOf(j2), Long.valueOf(j3), Integer.valueOf(this.networkType), str2, str3, this.cvF, Integer.valueOf(i), str4, Integer.valueOf(this.fromScene), str5});
            this.fromScene = 0;
        }
        if (i == 1) {
            this.uxg = this.uxh;
            this.uxh = str;
            this.iBE = j;
        }
        AppMethodBeat.o(8075);
    }

    private int daz() {
        AppMethodBeat.i(8088);
        float f = this.mController.ylL.getSharedPreferences(ah.doA(), 0).getFloat("current_text_size_scale_key", 1.0f);
        if (f == 0.875f) {
            AppMethodBeat.o(8088);
            return 1;
        } else if (f == 1.125f) {
            AppMethodBeat.o(8088);
            return 3;
        } else if (f == 1.25f || f == 1.375f || f == 1.625f) {
            AppMethodBeat.o(8088);
            return 4;
        } else {
            AppMethodBeat.o(8088);
            return 2;
        }
    }

    static /* synthetic */ void h(WebViewUI webViewUI) {
        AppMethodBeat.i(8114);
        View view = webViewUI.pzf.getView();
        view.scrollTo(view.getScrollX(), 0);
        aq.i cYb = webViewUI.ulI.cYb();
        cYb.une = new Object[]{webViewUI.cOG, Integer.valueOf(7)};
        cYb.b(webViewUI.icy);
        AppMethodBeat.o(8114);
    }

    static /* synthetic */ boolean m(WebViewUI webViewUI) {
        AppMethodBeat.i(8121);
        if (webViewUI.uvi == null || !webViewUI.uvi.isShown()) {
            AppMethodBeat.o(8121);
            return false;
        }
        AppMethodBeat.o(8121);
        return true;
    }
}
