WeChat.apk(点击下载) / y.java


package com.tencent.mm.plugin.webview.core;

import android.app.Dialog;
import android.app.Service;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Bitmap;
import android.graphics.Point;
import android.net.Uri;
import android.net.http.SslError;
import android.os.Bundle;
import android.os.Looper;
import android.os.MessageQueue;
import android.os.Parcelable;
import android.os.RemoteException;
import android.text.TextUtils;
import android.util.SparseBooleanArray;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewStub;
import android.widget.FrameLayout;
import android.widget.ScrollView;
import android.widget.TextView;
import aq3.d;
import b10.t;
import bw3.mq3;
import bw3.nq3;
import bw3.p40;
import bw3.y62;
import bw3.z62;
import com.tencent.mm.R;
import com.tencent.mm.modelsns.SnsAdClick;
import com.tencent.mm.opensdk.channel.MMessageActV2;
import com.tencent.mm.opensdk.modelbiz.OpenWebview;
import com.tencent.mm.plugin.mmsight.segment.FFmpegMetadataRetriever;
import com.tencent.mm.plugin.webview.core.b0;
import com.tencent.mm.plugin.webview.core.v;
import com.tencent.mm.plugin.webview.model.a2;
import com.tencent.mm.plugin.webview.model.b2;
import com.tencent.mm.plugin.webview.model.i2;
import com.tencent.mm.plugin.webview.model.l2;
import com.tencent.mm.plugin.webview.model.o0;
import com.tencent.mm.plugin.webview.model.p0;
import com.tencent.mm.plugin.webview.model.q0;
import com.tencent.mm.plugin.webview.model.u1;
import com.tencent.mm.plugin.webview.stub.WebViewStubService;
import com.tencent.mm.plugin.webview.ui.tools.WebViewUI;
import com.tencent.mm.plugin.webview.ui.tools.WebViewUIStyleHelper;
import com.tencent.mm.plugin.webview.ui.tools.g1;
import com.tencent.mm.plugin.webview.ui.tools.p1;
import com.tencent.mm.plugin.webview.ui.tools.r1;
import com.tencent.mm.plugin.webview.ui.tools.widget.m0;
import com.tencent.mm.pluginsdk.model.app.j0;
import com.tencent.mm.pluginsdk.ui.tools.c2;
import com.tencent.mm.protocal.GeneralControlWrapper;
import com.tencent.mm.protocal.JsapiPermissionWrapper;
import com.tencent.mm.sdk.crash.CrashReportFactory;
import com.tencent.mm.sdk.http.HttpWrapperBase;
import com.tencent.mm.sdk.platformtools.Log;
import com.tencent.mm.sdk.platformtools.MMApplicationContext;
import com.tencent.mm.sdk.platformtools.MMHandler;
import com.tencent.mm.sdk.platformtools.NetStatusUtil;
import com.tencent.mm.sdk.platformtools.QueueWorkerThread;
import com.tencent.mm.sdk.platformtools.Util;
import com.tencent.mm.sdk.platformtools.WeChatHosts;
import com.tencent.mm.ui.tools.c1;
import com.tencent.mm.ui.w;
import com.tencent.mm.ui.widget.MMWebView;
import com.tencent.mm.vfs.q1;
import com.tencent.tav.coremedia.TimeUtil;
import com.tencent.thumbplayer.tplayer.plugins.report.TPReportKeys;
import com.tencent.tmassistantsdk.downloadservice.ApkDownloadManager;
import com.tencent.xweb.ProxyConfig;
import com.tencent.xweb.SslErrorHandler;
import com.tencent.xweb.WebResourceRequest;
import com.tencent.xweb.WebResourceResponse;
import com.tencent.xweb.WebView;
import com.tencent.xweb.XWebSdk;
import hd.c;
import ie1.h;
import java.io.UnsupportedEncodingException;
import java.lang.ref.WeakReference;
import java.net.InetAddress;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLDecoder;
import java.net.URLEncoder;
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.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import junit.framework.Assert;
import kp3.h1;
import org.json.JSONArray;
import org.json.JSONObject;
import p64.i0;
import xg4.r0;
import xg4.t0;
import yf0.c;

public class y extends BaseWebViewController {
    public final f A1;
    public final b B1;
    public final l C1;
    public final c D1;
    public long E1;
    public final e F1;
    public final g G1;
    public final l2 N0;
    public final wg4.g O0;
    public final wg4.g P0;
    public g1 Q0;
    public WebViewUIStyleHelper R0;
    public uq3.f S0;
    public final com.tencent.mm.plugin.webview.ui.tools.floatball.c T0;
    public zo3.s U0;
    public cq3.a V0;
    public final wg4.g W0;
    public final wg4.g X0;
    public final wg4.g Y0;
    public final wg4.g Z0;

    /* renamed from: a1  reason: collision with root package name */
    public final u1 f164642a1;

    /* renamed from: b1  reason: collision with root package name */
    public final wg4.g f164643b1;

    /* renamed from: c1  reason: collision with root package name */
    public boolean f164644c1;

    /* renamed from: d1  reason: collision with root package name */
    public final wg4.g f164645d1;

    /* renamed from: e1  reason: collision with root package name */
    public String f164646e1;

    /* renamed from: f1  reason: collision with root package name */
    public final wg4.g f164647f1;

    /* renamed from: g1  reason: collision with root package name */
    public boolean f164648g1;

    /* renamed from: h1  reason: collision with root package name */
    public boolean f164649h1;

    /* renamed from: i1  reason: collision with root package name */
    public final String f164650i1;

    /* renamed from: j1  reason: collision with root package name */
    public final Set<String> f164651j1;

    /* renamed from: k1  reason: collision with root package name */
    public final wg4.g f164652k1;

    /* renamed from: l1  reason: collision with root package name */
    public final o0.c f164653l1;

    /* renamed from: m1  reason: collision with root package name */
    public r f164654m1;

    /* renamed from: n1  reason: collision with root package name */
    public long f164655n1;

    /* renamed from: o1  reason: collision with root package name */
    public final List<op3.a> f164656o1;

    /* renamed from: p1  reason: collision with root package name */
    public final C1702y f164657p1;

    /* renamed from: q1  reason: collision with root package name */
    public final i f164658q1;

    /* renamed from: r1  reason: collision with root package name */
    public final d f164659r1;

    /* renamed from: s1  reason: collision with root package name */
    public final j f164660s1;

    /* renamed from: t1  reason: collision with root package name */
    public final k f164661t1;

    /* renamed from: u1  reason: collision with root package name */
    public final a f164662u1;

    /* renamed from: v1  reason: collision with root package name */
    public String f164663v1;

    /* renamed from: w1  reason: collision with root package name */
    public final boolean f164664w1;

    /* renamed from: x1  reason: collision with root package name */
    public final o f164665x1;

    /* renamed from: y1  reason: collision with root package name */
    public final h f164666y1;

    /* renamed from: z1  reason: collision with root package name */
    public final n f164667z1;

    public static final class a implements op3.a {

        /* renamed from: a  reason: collision with root package name */
        public final /* synthetic */ y f164668a;

        public a(y yVar) {
            this.f164668a = yVar;
        }

        @Override // op3.a
        public boolean c(String str) {
            boolean z15;
            lh4.m.g(str, "url");
            if ((this.f164668a.O.b().f173509d & 2) > 0) {
                z15 = true;
            } else {
                z15 = false;
            }
            if (!z15) {
                Log.e(this.f164668a.c1(), "ActivityJumpHandler not allow, no inner url generalcontrol, url = %s", str);
                return true;
            }
            try {
                this.f164668a.U().mT(str, this.f164668a.O.c().f(7));
            } catch (Exception e15) {
                Log.w(this.f164668a.c1(), "ActivityJumpHandler, ex = " + e15.getMessage());
            }
            return true;
        }

        @Override // op3.a
        public boolean e(String str) {
            lh4.m.g(str, "url");
            if (Util.isNullOrNil(str)) {
                return false;
            }
            QueueWorkerThread queueWorkerThread = c2.f173194a;
            return bd.n.c(str, "weixin://jump/");
        }
    }

    public static final class a0 implements Runnable {

        /* renamed from: d  reason: collision with root package name */
        public final /* synthetic */ String f164669d;

        /* renamed from: e  reason: collision with root package name */
        public final /* synthetic */ int f164670e;

        /* renamed from: f  reason: collision with root package name */
        public final /* synthetic */ String f164671f;

        /* renamed from: g  reason: collision with root package name */
        public final /* synthetic */ y f164672g;

        public a0(String str, int i15, String str2, y yVar) {
            this.f164669d = str;
            this.f164670e = i15;
            this.f164671f = str2;
            this.f164672g = yVar;
        }

        public final void run() {
            String str;
            String str2;
            com.tencent.mm.plugin.report.service.q qVar = com.tencent.mm.plugin.report.service.q.INSTANCE;
            Object[] objArr = new Object[4];
            objArr[0] = this.f164669d;
            objArr[1] = Integer.valueOf(this.f164670e);
            Context context = MMApplicationContext.getContext();
            lh4.m.f(context, "getContext()");
            if (NetStatusUtil.isWifi(context)) {
                str = "wifi";
            } else if (NetStatusUtil.is5G(context)) {
                str = "5g";
            } else if (NetStatusUtil.is4G(context)) {
                str = "4g";
            } else if (NetStatusUtil.is3G(context)) {
                str = "3g";
            } else if (NetStatusUtil.is2G(context)) {
                str = "2g";
            } else {
                str = "none";
            }
            objArr[2] = str;
            y yVar = this.f164672g;
            String str3 = this.f164671f;
            StringBuilder sb5 = new StringBuilder();
            try {
                InetAddress[] allByName = InetAddress.getAllByName(str3);
                if (allByName != null && allByName.length > 0) {
                    for (InetAddress inetAddress : allByName) {
                        sb5.append(inetAddress.getHostAddress());
                        sb5.append(";");
                    }
                }
                str2 = sb5.toString();
            } catch (UnknownHostException e15) {
                Log.printErrStackTrace(yVar.c1(), e15, "dnsIps", new Object[0]);
                str2 = null;
            }
            objArr[3] = str2;
            qVar.g(17082, objArr);
        }
    }

    public static final class b implements op3.a {

        /* renamed from: a  reason: collision with root package name */
        public final /* synthetic */ y f164673a;

        public b(y yVar) {
            this.f164673a = yVar;
        }

        @Override // op3.a
        public boolean c(String str) {
            lh4.m.g(str, "url");
            if (!this.f164673a.O.c().f(5)) {
                Log.e(this.f164673a.c1(), "AddFriendHandler, permission fail");
                return true;
            }
            String substring = str.substring(19);
            lh4.m.f(substring, "this as java.lang.String).substring(startIndex)");
            if (Util.isNullOrNil(substring)) {
                return false;
            }
            Bundle bundle = new Bundle();
            bundle.putBoolean("from_webview", true);
            bundle.putString("userName", substring);
            try {
                this.f164673a.U().KM(8, bundle, this.f164673a.g());
            } catch (Exception e15) {
                String c15 = this.f164673a.c1();
                Log.w(c15, "AddFriendHandler, ex = " + e15.getMessage());
            }
            return true;
        }

        @Override // op3.a
        public boolean e(String str) {
            lh4.m.g(str, "url");
            if (Util.isNullOrNil(str)) {
                return false;
            }
            QueueWorkerThread queueWorkerThread = c2.f173194a;
            return bd.n.c(str, "weixin://addfriend/");
        }
    }

    public static final class b0 implements Runnable {

        /* renamed from: d  reason: collision with root package name */
        public final /* synthetic */ y f164674d;

        /* renamed from: e  reason: collision with root package name */
        public final /* synthetic */ int f164675e;

        public b0(y yVar, int i15) {
            this.f164674d = yVar;
            this.f164675e = i15;
        }

        public final void run() {
            kp3.l N = this.f164674d.N();
            int i15 = this.f164675e;
            if (!N.f247890h) {
                Log.e("MicroMsg.JsApiHandler", "onFontSizeChanged fail, not ready");
            } else {
                HashMap hashMap = new HashMap();
                hashMap.put("fontSize", String.valueOf(i15));
                String c15 = h1.a.c("menu:setfont", hashMap, N.f247898p, N.f247899q);
                MMWebView mMWebView = N.f247883a;
                mMWebView.evaluateJavascript("javascript:WeixinJSBridge._handleMessageFromWeixin(" + c15 + ")", null);
            }
            y yVar = this.f164674d;
            int i16 = this.f164675e;
            Iterator<z> it = yVar.W.iterator();
            while (it.hasNext()) {
                it.next().g(i16);
            }
        }
    }

    public static final class c implements op3.a {

        /* renamed from: a  reason: collision with root package name */
        public final /* synthetic */ y f164676a;

        public c(y yVar) {
            this.f164676a = yVar;
        }

        @Override // op3.a
        public boolean c(String str) {
            lh4.m.g(str, "url");
            if (!this.f164676a.O.c().f(17)) {
                Log.e(this.f164676a.c1(), "close window permission fail");
                return true;
            }
            this.f164676a.o0();
            return true;
        }

        @Override // op3.a
        public boolean e(String str) {
            lh4.m.g(str, "url");
            if (Util.isNullOrNil(str)) {
                return false;
            }
            QueueWorkerThread queueWorkerThread = c2.f173194a;
            return bd.n.c(str, "weixin://webview/close/");
        }
    }

    public static final class c0 extends lh4.o implements kh4.a<com.tencent.mm.plugin.webview.modeltools.c0> {

        /* renamed from: d  reason: collision with root package name */
        public static final c0 f164677d = new c0();

        public c0() {
            super(0);
        }

        /* Return type fixed from 'java.lang.Object' to match base method */
        @Override // kh4.a
        public com.tencent.mm.plugin.webview.modeltools.c0 invoke() {
            return new com.tencent.mm.plugin.webview.modeltools.c0();
        }
    }

    public static final class d implements op3.a {

        /* renamed from: a  reason: collision with root package name */
        public final /* synthetic */ y f164678a;

        public d(y yVar) {
            this.f164678a = yVar;
        }

        @Override // op3.a
        public boolean c(String str) {
            lh4.m.g(str, "url");
            com.tencent.mm.plugin.report.service.q.INSTANCE.idkeyStat(405, 25, 1, true);
            y.R0(this.f164678a, 1);
            return true;
        }

        @Override // op3.a
        public boolean e(String str) {
            lh4.m.g(str, "url");
            if (Util.isNullOrNil(str)) {
                return false;
            }
            QueueWorkerThread queueWorkerThread = c2.f173194a;
            return bd.n.c(str, "weixin://critical_update/");
        }
    }

    public static final class d0 extends lh4.o implements kh4.a<m> {

        /* renamed from: d  reason: collision with root package name */
        public final /* synthetic */ y f164679d;

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public d0(y yVar) {
            super(0);
            this.f164679d = yVar;
        }

        /* Return type fixed from 'java.lang.Object' to match base method */
        @Override // kh4.a
        public m invoke() {
            return new m(new WeakReference(this.f164679d));
        }
    }

    public static final class e implements op3.a {

        /* renamed from: a  reason: collision with root package name */
        public final /* synthetic */ y f164680a;

        /* renamed from: b  reason: collision with root package name */
        public final /* synthetic */ MMWebView f164681b;

        public e(y yVar, MMWebView mMWebView) {
            this.f164680a = yVar;
            this.f164681b = mMWebView;
        }

        @Override // op3.a
        public boolean c(String str) {
            lh4.m.g(str, "urlOrig");
            y yVar = this.f164680a;
            String stringExtra = yVar.L().getStringExtra("sentUsername");
            String str2 = "";
            if (stringExtra == null) {
                stringExtra = str2;
            }
            int R = yVar.R(Util.nullAsNil(stringExtra));
            String s15 = cu3.m.s(str);
            if (!cu3.m.o(s15, this.f164680a.E1)) {
                return false;
            }
            try {
                if (lh4.m.b("weixin://dl/shopping", s15)) {
                    String ec5 = this.f164680a.U().ec();
                    lh4.m.f(ec5, "invoker.getJDUrl()");
                    if (!Util.isNullOrNil(ec5)) {
                        t.a.a(this.f164680a, ec5, null, false, 6, null);
                    }
                } else if (lh4.m.b("weixin://dl/faq", s15)) {
                    int QV = this.f164680a.U().QV();
                    int cE = this.f164680a.U().cE();
                    String string = MMApplicationContext.getContext().getString(R.string.iz_, Integer.valueOf(QV), Integer.valueOf(cE));
                    lh4.m.f(string, "getContext().getString(c…otice_url, uin, newCount)");
                    t.a.a(this.f164680a, string, null, false, 6, null);
                } else if (lh4.m.b("weixin://dl/posts", s15)) {
                    this.f164680a.U().NP();
                } else if (lh4.m.b("weixin://dl/moments", s15)) {
                    this.f164680a.U().sb();
                } else {
                    lh4.m.f(s15, "url");
                    if (ek4.y.v(s15, "weixin://dl/feedback", false)) {
                        lh4.m.f(this.f164680a.U().Pc0(s15), "invoker.getFeedbackUrl(url)");
                    } else if (lh4.m.b("weixin://dl/scan", s15)) {
                        sv3.b.k(this.f164680a.H(), "scanner", ".ui.BaseScanUI", new Intent(), false);
                    } else {
                        cu3.m.l(this.f164681b.getActivityContextIfHas(), s15);
                    }
                }
                ArrayList arrayList = new ArrayList();
                lh4.m.f(s15, "url");
                arrayList.add(s15);
                arrayList.add("1");
                arrayList.add(String.valueOf(R));
                String stringExtra2 = this.f164680a.L().getStringExtra("sentUsername");
                if (stringExtra2 != null) {
                    str2 = stringExtra2;
                }
                String nullAsNil = Util.nullAsNil(str2);
                lh4.m.f(nullAsNil, "nullAsNil(sentUsername)");
                arrayList.add(nullAsNil);
                String nullAsNil2 = Util.nullAsNil(this.f164680a.y3());
                lh4.m.f(nullAsNil2, "nullAsNil(rawUrl)");
                arrayList.add(nullAsNil2);
                com.tencent.mm.plugin.report.service.q.INSTANCE.j(11405, arrayList);
                return true;
            } catch (Exception e15) {
                Log.e(this.f164680a.c1(), "kv report fail, ex = %s", e15.getMessage());
                return true;
            }
        }

        @Override // op3.a
        public boolean e(String str) {
            lh4.m.g(str, "url");
            if (Util.isNullOrNil(str)) {
                return false;
            }
            QueueWorkerThread queueWorkerThread = c2.f173194a;
            return bd.n.c(str, "weixin://");
        }
    }

    public static final class e0 extends lh4.o implements kh4.a<com.tencent.mm.plugin.webview.ui.tools.g> {

        /* renamed from: d  reason: collision with root package name */
        public final /* synthetic */ MMWebView f164682d;

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public e0(MMWebView mMWebView) {
            super(0);
            this.f164682d = mMWebView;
        }

        /* Return type fixed from 'java.lang.Object' to match base method */
        @Override // kh4.a
        public com.tencent.mm.plugin.webview.ui.tools.g invoke() {
            return new com.tencent.mm.plugin.webview.ui.tools.g(this.f164682d.getActivityContextIfHas(), this.f164682d);
        }
    }

    public static final class f implements op3.a {

        /* renamed from: a  reason: collision with root package name */
        public final /* synthetic */ y f164683a;

        public f(y yVar) {
            this.f164683a = yVar;
        }

        @Override // op3.a
        public boolean c(String str) {
            lh4.m.g(str, "url");
            Bundle bundle = new Bundle();
            bundle.putInt("MMActivity.OverrideEnterAnimation", 0);
            bundle.putInt("MMActivity.OverrideExitAnimation", R.anim.f357341dd);
            try {
                this.f164683a.U().KM(7, bundle, this.f164683a.g());
                return true;
            } catch (Exception e15) {
                String c15 = this.f164683a.c1();
                Log.w(c15, "FeedbackJumpHandler, ex = " + e15.getMessage());
                return true;
            }
        }

        @Override // op3.a
        public boolean e(String str) {
            lh4.m.g(str, "url");
            if (Util.isNullOrNil(str)) {
                return false;
            }
            QueueWorkerThread queueWorkerThread = c2.f173194a;
            return bd.n.c(str, "weixin://feedback/");
        }
    }

    public static final class f0 extends lh4.o implements kh4.a<Class<WebViewStubService>> {

        /* renamed from: d  reason: collision with root package name */
        public static final f0 f164684d = new f0();

        public f0() {
            super(0);
        }

        /* Return type fixed from 'java.lang.Object' to match base method */
        @Override // kh4.a
        public Class<WebViewStubService> invoke() {
            return WebViewStubService.class;
        }
    }

    public static final class g implements op3.a {

        /* renamed from: a  reason: collision with root package name */
        public final /* synthetic */ y f164685a;

        public g(y yVar) {
            this.f164685a = yVar;
        }

        @Override // op3.a
        public boolean c(String str) {
            lh4.m.g(str, "url");
            Log.w(this.f164685a.c1(), "freewifi had Deprecated");
            return true;
        }

        @Override // op3.a
        public boolean e(String str) {
            lh4.m.g(str, "url");
            if (Util.isNullOrNil(str)) {
                return false;
            }
            QueueWorkerThread queueWorkerThread = c2.f173194a;
            return bd.n.c(str, "weixin://connectToFreeWifi/");
        }
    }

    public static final class g0 extends lh4.o implements kh4.a<p> {

        /* renamed from: d  reason: collision with root package name */
        public final /* synthetic */ y f164686d;

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public g0(y yVar) {
            super(0);
            this.f164686d = yVar;
        }

        /* Return type fixed from 'java.lang.Object' to match base method */
        @Override // kh4.a
        public p invoke() {
            y yVar = this.f164686d;
            return new p(yVar, yVar);
        }
    }

    public static final class h implements op3.a {

        /* renamed from: a  reason: collision with root package name */
        public final /* synthetic */ y f164687a;

        public h(y yVar) {
            this.f164687a = yVar;
        }

        @Override // op3.a
        public boolean c(String str) {
            lh4.m.g(str, "url");
            if (Util.isNullOrNil(str)) {
                return false;
            }
            String substring = str.substring(17);
            lh4.m.f(substring, "this as java.lang.String).substring(startIndex)");
            String c15 = this.f164687a.c1();
            Log.i(c15, "[oneliang]get html content :" + substring);
            y yVar = this.f164687a;
            yVar.getClass();
            Iterator<z> it = yVar.W.iterator();
            while (it.hasNext()) {
                it.next().o(substring);
            }
            return false;
        }

        @Override // op3.a
        public boolean e(String str) {
            lh4.m.g(str, "url");
            if (Util.isNullOrNil(str)) {
                return false;
            }
            QueueWorkerThread queueWorkerThread = c2.f173194a;
            return bd.n.c(str, "weixin://gethtml/");
        }
    }

    public static final class i implements op3.a {

        /* renamed from: a  reason: collision with root package name */
        public final /* synthetic */ y f164688a;

        public i(y yVar) {
            this.f164688a = yVar;
        }

        @Override // op3.a
        public boolean c(String str) {
            lh4.m.g(str, "url");
            String substring = str.substring(17);
            lh4.m.f(substring, "this as java.lang.String).substring(startIndex)");
            if (substring.length() == 0) {
                Log.e(this.f164688a.c1(), "handleUrl fail, username is null");
                return true;
            }
            if (this.f164688a.O.c().f(2)) {
                kp3.l N = this.f164688a.N();
                if (!N.f247890h) {
                    Log.e("MicroMsg.JsApiHandler", "onGoProfile fail, not ready");
                } else {
                    MMHandler mMHandler = N.f247888f;
                    if (mMHandler != null) {
                        mMHandler.post(new kp3.v(N, substring));
                    }
                }
            }
            return true;
        }

        @Override // op3.a
        public boolean e(String str) {
            lh4.m.g(str, "url");
            if (Util.isNullOrNil(str)) {
                return false;
            }
            QueueWorkerThread queueWorkerThread = c2.f173194a;
            return bd.n.c(str, "weixin://profile/");
        }
    }

    public static final class j implements op3.a {

        /* renamed from: a  reason: collision with root package name */
        public final /* synthetic */ y f164689a;

        public j(y yVar) {
            this.f164689a = yVar;
        }

        @Override // op3.a
        public boolean c(String str) {
            lh4.m.g(str, "url");
            com.tencent.mm.plugin.report.service.q.INSTANCE.idkeyStat(405, 26, 1, true);
            y.R0(this.f164689a, 3);
            return true;
        }

        @Override // op3.a
        public boolean e(String str) {
            lh4.m.g(str, "url");
            if (Util.isNullOrNil(str)) {
                return false;
            }
            QueueWorkerThread queueWorkerThread = c2.f173194a;
            return bd.n.c(str, "weixin://manual_update/");
        }
    }

    public static final class k implements op3.a {

        /* renamed from: a  reason: collision with root package name */
        public final /* synthetic */ y f164690a;

        public k(y yVar) {
            this.f164690a = yVar;
        }

        @Override // op3.a
        public boolean c(String str) {
            lh4.m.g(str, "url");
            com.tencent.mm.plugin.report.service.q.INSTANCE.idkeyStat(405, 24, 1, true);
            y.R0(this.f164690a, 2);
            return true;
        }

        @Override // op3.a
        public boolean e(String str) {
            lh4.m.g(str, "url");
            if (Util.isNullOrNil(str)) {
                return false;
            }
            QueueWorkerThread queueWorkerThread = c2.f173194a;
            return bd.n.c(str, "weixin://recommend_update/");
        }
    }

    public static final class l implements op3.a {

        /* renamed from: a  reason: collision with root package name */
        public final /* synthetic */ y f164691a;

        public l(y yVar) {
            this.f164691a = yVar;
        }

        @Override // op3.a
        public boolean c(String str) {
            lh4.m.g(str, "url");
            OpenWebview.Resp resp = new OpenWebview.Resp();
            Uri parse = Uri.parse(str);
            resp.result = parse.getQuery();
            resp.errCode = Util.getInt(parse.getQueryParameter("errCode"), 0);
            resp.errStr = parse.getQueryParameter("errMsg");
            resp.transaction = this.f164691a.L().getStringExtra("transaction_for_openapi_openwebview");
            String queryParameter = parse.getQueryParameter("appid");
            if (Util.isNullOrNil(queryParameter)) {
                Log.e(this.f164691a.c1(), "SDKOpenWebViewResultHandler handleUrl, appId is null");
                return true;
            }
            Bundle bundle = new Bundle();
            resp.toBundle(bundle);
            j0.g(bundle);
            MMessageActV2.Args args = new MMessageActV2.Args();
            try {
                args.targetPkgName = this.f164691a.U().Cb(queryParameter);
                args.bundle = bundle;
                args.flags = 268435456;
                this.f164691a.c1();
                MMessageActV2.send(this.f164691a.H(), args);
                this.f164691a.o0();
                return true;
            } catch (Exception e15) {
                Log.printErrStackTrace(this.f164691a.c1(), e15, "", new Object[0]);
                return true;
            }
        }

        @Override // op3.a
        public boolean e(String str) {
            lh4.m.g(str, "url");
            if (Util.isNullOrNil(str)) {
                return false;
            }
            QueueWorkerThread queueWorkerThread = c2.f173194a;
            return bd.n.c(str, "weixin://openapi/openwebview/result?");
        }
    }

    public static final class m extends m0 {

        /* renamed from: e  reason: collision with root package name */
        public final WeakReference<y> f164692e;

        /* renamed from: f  reason: collision with root package name */
        public final wg4.g f164693f = wg4.h.a(new a(this));

        /* renamed from: g  reason: collision with root package name */
        public final String f164694g = ("MicroMsg.WebViewController.SceneEndCallbacker:" + e());

        public static final class a extends lh4.o implements kh4.a<Integer> {

            /* renamed from: d  reason: collision with root package name */
            public final /* synthetic */ m f164695d;

            /* JADX INFO: super call moved to the top of the method (can break code semantics) */
            public a(m mVar) {
                super(0);
                this.f164695d = mVar;
            }

            /* Return type fixed from 'java.lang.Object' to match base method */
            @Override // kh4.a
            public Integer invoke() {
                return Integer.valueOf(this.f164695d.hashCode());
            }
        }

        public m(WeakReference<y> weakReference) {
            lh4.m.g(weakReference, "controller");
            this.f164692e = weakReference;
        }

        public final int e() {
            return ((Number) this.f164693f.getValue()).intValue();
        }

        @Override // com.tencent.mm.plugin.webview.stub.m, com.tencent.mm.plugin.webview.ui.tools.widget.m0
        public boolean hg0(com.tencent.mm.plugin.webview.stub.d dVar) {
            String str = this.f164694g;
            Log.i(str, "onSceneEnd, instance hashcode = " + hashCode());
            if (dVar != null) {
                int i15 = dVar.getData().getInt("scene_end_listener_hash_code");
                Log.i(this.f164694g, "get hash code = %d, self hash code = %d", Integer.valueOf(i15), Integer.valueOf(e()));
                String str2 = this.f164694g;
                Log.i(str2, "edw onSceneEnd, type = " + dVar.getType() + ", errCode = " + dVar.getErrCode() + ", errType = " + dVar.uh0());
                if (i15 != e()) {
                    Log.e(this.f164694g, "hash code not equal");
                    return false;
                }
                y yVar = this.f164692e.get();
                if (yVar != null) {
                    int type = dVar.getType();
                    if (type == 106) {
                        y.S0(yVar, 106);
                        yVar.o0();
                    } else if (type == 666) {
                        y.S0(yVar, eo0.f.CTRL_INDEX);
                        yVar.o0();
                    }
                }
            }
            return true;
        }
    }

    public static final class n implements op3.a {

        /* renamed from: a  reason: collision with root package name */
        public final /* synthetic */ y f164696a;

        public n(y yVar) {
            this.f164696a = yVar;
        }

        @Override // op3.a
        public boolean c(String str) {
            lh4.m.g(str, "url");
            String substring = str.substring(25);
            lh4.m.f(substring, "this as java.lang.String).substring(startIndex)");
            try {
                String decode = URLDecoder.decode(substring);
                Bundle bundle = new Bundle();
                bundle.putString("nowUrl", this.f164696a.f164663v1);
                bundle.putString("tweetid", Util.nullAsNil(this.f164696a.L().getStringExtra("tweetid")));
                bundle.putString("htmlData", decode);
                bundle.putInt("type", this.f164696a.L().getIntExtra("type", 0));
                this.f164696a.U().KM(3, bundle, this.f164696a.g());
                return true;
            } catch (Exception e15) {
                String c15 = this.f164696a.c1();
                Log.e(c15, "edw ViewImageGetHtmlHandler handleUrl, ex = " + e15.getMessage());
                return false;
            }
        }

        @Override // op3.a
        public boolean e(String str) {
            lh4.m.g(str, "url");
            if (Util.isNullOrNil(str)) {
                return false;
            }
            QueueWorkerThread queueWorkerThread = c2.f173194a;
            return bd.n.c(str, "weixin://private/gethtml/");
        }
    }

    public static final class o implements op3.a {

        /* renamed from: a  reason: collision with root package name */
        public final /* synthetic */ y f164697a;

        /* renamed from: b  reason: collision with root package name */
        public final /* synthetic */ MMWebView f164698b;

        public o(y yVar, MMWebView mMWebView) {
            this.f164697a = yVar;
            this.f164698b = mMWebView;
        }

        @Override // op3.a
        public boolean c(String str) {
            lh4.m.g(str, "url");
            try {
                if (!this.f164697a.U().isSDCardAvailable()) {
                    this.f164697a.U().KM(2, null, this.f164697a.g());
                    return true;
                }
                y yVar = this.f164697a;
                String substring = str.substring(19);
                lh4.m.f(substring, "this as java.lang.String).substring(startIndex)");
                yVar.f164663v1 = substring;
                String c15 = this.f164697a.c1();
                Log.i(c15, "viewimage currentUrl :" + this.f164697a.f164663v1);
                MMWebView mMWebView = this.f164698b;
                this.f164697a.f164667z1.getClass();
                c2.f(mMWebView, "weixin://private/gethtml/", "'<head>' + document.getElementsByTagName('head')[0].innerHTML + '</head><body>' + document.getElementsByTagName('body')[0].innerHTML + '</body>'", this.f164697a.f164664w1);
                return true;
            } catch (Exception e15) {
                String c16 = this.f164697a.c1();
                Log.e(c16, "edw handleUrl, ex = " + e15.getMessage());
                return false;
            }
        }

        @Override // op3.a
        public boolean e(String str) {
            lh4.m.g(str, "url");
            if (Util.isNullOrNil(str)) {
                return false;
            }
            QueueWorkerThread queueWorkerThread = c2.f173194a;
            return bd.n.c(str, "weixin://viewimage/");
        }
    }

    public final class p {

        /* renamed from: a  reason: collision with root package name */
        public final y f164699a;

        /* renamed from: b  reason: collision with root package name */
        public String f164700b;

        /* renamed from: c  reason: collision with root package name */
        public int f164701c;

        /* renamed from: d  reason: collision with root package name */
        public volatile String f164702d = "";

        /* renamed from: e  reason: collision with root package name */
        public volatile String f164703e = "";

        /* renamed from: f  reason: collision with root package name */
        public long f164704f;

        /* renamed from: g  reason: collision with root package name */
        public int f164705g;

        /* renamed from: h  reason: collision with root package name */
        public final /* synthetic */ y f164706h;

        public static final class a implements MessageQueue.IdleHandler {

            /* renamed from: d  reason: collision with root package name */
            public final /* synthetic */ p f164707d;

            /* renamed from: e  reason: collision with root package name */
            public final /* synthetic */ String f164708e;

            /* renamed from: f  reason: collision with root package name */
            public final /* synthetic */ long f164709f;

            /* renamed from: g  reason: collision with root package name */
            public final /* synthetic */ int f164710g;

            public a(p pVar, String str, long j15, int i15) {
                this.f164707d = pVar;
                this.f164708e = str;
                this.f164709f = j15;
                this.f164710g = i15;
            }

            public boolean queueIdle() {
                Looper.myQueue().removeIdleHandler(this);
                this.f164707d.a(this.f164708e, this.f164709f, this.f164710g);
                return false;
            }
        }

        public p(y yVar, y yVar2) {
            lh4.m.g(yVar2, "controller");
            this.f164706h = yVar;
            this.f164699a = yVar2;
            String userAgentString = yVar2.f164462a.getSettings().getUserAgentString();
            lh4.m.f(userAgentString, "controller.viewWV.settings.userAgentString");
            this.f164700b = userAgentString;
            this.f164701c = yVar2.L().getIntExtra("from_scence", 0);
        }

        /* JADX WARNING: Removed duplicated region for block: B:56:0x014b  */
        /* JADX WARNING: Removed duplicated region for block: B:58:? A[RETURN, SYNTHETIC] */
        public final void a(String str, long j15, int i15) {
            boolean z15;
            String str2;
            String str3;
            String str4;
            UnsupportedEncodingException e15;
            int i16;
            String str5 = "";
            lh4.m.g(str, "targetUrl");
            Context context = MMApplicationContext.getContext();
            if (NetStatusUtil.isConnected(context)) {
                if (NetStatusUtil.isWifi(context)) {
                    i16 = 1;
                } else if (NetStatusUtil.is5G(context)) {
                    i16 = 5;
                } else if (NetStatusUtil.is4G(context)) {
                    i16 = 4;
                } else if (NetStatusUtil.is3G(context)) {
                    i16 = 3;
                } else if (NetStatusUtil.is2G(context)) {
                    i16 = 2;
                } else {
                    i16 = 0;
                }
                this.f164705g = i16;
                Log.i(this.f164706h.c1(), "get networkType " + this.f164705g);
            }
            String S = this.f164699a.S(this.f164703e);
            if (this.f164701c != 0) {
                this.f164702d = " ";
            }
            if ((this.f164699a.O.b().f173509d & 2048) > 0) {
                z15 = true;
            } else {
                z15 = false;
            }
            this.f164706h.c1();
            long j16 = this.f164704f;
            if (j16 > 0) {
                long j17 = this.f164706h.f164655n1;
                if (j17 > j16 && j15 > j17 && !TextUtils.isEmpty(S) && z15) {
                    y yVar = this.f164706h;
                    long j18 = yVar.f164655n1;
                    long j19 = j18 - this.f164704f;
                    long j25 = j15 - j18;
                    yVar.c1();
                    try {
                        str4 = ck.q.b(Util.nullAsNil(this.f164700b), "UTF-8");
                        try {
                            str2 = ck.q.b(Util.nullAsNil(this.f164703e), "UTF-8");
                            try {
                                str3 = ck.q.b(Util.nullAsNil(str), "UTF-8");
                                try {
                                    str5 = ck.q.b(Util.nullAsNil(this.f164702d), "UTF-8");
                                } catch (UnsupportedEncodingException e16) {
                                    e15 = e16;
                                }
                            } catch (UnsupportedEncodingException e17) {
                                e15 = e17;
                                str3 = str5;
                                Log.printErrStackTrace(this.f164706h.c1(), e15, str5, new Object[0]);
                                str4 = str4;
                                com.tencent.mm.plugin.report.service.q.INSTANCE.g(13376, Long.valueOf(this.f164704f), S, Long.valueOf(j19), Long.valueOf(j25), Integer.valueOf(this.f164705g), str4, str2, de2.e.f200031a, Integer.valueOf(i15), str3, Integer.valueOf(this.f164701c), str5);
                                this.f164701c = 0;
                                if (i15 != 1) {
                                }
                            }
                        } catch (UnsupportedEncodingException e18) {
                            e15 = e18;
                            str3 = str5;
                            str2 = str3;
                            Log.printErrStackTrace(this.f164706h.c1(), e15, str5, new Object[0]);
                            str4 = str4;
                            com.tencent.mm.plugin.report.service.q.INSTANCE.g(13376, Long.valueOf(this.f164704f), S, Long.valueOf(j19), Long.valueOf(j25), Integer.valueOf(this.f164705g), str4, str2, de2.e.f200031a, Integer.valueOf(i15), str3, Integer.valueOf(this.f164701c), str5);
                            this.f164701c = 0;
                            if (i15 != 1) {
                            }
                        }
                    } catch (UnsupportedEncodingException e19) {
                        e15 = e19;
                        str4 = str5;
                        str3 = str4;
                        str2 = str3;
                        Log.printErrStackTrace(this.f164706h.c1(), e15, str5, new Object[0]);
                        str4 = str4;
                        com.tencent.mm.plugin.report.service.q.INSTANCE.g(13376, Long.valueOf(this.f164704f), S, Long.valueOf(j19), Long.valueOf(j25), Integer.valueOf(this.f164705g), str4, str2, de2.e.f200031a, Integer.valueOf(i15), str3, Integer.valueOf(this.f164701c), str5);
                        this.f164701c = 0;
                        if (i15 != 1) {
                        }
                    }
                    com.tencent.mm.plugin.report.service.q.INSTANCE.g(13376, Long.valueOf(this.f164704f), S, Long.valueOf(j19), Long.valueOf(j25), Integer.valueOf(this.f164705g), str4, str2, de2.e.f200031a, Integer.valueOf(i15), str3, Integer.valueOf(this.f164701c), str5);
                    this.f164701c = 0;
                }
            }
            if (i15 != 1) {
                this.f164702d = this.f164703e;
                this.f164703e = str;
                this.f164704f = j15;
            }
        }

        public final void b(String str, long j15, int i15) {
            lh4.m.g(str, "targetUrl");
            Looper.myQueue().addIdleHandler(new a(this, str, j15, i15));
        }
    }

    public static final class q extends lh4.o implements kh4.a<String> {

        /* renamed from: d  reason: collision with root package name */
        public final /* synthetic */ y f164711d;

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public q(y yVar) {
            super(0);
            this.f164711d = yVar;
        }

        /* Return type fixed from 'java.lang.Object' to match base method */
        @Override // kh4.a
        public String invoke() {
            return "MicroMsg.WebViewController:" + this.f164711d.g();
        }
    }

    public static final class r implements o0.a {

        /* renamed from: a  reason: collision with root package name */
        public final WeakReference<y> f164712a;

        /* renamed from: b  reason: collision with root package name */
        public final Map<Integer, Integer> f164713b = new HashMap();

        public r(WeakReference<y> weakReference) {
            lh4.m.g(weakReference, "weakController");
            this.f164712a = weakReference;
        }

        @Override // com.tencent.mm.plugin.webview.model.o0.a
        public void remove(int i15) {
            y yVar = this.f164712a.get();
            if (yVar != null) {
                y.S0(yVar, i15);
            }
            if (((HashMap) this.f164713b).containsKey(Integer.valueOf(i15))) {
                Object obj = ((HashMap) this.f164713b).get(Integer.valueOf(i15));
                lh4.m.d(obj);
                int intValue = ((Number) obj).intValue();
                Integer valueOf = Integer.valueOf(i15);
                ((HashMap) this.f164713b).put(valueOf, Integer.valueOf(intValue - 1));
                return;
            }
            ((HashMap) this.f164713b).put(Integer.valueOf(i15), 0);
        }
    }

    public static final class s implements o0.c {

        /* renamed from: a  reason: collision with root package name */
        public final WeakReference<y> f164714a;

        /* renamed from: b  reason: collision with root package name */
        public i0 f164715b;

        public s(WeakReference<y> weakReference) {
            lh4.m.g(weakReference, "weakController");
            this.f164714a = weakReference;
        }

        @Override // com.tencent.mm.plugin.webview.model.o0.c
        public void a() {
            i0 i0Var = this.f164715b;
            if (i0Var != null && i0Var.isShowing()) {
                i0Var.dismiss();
            }
            if (i0Var != null) {
                i0Var.setCancelMessage(null);
            }
            if (i0Var != null) {
                i0Var.setDismissMessage(null);
            }
            this.f164715b = null;
        }

        @Override // com.tencent.mm.plugin.webview.model.o0.c
        public void b(String str, int i15) {
            lh4.m.g(str, "url");
            y yVar = this.f164714a.get();
            if (yVar != null) {
                boolean z15 = true;
                yVar.I0(str, true, i15);
                cq3.a aVar = yVar.V0;
                if (aVar == null || !((WebViewUI) aVar).F.f192404a) {
                    z15 = false;
                }
                if (z15 && aVar != null) {
                    WebViewUI webViewUI = (WebViewUI) aVar;
                    cq3.f fVar = webViewUI.F;
                    fVar.getClass();
                    if (!fVar.f192404a) {
                        Log.i("MicroMsg.WebViewSnapshotHelper", "exitSnapshotMode not in snap shot mode now");
                        return;
                    }
                    Log.i("MicroMsg.WebViewSnapshotHelper", "exitSnapshotMode");
                    fVar.f192404a = false;
                    webViewUI.getController().y0(0);
                    MMWebView mMWebView = webViewUI.f166462g;
                    if (mMWebView != null) {
                        mMWebView.setVisibility(0);
                    }
                    ViewGroup viewGroup = fVar.f192405b;
                    if (viewGroup != null) {
                        viewGroup.setVisibility(8);
                    }
                    fVar.b();
                }
            }
        }

        @Override // com.tencent.mm.plugin.webview.model.o0.c
        public void c(String str, String str2) {
            cq3.a aVar;
            String str3;
            lh4.m.g(str, "pageUrl");
            y yVar = this.f164714a.get();
            if (yVar != null && (aVar = yVar.V0) != null) {
                WebViewUI webViewUI = (WebViewUI) aVar;
                cq3.f fVar = webViewUI.F;
                fVar.getClass();
                if (fVar.f192404a) {
                    Log.i("MicroMsg.WebViewSnapshotHelper", "enterSnapshotMode already in snap shot mode now");
                    return;
                }
                l2.n(16);
                Log.i("MicroMsg.WebViewSnapshotHelper", "enterSnapshotMode pageUrl=" + str);
                fVar.f192415l = new WeakReference<>(webViewUI);
                if (fVar.f192405b == null) {
                    fVar.f192405b = (ViewGroup) ((ViewStub) webViewUI.findViewById(R.id.p25)).inflate();
                }
                if (fVar.f192405b != null) {
                    fVar.f192406c = webViewUI.findViewById(R.id.n1k);
                    fVar.f192407d = (FrameLayout) webViewUI.findViewById(R.id.n1j);
                    fVar.f192408e = (ScrollView) webViewUI.findViewById(R.id.n1e);
                    fVar.f192410g = webViewUI.findViewById(R.id.n1f);
                    fVar.f192411h = webViewUI.findViewById(R.id.n1i);
                    fVar.f192412i = (TextView) webViewUI.findViewById(R.id.n1h);
                    View findViewById = webViewUI.findViewById(R.id.n1g);
                    fVar.f192413j = findViewById;
                    if (findViewById != null) {
                        findViewById.setOnClickListener(cq3.c.f192401d);
                    }
                    c1.a(fVar.f192411h);
                    x11.a.f336405a.j(fVar.f192406c, (float) gy3.a.b(webViewUI, 8), false, true);
                    View view = fVar.f192411h;
                    if (view != null) {
                        view.setOnClickListener(new cq3.d(fVar));
                    }
                }
                fVar.f192404a = true;
                webViewUI.getController().y0(8);
                MMWebView mMWebView = webViewUI.f166462g;
                if (mMWebView != null) {
                    mMWebView.setVisibility(8);
                }
                if (Util.isNullOrNil(str2)) {
                    str3 = webViewUI.getString(R.string.l79);
                } else {
                    str3 = str2;
                }
                TextView textView = fVar.f192412i;
                if (textView != null) {
                    textView.setText(str3);
                }
                MMWebView b15 = MMWebView.b.b(webViewUI);
                lh4.m.f(b15, "snapshotWebView");
                fVar.f192409f = b15;
                b15.setBackgroundColor(0);
                MMWebView mMWebView2 = fVar.f192409f;
                if (mMWebView2 != null) {
                    mMWebView2.setWebViewCallbackClient(fVar.f192419p);
                }
                FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(-1, -1);
                FrameLayout frameLayout = fVar.f192407d;
                if (frameLayout != null) {
                    frameLayout.addView(fVar.f192409f, layoutParams);
                }
                View view2 = fVar.f192410g;
                if (view2 != null) {
                    view2.setOnClickListener(new cq3.b(fVar, webViewUI));
                }
                MMWebView mMWebView3 = fVar.f192409f;
                ScrollView scrollView = fVar.f192408e;
                lh4.m.d(scrollView);
                f0 f0Var = f0.f164574a;
                if (mMWebView3 != null) {
                    scrollView.getViewTreeObserver().addOnScrollChangedListener(new g0(scrollView, mMWebView3, mMWebView3.getScale()));
                }
                MMWebView mMWebView4 = fVar.f192409f;
                lh4.m.d(mMWebView4);
                y yVar2 = new y(mMWebView4, null, new t.b(null, false, false, false, false, 0, true, 63, null), xg4.g0.f338662d, null, 18, null);
                fVar.f192414k = yVar2;
                yVar2.init();
                Intent intent = new Intent();
                intent.putExtra("rawUrl", str);
                fVar.f192416m = true;
                xc4.t tVar = xc4.j.f338034d;
                cq3.e eVar = new cq3.e(fVar);
                xc4.j jVar = (xc4.j) tVar;
                jVar.getClass();
                jVar.w(eVar, 3000, false);
                y yVar3 = fVar.f192414k;
                if (yVar3 != null) {
                    yVar3.E3(fVar.f192417n);
                }
                y yVar4 = fVar.f192414k;
                if (yVar4 != null) {
                    yVar4.P3(intent);
                }
            }
        }

        @Override // com.tencent.mm.plugin.webview.model.o0.c
        public void d(DialogInterface.OnCancelListener onCancelListener) {
            lh4.m.g(onCancelListener, "cancelListener");
            y yVar = this.f164714a.get();
            if (yVar != null) {
                i0 i0Var = this.f164715b;
                if (i0Var != null && i0Var.isShowing()) {
                    i0Var.dismiss();
                }
                if (i0Var != null) {
                    i0Var.setCancelMessage(null);
                }
                if (i0Var != null) {
                    i0Var.setDismissMessage(null);
                }
                this.f164715b = i14.j.Q(yVar.f164462a.getActivityContextIfHas(), null, yVar.H().getString(R.string.hdm), true, true, onCancelListener);
            }
        }

        @Override // com.tencent.mm.plugin.webview.model.o0.c
        public boolean e() {
            boolean z15;
            y yVar = this.f164714a.get();
            if (yVar == null || yVar.V0 == null) {
                return false;
            }
            v.b bVar = v.f164638a;
            if (x.a().getInt("openSnapOauth", 1) == 1) {
                z15 = true;
            } else {
                z15 = false;
            }
            Log.i("WebViewCommand", "openSnapOauth = " + z15);
            if (z15) {
                return true;
            }
            return false;
        }

        @Override // com.tencent.mm.plugin.webview.model.o0.c
        public String getCurrentUrl() {
            boolean z15;
            y yVar = this.f164714a.get();
            if (yVar == null) {
                return "";
            }
            String currentUrl = yVar.getCurrentUrl();
            if (currentUrl == null || ek4.y.n(currentUrl)) {
                z15 = true;
            } else {
                z15 = false;
            }
            if (!z15) {
                return yVar.getCurrentUrl();
            }
            return yVar.y3();
        }

        @Override // com.tencent.mm.plugin.webview.model.o0.c
        public void goBack() {
            y yVar = this.f164714a.get();
            if (yVar != null) {
                Iterator<T> it = yVar.W.iterator();
                while (it.hasNext()) {
                    it.next().i();
                }
            }
        }
    }

    public static final class t implements Runnable {

        /* renamed from: d  reason: collision with root package name */
        public final /* synthetic */ y f164716d;

        /* renamed from: e  reason: collision with root package name */
        public final /* synthetic */ Uri f164717e;

        public t(y yVar, Uri uri) {
            this.f164716d = yVar;
            this.f164717e = uri;
        }

        public final void run() {
            ((ln.l) yz3.j.c(ln.l.class)).OM0(this.f164716d.f164462a.getActivityContextIfHas(), this.f164717e, null);
        }
    }

    public static final class u extends lh4.o implements kh4.a<HashSet<String>> {

        /* renamed from: d  reason: collision with root package name */
        public final /* synthetic */ y f164718d;

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public u(y yVar) {
            super(0);
            this.f164718d = yVar;
        }

        /* Return type fixed from 'java.lang.Object' to match base method */
        @Override // kh4.a
        public HashSet<String> invoke() {
            HashSet hashSet = new HashSet();
            y yVar = this.f164718d;
            hashSet.add("file:///android_asset/");
            String i15 = z80.b.i();
            hashSet.add("file://" + com.tencent.mm.plugin.websearch.p.g(0).h());
            hashSet.add("file://" + com.tencent.mm.plugin.websearch.p.b(3));
            hashSet.add("file://" + com.tencent.mm.plugin.websearch.p.g(4).m());
            hashSet.add("file://" + com.tencent.mm.plugin.websearch.p.g(8).m());
            hashSet.add("file://" + com.tencent.mm.plugin.websearch.p.g(11).m());
            q1 q1Var = new q1(i15, "emoji/res");
            hashSet.add("file://" + q1Var.o());
            q1 q1Var2 = new q1(z80.b.E(), "emoji/res");
            hashSet.add("file://" + q1Var2.o());
            Log.i(yVar.c1(), "add webview UI FILE URL WHITE LIST data: %s sdcard:%s", q1Var.o(), q1Var2.o());
            y yVar2 = this.f164718d;
            Iterator it = hashSet.iterator();
            while (it.hasNext()) {
                String c15 = yVar2.c1();
                Log.i(c15, "albie: WebViewUI white list path : " + ((String) it.next()));
            }
            return hashSet;
        }
    }

    public static final class v extends lh4.o implements kh4.a<Boolean> {

        /* renamed from: d  reason: collision with root package name */
        public final /* synthetic */ y f164719d;

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public v(y yVar) {
            super(0);
            this.f164719d = yVar;
        }

        /* Return type fixed from 'java.lang.Object' to match base method */
        @Override // kh4.a
        public Boolean invoke() {
            return Boolean.valueOf(this.f164719d.L().getBooleanExtra("finishviewifloadfailed", false));
        }
    }

    public static final class w extends lh4.o implements kh4.a<Boolean> {

        /* renamed from: d  reason: collision with root package name */
        public final /* synthetic */ y f164720d;

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public w(y yVar) {
            super(0);
            this.f164720d = yVar;
        }

        /* Return type fixed from 'java.lang.Object' to match base method */
        @Override // kh4.a
        public Boolean invoke() {
            return Boolean.valueOf(this.f164720d.L().getBooleanExtra("KFromLoginHistory", false));
        }
    }

    public static final class x extends lh4.o implements kh4.a<Boolean> {

        /* renamed from: d  reason: collision with root package name */
        public final /* synthetic */ y f164721d;

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public x(y yVar) {
            super(0);
            this.f164721d = yVar;
        }

        /* Return type fixed from 'java.lang.Object' to match base method */
        @Override // kh4.a
        public Boolean invoke() {
            return Boolean.valueOf(this.f164721d.L().getBooleanExtra("neverBlockLocalRequest", false));
        }
    }

    /* renamed from: com.tencent.mm.plugin.webview.core.y$y  reason: collision with other inner class name */
    public static final class C1702y implements op3.a {

        /* renamed from: a  reason: collision with root package name */
        public boolean f164722a;

        /* renamed from: b  reason: collision with root package name */
        public String f164723b = "";

        /* renamed from: c  reason: collision with root package name */
        public Point f164724c;

        /* renamed from: d  reason: collision with root package name */
        public long f164725d;

        /* renamed from: e  reason: collision with root package name */
        public final /* synthetic */ t.b f164726e;

        /* renamed from: f  reason: collision with root package name */
        public final /* synthetic */ y f164727f;

        public C1702y(t.b bVar, y yVar) {
            this.f164726e = bVar;
            this.f164727f = yVar;
        }

        public final boolean a(String str, int i15) {
            lh4.m.g(str, "url");
            String stringExtra = this.f164727f.L().getStringExtra("geta8key_username");
            int R = this.f164727f.R(stringExtra);
            if (!this.f164722a) {
                this.f164723b = str;
            }
            mp3.b bVar = this.f164727f.f164482k;
            if (bVar.f266827b && bVar.f266837l && !bVar.f266828c) {
                f0 f0Var = f0.f164574a;
                if (((Boolean) ((wg4.n) f0.f164580g).getValue()).booleanValue()) {
                    Log.w(this.f164727f.c1(), "handle oauth fail on background");
                    y yVar = this.f164727f;
                    yVar.w(yVar.f164487m0, str);
                    return false;
                }
            }
            com.tencent.mm.plugin.webview.stub.l U = this.f164727f.U();
            y yVar2 = this.f164727f;
            o0.c cVar = yVar2.f164653l1;
            r rVar = yVar2.f164654m1;
            int e15 = yVar2.Y0().e();
            Context H = this.f164727f.H();
            Dialog dialog = this.f164727f.f164488n;
            o0.b.f165697a = System.currentTimeMillis();
            wq3.b.INSTANCE.c(1, "");
            s sVar = (s) cVar;
            String currentUrl = sVar.getCurrentUrl();
            Log.i("MicroMsg.OauthAuthorizeLogic", "doOauthAuthorize scene: %d, autoOauth: %d, url=%s", Integer.valueOf(R), Integer.valueOf(i15), currentUrl);
            sVar.d(new p0(sVar));
            mq3 mq32 = new mq3();
            mq32.f30056d = str;
            mq32.f30057e = stringExtra;
            mq32.f30058f = R;
            mq32.f30059g = i15;
            mq32.f30061i = currentUrl;
            c.b bVar2 = new c.b();
            bVar2.f345559a = mq32;
            bVar2.f345560b = new nq3();
            bVar2.f345561c = "/cgi-bin/mmbiz-bin/oauth_authorize";
            bVar2.f345562d = com.tencent.mm.plugin.appbrand.jsapi.pay.w.CTRL_INDEX;
            bVar2.f345563e = 0;
            bVar2.f345564f = 0;
            ((com.tencent.mm.ipcinvoker.wx_extension.j) yz3.j.c(com.tencent.mm.ipcinvoker.wx_extension.j.class)).hD(bVar2.a(), new q0(new WeakReference(H), U, sVar, rVar, str, e15, dialog));
            return true;
        }

        /* JADX WARNING: Code restructure failed: missing block: B:11:0x0053, code lost:
            r0 = false;
         */
        /* JADX WARNING: Code restructure failed: missing block: B:7:0x002d, code lost:
            if (r0 == 1) goto L_0x0051;
         */
        /* JADX WARNING: Code restructure failed: missing block: B:9:0x004f, code lost:
            if (com.tencent.mm.plugin.webview.model.o0.b.f165699c == 1) goto L_0x0051;
         */
        public final boolean b(String str) {
            boolean z15;
            lh4.m.g(str, "url");
            if (6 == this.f164727f.L().getIntExtra("geta8key_scene", 0)) {
                Log.i("MicroMsg.OauthAuthorizeLogic", "shouldNativeOauthIntercept from oauth");
                return false;
            } else if (Util.isNullOrNil(str)) {
                return false;
            } else {
                int i15 = o0.b.f165699c;
                if (i15 == -1) {
                    int Xj0 = ((ie1.h) yz3.j.c(ie1.h.class)).Xj0(h.c.D6, 1);
                    o0.b.f165699c = Xj0;
                    Log.i("MicroMsg.OauthAuthorizeLogic", "isABTestOpen %d", Integer.valueOf(Xj0));
                }
                boolean z16 = true;
                if (!z16) {
                    return false;
                }
                if (o0.f165695a == null && !o0.f165696b) {
                    String b15 = o0.b();
                    if (Util.isNullOrNil(b15)) {
                        b15 = WeChatHosts.domainString(R.string.fya) + "/connect/oauth2/authorize";
                    }
                    o0.f165695a = b15.split(";");
                    o0.f165696b = true;
                }
                String[] strArr = o0.f165695a;
                if (strArr != null && strArr.length != 0) {
                    Uri parse = Uri.parse(str);
                    String str2 = parse.getAuthority() + parse.getPath();
                    if (!Util.isNullOrNil(str2)) {
                        int i16 = 0;
                        while (true) {
                            String[] strArr2 = o0.f165695a;
                            if (i16 >= strArr2.length) {
                                break;
                            } else if (str2.equalsIgnoreCase(strArr2[i16])) {
                                z15 = true;
                                break;
                            } else {
                                i16++;
                            }
                        }
                    } else {
                        Log.i("MicroMsg.OauthAuthorizeLogic", "isOauthHost target nil");
                    }
                } else {
                    Log.i("MicroMsg.OauthAuthorizeLogic", "isOauthHost sOauthHostPaths nil");
                }
                z15 = false;
                if (z15) {
                    return true;
                }
                return false;
            }
        }

        @Override // op3.a
        public boolean c(String str) {
            int i15;
            lh4.m.g(str, "url");
            if (this.f164722a || !((s) this.f164727f.f164653l1).e()) {
                i15 = 0;
            } else {
                i15 = 1;
            }
            return a(str, i15);
        }

        @Override // op3.a
        public boolean e(String str) {
            lh4.m.g(str, "url");
            if (this.f164726e.f9918g || !b(str)) {
                return false;
            }
            return true;
        }
    }

    public static final class z extends lh4.o implements kh4.a<wg4.b0> {

        /* renamed from: d  reason: collision with root package name */
        public final /* synthetic */ y f164728d;

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public z(y yVar) {
            super(0);
            this.f164728d = yVar;
        }

        /* Return type fixed from 'java.lang.Object' to match base method */
        @Override // kh4.a
        public wg4.b0 invoke() {
            String str;
            String str2;
            String str3;
            wg4.l[] lVarArr;
            y yVar = this.f164728d;
            Iterator<z> it = yVar.W.iterator();
            while (it.hasNext()) {
                z next = it.next();
                if (next instanceof a0) {
                    ((a0) next).s(yVar.S);
                }
            }
            y yVar2 = this.f164728d;
            if (!yVar2.f164482k.f266837l) {
                wq3.v vVar = yVar2.S;
                MMWebView mMWebView = yVar2.f164462a;
                wg4.g gVar = aq3.d.f7969a;
                lh4.m.g(vVar, "performanceHelper");
                lh4.m.g(mMWebView, "webView");
                long j15 = vVar.f334866s;
                StringBuilder sb5 = new StringBuilder();
                sb5.append(Uri.parse(vVar.f334862o).getHost());
                sb5.append(",");
                sb5.append(ck.q.b(vVar.f334862o, "utf-8"));
                sb5.append(",");
                boolean z15 = vVar.f334856i;
                int i15 = 2;
                int i16 = vVar.f334852e ? 2 : 0;
                int i17 = 4;
                sb5.append((z15 ? 1 : 0) | i16 | (vVar.f334858k ? 4 : 0));
                sb5.append(",");
                ck.q.b(vVar.f334862o, "utf-8");
                boolean z16 = vVar.f334854g;
                if (vVar.f334859l.size() <= 0) {
                    i15 = 0;
                }
                if (vVar.f334860m.size() <= 0) {
                    i17 = 0;
                }
                sb5.append((z16 ? 1 : 0) | i15 | i17);
                sb5.append(",");
                sb5.append(vVar.f334853f ? 1 : 0);
                sb5.append(",");
                sb5.append(vVar.f334867t);
                sb5.append(",");
                sb5.append(ck.q.b(vVar.f334870w, "utf-8"));
                sb5.append(",");
                sb5.append(",");
                sb5.append(",");
                sb5.append(",");
                sb5.append(0);
                sb5.append(",");
                sb5.append(aq3.d.d("pageAppear", vVar, j15));
                sb5.append(aq3.d.d("onWebViewCreateStart", vVar, j15));
                sb5.append(aq3.d.d("onWebViewCreateEnd", vVar, j15));
                sb5.append(aq3.d.d("getA8KeyStart", vVar, j15));
                sb5.append(aq3.d.d("getA8KeyEnd", vVar, j15));
                sb5.append(aq3.d.d("clientLoadUrl", vVar, j15));
                sb5.append(aq3.d.d("navigationStart", vVar, j15));
                sb5.append(aq3.d.d("domainLookupStart", vVar, j15));
                sb5.append(aq3.d.d("domainLookupEnd", vVar, j15));
                sb5.append(aq3.d.d("connectStart", vVar, j15));
                sb5.append(aq3.d.d("connectEnd", vVar, j15));
                sb5.append(aq3.d.d("responseStart", vVar, j15));
                sb5.append(aq3.d.d("responseEnd", vVar, j15));
                if (vVar.f334856i) {
                    StringBuilder sb6 = new StringBuilder();
                    str2 = "navigationStart";
                    str = "domainLookupStart";
                    sb6.append(vVar.f334857j - j15);
                    sb6.append(',');
                    str3 = sb6.toString();
                } else {
                    str2 = "navigationStart";
                    str = "domainLookupStart";
                    str3 = aq3.d.d("domLoading", vVar, j15);
                }
                sb5.append(str3);
                sb5.append(aq3.d.d("domInteractive", vVar, j15));
                sb5.append(aq3.d.d("domContentLoadedEventStart", vVar, j15));
                sb5.append(aq3.d.d("domContentLoadedEventEnd", vVar, j15));
                sb5.append(aq3.d.d("loadEventStart", vVar, j15));
                sb5.append(aq3.d.d("loadEventEnd", vVar, j15));
                sb5.append(aq3.d.d("onTryBindServiceStart", vVar, j15));
                sb5.append(aq3.d.d("onPostBindedEnd", vVar, j15));
                sb5.append(aq3.d.d("onCreate", vVar, j15));
                sb5.append(aq3.d.d("onUIInitEnd", vVar, j15));
                sb5.append("0,0,0,0,0,0,0,");
                sb5.append(aq3.d.d("onPostBindedStart", vVar, j15));
                sb5.append(aq3.d.d("firstContentfulPaint", vVar, j15));
                if (vVar.f334865r == d.EnumC0141d.Unknown) {
                    vVar.f334865r = aq3.d.b();
                }
                sb5.append(vVar.f334865r.f7985d);
                sb5.append(",");
                sb5.append(vVar.f334871x);
                sb5.append(",");
                String sb7 = sb5.toString();
                lh4.m.f(sb7, "StringBuilder().apply {\n…,\")\n\n        }.toString()");
                com.tencent.mm.plugin.report.service.q qVar = com.tencent.mm.plugin.report.service.q.INSTANCE;
                qVar.kvStat(19471, sb7);
                boolean z17 = vVar.f334852e;
                boolean z18 = vVar.f334853f;
                if (z17) {
                    qVar.v(1200, 2, 1);
                }
                if (z18) {
                    qVar.v(1200, 3, 1);
                }
                aq3.d.j(vVar.f334867t, vVar.f334862o, false, true, vVar.f334852e, vVar.f334853f, vVar.f334854g, false, 128, null);
                if (kp3.g1.a()) {
                    long j16 = vVar.f334866s;
                    ArrayList arrayList = new ArrayList();
                    arrayList.add(0L);
                    arrayList.add(Long.valueOf(aq3.d.a("pageAppear", vVar, j16)));
                    arrayList.add(Long.valueOf(aq3.d.a("onWebViewCreateStart", vVar, j16)));
                    arrayList.add(Long.valueOf(aq3.d.a("onWebViewCreateEnd", vVar, j16)));
                    arrayList.add(Long.valueOf(aq3.d.a("getA8KeyStart", vVar, j16)));
                    arrayList.add(Long.valueOf(aq3.d.a("getA8KeyEnd", vVar, j16)));
                    arrayList.add(Long.valueOf(aq3.d.a("clientLoadUrl", vVar, j16)));
                    arrayList.add(Long.valueOf(aq3.d.a(str2, vVar, j16)));
                    arrayList.add(Long.valueOf(aq3.d.a(str, vVar, j16)));
                    arrayList.add(Long.valueOf(aq3.d.a("domainLookupEnd", vVar, j16)));
                    arrayList.add(Long.valueOf(aq3.d.a("connectStart", vVar, j16)));
                    arrayList.add(Long.valueOf(aq3.d.a("connectEnd", vVar, j16)));
                    arrayList.add(Long.valueOf(aq3.d.a("responseStart", vVar, j16)));
                    arrayList.add(Long.valueOf(aq3.d.a("responseEnd", vVar, j16)));
                    arrayList.add(Long.valueOf(aq3.d.a("domLoading", vVar, j16)));
                    arrayList.add(Long.valueOf(aq3.d.a("domInteractive", vVar, j16)));
                    arrayList.add(Long.valueOf(aq3.d.a("onTryBindServiceStart", vVar, j16)));
                    arrayList.add(Long.valueOf(aq3.d.a("onPostBindedEnd", vVar, j16)));
                    arrayList.add(Long.valueOf(aq3.d.a("onCreate", vVar, j16)));
                    arrayList.add(Long.valueOf(aq3.d.a("onUIInitEnd", vVar, j16)));
                    long a15 = aq3.d.a("firstContentfulPaint", vVar, j16);
                    if (a15 <= 0) {
                        arrayList.add(0L);
                        arrayList.add(0L);
                    } else {
                        arrayList.add(Long.valueOf(aq3.d.a("fetchStart", vVar, j16)));
                        arrayList.add(Long.valueOf(a15));
                    }
                    String str4 = '[' + xg4.c0.V(xg4.c0.w0(arrayList, 22), null, null, null, 0, null, null, 63, null) + ']';
                    String[][] strArr = vVar.f334851d;
                    if (strArr != null) {
                        ArrayList arrayList2 = new ArrayList(strArr.length);
                        for (String[] strArr2 : strArr) {
                            arrayList2.add(new wg4.l(strArr2[0], strArr2[1]));
                        }
                        lVarArr = (wg4.l[]) arrayList2.toArray(new wg4.l[0]);
                    } else {
                        lVarArr = null;
                    }
                    lh4.j0 j0Var = new lh4.j0(11);
                    j0Var.a(new wg4.l("section", "GetA8Key"));
                    j0Var.a(new wg4.l("preGetA8Key", String.valueOf(vVar.f334852e)));
                    j0Var.a(new wg4.l("preDns", String.valueOf(vVar.f334853f)));
                    if (lVarArr == null) {
                        lVarArr = new wg4.l[0];
                    }
                    j0Var.b(lVarArr);
                    j0Var.a(new wg4.l("section", "Prefetch"));
                    j0Var.a(new wg4.l("prefetch", String.valueOf(vVar.f334854g)));
                    j0Var.a(new wg4.l("prefetchId", vVar.f334855h));
                    j0Var.a(new wg4.l("prefetchJS", xg4.c0.V(vVar.f334859l, "<br/>", null, null, 0, null, null, 62, null)));
                    j0Var.a(new wg4.l("prefetchCSS", xg4.c0.V(vVar.f334860m, "<br/>", null, null, 0, null, null, 62, null)));
                    j0Var.a(new wg4.l("section", "Prefetch Headers"));
                    HashMap<String, String> hashMap = vVar.f334861n;
                    LinkedHashMap linkedHashMap = new LinkedHashMap();
                    for (Map.Entry<String, String> entry : hashMap.entrySet()) {
                        entry.getValue();
                        String lowerCase = ek4.d0.l0(entry.getKey()).toString().toLowerCase();
                        lh4.m.f(lowerCase, "this as java.lang.String).toLowerCase()");
                        if (ek4.y.v(lowerCase, "x-wx-", false)) {
                            linkedHashMap.put(entry.getKey(), entry.getValue());
                        }
                    }
                    j0Var.b(t0.o(linkedHashMap).toArray(new wg4.l[0]));
                    vVar.c("['PageAppear', 'WebView', 'GetA8key', 'ClientLoadToNavStart', 'DomainLookUp', 'ConnectStart', 'Response', 'DomLoadingToInteractive', 'Invoker', 'WebViewUICreate', 'FCPToFetchStart']", str4, mMWebView, xg4.u.f(j0Var.d(new wg4.l[j0Var.c()])));
                }
            }
            return wg4.b0.f332794a;
        }
    }

    /* JADX INFO: this call moved to the top of the method (can break code semantics) */
    public /* synthetic */ y(MMWebView mMWebView, l2 l2Var, t.b bVar, Set set, kp3.i iVar, int i15, lh4.h hVar) {
        this(mMWebView, (i15 & 2) != 0 ? new l2() : l2Var, (i15 & 4) != 0 ? new t.b(null, false, false, false, false, 0, false, 127, null) : bVar, (i15 & 8) != 0 ? null : set, (i15 & 16) == 0 ? iVar : null);
    }

    public static final void R0(y yVar, int i15) {
        yVar.getClass();
        Bundle bundle = new Bundle();
        bundle.putInt("update_type_key", i15);
        try {
            yVar.U().KM(1, bundle, yVar.g());
        } catch (Exception e15) {
            String c15 = yVar.c1();
            Log.e(c15, "doUpdate fail, ex = " + e15.getMessage());
        }
    }

    public static final void S0(y yVar, int i15) {
        yVar.getClass();
        try {
            Bundle bundle = new Bundle();
            bundle.putInt("scene_end_type", i15);
            bundle.putInt("scene_end_listener_hash_code", yVar.Y0().e());
            yVar.U().KM(6, bundle, yVar.Y0().e());
        } catch (Exception e15) {
            String c15 = yVar.c1();
            Log.e(c15, "removeSceneEnd, ex = " + e15.getMessage());
        }
    }

    @Override // com.tencent.mm.plugin.webview.core.BaseWebViewController
    public void D0() {
        String str;
        String str2;
        boolean z15;
        boolean z16;
        String str3;
        String str4;
        String str5;
        c1();
        byte[] byteArrayExtra = L().getByteArrayExtra("key_scan_qr_code_get_a8key_req");
        byte[] byteArrayExtra2 = L().getByteArrayExtra("key_scan_qr_code_get_a8key_resp");
        if (!(byteArrayExtra == null || byteArrayExtra2 == null)) {
            Log.i(c1(), "set outer get A8key result");
            vp3.c B = B();
            B.getClass();
            if (byteArrayExtra.length > 0 && byteArrayExtra2.length > 0) {
                y62 y622 = new y62();
                z62 z622 = new z62();
                try {
                    y622.parseFrom(byteArrayExtra);
                    z622.parseFrom(byteArrayExtra2);
                    B.f328029p = y622.f43009i.f32041d;
                } catch (Exception unused) {
                }
                if (Util.isNullOrNil(B.f328029p) || z622.f44129d == null) {
                    Log.e("MicroMsg.LuggageGetA8Key", "ReqUrl or FullUrl is null");
                } else {
                    B.f328030q = z622;
                    B.f328031r = y622;
                }
            }
        }
        String stringExtra = L().getStringExtra("geta8key_username");
        String stringExtra2 = L().getStringExtra("msgUsername");
        String stringExtra3 = L().getStringExtra("serverMsgID");
        vp3.c B2 = B();
        String str6 = "";
        if (stringExtra2 == null) {
            str = str6;
        } else {
            str = stringExtra2;
        }
        B2.f328034u = str;
        B().f328016c = L().getStringExtra("kReferrer");
        B().f328035v = stringExtra3;
        vp3.c B3 = B();
        if (stringExtra == null) {
            str2 = str6;
        } else {
            str2 = stringExtra;
        }
        B3.f328018e = str2;
        B().f328015b = R(stringExtra);
        B().f328019f = L().getStringExtra("geta8key_open_webview_appid");
        boolean z17 = false;
        B().f328017d = 0;
        B().f328021h = L().getByteArrayExtra("geta8key_cookie");
        B().f328027n = L().getIntExtra("key_wallet_region", 0);
        vp3.c B4 = B();
        String stringExtra4 = L().getStringExtra("key_function_id");
        if (stringExtra4 == null) {
            stringExtra4 = str6;
        }
        B4.f328020g = stringExtra4;
        B().A = L().getIntExtra("KMsgType", 0);
        B().B = L().getIntExtra("KAppMsgType", 0);
        int intExtra = L().getIntExtra("geta8key_session_id", 0);
        if (intExtra != 0) {
            Log.i(c1(), "set requestid:" + intExtra);
            B().f328022i = intExtra;
        }
        int intExtra2 = L().getIntExtra("geta8key_init_request_id", 0);
        if (intExtra2 != 0) {
            Log.i(c1(), "set initRequestId:" + intExtra2);
            B().f328023j = intExtra2;
        }
        if (stringExtra2 == null || stringExtra2.length() == 0) {
            z15 = true;
        } else {
            z15 = false;
        }
        if (z15) {
            vp3.c B5 = B();
            y62 y623 = B().f328031r;
            if (y623 == null || (str5 = y623.G) == null) {
                str5 = str6;
            }
            B5.f328034u = str5;
        }
        if (stringExtra == null || stringExtra.length() == 0) {
            z16 = true;
        } else {
            z16 = false;
        }
        if (z16) {
            vp3.c B6 = B();
            y62 y624 = B().f328031r;
            if (y624 == null || (str4 = y624.f43013p) == null) {
                str4 = str6;
            }
            B6.f328018e = str4;
        }
        if (stringExtra3 == null || stringExtra3.length() == 0) {
            z17 = true;
        }
        if (z17) {
            vp3.c B7 = B();
            y62 y625 = B().f328031r;
            if (!(y625 == null || (str3 = y625.H) == null)) {
                str6 = str3;
            }
            B7.f328035v = str6;
        }
    }

    @Override // b10.t, com.tencent.mm.plugin.webview.core.BaseWebViewController
    public void H3(String str, Map<String, String> map, boolean z15) {
        lh4.m.g(str, "url");
        com.tencent.mm.plugin.webview.model.a.c(this.f164462a, str);
        super.H3(str, map, z15);
    }

    @Override // com.tencent.mm.plugin.webview.core.BaseWebViewController
    public Set<String> I() {
        return (Set) ((wg4.n) this.W0).getValue();
    }

    @Override // b10.t, com.tencent.mm.plugin.webview.core.BaseWebViewController
    public int J3() {
        return R(L().getStringExtra("geta8key_username"));
    }

    @Override // com.tencent.mm.plugin.webview.core.BaseWebViewController
    public void L0(boolean z15, String str, JsapiPermissionWrapper jsapiPermissionWrapper) {
        WebViewUIStyleHelper webViewUIStyleHelper;
        WebViewUI webViewUI;
        lh4.m.g(str, "uiConfig");
        if (z15) {
            if ((str.length() > 0) && (webViewUIStyleHelper = this.R0) != null && (webViewUI = webViewUIStyleHelper.f166606d) != null && webViewUIStyleHelper.f166607e != null && webViewUI.S1 != null && jsapiPermissionWrapper != null) {
                try {
                    JSONArray optJSONArray = new JSONObject(str).optJSONArray("uiConfigs");
                    if (optJSONArray == null) {
                        return;
                    }
                    if (optJSONArray.length() > 0) {
                        int length = optJSONArray.length();
                        for (int i15 = 0; i15 < length; i15++) {
                            JSONObject optJSONObject = optJSONArray.optJSONObject(i15);
                            if (optJSONObject != null) {
                                webViewUIStyleHelper.a(optJSONObject.optString("func"), optJSONObject.optJSONObject("data"), jsapiPermissionWrapper);
                            }
                        }
                    }
                } catch (Exception e15) {
                    Log.printErrStackTrace("MicroMsg.WebViewUIStyleHelper", e15, "configWebPrefetchUIStyle exception", new Object[0]);
                }
            }
        }
    }

    @Override // b10.t, com.tencent.mm.plugin.webview.core.BaseWebViewController
    public void P3(Intent intent) {
        boolean z15;
        boolean z16;
        boolean z17;
        boolean z18;
        lh4.m.g(intent, "intent");
        super.P3(intent);
        if (!this.f164644c1) {
            sp3.b bVar = sp3.b.f304408a;
            String y35 = y3();
            boolean z19 = false;
            if (y35 == null || y35.length() == 0) {
                z15 = true;
            } else {
                z15 = false;
            }
            if (z15) {
                z16 = false;
            } else {
                z16 = ek4.d0.z(y35, "adCgiRedirect=1", false, 2, null);
            }
            if (z16 || bVar.d(y35)) {
                z17 = true;
            } else {
                z17 = false;
            }
            if (z17) {
                boolean c15 = bVar.c();
                Log.i("MicroMsg.WebViewHighRiskAdH5Interceptor", "checkInitAdInterceptor, controller.hash=" + hashCode() + ",rawUrl=" + y3() + ", expt=" + c15);
                String y36 = y3();
                if (y36 == null || y36.length() == 0) {
                    z18 = true;
                } else {
                    z18 = false;
                }
                if (!z18) {
                    z19 = ek4.d0.z(y36, "adCgiRedirect=1", false, 2, null);
                }
                boolean d15 = bVar.d(y3());
                if (z19) {
                    com.tencent.mm.plugin.report.service.q.INSTANCE.t(1951, 2);
                }
                if (d15) {
                    com.tencent.mm.plugin.report.service.q.INSTANCE.t(1951, 11);
                }
                if (c15) {
                    r(new sp3.d());
                    this.f164644c1 = true;
                    com.tencent.mm.plugin.report.service.q.INSTANCE.t(1951, 1);
                }
            }
        }
        hashCode();
        y3();
    }

    @Override // com.tencent.mm.plugin.webview.core.BaseWebViewController
    public int R(String str) {
        boolean z15;
        int i15;
        int i16 = this.f164464b.f9917f;
        if (i16 != 0) {
            return i16;
        }
        int intExtra = L().getIntExtra("geta8key_scene", 0);
        if (intExtra == 0) {
            if (str == null || str.length() == 0) {
                z15 = true;
            } else {
                z15 = false;
            }
            if (!z15) {
                try {
                    if (a0(this.f164469d0)) {
                        if (U().Xa0(str)) {
                            i15 = 8;
                        } else if (U().Jp(str)) {
                            Bundle bundle = new Bundle();
                            bundle.putString("enterprise_biz_username", str);
                            try {
                                Bundle v65 = U().v6(102, bundle);
                                if (v65 != null) {
                                    v65.getBoolean("is_enterprise_username");
                                }
                            } catch (RemoteException unused) {
                                Log.e(c1(), "invoke the check enterprise failed");
                            }
                            i15 = 7;
                        }
                        intExtra = i15;
                    }
                    i15 = 1;
                    intExtra = i15;
                } catch (Exception e15) {
                    Log.e(c1(), "getScene fail, ex = " + e15.getMessage());
                    intExtra = 1;
                }
            } else {
                intExtra = 0;
            }
        }
        Log.i(c1(), "KGetA8KeyScene = %s", Integer.valueOf(intExtra));
        return intExtra;
    }

    @Override // b10.t, com.tencent.mm.plugin.webview.core.BaseWebViewController
    public String S(String str) {
        String str2;
        Throwable th5;
        if (TextUtils.isEmpty(str)) {
            return "";
        }
        Bundle bundle = new Bundle();
        bundle.putInt("webview_binder_id", g());
        bundle.putString("rawUrl", str);
        try {
            str2 = Util.nullAsNil(U().v6(76, bundle).getString("appId"));
            lh4.m.f(str2, "nullAsNil(data.getString(\"appId\"))");
            try {
                Log.i(c1(), "stev cachedAppId %s", str2);
            } catch (Throwable th6) {
                th5 = th6;
            }
        } catch (Throwable th7) {
            th5 = th7;
            str2 = "";
            Log.w(c1(), "get cachedAppId error %s", th5.getMessage());
            return str2;
        }
        return str2;
    }

    public final void T0(int i15) {
        try {
            Bundle bundle = new Bundle();
            bundle.putInt("scene_end_type", i15);
            bundle.putInt("scene_end_listener_hash_code", Y0().e());
            U().KM(5, bundle, Y0().e());
        } catch (Exception e15) {
            String c15 = c1();
            Log.e(c15, "addSceneEnd, ex = " + e15.getMessage());
        }
    }

    public final boolean U0(String str) {
        boolean z15;
        ek4.h hVar;
        String str2;
        boolean z16;
        boolean z17;
        boolean z18;
        boolean z19;
        boolean z25;
        boolean z26;
        String str3 = str;
        Log.i(c1(), "dealCustomScheme, url = " + str3);
        if (str3 == null || str.length() == 0) {
            z15 = true;
        } else {
            z15 = false;
        }
        if (z15) {
            return false;
        }
        try {
            if (U().c1(str3)) {
                Log.i(c1(), "dealCustomScheme, url is handled by QrCodeURLHelper, url = " + str3);
                U().SE(str3, g());
                return true;
            }
        } catch (Exception e15) {
            Log.w(c1(), "dealCustomScheme, tryHandleEvents, ex = " + e15.getMessage());
        }
        Uri parse = Uri.parse(str);
        if (parse != null && !ek4.y.v(str3, "weixin://", false) && !ek4.y.v(str3, ProxyConfig.MATCH_HTTP, false)) {
            String str4 = "";
            if (ek4.y.v(str3, "tel:", false)) {
                String q15 = ek4.y.q(str3, "tel:", str4, false);
                if (!Util.isNullOrNil(q15)) {
                    try {
                        U().G6(q15, g());
                    } catch (Exception e16) {
                        Log.w(c1(), "showPhoneSpanDialog, ex = %s", e16.getMessage());
                    }
                }
                return true;
            } else if (ek4.y.v(str3, "sms:", false) || ek4.y.v(str3, "smsto:", false)) {
                if (this.f164462a.getActivityContextIfHas() == null) {
                    Log.e(c1(), "sms, viewWV.activityContextIfHas = null");
                    return true;
                }
                Context activityContextIfHas = this.f164462a.getActivityContextIfHas();
                lh4.m.f(activityContextIfHas, "viewWV.activityContextIfHas");
                Pattern compile = Pattern.compile("sms:(\\d*)(\\?body=(.*))?");
                lh4.m.f(compile, "compile(pattern)");
                String decode = URLDecoder.decode(str3, "UTF-8");
                lh4.m.f(decode, "decodedUrl");
                Matcher matcher = compile.matcher(decode);
                lh4.m.f(matcher, "nativePattern.matcher(input)");
                String str5 = null;
                if (!matcher.matches()) {
                    hVar = null;
                } else {
                    hVar = new ek4.h(matcher, decode);
                }
                if (hVar != null) {
                    str2 = (String) xg4.c0.R(hVar.b(), 1);
                } else {
                    str2 = null;
                }
                if (hVar != null) {
                    str5 = (String) xg4.c0.R(hVar.b(), 3);
                }
                if (str2 == null || str2.length() == 0) {
                    z16 = true;
                } else {
                    z16 = false;
                }
                if (z16) {
                    str4 = activityContextIfHas.getString(R.string.k4j);
                } else {
                    if (str2 == null || str2.length() == 0) {
                        z17 = true;
                    } else {
                        z17 = false;
                    }
                    if (!z17) {
                        if (str5 == null || str5.length() == 0) {
                            z25 = true;
                        } else {
                            z25 = false;
                        }
                        if (z25) {
                            str4 = Util.safeFormatString(activityContextIfHas.getString(R.string.k4k), str2);
                        }
                    }
                    if (str2 == null || str2.length() == 0) {
                        z18 = true;
                    } else {
                        z18 = false;
                    }
                    if (!z18) {
                        if (str5 == null || str5.length() == 0) {
                            z19 = true;
                        } else {
                            z19 = false;
                        }
                        if (!z19) {
                            str4 = Util.safeFormatString(activityContextIfHas.getString(R.string.k4l), str5, str2);
                        }
                    }
                }
                if (!Util.isNullOrNil(str4)) {
                    m60.d.O(new com.tencent.mm.plugin.webview.ui.tools.m0(activityContextIfHas, str4, str3));
                } else {
                    Log.e("MicroMsg.WebViewUI.SMSQueryHelper", "sms, url is illegal, url = %s", str3);
                }
                return true;
            } else if (ek4.y.v(str3, "mailto:", false)) {
                Intent intent = new Intent("android.intent.action.SENDTO");
                intent.addFlags(268435456);
                intent.setData(parse);
                try {
                    Context H = H();
                    k30.a aVar = new k30.a();
                    aVar.c(intent);
                    j30.a.d(H, aVar.b(), "com/tencent/mm/plugin/webview/core/WebViewController", "dealCustomScheme", "(Ljava/lang/String;)Z", "Undefined", "startActivity", "(Landroid/content/Intent;)V");
                    H.startActivity((Intent) aVar.a(0));
                    j30.a.e(H, "com/tencent/mm/plugin/webview/core/WebViewController", "dealCustomScheme", "(Ljava/lang/String;)Z", "Undefined", "startActivity", "(Landroid/content/Intent;)V");
                } catch (Exception e17) {
                    Log.e(c1(), "start mailto app failed:[%s]", e17.getMessage());
                }
                return true;
            } else {
                try {
                    if ((this.O.b().f173509d & 8192) != 0) {
                        z26 = true;
                    } else {
                        z26 = false;
                    }
                    if (z26 || !U().Vy()) {
                        int intExtra = L().getIntExtra("key_download_restrict", 0);
                        String stringExtra = L().getStringExtra("key_function_id");
                        if (!Util.isNullOrNil(stringExtra)) {
                            com.tencent.mm.plugin.report.service.q.INSTANCE.g(14596, stringExtra, Integer.valueOf(intExtra), 1);
                        }
                        if (intExtra == 1) {
                            Log.e(c1(), "not allow launch app by custom scheme : %s", str3);
                            return true;
                        }
                        long nowSecond = Util.nowSecond() - this.f164655n1;
                        Log.i(c1(), "scheme launch interval ; %d", Long.valueOf(nowSecond));
                        if (nowSecond <= 2) {
                            String currentUrl = getCurrentUrl();
                            try {
                                currentUrl = ck.q.b(currentUrl, "UTF-8");
                                str3 = ck.q.b(str3, "UTF-8");
                            } catch (Exception unused) {
                                Log.i(c1(), "formate url failed");
                            }
                            com.tencent.mm.plugin.report.service.q.INSTANCE.g(13983, 4, currentUrl, str3);
                        }
                        if (L().getBooleanExtra("show_openapp_dialog", true)) {
                            return e04.a.a(new t(this, parse));
                        }
                        Intent intent2 = new Intent("android.intent.action.VIEW", parse);
                        intent2.addFlags(268435456);
                        if (Util.isIntentAvailable(H(), intent2, true)) {
                            try {
                                Context H2 = H();
                                k30.a aVar2 = new k30.a();
                                aVar2.c(intent2);
                                j30.a.d(H2, aVar2.b(), "com/tencent/mm/plugin/webview/core/WebViewController", "dealCustomScheme", "(Ljava/lang/String;)Z", "Undefined", "startActivity", "(Landroid/content/Intent;)V");
                                H2.startActivity((Intent) aVar2.a(0));
                                j30.a.e(H2, "com/tencent/mm/plugin/webview/core/WebViewController", "dealCustomScheme", "(Ljava/lang/String;)Z", "Undefined", "startActivity", "(Landroid/content/Intent;)V");
                                return true;
                            } catch (Exception e18) {
                                Log.printErrStackTrace(c1(), e18, str4, new Object[0]);
                                return false;
                            }
                        }
                    } else {
                        Log.e(c1(), "dealCustomScheme, not allow outer open url");
                        return true;
                    }
                } catch (Exception e19) {
                    Log.printErrStackTrace(c1(), e19, str4, new Object[0]);
                }
            }
        }
        return false;
    }

    /* JADX WARNING: Code restructure failed: missing block: B:40:0x0122, code lost:
        if (bd.d.c(r15, r0, true) != false) goto L_0x0124;
     */
    public boolean V0(String str) {
        boolean z15;
        if (str == null || str.length() == 0) {
            z15 = true;
        } else {
            z15 = false;
        }
        if (z15) {
            return false;
        }
        try {
            if (!bd.d.c(str, "weixin://jump/", true)) {
                if (!bd.d.c(str, "weixin://scanqrcode/", true)) {
                    if (!bd.d.c(str, "weixin://dl/business", true) || !cu3.m.q(Uri.parse(str))) {
                        if (bd.d.c(str, "weixinpreinject://iframe", true)) {
                            Log.i(c1(), "preInjectJsBridge,accept preinject_Iframe and continue preinjectjsbridge");
                        } else {
                            if (!bd.d.c(str, "weixin://dl/login/common_view", true)) {
                                if (!bd.d.c(str, "weixin://dl/login/phone_view", true)) {
                                    if (bd.d.c(str, "weixin://webview/initReady/", true) || bd.d.c(str, "weixin://webview/preInjectJSBridge/", true)) {
                                        return true;
                                    }
                                }
                            }
                            String y35 = y3();
                            String str2 = cu3.m.f194045c;
                            lh4.m.f(str2, "PREFIX_SUPPORT_QQ");
                            if (!bd.d.c(y35, str2, true)) {
                                String str3 = cu3.m.f194046d;
                                lh4.m.f(str3, "PREFIX_SUPPORT_WECHAT");
                            }
                            if (((Boolean) ((wg4.n) this.X0).getValue()).booleanValue()) {
                                cu3.m.k(this.f164462a.getActivityContextIfHas(), str);
                                o0();
                                return true;
                            }
                        }
                        if (d1(str)) {
                            return true;
                        }
                        if (!bd.d.c(str, "weixin://", true)) {
                            return false;
                        }
                        Log.e(c1(), "shouldOverrideUrlLoading, can not deal with this weixin scheme, stop directly, url = %s", str);
                        return true;
                    }
                    String host = Uri.parse(y3()).getHost();
                    Intent intent = new Intent("android.intent.action.VIEW");
                    intent.addCategory("android.intent.category.BROWSABLE");
                    intent.setData(Uri.parse(str + "&domain=" + host));
                    int intExtra = intent.getIntExtra("pay_channel", -1);
                    if (intExtra != -1) {
                        Log.i(c1(), "%s do deeplink, bypass pay channel: %s", str, Integer.valueOf(intExtra));
                        intent.putExtra("pay_channel", intExtra);
                    }
                    intent.putExtra("translate_link_scene", 13);
                    Context H = H();
                    k30.a aVar = new k30.a();
                    aVar.c(intent);
                    j30.a.d(H, aVar.b(), "com/tencent/mm/plugin/webview/core/WebViewController", "dealWeixinScheme", "(Ljava/lang/String;)Z", "Undefined", "startActivity", "(Landroid/content/Intent;)V");
                    H.startActivity((Intent) aVar.a(0));
                    j30.a.e(H, "com/tencent/mm/plugin/webview/core/WebViewController", "dealWeixinScheme", "(Ljava/lang/String;)Z", "Undefined", "startActivity", "(Landroid/content/Intent;)V");
                    return true;
                }
            }
            h1(str);
            return true;
        } catch (Exception e15) {
            Log.w(c1(), "shouldOverride, jumpToActivity, ex = " + e15.getMessage());
        }
    }

    public final vp3.c W0() {
        return B();
    }

    @Override // com.tencent.mm.plugin.webview.core.BaseWebViewController
    public Class<? extends Service> X() {
        return (Class) ((wg4.n) this.P0).getValue();
    }

    public final String X0() {
        if (!a0(this.f164471e0)) {
            return "";
        }
        return L().getStringExtra("KPublisherId");
    }

    public final m Y0() {
        return (m) ((wg4.n) this.f164652k1).getValue();
    }

    public final String Z0() {
        String title = this.f164462a.getTitle();
        if (title != null) {
            return title;
        }
        String stringExtra = L().getStringExtra(FFmpegMetadataRetriever.METADATA_KEY_TITLE);
        if (stringExtra != null) {
            return stringExtra;
        }
        String stringExtra2 = L().getStringExtra("webpageTitle");
        if (stringExtra2 == null) {
            return "";
        }
        return stringExtra2;
    }

    public final Point a1() {
        return this.f164657p1.f164724c;
    }

    @Override // com.tencent.mm.plugin.webview.core.BaseWebViewController
    public void b0() {
        r(new b2());
        super.b0();
        r(new jp3.d());
    }

    public final long b1() {
        return this.f164657p1.f164725d;
    }

    public final String c1() {
        return (String) ((wg4.n) this.O0).getValue();
    }

    /* JADX WARNING: Removed duplicated region for block: B:20:0x0090  */
    /* JADX WARNING: Removed duplicated region for block: B:38:0x00da  */
    /* JADX WARNING: Removed duplicated region for block: B:55:0x016d A[Catch:{ Exception -> 0x0173 }] */
    public final void d() {
        boolean z15;
        uq3.f fVar;
        g1 g1Var;
        if (!this.I0) {
            kp3.l N = N();
            MMWebView mMWebView = this.f164462a;
            if (N == null) {
                Log.w("MicroMsg.WebViewReportOnLeaveHelper", "handler is null");
            } else {
                String url = mMWebView.getUrl();
                if (!Util.isNullOrNil(url)) {
                    try {
                        if (new URL(url).getHost().equals(WeChatHosts.domainString(R.string.fy9))) {
                            com.tencent.mm.plugin.webview.modeltools.y yVar = new com.tencent.mm.plugin.webview.modeltools.y(mMWebView);
                            if (!N.f247890h) {
                                yVar.onReceiveValue(null);
                            } else {
                                String c15 = h1.a.c("reportOnLeaveForMP", new HashMap(), N.f247898p, N.f247899q);
                                N.f247883a.evaluateJavascript("javascript:WeixinJSBridge._handleMessageFromWeixin(" + c15 + ")", yVar);
                            }
                            z15 = true;
                            fVar = this.S0;
                            if (fVar != null) {
                                synchronized (fVar) {
                                    try {
                                        for (c.a aVar : fVar.f319987f) {
                                            aVar.onDestroy();
                                        }
                                    } catch (Exception e15) {
                                        Log.e(fVar.f319986e, "onDestroy ex " + e15.getMessage());
                                    }
                                    fVar.f319987f.clear();
                                    tq3.d dVar = fVar.f319988g;
                                    if (dVar != null) {
                                        dVar.f314096j.clear();
                                    }
                                }
                            }
                            g1Var = this.Q0;
                            if (g1Var != null) {
                                for (SparseBooleanArray sparseBooleanArray : ((HashMap) g1Var.f167158b).values()) {
                                    if (sparseBooleanArray != null) {
                                        sparseBooleanArray.clear();
                                    }
                                }
                                ((HashMap) g1Var.f167158b).clear();
                                g1Var.f167167k.clear();
                                p64.n nVar = g1Var.f167173q;
                                if (nVar != null) {
                                    if (nVar.h()) {
                                        g1Var.f167173q.p();
                                    }
                                    g1Var.f167173q.j();
                                    g1Var.f167173q = null;
                                }
                                g1Var.f167165i = null;
                                g1Var.f167174r = null;
                                g1Var.f167179w = null;
                            }
                            onDestroy();
                            this.f164462a.removeJavascriptInterface("MicroMsg");
                            this.f164462a.removeJavascriptInterface("JsApi");
                            this.f164462a.removeJavascriptInterface("__wx");
                            this.f164462a.removeJavascriptInterface("CustomFullscreenApi");
                            this.f164462a.removeJavascriptInterface("__wxtag");
                            this.f164462a.setWebChromeClient(null);
                            this.f164462a.setWebViewClient(null);
                            this.f164462a.setOnTouchListener(null);
                            this.f164462a.setOnLongClickListener(null);
                            this.f164462a.setVisibility(8);
                            this.f164462a.removeAllViews();
                            this.f164462a.clearView();
                            if (!z15) {
                                this.f164462a.destroy();
                            }
                            this.S0 = null;
                            this.Q0 = null;
                            this.R0 = null;
                            this.V0 = null;
                        }
                    } catch (Exception e16) {
                        Log.e("MicroMsg.WebViewReportOnLeaveHelper", "create url fail : " + e16.getLocalizedMessage());
                    }
                }
            }
        }
        z15 = false;
        fVar = this.S0;
        if (fVar != null) {
        }
        g1Var = this.Q0;
        if (g1Var != null) {
        }
        onDestroy();
        this.f164462a.removeJavascriptInterface("MicroMsg");
        this.f164462a.removeJavascriptInterface("JsApi");
        this.f164462a.removeJavascriptInterface("__wx");
        this.f164462a.removeJavascriptInterface("CustomFullscreenApi");
        this.f164462a.removeJavascriptInterface("__wxtag");
        try {
            this.f164462a.setWebChromeClient(null);
            this.f164462a.setWebViewClient(null);
            this.f164462a.setOnTouchListener(null);
            this.f164462a.setOnLongClickListener(null);
            this.f164462a.setVisibility(8);
            this.f164462a.removeAllViews();
            this.f164462a.clearView();
            if (!z15) {
            }
        } catch (Exception e17) {
            Log.e(c1(), "releaseWebView, ex = %s", e17.getMessage());
        }
        this.S0 = null;
        this.Q0 = null;
        this.R0 = null;
        this.V0 = null;
    }

    public boolean d1(String str) {
        lh4.m.g(str, "url");
        Iterator it = ((ArrayList) this.f164656o1).iterator();
        while (it.hasNext()) {
            op3.a aVar = (op3.a) it.next();
            if (aVar.e(str)) {
                String c15 = c1();
                Log.i(c15, "url handled, url = " + str);
                boolean c16 = aVar.c(str);
                String c17 = c1();
                Log.i(c17, "url handled, ret = " + c16 + ", url = " + str);
                return true;
            }
        }
        return false;
    }

    @Override // com.tencent.xweb.WebViewClient, com.tencent.mm.plugin.webview.core.BaseWebViewController
    public void doUpdateVisitedHistory(WebView webView, String str, boolean z15) {
        lh4.m.g(webView, "view");
        lh4.m.g(str, "url");
        this.f164506w = str;
        super.doUpdateVisitedHistory(webView, str, z15);
    }

    @Override // com.tencent.mm.plugin.webview.core.BaseWebViewController
    public WebResourceResponse e0(WebView webView, WebResourceRequest webResourceRequest, Bundle bundle) {
        WebResourceResponse b15;
        lh4.m.g(webView, "webview");
        lh4.m.g(webResourceRequest, "request");
        if (!i0() || !a0(this.f164469d0) || (b15 = this.f164642a1.b(webResourceRequest.getUrl().toString(), webResourceRequest, !((Boolean) ((wg4.n) this.f164643b1).getValue()).booleanValue(), U())) == null) {
            return super.e0(webView, webResourceRequest, bundle);
        }
        return b15;
    }

    public final boolean e1() {
        return this.f164657p1.f164722a;
    }

    public final void f1() {
        int intExtra = L().getIntExtra("pay_channel", -1);
        if (intExtra != -1) {
            Log.i(c1(), "hy: found channel in intent. pay channel: %d", Integer.valueOf(intExtra));
            return;
        }
        int jw4 = U().jw();
        if (jw4 != -1) {
            Log.i(c1(), "hy: found channel in channel helper. pay channel: %d", Integer.valueOf(jw4));
            L().putExtra("pay_channel", jw4);
        }
    }

    public final boolean g1() {
        boolean z15;
        try {
            String stringExtra = L().getStringExtra("srcUsername");
            String stringExtra2 = L().getStringExtra("bizofstartfrom");
            if (stringExtra != null) {
                if (!ek4.y.n(stringExtra)) {
                    z15 = false;
                    if (z15 && lh4.m.b(stringExtra2, "enterpriseHomeSubBrand")) {
                        return true;
                    }
                }
            }
            z15 = true;
            return z15 ? false : false;
        } catch (Exception unused) {
            return false;
        }
    }

    public void h1(String str) {
        lh4.m.g(str, "url");
        boolean z15 = false;
        boolean booleanExtra = L().getBooleanExtra(w.j.f187153s, false);
        if ((this.O.b().f173509d & 2) > 0) {
            z15 = true;
        }
        if (z15 || booleanExtra) {
            String c15 = c1();
            Log.i(c15, "allowJumpWithoutPerm: " + booleanExtra);
            Bundle bundle = new Bundle();
            bundle.putInt("fromScene", 100);
            if (U().D80(str, this.O.c().f(7), bundle)) {
                String c16 = c1();
                Log.i(c16, "shouldOverride, built in url handled, url = " + str);
                return;
            }
            return;
        }
        Log.w(c1(), "shouldOverride, allow inner open url, not allow");
    }

    public final void i1(int i15) {
        if (i15 < 1 || i15 > 8) {
            i15 = 2;
        }
        ((xc4.j) xc4.j.f338034d).z(new b0(this, i15));
    }

    @Override // com.tencent.mm.plugin.webview.core.BaseWebViewController
    public boolean l0() {
        boolean z15;
        Iterator<T> it = this.U.iterator();
        while (it.hasNext()) {
            if (!it.next().k(y3())) {
                return false;
            }
        }
        String stringExtra = L().getStringExtra("data");
        if (stringExtra == null || ek4.y.n(stringExtra)) {
            z15 = true;
        } else {
            z15 = false;
        }
        if (!z15 || this.f164464b.f9916e) {
            return false;
        }
        return true;
    }

    @Override // com.tencent.mm.plugin.webview.core.BaseWebViewController
    public void n0() {
        int i15;
        String str;
        boolean z15;
        int i16;
        boolean z16;
        String str2;
        boolean z17;
        int i17;
        int i18;
        int i19;
        int i25;
        if (g0()) {
            Log.e(c1(), "onBinded call when activity has been finished");
            return;
        }
        this.S.a("onPostBindedStart", System.currentTimeMillis());
        wq3.w wVar = this.f164478i;
        if (wVar != null) {
            wVar.f334878g = wVar.f334880i - wVar.f334879h;
            if (d60.z.n().a().f224329e.f224335f > wVar.f334872a) {
                z17 = true;
            } else {
                z17 = false;
            }
            wVar.f334876e = z17;
            Log.i("MicroMsg.WebViewPerformanceMonitor", "Web-Trace Report kernelMode=" + wVar.f334873b + ", progressMode=" + wVar.f334874c + ", progressLaunchTime=" + wVar.f334875d + ", isProgressColdLaunch=" + wVar.f334876e + ", webViewCreateTime=" + wVar.f334877f + ", bindCostTime=" + wVar.f334878g + ",isMPPreloadController=" + wVar.f334881j + ", isRenderProcessInit:" + wVar.f334884m + ", isGPUProcessInit:" + wVar.f334886o + ", isRenderSandBoxProcessInit:" + wVar.f334885n);
            com.tencent.mm.plugin.report.service.q qVar = com.tencent.mm.plugin.report.service.q.INSTANCE;
            Object[] objArr = new Object[19];
            objArr[0] = Integer.valueOf(wVar.f334873b);
            objArr[1] = Integer.valueOf(wVar.f334874c);
            objArr[2] = Long.valueOf(wVar.f334875d);
            objArr[3] = Integer.valueOf(wVar.f334876e ? 1 : 0);
            objArr[4] = Long.valueOf(wVar.f334877f);
            objArr[5] = Long.valueOf(wVar.f334878g);
            objArr[6] = Integer.valueOf(wVar.f334881j ? 1 : 0);
            objArr[7] = Integer.valueOf(XWebSdk.getXWebSdkVersion());
            objArr[8] = Integer.valueOf(XWebSdk.getInstalledNewstVersion(MMApplicationContext.getContext()));
            objArr[9] = Integer.valueOf(XWebSdk.getMultiProcessType());
            if (XWebSdk.getEnableSandbox()) {
                i17 = 1;
            } else {
                i17 = 2;
            }
            objArr[10] = Integer.valueOf(i17);
            objArr[11] = 0;
            objArr[12] = 0;
            if (wVar.f334884m) {
                i18 = 2;
            } else {
                i18 = 1;
            }
            objArr[13] = Integer.valueOf(i18);
            if (wVar.f334885n) {
                i19 = 2;
            } else {
                i19 = 1;
            }
            objArr[14] = Integer.valueOf(i19);
            if (wVar.f334886o) {
                i25 = 2;
            } else {
                i25 = 1;
            }
            objArr[15] = Integer.valueOf(i25);
            objArr[16] = "";
            int i26 = com.tencent.mm.pluginsdk.model.q1.f171483a;
            objArr[17] = 3;
            objArr[18] = Integer.valueOf(wVar.f334882k ? 1 : 0);
            qVar.g(25365, objArr);
        }
        Log.i(c1(), "Abe-Debug onPostBindedStart");
        p1 p1Var = p1.f168890i;
        p1Var.f168898h = U();
        String stringExtra = L().getStringExtra("ad_info");
        if (stringExtra != null) {
            com.tencent.mm.plugin.webview.stub.l lVar = p1Var.f168898h;
            if (lVar != null) {
                try {
                    str2 = lVar.v6(23, null).getString("config_info_username");
                } catch (RemoteException e15) {
                    Log.e("MicroMsg.WebViewReportUtil", "setTraceId getConfigInfo exp:%s", e15);
                }
                p1Var.e(stringExtra, str2);
            }
            str2 = "";
            p1Var.e(stringExtra, str2);
        }
        this.S.a("onJSAPIStart", System.currentTimeMillis());
        Bundle bundleExtra = L().getBundleExtra("jsapiargs");
        if (bundleExtra == null) {
            bundleExtra = new Bundle();
        }
        bundleExtra.putInt("key_download_restrict", L().getIntExtra("key_download_restrict", 0));
        bundleExtra.putString("key_function_id", L().getStringExtra("key_function_id"));
        Log.i(c1(), "KDownloadRestrict = %d, KFunctionID = %s", Integer.valueOf(bundleExtra.getInt("key_download_restrict", 0)), bundleExtra.getString("key_function_id", ""));
        Bundle bundle = new Bundle();
        bundle.putBundle("jsapiargs", bundleExtra);
        bundle.putCharSequence("bizofstartfrom", L().getStringExtra("bizofstartfrom"));
        bundle.putBundle("startwebviewparams", L().getBundleExtra("startwebviewparams"));
        Iterator<b0> it = this.U.iterator();
        while (true) {
            if (!it.hasNext()) {
                i15 = -1;
                break;
            }
            b0 next = it.next();
            if (next.e() != -1) {
                i15 = next.e();
                break;
            }
        }
        bundle.putInt("screen_orientation", i15);
        try {
            U().KM(20, bundle, g());
        } catch (RemoteException e16) {
            Log.e(c1(), "postBinded, invoke AC_SET_INITIAL_ARGS, ex = " + e16.getMessage());
        }
        String stringExtra2 = L().getStringExtra("geta8key_username");
        int intExtra = L().getIntExtra("preChatTYPE", 0);
        String stringExtra3 = L().getStringExtra("srcUsername");
        long longExtra = L().getLongExtra("message_id", 0);
        int intExtra2 = L().getIntExtra("message_index", 0);
        String stringExtra4 = L().getStringExtra("KsnsViewId");
        String stringExtra5 = L().getStringExtra("KPublisherId");
        String stringExtra6 = L().getStringExtra("KAppId");
        if (stringExtra6 == null) {
            stringExtra6 = L().getStringExtra("geta8key_open_webview_appid");
        }
        String stringExtra7 = L().getStringExtra("pre_username");
        String stringExtra8 = L().getStringExtra("expid_str");
        String string = bundleExtra.getString("key_snsad_statextstr");
        i2 k15 = this.N0.k();
        k15.f165576a = stringExtra2;
        k15.f165593r = intExtra;
        k15.f165577b = y3();
        k15.f165584i = intExtra2;
        k15.f165580e = R(stringExtra2);
        k15.f165583h = longExtra;
        k15.f165587l = new gh.q(longExtra).toString();
        k15.f165578c = stringExtra3;
        k15.f165579d = stringExtra4;
        k15.f165585j = stringExtra5;
        k15.f165586k = stringExtra6;
        k15.f165588m = stringExtra7;
        k15.f165589n = this.f164646e1;
        k15.f165590o = string;
        k15.f165591p = Z0();
        k15.f165594s = stringExtra8;
        String stringExtra9 = L().getStringExtra("share_report_pre_msg_desc");
        if (stringExtra9 == null) {
            str = "";
        } else {
            str = stringExtra9;
        }
        k15.f165592q = str;
        d.c cVar = this.f164474g;
        lh4.m.g(cVar, "browseInfo");
        k15.f165596u = cVar;
        com.tencent.mm.plugin.webview.model.h1 i27 = this.N0.i();
        i27.f165562a = stringExtra5;
        i27.f165567f = R(stringExtra2);
        this.N0.b().f165651c = y3();
        if (g1()) {
            try {
                Bundle bundle2 = new Bundle();
                bundle2.putString("srcUsername", L().getStringExtra("srcUsername"));
                U().KM(29, bundle2, g());
            } catch (Exception unused) {
            }
        }
        if (!Util.isNullOrNil(stringExtra3)) {
            try {
                U().ib0(stringExtra3);
            } catch (Exception e17) {
                Log.e(c1(), "postBinded, fail triggerGetContact, ex = " + e17.getMessage());
            }
        }
        try {
            f1();
        } catch (Exception unused2) {
            Log.e(c1(), "hy: init pay channel failed");
        }
        ((ArrayList) this.f164656o1).clear();
        kp3.l N = N();
        String stringExtra10 = L().getStringExtra("geta8key_username");
        HashMap e18 = r0.e(new wg4.l("message_id", Long.valueOf(L().getLongExtra("message_id", 0))), new wg4.l("message_index", Integer.valueOf(L().getIntExtra("message_index", 0))), new wg4.l(TPReportKeys.PlayerStep.PLAYER_BUFFERING_SCENE, Integer.valueOf(R(stringExtra10))), new wg4.l("pay_channel", Integer.valueOf(L().getIntExtra("pay_channel", 0))), new wg4.l("stastic_scene", Integer.valueOf(L().getIntExtra("stastic_scene", 0))), new wg4.l("from_scence", Integer.valueOf(L().getIntExtra("from_scence", 0))));
        String stringExtra11 = L().getStringExtra("srcUsername");
        if (stringExtra11 == null || ek4.y.n(stringExtra11)) {
            z15 = true;
        } else {
            z15 = false;
        }
        if (!z15) {
            e18.putAll(r0.e(new wg4.l("srcUsername", L().getStringExtra("srcUsername")), new wg4.l("srcDisplayname", L().getStringExtra("srcDisplayname"))));
        } else {
            if (stringExtra10 == null || ek4.y.n(stringExtra10)) {
                z16 = true;
            } else {
                z16 = false;
            }
            if (!z16) {
                e18.put("srcUsername", stringExtra10);
            }
        }
        if (!Util.isNullOrNil(L().getStringExtra("KTemplateId"))) {
            e18.put("KTemplateId", String.valueOf(L().getStringExtra("KTemplateId")));
        }
        int intExtra3 = L().getIntExtra("pay_scene", -1);
        if (intExtra3 != -1) {
            Log.i(c1(), "get pay scene from extra: %s", Integer.valueOf(intExtra3));
        } else {
            Log.i(c1(), "default pay scene to: %s", 3);
            intExtra3 = 3;
        }
        e18.put("pay_scene", Integer.valueOf(intExtra3));
        N.f247889g = e18;
        List<op3.a> list = this.f164656o1;
        ArrayList arrayList = new ArrayList();
        arrayList.add(N());
        arrayList.add(this.f164657p1);
        arrayList.add(this.f164658q1);
        arrayList.add(this.f164659r1);
        arrayList.add(this.f164660s1);
        arrayList.add(this.f164661t1);
        arrayList.add(this.f164662u1);
        arrayList.add(this.f164665x1);
        arrayList.add(this.A1);
        arrayList.add(this.B1);
        arrayList.add(this.D1);
        arrayList.add(this.f164667z1);
        arrayList.add(this.C1);
        arrayList.add(this.f164666y1);
        if (L().getBooleanExtra("allow_wx_schema_url", false)) {
            arrayList.add(this.G1);
        }
        arrayList.add(this.F1);
        ((ArrayList) list).addAll(arrayList);
        Log.i(c1(), "Abe-Debug controllerListeners call, size = %d", Integer.valueOf(this.W.size()));
        Iterator<T> it4 = this.W.iterator();
        while (it4.hasNext()) {
            System.currentTimeMillis();
            it4.next().e();
            System.currentTimeMillis();
            c1();
        }
        com.tencent.mm.plugin.report.service.q.INSTANCE.idkeyStat(64, 0, 1, false);
        try {
            i16 = Util.getInt(U().qa0("WebviewDisableDigestVerify"), 0);
        } catch (Exception e19) {
            Log.w(c1(), "getting js digest verification config fails, ex = " + e19.getMessage());
            i16 = 0;
        }
        Log.i(c1(), "js digest verification config = %d", Integer.valueOf(i16));
        if (i16 == 0) {
            SharedPreferences sharedPreferences = H().getSharedPreferences("com.tencent.mm_webview_x5_preferences", 4);
            lh4.m.f(sharedPreferences, "context.getSharedPrefere…ntext.MODE_MULTI_PROCESS)");
            if (sharedPreferences.getBoolean("wvsha1", true) && this.f164464b.f9914c) {
                N().s0(true);
            }
        }
        try {
            h1(y3());
        } catch (Exception e25) {
            Log.w(c1(), "postBinded, jumpToActivity, ex = " + e25.getMessage());
        }
        this.S.a("onPostBindedEnd", System.currentTimeMillis());
    }

    /* JADX WARNING: Failed to process nested try/catch */
    /* JADX WARNING: Missing exception handler attribute for start block: B:7:0x0068 */
    @Override // b10.t, com.tencent.mm.plugin.webview.core.BaseWebViewController
    public void onDestroy() {
        if (a0(this.f164471e0)) {
            ((p) ((wg4.n) this.Z0).getValue()).a("", Util.nowSecond(), 0);
        }
        com.tencent.mm.plugin.webview.ui.tools.g gVar = (com.tencent.mm.plugin.webview.ui.tools.g) ((wg4.n) this.f164645d1).getValue();
        gVar.getClass();
        Log.i("MicroMsg.WebView.MMSslErrorHandler", "detach");
        gVar.f167151a = null;
        gVar.f167152b = null;
        ((HashMap) gVar.f167153c).clear();
        ((HashMap) gVar.f167154d).clear();
        if (g1()) {
            Bundle bundle = new Bundle();
            bundle.putString("srcUsername", L().getStringExtra("srcUsername"));
            U().KM(30, bundle, g());
        }
        try {
            U().xi(Y0().e());
        } catch (Exception e15) {
            String c15 = c1();
            Log.i(c15, "onDestroy remove callbacker ex " + e15.getMessage());
        }
        super.onDestroy();
    }

    @Override // com.tencent.xweb.WebViewClient
    public void onLoadResource(WebView webView, String str) {
        lh4.m.g(str, "url");
        String c15 = c1();
        Log.i(c15, "edw onLoadResource opt, url = " + str);
        if (A(str)) {
            String c16 = c1();
            Log.f(c16, "onLoadResource, canLoadUrl fail, url = " + str);
            super.onLoadResource(webView, str);
            return;
        }
        l2.f f15 = this.N0.f();
        f15.getClass();
        if (Util.isNullOrNil(str)) {
            Log.e("MicroMsg.WebviewReporter", "WebViewRenderReporter.onLoadResource failed, url is null");
        } else {
            try {
                if (!Util.isNullOrNil(f15.f165657c) && !str.equals(f15.f165657c) && f15.f165658d) {
                    if (f15.f165655a.containsKey(f15.f165657c)) {
                        f15.f165655a.put(f15.f165657c, Long.valueOf(Util.nowMilliSecond() - f15.f165655a.get(f15.f165657c).longValue()));
                    }
                    f15.f165658d = false;
                }
            } catch (Exception e15) {
                Log.printErrStackTrace("MicroMsg.WebviewReporter", e15, "onLoadResource", new Object[0]);
            }
        }
        super.onLoadResource(webView, str);
    }

    @Override // com.tencent.xweb.WebViewClient, com.tencent.mm.plugin.webview.core.BaseWebViewController
    public void onPageCommitVisible(WebView webView, String str) {
        super.onPageCommitVisible(webView, str);
        this.S.a("onPageCommit", System.currentTimeMillis());
    }

    /* JADX WARNING: Removed duplicated region for block: B:45:0x01d3  */
    /* JADX WARNING: Removed duplicated region for block: B:53:0x01f3 A[Catch:{ Exception -> 0x0223 }] */
    /* JADX WARNING: Removed duplicated region for block: B:54:0x01f9 A[Catch:{ Exception -> 0x0223 }] */
    /* JADX WARNING: Removed duplicated region for block: B:70:0x023a  */
    /* JADX WARNING: Removed duplicated region for block: B:71:0x023d  */
    /* JADX WARNING: Removed duplicated region for block: B:74:0x025f  */
    /* JADX WARNING: Removed duplicated region for block: B:77:0x027c  */
    /* JADX WARNING: Removed duplicated region for block: B:79:0x0295  */
    @Override // com.tencent.xweb.WebViewClient, com.tencent.mm.plugin.webview.core.BaseWebViewController
    public void onPageFinished(WebView webView, String str) {
        String str2;
        l2 l2Var;
        int i15;
        p1 p1Var;
        String str3;
        boolean booleanExtra;
        Parcelable parcelable;
        int i16;
        boolean z15;
        String str4;
        String str5;
        int i17;
        int i18;
        int i19;
        int i25;
        super.onPageFinished(webView, str);
        this.S.a("onPageFinished", System.currentTimeMillis());
        com.tencent.mm.plugin.webview.model.a.c(this.f164462a, str);
        if (!u(str)) {
            if (!this.f164649h1) {
                this.f164649h1 = true;
                wq3.w wVar = this.f164478i;
                if (wVar != null) {
                    wVar.f334883l = System.currentTimeMillis();
                }
                wq3.w wVar2 = this.f164478i;
                if (wVar2 != null) {
                    str2 = "";
                    wVar2.f334878g = wVar2.f334880i - wVar2.f334879h;
                    long j15 = wVar2.f334883l - wVar2.f334872a;
                    if (j15 > 0) {
                        if (d60.z.n().a().f224329e.f224335f > wVar2.f334872a) {
                            z15 = true;
                        } else {
                            z15 = false;
                        }
                        wVar2.f334876e = z15;
                        Log.i("MicroMsg.WebViewPerformanceMonitor", "Web-Trace Report kernelMode=" + wVar2.f334873b + ", progressMode=" + wVar2.f334874c + ", progressLaunchTime=" + wVar2.f334875d + ", isProgressColdLaunch=" + wVar2.f334876e + ", webViewCreateTime=" + wVar2.f334877f + ", bindCostTime=" + wVar2.f334878g + ",isMPPreloadController=" + wVar2.f334881j + ", isRenderProcessInit:" + wVar2.f334884m + ", isGPUProcessInit:" + wVar2.f334886o + ", isRenderSandBoxProcessInit:" + wVar2.f334885n + ", onPageFinishedTime:" + j15);
                        if (str == null) {
                            str4 = str2;
                        } else {
                            str4 = str;
                        }
                        try {
                            str5 = URLEncoder.encode(str4, "UTF-8");
                        } catch (Throwable unused) {
                            str5 = str2;
                        }
                        com.tencent.mm.plugin.report.service.q qVar = com.tencent.mm.plugin.report.service.q.INSTANCE;
                        Object[] objArr = new Object[18];
                        objArr[0] = Integer.valueOf(wVar2.f334873b);
                        objArr[1] = Integer.valueOf(wVar2.f334874c);
                        objArr[2] = Long.valueOf(wVar2.f334875d);
                        objArr[3] = Integer.valueOf(wVar2.f334876e ? 1 : 0);
                        objArr[4] = Long.valueOf(wVar2.f334877f);
                        objArr[5] = Long.valueOf(wVar2.f334878g);
                        objArr[6] = Integer.valueOf(wVar2.f334881j ? 1 : 0);
                        objArr[7] = Integer.valueOf(XWebSdk.getXWebSdkVersion());
                        objArr[8] = Integer.valueOf(XWebSdk.getInstalledNewstVersion(MMApplicationContext.getContext()));
                        objArr[9] = Integer.valueOf(XWebSdk.getMultiProcessType());
                        if (XWebSdk.getEnableSandbox()) {
                            i17 = 1;
                        } else {
                            i17 = 2;
                        }
                        objArr[10] = Integer.valueOf(i17);
                        objArr[11] = 1;
                        objArr[12] = Long.valueOf(j15);
                        if (wVar2.f334884m) {
                            i18 = 2;
                        } else {
                            i18 = 1;
                        }
                        objArr[13] = Integer.valueOf(i18);
                        if (wVar2.f334885n) {
                            i19 = 2;
                        } else {
                            i19 = 1;
                        }
                        objArr[14] = Integer.valueOf(i19);
                        if (wVar2.f334886o) {
                            i25 = 2;
                        } else {
                            i25 = 1;
                        }
                        objArr[15] = Integer.valueOf(i25);
                        objArr[16] = str5;
                        int i26 = com.tencent.mm.pluginsdk.model.q1.f171483a;
                        objArr[17] = 3;
                        qVar.g(25365, objArr);
                    }
                    Log.i(c1(), "edw onPageFinished opt, url = %s", str);
                    l2Var = this.N0;
                    if (l2Var.f165641m == null) {
                        l2Var.f165641m = new l2.c();
                    }
                    l2.c cVar = l2Var.f165641m;
                    if (cVar.f165652a && !cVar.f165653b) {
                        Uri parse = Uri.parse(str);
                        if (str.startsWith(ProxyConfig.MATCH_HTTP)) {
                            Log.i("MicroMsg.WebviewReporter.DomainReporter", "onPageFinished, url not startswith http");
                        } else {
                            String host = parse.getHost();
                            if (host != null && host.equalsIgnoreCase("v.html5.qq.com")) {
                                com.tencent.mm.plugin.report.service.q.INSTANCE.idkeyStat(283, 0, 1, true);
                                i16 = 1;
                                try {
                                    cVar.f165653b = true;
                                    Object[] objArr2 = new Object[1];
                                    objArr2[0] = str;
                                    Log.i("MicroMsg.WebviewReporter.DomainReporter", "onPageFinished, domain visit reported, url = %s", objArr2);
                                } catch (Exception unused2) {
                                    Object[] objArr3 = new Object[i16];
                                    i15 = 0;
                                    objArr3[0] = str;
                                    Log.e("MicroMsg.WebviewReporter.DomainReporter", "onPageFinished, parse url fail, url = %s", objArr3);
                                    p1Var = p1.f168890i;
                                    if (!Util.isNullOrNil(p1Var.f168891a)) {
                                    }
                                    ((com.tencent.mm.plugin.webview.modeltools.c0) ((wg4.n) this.f164647f1).getValue()).a(str);
                                    booleanExtra = L().getBooleanExtra("shouldForceViewPort", false);
                                    c1();
                                    if (booleanExtra) {
                                    }
                                    lh4.m.d(str);
                                    if (!A(str)) {
                                    }
                                }
                            }
                        }
                    }
                    i15 = 0;
                    p1Var = p1.f168890i;
                    if (!Util.isNullOrNil(p1Var.f168891a)) {
                        str3 = str2;
                    } else {
                        str3 = str2;
                        p1Var.d(2, str3, i15);
                    }
                    ((com.tencent.mm.plugin.webview.modeltools.c0) ((wg4.n) this.f164647f1).getValue()).a(str);
                    booleanExtra = L().getBooleanExtra("shouldForceViewPort", false);
                    c1();
                    if (booleanExtra) {
                        String stringExtra = L().getStringExtra("view_port_code");
                        lh4.m.d(webView);
                        webView.evaluateJavascript(stringExtra, null);
                    }
                    lh4.m.d(str);
                    if (!A(str)) {
                        Log.f(c1(), "onPageFinished, canLoadUrl fail, url = " + str);
                        return;
                    } else if (lh4.m.b(str, this.f164650i1)) {
                        Log.i(c1(), "onPageFinished, js is finished loaded");
                        return;
                    } else {
                        l2.l e15 = this.N0.e();
                        e15.getClass();
                        if (Util.isNullOrNil(str)) {
                            Log.e("MicroMsg.WebviewReporter", "WebviewOpenUrl.stopLoadUrl failed, url is null");
                        } else if (e15.f165670a.containsKey(str)) {
                            e15.f165670a.put(str, Long.valueOf(Util.nowMilliSecond() - e15.f165670a.get(str).longValue()));
                        }
                        l2.f f15 = this.N0.f();
                        f15.getClass();
                        if (Util.isNullOrNil(str)) {
                            Log.e("MicroMsg.WebviewReporter", "WebViewRenderReporter.onPageFinish failed, url is null");
                        } else {
                            try {
                                if (f15.f165656b.containsKey(str)) {
                                    f15.f165656b.put(str, Long.valueOf(Util.nowMilliSecond() - f15.f165656b.get(str).longValue()));
                                }
                            } catch (Exception e16) {
                                Log.printErrStackTrace("MicroMsg.WebviewReporter", e16, "onPageFinish", new Object[0]);
                            }
                        }
                        l2 l2Var2 = this.N0;
                        if (l2Var2.f165634f == null) {
                            l2Var2.f165634f = new l2.g(l2Var2);
                        }
                        l2.g gVar = l2Var2.f165634f;
                        if (!gVar.f165663c) {
                            gVar.f165663c = true;
                            int g15 = l2.g();
                            long nowMilliSecond = Util.nowMilliSecond() - gVar.f165661a;
                            if (nowMilliSecond >= 0 && nowMilliSecond <= ApkDownloadManager.INTERVAL) {
                                String str6 = gVar.f165665e;
                                Object[] objArr4 = new Object[11];
                                objArr4[0] = 4;
                                objArr4[1] = Long.valueOf(nowMilliSecond);
                                objArr4[2] = Integer.valueOf(g15);
                                String str7 = gVar.f165662b;
                                if (str7 != null) {
                                    str7 = str7.replace(",", "!");
                                }
                                objArr4[3] = str7;
                                objArr4[4] = 0;
                                objArr4[5] = 0;
                                objArr4[6] = 0;
                                objArr4[7] = Integer.valueOf(l2.f165627t);
                                objArr4[8] = Integer.valueOf(l2.f165628u);
                                objArr4[9] = Integer.valueOf(gVar.f165664d);
                                objArr4[10] = gVar.f165665e;
                                l2.a(str6, objArr4);
                                Log.i("MicroMsg.WebviewReporter", "WebViewTotalTimeReporter.report url : %s, cost time : %d, netType : %d, %d, %d, getA8KeyScene:%d, prePublishid:%s", gVar.f165662b, Long.valueOf(nowMilliSecond), Integer.valueOf(g15), Integer.valueOf(l2.f165627t), Integer.valueOf(l2.f165628u), Integer.valueOf(gVar.f165664d), gVar.f165665e);
                            }
                        }
                        Bundle bundle = (Bundle) L().getParcelableExtra("jsapiargs");
                        if (!(bundle == null || (parcelable = bundle.getParcelable("KSnsAdTag")) == null || !(parcelable instanceof SnsAdClick))) {
                            String string = bundle.getString("KAnsUxInfo", str3);
                            this.N0.h().f165457a = (SnsAdClick) parcelable;
                            a2 h15 = this.N0.h();
                            lh4.m.f(string, "uxInfo");
                            h15.b(str, "1", System.currentTimeMillis() + str3, string);
                            this.N0.h().a();
                        }
                        r1.f169083a.a(L(), str, true);
                        this.f164655n1 = Util.nowSecond();
                        return;
                    }
                }
            }
            str2 = "";
            Log.i(c1(), "edw onPageFinished opt, url = %s", str);
            l2Var = this.N0;
            if (l2Var.f165641m == null) {
            }
            l2.c cVar2 = l2Var.f165641m;
            try {
                Uri parse2 = Uri.parse(str);
                if (str.startsWith(ProxyConfig.MATCH_HTTP)) {
                }
                i15 = 0;
            } catch (Exception unused3) {
                i16 = 1;
                Object[] objArr32 = new Object[i16];
                i15 = 0;
                objArr32[0] = str;
                Log.e("MicroMsg.WebviewReporter.DomainReporter", "onPageFinished, parse url fail, url = %s", objArr32);
                p1Var = p1.f168890i;
                if (!Util.isNullOrNil(p1Var.f168891a)) {
                }
                ((com.tencent.mm.plugin.webview.modeltools.c0) ((wg4.n) this.f164647f1).getValue()).a(str);
                booleanExtra = L().getBooleanExtra("shouldForceViewPort", false);
                c1();
                if (booleanExtra) {
                }
                lh4.m.d(str);
                if (!A(str)) {
                }
            }
            p1Var = p1.f168890i;
            if (!Util.isNullOrNil(p1Var.f168891a)) {
            }
            ((com.tencent.mm.plugin.webview.modeltools.c0) ((wg4.n) this.f164647f1).getValue()).a(str);
            booleanExtra = L().getBooleanExtra("shouldForceViewPort", false);
            c1();
            if (booleanExtra) {
            }
            lh4.m.d(str);
            if (!A(str)) {
            }
        }
    }

    @Override // com.tencent.xweb.WebViewClient, com.tencent.mm.plugin.webview.core.BaseWebViewController
    public void onPageStarted(WebView webView, String str, Bitmap bitmap) {
        Parcelable parcelable;
        lh4.m.g(webView, "view");
        lh4.m.g(str, "url");
        this.f164648g1 = true;
        super.onPageStarted(webView, str, bitmap);
        Q().a("onPageStarted", System.currentTimeMillis());
        com.tencent.mm.plugin.webview.model.a.c(Z(), str);
        if (!u(str)) {
            if (!Z().supportFeature(2006)) {
                N().i();
            }
            wq3.y.a(str);
            String c15 = c1();
            Log.i(c15, "edw onPageStarted opt, url = " + str);
            com.tencent.mm.plugin.report.service.q.INSTANCE.idkeyStat(155, 0, 1, false);
            ((e00.l) yz3.j.c(e00.l.class)).kn(X0(), 0);
            if (CrashReportFactory.hasDebuger() && lh4.m.b("http://www.dktest-mmcrash.com/", str)) {
                Assert.assertTrue("test errlog in tools " + new SimpleDateFormat(TimeUtil.YYYY2MM2DD_HH1MM1SS).format(new Date()), false);
            }
            this.f164646e1 = D3();
            ((p) ((wg4.n) this.Z0).getValue()).b(str, Util.nowSecond(), 1);
            this.N0.k().a(this.f164646e1);
            E0(str);
            p1.f168890i.c(str);
            c1();
            if (A(str)) {
                String c16 = c1();
                Log.f(c16, "onPageStarted, canLoadUrl fail, url = " + str);
                return;
            }
            ((com.tencent.mm.plugin.webview.modeltools.c0) ((wg4.n) this.f164647f1).getValue()).a(str);
            l2.l e15 = this.N0.e();
            e15.a(J3(), X0());
            e15.b(str);
            Bundle bundle = (Bundle) L().getParcelableExtra("jsapiargs");
            if (!(bundle == null || (parcelable = bundle.getParcelable("KSnsAdTag")) == null || !(parcelable instanceof SnsAdClick))) {
                String string = bundle.getString("KAnsUxInfo", "");
                this.N0.h().c((SnsAdClick) parcelable);
                a2 h15 = this.N0.h();
                lh4.m.f(string, "uxInfo");
                h15.b(str, "0", System.currentTimeMillis() + "", string);
                this.N0.h().a();
            }
            r1.f169083a.a(L(), str, false);
            if (!this.f164657p1.b(str) && this.f164464b.f9918g) {
                if (com.tencent.mm.plugin.webview.modeltools.o.f165951a == null) {
                    com.tencent.mm.plugin.webview.modeltools.o.f165951a = new ArrayList<>();
                }
                if (!com.tencent.mm.plugin.webview.modeltools.o.f165951a.contains(str)) {
                    com.tencent.mm.plugin.webview.modeltools.o.f165951a.add(str);
                }
            }
        }
    }

    @Override // com.tencent.xweb.WebViewClient, com.tencent.mm.plugin.webview.core.BaseWebViewController
    public void onReceivedError(WebView webView, int i15, String str, String str2) {
        if (!a0(this.f164471e0)) {
            Log.i(c1(), "onReceivedError, intent not ready");
            return;
        }
        String domainString = WeChatHosts.domainString(R.string.fy9);
        boolean isConnected = NetStatusUtil.isConnected(MMApplicationContext.getContext());
        Log.e(c1(), "edw onReceivedError, failingUrl = %s, errorCode = %d, desc = %s, isNetworkConnected = %b, allowFileAccess = %b", str2, Integer.valueOf(i15), str, Boolean.valueOf(isConnected), Boolean.valueOf(this.f164462a.getSettings().getAllowFileAccess()));
        com.tencent.mm.plugin.report.service.q qVar = com.tencent.mm.plugin.report.service.q.INSTANCE;
        qVar.idkeyStat(155, 1, 1, false);
        qVar.idkeyStat(155, (long) aq3.a.a(i15), 1, false);
        ((e00.l) yz3.j.c(e00.l.class)).kn(X0(), 1);
        ((e00.l) yz3.j.c(e00.l.class)).kn(X0(), aq3.a.a(i15));
        ((e00.l) yz3.j.c(e00.l.class)).O50(X0(), y3(), aq3.a.a(i15), this.N0.i().f165563b);
        super.onReceivedError(webView, i15, str, str2);
        p1 p1Var = p1.f168890i;
        if (!Util.isNullOrNil(p1Var.f168891a)) {
            p1Var.d(3, "", i15);
        }
        this.N0.h().f165458b = i15;
        r1.f169084b = i15;
        if (((Boolean) ((wg4.n) this.Y0).getValue()).booleanValue()) {
            o0();
        }
        try {
            if (lh4.m.b(new URL(str2).getHost(), domainString)) {
                ((xc4.j) xc4.j.f338034d).g(new a0(str2, i15, domainString, this), "WebViewUI.CheckDNS");
            }
        } catch (MalformedURLException e15) {
            Log.printErrStackTrace(c1(), e15, "check mp url", new Object[0]);
        }
        super.onReceivedError(webView, i15, str, str2);
    }

    @Override // com.tencent.xweb.WebViewClient, com.tencent.mm.plugin.webview.core.BaseWebViewController
    public void onReceivedSslError(WebView webView, SslErrorHandler sslErrorHandler, SslError sslError) {
        String str;
        String str2;
        if (!a0(this.f164471e0)) {
            Log.i(c1(), "onReceivedSslError, intent not ready");
            return;
        }
        if (webView != null) {
            str = webView.getUrl();
        } else {
            str = null;
        }
        if (str == null) {
            str2 = this.f164506w;
        } else {
            str2 = webView.getUrl();
        }
        if (str2 != null) {
            String yy02 = ((r21.d) d60.z.q(r21.d.class)).yy0();
            lh4.m.f(yy02, "service(IBrandService::class.java).hardCodeUrl");
            if (ek4.y.v(str2, yy02, false)) {
                str2 = y3();
            }
        }
        com.tencent.mm.plugin.report.service.q qVar = com.tencent.mm.plugin.report.service.q.INSTANCE;
        qVar.idkeyStat(155, 1, 1, false);
        qVar.idkeyStat(155, 30, 1, false);
        ((e00.l) yz3.j.c(e00.l.class)).kn(X0(), 1);
        ((e00.l) yz3.j.c(e00.l.class)).kn(X0(), 30);
        ((e00.l) yz3.j.c(e00.l.class)).O50(X0(), y3(), 30, this.N0.i().f165563b);
        ((com.tencent.mm.plugin.webview.ui.tools.g) ((wg4.n) this.f164645d1).getValue()).b(str2, sslErrorHandler, sslError);
        super.onReceivedSslError(webView, sslErrorHandler, sslError);
    }

    /* JADX WARNING: Removed duplicated region for block: B:12:0x0057  */
    @Override // com.tencent.mm.plugin.webview.core.BaseWebViewController
    public void p0() {
        int i15;
        String url;
        boolean z15;
        boolean z16;
        try {
            if (U().Vy()) {
                if (this.f164464b.f9915d) {
                    i15 = wq3.n.b(H(), U(), y3());
                } else {
                    i15 = wq3.n.a(H());
                }
                i1(i15);
                url = this.f164462a.getUrl();
                if (!Util.isNullOrNil(url)) {
                    Set<String> set = this.f164651j1;
                    lh4.m.d(url);
                    if (((HashSet) set).add(url)) {
                        GeneralControlWrapper b15 = this.O.b();
                        lh4.m.f(b15, "wvPerm.genCtrl");
                        boolean z17 = false;
                        if ((b15.f173509d & 512) > 0) {
                            z15 = true;
                        } else {
                            z15 = false;
                        }
                        if (z15) {
                            kp3.l N = N();
                            Log.i("MicroMsg.JsApiHandler", "getAllHostsInPage, ready(%s).", Boolean.valueOf(N.f247890h));
                            MMWebView mMWebView = N.f247883a;
                            if (mMWebView != null && N.f247890h) {
                                mMWebView.evaluateJavascript("javascript:WeixinJSBridge._handleMessageFromWeixin(" + h1.a.c("sys:get_all_hosts", new HashMap(), N.f247898p, N.f247899q) + ")", null);
                            }
                        }
                        if ((b15.f173509d & 1024) > 0) {
                            z16 = true;
                        } else {
                            z16 = false;
                        }
                        if (z16) {
                            N().p(false);
                            return;
                        }
                        u1 u1Var = this.f164642a1;
                        u1Var.getClass();
                        if (!Util.isNullOrNil(url)) {
                            String host = Uri.parse(url).getHost();
                            if (!Util.isNullOrNil(host)) {
                                z17 = ((HashSet) u1Var.f165818b).remove(host);
                            }
                        }
                        if (z17) {
                            N().p(true);
                        }
                    }
                }
                super.p0();
            }
        } catch (Exception e15) {
            Log.e(c1(), "onLoadJsApiFinished, ex = " + e15.getMessage());
        }
        i15 = 2;
        i1(i15);
        url = this.f164462a.getUrl();
        if (!Util.isNullOrNil(url)) {
        }
        super.p0();
    }

    @Override // com.tencent.mm.plugin.webview.core.BaseWebViewController
    public void q0() {
        wg4.g gVar = aq3.d.f7969a;
        com.tencent.mm.plugin.report.service.q.INSTANCE.v(1200, 100, 1);
        for (T t15 : this.W) {
            if (t15 instanceof a0) {
                t15.r(this.S);
            }
        }
        wq3.v vVar = this.S;
        MMWebView mMWebView = this.f164462a;
        z zVar = new z(this);
        vVar.getClass();
        lh4.m.g(mMWebView, "webView");
        mMWebView.evaluateJavascript("JSON.stringify(Object.assign({timing: performance && performance.timing}, {paint:{'firstContentfulPaint':(function(p){return p[0] && parseInt(p[0].startTime + performance.timeOrigin)})(performance.getEntriesByName('first-contentful-paint'))}}))", new wq3.u(vVar, zVar));
    }

    @Override // com.tencent.mm.plugin.webview.core.BaseWebViewController
    /* renamed from: s0 */
    public boolean j(int i15, String str, z62 z622) {
        long j15;
        lh4.m.g(str, "reqUrl");
        lh4.m.g(z622, "response");
        p40 p402 = z622.f44143u;
        if (p402 != null) {
            j15 = p402.f32653d;
        } else {
            j15 = -1;
        }
        this.E1 = j15;
        l2 l2Var = this.N0;
        String str2 = z622.f44129d;
        lh4.m.f(str2, "response.FullURL");
        boolean v15 = ek4.y.v(str2, HttpWrapperBase.PROTOCAL_HTTPS, false);
        l2Var.getClass();
        l2.f165627t = 0;
        if (v15) {
            l2.f165628u = 1;
        } else {
            l2.f165628u = 0;
        }
        l2 l2Var2 = this.N0;
        if (l2Var2.f165630b == null) {
            l2Var2.f165630b = new l2.k(l2Var2);
        }
        l2Var2.f165630b.a(str, true);
        l2.f f15 = this.N0.f();
        int i16 = oq3.h.f278060c;
        String X02 = X0();
        f15.f165659e = i16;
        f15.f165660f = X02;
        String str3 = z622.f44129d;
        if (Util.isNullOrNil(str3)) {
            Log.e("MicroMsg.WebviewReporter", "WebViewRenderReporter.onPageStart failed, url is null");
        } else {
            f15.f165657c = str3;
            f15.f165658d = true;
            if (!f15.f165655a.containsKey(str3)) {
                f15.f165655a.put(str3, Long.valueOf(Util.nowMilliSecond()));
            }
            if (!f15.f165656b.containsKey(str3)) {
                f15.f165656b.put(str3, Long.valueOf(Util.nowMilliSecond()));
            }
        }
        return super.j(i15, str, z622);
    }

    @Override // com.tencent.mm.plugin.webview.core.BaseWebViewController
    public void t0(com.tencent.mm.plugin.webview.stub.l lVar) {
        boolean z15;
        String c15 = c1();
        Object[] objArr = new Object[1];
        if (lVar == null) {
            z15 = true;
        } else {
            z15 = false;
        }
        objArr[0] = Boolean.valueOf(z15);
        Log.i(c15, "onServiceConnected, invoker == null ? %b", objArr);
        if (lVar == null) {
            Log.f(c1(), "service connect success, while invoker is null");
            o0();
            return;
        }
        try {
            lVar.qf0(Y0(), Y0().e());
        } catch (Exception e15) {
            Log.e(c1(), "addCallback fail, ex = %s", e15.getMessage());
        }
    }

    @Override // com.tencent.mm.plugin.webview.core.BaseWebViewController
    public boolean u(String str) {
        return false;
    }

    @Override // com.tencent.mm.plugin.webview.core.BaseWebViewController
    public boolean u0() {
        boolean z15;
        Log.i(c1(), "edw onServiceDisconnected");
        Iterator<b0> it = this.U.iterator();
        while (true) {
            if (it.hasNext()) {
                if (it.next().u()) {
                    z15 = true;
                    break;
                }
            } else {
                z15 = false;
                break;
            }
        }
        if (z15) {
            return false;
        }
        Log.i(c1(), "maybe mm process crash, try rebind service");
        return true;
    }

    @Override // com.tencent.mm.plugin.webview.core.BaseWebViewController
    public void v0() {
        boolean z15;
        xp3.a aVar = xp3.a.f340537f;
        xp3.b bVar = xp3.b.NothingComplete;
        Iterator<b0> it = this.U.iterator();
        while (it.hasNext()) {
            if (it.next().p(y3(), L())) {
                return;
            }
        }
        if (!d1(y3())) {
            if (l0()) {
                Log.i(c1(), "needSyncGetA8Key");
                xp3.c cVar = this.f164472f;
                cVar.getClass();
                cVar.f340563n = bVar;
                xp3.f.f340585a.b(aVar, this.f164472f);
                BaseWebViewController.J0(this, y3(), false, 0, 6, null);
                return;
            }
            Log.i(c1(), "terry onStartLoad:" + y3());
            String str = (String) ((wg4.n) this.f164465b0).getValue();
            if (str == null || ek4.y.n(str)) {
                z15 = true;
            } else {
                z15 = false;
            }
            if (!z15) {
                Log.i(c1(), str);
                if (L().getBooleanExtra("QRDataFlag", true)) {
                    try {
                        str = U().AT(str);
                    } catch (Exception e15) {
                        Log.w(c1(), "postBinded, formatQRString, ex = " + e15.getMessage());
                    }
                }
                this.f164462a.getSettings().setUseWideViewPort(false);
                this.f164462a.getSettings().setLoadWithOverviewMode(false);
                this.f164462a.getSettings().setJavaScriptEnabled(false);
                Iterator<z> it4 = this.W.iterator();
                while (it4.hasNext()) {
                    it4.next().p(true);
                }
                this.f164462a.loadDataWithBaseURL(null, str, "text/html", "utf-8", null);
                Log.i(c1(), "loadDataWithBaseUrl, data = " + str);
            } else if (A(y3())) {
                Log.f(c1(), "postBinded 2, canLoadUrl fail, url = " + y3());
            } else {
                if (this.f164464b.f9916e) {
                    this.O.g(y3(), null, null);
                }
                Iterator<b0> it5 = this.U.iterator();
                while (it5.hasNext()) {
                    if (it5.next().o(y3())) {
                        return;
                    }
                }
                if (!this.f164462a.f187323e) {
                    xp3.c cVar2 = this.f164472f;
                    cVar2.getClass();
                    cVar2.f340563n = bVar;
                    xp3.f.f340585a.b(aVar, this.f164472f);
                    Iterator<z> it6 = this.W.iterator();
                    while (it6.hasNext()) {
                        it6.next().p(false);
                    }
                    t.a.a(this, y3(), null, false, 6, null);
                }
            }
        }
    }

    @Override // com.tencent.mm.plugin.webview.core.BaseWebViewController
    public boolean w0(int i15, String str, z62 z622) {
        boolean z15;
        lh4.m.g(str, "reqUrl");
        lh4.m.g(z622, "resp");
        int i16 = z622.f44131f;
        String str2 = z622.f44129d;
        if (i16 == 3) {
            Log.i(c1(), "getA8key-app: " + str2);
            if (str2 == null || str2.length() == 0) {
                z15 = true;
            } else {
                z15 = false;
            }
            if (z15) {
                Log.e(c1(), "getA8key-app, fullUrl is null");
                return false;
            }
            U0(str2);
            return true;
        } else if (i16 == 4) {
            lh4.m.f(str2, "fullUrl");
            if (Util.isNullOrNil(str2)) {
                Log.e(c1(), "search contact err: null or nill url");
            } else {
                T0(106);
                Bundle bundle = new Bundle();
                bundle.putString("search_contact_data_url", str2);
                bundle.putInt("webview_binder_id", Y0().e());
                try {
                    U().xX(106, bundle);
                } catch (Exception e15) {
                    Log.w(c1(), "startSearchContact, ex = " + e15.getMessage());
                }
            }
            return true;
        } else if (i16 != 20) {
            return super.w0(i15, str, z622);
        } else {
            lh4.m.f(str2, "fullUrl");
            T0(106);
            Bundle bundle2 = new Bundle();
            bundle2.putString("emoji_store_jump_url", str2);
            bundle2.putInt("webview_binder_id", Y0().e());
            try {
                U().xX(eo0.f.CTRL_INDEX, bundle2);
            } catch (Exception e16) {
                Log.w(c1(), "startSearchContact, ex = " + e16.getMessage());
            }
            return true;
        }
    }

    @Override // com.tencent.mm.plugin.webview.core.BaseWebViewController
    public boolean x0(WebView webView, String str) {
        MMWebView mMWebView;
        lh4.m.g(webView, "webView");
        lh4.m.g(str, "url");
        String c15 = c1();
        Log.i(c15, "WebView-Trace shouldOverride url = " + str);
        if (!this.f164657p1.b(str) && this.f164464b.f9918g) {
            if (com.tencent.mm.plugin.webview.modeltools.o.f165951a == null) {
                com.tencent.mm.plugin.webview.modeltools.o.f165951a = new ArrayList<>();
            }
            if (!com.tencent.mm.plugin.webview.modeltools.o.f165951a.contains(str)) {
                com.tencent.mm.plugin.webview.modeltools.o.f165951a.add(str);
            }
        }
        b0.a f05 = f0(webView, str);
        if (f05.f164560a) {
            return f05.f164561b;
        }
        if (A(str)) {
            String c16 = c1();
            Log.f(c16, "shouldOverrideUrlLoading, canLoadUrl fail, url = " + str);
            return true;
        } else if (bd.d.c(str, "about:blank", true)) {
            Log.e(c1(), "shouldOverride, url is about:blank");
            return true;
        } else if (((kq.p) yz3.j.c(kq.p.class)).R30(str, X0(), webView)) {
            Log.i(c1(), "use the downloader to download");
            return true;
        } else if (bd.d.c(str, "weixinping://iframe", true) || bd.d.c(str, "weixinpreinject://iframe", true)) {
            return true;
        } else {
            if (V0(str)) {
                String c17 = c1();
                Log.i(c17, "weixin scheme url deal success, url = " + str);
                return true;
            } else if (U0(str)) {
                String c18 = c1();
                Log.i(c18, "custom scheme url deal success, url = " + str);
                return true;
            } else {
                if (webView instanceof MMWebView) {
                    mMWebView = (MMWebView) webView;
                } else {
                    mMWebView = null;
                }
                com.tencent.mm.plugin.webview.model.a.c(mMWebView, str);
                return false;
            }
        }
    }

    /* JADX INFO: super call moved to the top of the method (can break code semantics) */
    public y(MMWebView mMWebView, l2 l2Var, t.b bVar, Set<String> set, kp3.i iVar) {
        super(mMWebView, bVar, set, iVar);
        lh4.m.g(mMWebView, "viewWV");
        lh4.m.g(l2Var, "webviewReportMgr");
        lh4.m.g(bVar, "options");
        this.N0 = l2Var;
        this.O0 = wg4.h.a(new q(this));
        this.P0 = wg4.h.a(f0.f164684d);
        this.T0 = new com.tencent.mm.plugin.webview.ui.tools.floatball.c();
        this.W0 = wg4.h.a(new u(this));
        this.X0 = wg4.h.a(new w(this));
        this.Y0 = wg4.h.a(new v(this));
        this.Z0 = wg4.h.a(new g0(this));
        this.f164642a1 = new u1(H());
        this.f164643b1 = wg4.h.a(new x(this));
        this.f164645d1 = wg4.h.a(new e0(mMWebView));
        this.f164647f1 = wg4.h.a(c0.f164677d);
        this.f164650i1 = "file:///android_asset/jsapi/wxjs.js";
        this.f164651j1 = new HashSet();
        this.f164652k1 = wg4.h.a(new d0(this));
        this.f164653l1 = new s(new WeakReference(this));
        this.f164654m1 = new r(new WeakReference(this));
        this.f164656o1 = new ArrayList();
        this.f164657p1 = new C1702y(bVar, this);
        this.f164658q1 = new i(this);
        this.f164659r1 = new d(this);
        this.f164660s1 = new j(this);
        this.f164661t1 = new k(this);
        this.f164662u1 = new a(this);
        this.f164664w1 = true;
        this.f164665x1 = new o(this, mMWebView);
        this.f164666y1 = new h(this);
        this.f164667z1 = new n(this);
        this.A1 = new f(this);
        this.B1 = new b(this);
        this.C1 = new l(this);
        this.D1 = new c(this);
        this.F1 = new e(this, mMWebView);
        this.G1 = new g(this);
    }

    /* JADX INFO: this call moved to the top of the method (can break code semantics) */
    public y(MMWebView mMWebView, l2 l2Var, t.b bVar) {
        this(mMWebView, l2Var, bVar, null, null, 16, null);
        lh4.m.g(mMWebView, "viewWV");
        lh4.m.g(l2Var, "webviewReportMgr");
        lh4.m.g(bVar, "options");
    }
}