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


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

import android.app.Dialog;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageInfo;
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.Parcelable;
import android.util.SparseBooleanArray;
import android.view.MotionEvent;
import android.view.View;
import aq3.d;
import b10.t;
import bw3.b72;
import bw3.c72;
import bw3.d72;
import bw3.wu2;
import bw3.z62;
import com.google.android.gms.common.internal.ServiceSpecificExtraArgs;
import com.tencent.mm.plugin.webview.core.b0;
import com.tencent.mm.plugin.webview.core.v;
import com.tencent.mm.plugin.webview.ui.tools.WebViewUI;
import com.tencent.mm.plugin.webview.ui.tools.WebViewUI$$e0;
import com.tencent.mm.plugin.webview.ui.tools.i2;
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.platformtools.BuildInfo;
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.MultiProcessMMKV;
import com.tencent.mm.sdk.platformtools.Util;
import com.tencent.mm.ui.w;
import com.tencent.mm.ui.widget.MMWebView;
import com.tencent.xweb.CookieManager;
import com.tencent.xweb.HttpAuthHandler;
import com.tencent.xweb.ProxyConfig;
import com.tencent.xweb.RenderProcessGoneDetail;
import com.tencent.xweb.SslErrorHandler;
import com.tencent.xweb.WebResourceError;
import com.tencent.xweb.WebResourceRequest;
import com.tencent.xweb.WebResourceResponse;
import com.tencent.xweb.WebSettings;
import com.tencent.xweb.WebView;
import com.tencent.xweb.WebViewClient;
import dk0.n0;
import gx0.u;
import ie1.h;
import ih.a2;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentLinkedDeque;
import java.util.concurrent.ConcurrentSkipListSet;
import kotlin.Metadata;
import kp3.f1;
import kp3.h1;
import kp3.l1;
import vp3.c$$d;
import vp3.h;
import wq3.j;
import xg4.r0;
import xg4.y0;

public abstract class BaseWebViewController extends WebViewClient implements vp3.a<z62>, b10.t {
    public static final c L0 = new c(null);
    public static final String[] M0 = {"https://statres.quickapp.cn/quickapp/js/routerinline.min.js", "http://fastappjump-drcn.hispace.hicloud.com/", "http://thefatherofsalmon.com/", "http://v2.thefatherofsalmon.com/"};
    public String A = "";
    public final ConcurrentSkipListSet<String> A0;
    public String B = "";
    public final boolean B0;
    public String C = "";
    public i C0;
    public String D = "";
    public final wg4.g D0;
    public String E = "";
    public final wg4.g E0;
    public String F = "";
    public boolean F0;
    public boolean G;
    public vd.c G0;
    public boolean H;
    public l H0;
    public boolean I;
    public boolean I0;
    public boolean J;
    public final wg4.g J0;
    public final wg4.g K;
    public final wg4.g K0;
    public final wg4.g L;
    public final wg4.g M;
    public final wg4.g N;
    public final vp3.h O;
    public final Map<String, String> P;
    public final wg4.g Q;
    public final c0 R;
    public final wq3.v S;
    public final wg4.g T;
    public final ConcurrentLinkedDeque<b0> U;
    public final ConcurrentLinkedDeque<u> V;
    public final ConcurrentLinkedDeque<z> W;
    public final ConcurrentHashMap<Integer, ConcurrentLinkedDeque<kh4.a<wg4.b0>>> X;
    public boolean Y;
    public k Z;

    /* renamed from: a  reason: collision with root package name */
    public final MMWebView f164462a;

    /* renamed from: a0  reason: collision with root package name */
    public final View.OnTouchListener f164463a0;

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

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

    /* renamed from: c  reason: collision with root package name */
    public Set<String> f164466c;

    /* renamed from: c0  reason: collision with root package name */
    public final int f164467c0;

    /* renamed from: d  reason: collision with root package name */
    public kp3.i f164468d;

    /* renamed from: d0  reason: collision with root package name */
    public final int f164469d0;

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

    /* renamed from: e0  reason: collision with root package name */
    public final int f164471e0;

    /* renamed from: f  reason: collision with root package name */
    public xp3.c f164472f = new xp3.c();

    /* renamed from: f0  reason: collision with root package name */
    public final int f164473f0;

    /* renamed from: g  reason: collision with root package name */
    public final d.c f164474g = new d.c();

    /* renamed from: g0  reason: collision with root package name */
    public final int f164475g0;

    /* renamed from: h  reason: collision with root package name */
    public HashMap<String, SparseBooleanArray> f164476h;

    /* renamed from: h0  reason: collision with root package name */
    public final int f164477h0;

    /* renamed from: i  reason: collision with root package name */
    public wq3.w f164478i;

    /* renamed from: i0  reason: collision with root package name */
    public final int f164479i0;

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

    /* renamed from: j0  reason: collision with root package name */
    public final int f164481j0;

    /* renamed from: k  reason: collision with root package name */
    public final mp3.b f164482k = new mp3.b();

    /* renamed from: k0  reason: collision with root package name */
    public final int f164483k0;

    /* renamed from: l  reason: collision with root package name */
    public boolean f164484l;

    /* renamed from: l0  reason: collision with root package name */
    public final int f164485l0;

    /* renamed from: m  reason: collision with root package name */
    public String f164486m;

    /* renamed from: m0  reason: collision with root package name */
    public final int f164487m0;

    /* renamed from: n  reason: collision with root package name */
    public Dialog f164488n;

    /* renamed from: n0  reason: collision with root package name */
    public final int f164489n0;

    /* renamed from: o  reason: collision with root package name */
    public String f164490o;

    /* renamed from: o0  reason: collision with root package name */
    public final int f164491o0;

    /* renamed from: p  reason: collision with root package name */
    public int f164492p;

    /* renamed from: p0  reason: collision with root package name */
    public final int f164493p0;

    /* renamed from: q  reason: collision with root package name */
    public long f164494q;

    /* renamed from: q0  reason: collision with root package name */
    public final int f164495q0;

    /* renamed from: r  reason: collision with root package name */
    public boolean f164496r;

    /* renamed from: r0  reason: collision with root package name */
    public final Set<Integer> f164497r0;

    /* renamed from: s  reason: collision with root package name */
    public boolean f164498s;

    /* renamed from: s0  reason: collision with root package name */
    public final Set<Integer> f164499s0;

    /* renamed from: t  reason: collision with root package name */
    public boolean f164500t;

    /* renamed from: t0  reason: collision with root package name */
    public final boolean f164501t0;

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

    /* renamed from: u0  reason: collision with root package name */
    public final List<e> f164503u0;

    /* renamed from: v  reason: collision with root package name */
    public d.a f164504v = d.a.None;

    /* renamed from: v0  reason: collision with root package name */
    public final ConcurrentLinkedDeque<wg4.l<ControllerAction, kh4.a<wg4.b0>>> f164505v0;

    /* renamed from: w  reason: collision with root package name */
    public String f164506w;

    /* renamed from: w0  reason: collision with root package name */
    public final ConcurrentLinkedDeque<wg4.l<PageAction, kh4.a<wg4.b0>>> f164507w0;

    /* renamed from: x  reason: collision with root package name */
    public final wg4.g f164508x = wg4.h.a(f.f164526d);

    /* renamed from: x0  reason: collision with root package name */
    public final ConcurrentSkipListSet<Integer> f164509x0;

    /* renamed from: y  reason: collision with root package name */
    public com.tencent.mm.plugin.webview.stub.l f164510y;

    /* renamed from: y0  reason: collision with root package name */
    public final ConcurrentSkipListSet<Integer> f164511y0;

    /* renamed from: z  reason: collision with root package name */
    public Intent f164512z;

    /* renamed from: z0  reason: collision with root package name */
    public final ConcurrentSkipListSet<String> f164513z0;

    @Metadata(d1 = {"\u0000\u0018\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\u000e\n\u0000\b\u0005\u0018\u00002\u00020\u0001B\u0005¢\u0006\u0002\u0010\u0002J\u0010\u0010\u0003\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u0006H\u0016¨\u0006\u0007"}, d2 = {"Lcom/tencent/mm/plugin/webview/core/BaseWebViewController$Auth;", "Lcom/tencent/mm/plugin/webview/core/BaseWebViewController$PageAction;", "()V", "verify", "", "url", "", "webview-sdk_release"}, k = 1, mv = {1, 7, 1}, xi = 48)
    public static final class Auth extends PageAction {
        @Override // com.tencent.mm.plugin.webview.core.BaseWebViewController.PageAction
        public boolean verify(String str) {
            lh4.m.g(str, "url");
            BaseWebViewController controller = getController();
            if (!waitFor(lh4.g0.a(Inject.class), str) || !waitFor(controller.f164469d0) || (!controller.f164464b.f9916e && !controller.O.e(str) && !waitFor(controller.f164477h0, str))) {
                return false;
            }
            return true;
        }
    }

    @Metadata(d1 = {"\u0000\u0012\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0000\b\u0005\u0018\u00002\u00020\u0001B\u0005¢\u0006\u0002\u0010\u0002J\b\u0010\u0003\u001a\u00020\u0004H\u0016¨\u0006\u0005"}, d2 = {"Lcom/tencent/mm/plugin/webview/core/BaseWebViewController$Bind;", "Lcom/tencent/mm/plugin/webview/core/BaseWebViewController$ControllerAction;", "()V", "verify", "", "webview-sdk_release"}, k = 1, mv = {1, 7, 1}, xi = 48)
    public static final class Bind extends ControllerAction {
        @Override // com.tencent.mm.plugin.webview.core.BaseWebViewController.ControllerAction
        public boolean verify() {
            BaseWebViewController controller = getController();
            if (!waitFor(controller.f164471e0) || !waitFor(controller.f164469d0)) {
                return false;
            }
            return true;
        }
    }

    @Metadata(d1 = {"\u0000\u0012\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0000\b%\u0018\u00002\u00020\u0001B\u0005¢\u0006\u0002\u0010\u0002J\b\u0010\u0003\u001a\u00020\u0004H&¨\u0006\u0005"}, d2 = {"Lcom/tencent/mm/plugin/webview/core/BaseWebViewController$ControllerAction;", "Lcom/tencent/mm/plugin/webview/core/BaseWebViewController$WebAction;", "()V", "verify", "", "webview-sdk_release"}, k = 1, mv = {1, 7, 1}, xi = 48)
    public static abstract class ControllerAction extends WebAction {
        public abstract boolean verify();
    }

    @Metadata(d1 = {"\u0000\u0012\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0000\b\u0005\u0018\u00002\u00020\u0001B\u0005¢\u0006\u0002\u0010\u0002J\b\u0010\u0003\u001a\u00020\u0004H\u0016¨\u0006\u0005"}, d2 = {"Lcom/tencent/mm/plugin/webview/core/BaseWebViewController$Init;", "Lcom/tencent/mm/plugin/webview/core/BaseWebViewController$ControllerAction;", "()V", "verify", "", "webview-sdk_release"}, k = 1, mv = {1, 7, 1}, xi = 48)
    public static final class Init extends ControllerAction {
        @Override // com.tencent.mm.plugin.webview.core.BaseWebViewController.ControllerAction
        public boolean verify() {
            return waitFor(getController().f164467c0);
        }
    }

    @Metadata(d1 = {"\u0000\u0018\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\u000e\n\u0000\b\u0005\u0018\u00002\u00020\u0001B\u0005¢\u0006\u0002\u0010\u0002J\u0010\u0010\u0003\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u0006H\u0016¨\u0006\u0007"}, d2 = {"Lcom/tencent/mm/plugin/webview/core/BaseWebViewController$Inject;", "Lcom/tencent/mm/plugin/webview/core/BaseWebViewController$PageAction;", "()V", "verify", "", "url", "", "webview-sdk_release"}, k = 1, mv = {1, 7, 1}, xi = 48)
    public static final class Inject extends PageAction {
        @Override // com.tencent.mm.plugin.webview.core.BaseWebViewController.PageAction
        public boolean verify(String str) {
            lh4.m.g(str, "url");
            BaseWebViewController controller = getController();
            if (((controller.f164462a.f187323e || waitFor(controller.f164489n0, str) || waitFor(lh4.g0.a(PageLoadEndForCommitNotSupport.class), str)) && waitFor(controller.f164469d0) && (controller.f164464b.f9916e || controller.O.e(str) || waitFor(controller.f164477h0, str))) || controller.P0()) {
                return true;
            }
            return false;
        }
    }

    @Metadata(d1 = {"\u0000 \n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0010\b\n\u0000\b%\u0018\u00002\u00020\u0001B\u0005¢\u0006\u0002\u0010\u0002J\u0010\u0010\u0003\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u0006H&J\u0016\u0010\u0007\u001a\u00020\u00042\u0006\u0010\b\u001a\u00020\t2\u0006\u0010\u0005\u001a\u00020\u0006¨\u0006\n"}, d2 = {"Lcom/tencent/mm/plugin/webview/core/BaseWebViewController$PageAction;", "Lcom/tencent/mm/plugin/webview/core/BaseWebViewController$WebAction;", "()V", "verify", "", "url", "", "waitFor", "status", "", "webview-sdk_release"}, k = 1, mv = {1, 7, 1}, xi = 48)
    public static abstract class PageAction extends WebAction {
        public abstract boolean verify(String str);

        public final boolean waitFor(int i15, String str) {
            lh4.m.g(str, "url");
            if ((lh4.m.b(str, getController().B) || getController().f164499s0.contains(Integer.valueOf(i15))) && getController().f164509x0.contains(Integer.valueOf(i15))) {
                return true;
            }
            return false;
        }
    }

    @Metadata(d1 = {"\u0000\u0018\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\u000e\n\u0000\b\u0005\u0018\u00002\u00020\u0001B\u0005¢\u0006\u0002\u0010\u0002J\u0010\u0010\u0003\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u0006H\u0016¨\u0006\u0007"}, d2 = {"Lcom/tencent/mm/plugin/webview/core/BaseWebViewController$PageLoadEndForCommitNotSupport;", "Lcom/tencent/mm/plugin/webview/core/BaseWebViewController$PageAction;", "()V", "verify", "", "url", "", "webview-sdk_release"}, k = 1, mv = {1, 7, 1}, xi = 48)
    public static final class PageLoadEndForCommitNotSupport extends PageAction {
        @Override // com.tencent.mm.plugin.webview.core.BaseWebViewController.PageAction
        public boolean verify(String str) {
            lh4.m.g(str, "url");
            BaseWebViewController controller = getController();
            if (!waitFor(lh4.g0.a(Start.class)) || !waitFor(controller.f164491o0, str) || !waitFor(controller.f164495q0, str)) {
                return false;
            }
            return true;
        }
    }

    @Metadata(d1 = {"\u0000\u0018\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\u000e\n\u0000\b\u0005\u0018\u00002\u00020\u0001B\u0005¢\u0006\u0002\u0010\u0002J\u0010\u0010\u0003\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u0006H\u0016¨\u0006\u0007"}, d2 = {"Lcom/tencent/mm/plugin/webview/core/BaseWebViewController$ProgressBarEnd;", "Lcom/tencent/mm/plugin/webview/core/BaseWebViewController$PageAction;", "()V", "verify", "", "url", "", "webview-sdk_release"}, k = 1, mv = {1, 7, 1}, xi = 48)
    public static final class ProgressBarEnd extends PageAction {
        @Override // com.tencent.mm.plugin.webview.core.BaseWebViewController.PageAction
        public boolean verify(String str) {
            lh4.m.g(str, "url");
            BaseWebViewController controller = getController();
            if (!controller.G() || (!controller.Q0() && !waitFor(lh4.g0.a(Ready.class), str) && !waitFor(controller.f164491o0, str) && !waitFor(controller.f164489n0, str) && !waitFor(controller.f164479i0, str))) {
                return false;
            }
            return true;
        }
    }

    @Metadata(d1 = {"\u0000\u0018\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\u000e\n\u0000\b\u0005\u0018\u00002\u00020\u0001B\u0005¢\u0006\u0002\u0010\u0002J\u0010\u0010\u0003\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u0006H\u0016¨\u0006\u0007"}, d2 = {"Lcom/tencent/mm/plugin/webview/core/BaseWebViewController$ProgressBarStart;", "Lcom/tencent/mm/plugin/webview/core/BaseWebViewController$PageAction;", "()V", "verify", "", "url", "", "webview-sdk_release"}, k = 1, mv = {1, 7, 1}, xi = 48)
    public static final class ProgressBarStart extends PageAction {
        @Override // com.tencent.mm.plugin.webview.core.BaseWebViewController.PageAction
        public boolean verify(String str) {
            lh4.m.g(str, "url");
            BaseWebViewController controller = getController();
            if (!waitFor(lh4.g0.a(Start.class)) || ((controller.a0(controller.f164475g0) || (!waitFor(controller.f164483k0, str) && !waitFor(controller.f164481j0, str))) && (waitFor(lh4.g0.a(ProgressBarEnd.class), str) || !controller.a0(controller.f164475g0) || !waitFor(controller.f164485l0, str)))) {
                return false;
            }
            return true;
        }
    }

    @Metadata(d1 = {"\u0000\u0018\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\u000e\n\u0000\b\u0005\u0018\u00002\u00020\u0001B\u0005¢\u0006\u0002\u0010\u0002J\u0010\u0010\u0003\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u0006H\u0016¨\u0006\u0007"}, d2 = {"Lcom/tencent/mm/plugin/webview/core/BaseWebViewController$Ready;", "Lcom/tencent/mm/plugin/webview/core/BaseWebViewController$PageAction;", "()V", "verify", "", "url", "", "webview-sdk_release"}, k = 1, mv = {1, 7, 1}, xi = 48)
    public static final class Ready extends PageAction {
        @Override // com.tencent.mm.plugin.webview.core.BaseWebViewController.PageAction
        public boolean verify(String str) {
            lh4.m.g(str, "url");
            BaseWebViewController controller = getController();
            if ((!waitFor(lh4.g0.a(Start.class)) || !waitFor(lh4.g0.a(Auth.class), str) || (!waitFor(controller.f164491o0, str) && !controller.f164462a.f187323e)) && !controller.Q0()) {
                return false;
            }
            return true;
        }
    }

    @Metadata(d1 = {"\u0000\u001a\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0002\b\u0004\n\u0002\u0010\u000e\n\u0000\b\u0005\u0018\u00002\u00020\u0001B\u0005¢\u0006\u0002\u0010\u0002J\u0010\u0010\u0007\u001a\u00020\u00042\u0006\u0010\b\u001a\u00020\tH\u0016R\u0014\u0010\u0003\u001a\u00020\u0004X–D¢\u0006\b\n\u0000\u001a\u0004\b\u0005\u0010\u0006¨\u0006\n"}, d2 = {"Lcom/tencent/mm/plugin/webview/core/BaseWebViewController$SPAUpdated;", "Lcom/tencent/mm/plugin/webview/core/BaseWebViewController$PageAction;", "()V", "keep", "", "getKeep", "()Z", "verify", "url", "", "webview-sdk_release"}, k = 1, mv = {1, 7, 1}, xi = 48)
    public static final class SPAUpdated extends PageAction {
        private final boolean keep = true;

        @Override // com.tencent.mm.plugin.webview.core.BaseWebViewController.WebAction
        public boolean getKeep() {
            return this.keep;
        }

        @Override // com.tencent.mm.plugin.webview.core.BaseWebViewController.PageAction
        public boolean verify(String str) {
            lh4.m.g(str, "url");
            BaseWebViewController controller = getController();
            if (!waitFor(lh4.g0.a(Ready.class), str) || !waitFor(controller.f164493p0, str)) {
                return false;
            }
            return true;
        }
    }

    @Metadata(d1 = {"\u0000\u0012\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0000\b\u0005\u0018\u00002\u00020\u0001B\u0005¢\u0006\u0002\u0010\u0002J\b\u0010\u0003\u001a\u00020\u0004H\u0016¨\u0006\u0005"}, d2 = {"Lcom/tencent/mm/plugin/webview/core/BaseWebViewController$Start;", "Lcom/tencent/mm/plugin/webview/core/BaseWebViewController$ControllerAction;", "()V", "verify", "", "webview-sdk_release"}, k = 1, mv = {1, 7, 1}, xi = 48)
    public static final class Start extends ControllerAction {
        @Override // com.tencent.mm.plugin.webview.core.BaseWebViewController.ControllerAction
        public boolean verify() {
            boolean z15;
            boolean z16;
            BaseWebViewController controller = getController();
            if (waitFor(controller.f164471e0) && (!controller.l0() || waitFor(controller.f164469d0))) {
                if (controller.y3().length() > 0) {
                    z15 = true;
                } else {
                    z15 = false;
                }
                if (z15) {
                    return true;
                }
                String str = (String) ((wg4.n) controller.f164465b0).getValue();
                if (str == null || ek4.y.n(str)) {
                    z16 = true;
                } else {
                    z16 = false;
                }
                if (!z16) {
                    return true;
                }
            }
            return false;
        }
    }

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

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

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

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

    public static final class a0 implements Runnable {

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

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

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

        public a0(BaseWebViewController baseWebViewController, int i15, String str) {
            this.f164515d = baseWebViewController;
            this.f164516e = i15;
            this.f164517f = str;
        }

        public final void run() {
            ConcurrentLinkedDeque<z> concurrentLinkedDeque = this.f164515d.W;
            int i15 = this.f164516e;
            String str = this.f164517f;
            Iterator<T> it = concurrentLinkedDeque.iterator();
            while (it.hasNext()) {
                it.next().c(i15, str);
            }
        }
    }

    public static final class b implements j {

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

        public b(WeakReference<BaseWebViewController> weakReference) {
            lh4.m.g(weakReference, "weakController");
            this.f164518a = weakReference;
        }

        @Override // com.tencent.mm.plugin.webview.core.j
        public boolean c() {
            BaseWebViewController baseWebViewController = this.f164518a.get();
            return baseWebViewController != null && baseWebViewController.u0();
        }

        @Override // com.tencent.mm.plugin.webview.core.j
        public void d(i iVar) {
            lh4.m.g(iVar, "conn");
            BaseWebViewController baseWebViewController = this.f164518a.get();
            if (baseWebViewController != null) {
                if (baseWebViewController.g0()) {
                    Log.i(baseWebViewController.E(), "WebView-Trace onConnected when destroyCalled");
                    return;
                }
                xp3.f.f340585a.b(xp3.a.f340541j, baseWebViewController.f164472f);
                baseWebViewController.C0 = iVar;
                com.tencent.mm.plugin.webview.stub.l U = iVar.U();
                lh4.m.g(U, "<set-?>");
                baseWebViewController.f164510y = U;
                baseWebViewController.N().f247894l = baseWebViewController.U();
                baseWebViewController.t0(baseWebViewController.U());
                String E = baseWebViewController.E();
                Log.i(E, "WebView-Trace tryBindService#" + baseWebViewController.g() + " checkStatus CONTROLLER_INVOKER_READY");
                wq3.w wVar = baseWebViewController.f164478i;
                if (wVar != null) {
                    wVar.f334880i = System.currentTimeMillis();
                }
                if (baseWebViewController.A0.contains(lh4.g0.a(Bind.class).k())) {
                    baseWebViewController.n0();
                } else {
                    baseWebViewController.v(baseWebViewController.f164469d0);
                }
            }
        }
    }

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

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

        public b0() {
            super(0);
        }

        /* Return type fixed from 'java.lang.Object' to match base method */
        @Override // kh4.a
        public Boolean invoke() {
            boolean z15 = false;
            if ((((ie1.h) yz3.j.c(ie1.h.class)).Xj0(h.c.W6, 0) & 2) != 0) {
                z15 = true;
            }
            return Boolean.valueOf(z15);
        }
    }

    public static final class c {
        public c(lh4.h hVar) {
        }

        public final String a(Intent intent) {
            String str;
            String uri;
            lh4.m.g(intent, "intent");
            boolean z15 = false;
            try {
                str = intent.getStringExtra("rawUrl");
                if (str == null) {
                    str = "";
                }
            } catch (Exception e15) {
                Log.e("MicroMsg.WebViewController", "getRawUrl exception:%s", e15.getMessage());
                if (!(e15 instanceof ClassNotFoundException)) {
                    str = null;
                } else {
                    throw e15;
                }
            }
            if (str == null || ek4.y.n(str)) {
                z15 = true;
            }
            if (!z15) {
                return str;
            }
            Uri data = intent.getData();
            if (data == null || (uri = data.toString()) == null) {
                return "";
            }
            return uri;
        }
    }

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

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

        public c0() {
            super(0);
        }

        /* Return type fixed from 'java.lang.Object' to match base method */
        @Override // kh4.a
        public Boolean invoke() {
            boolean z15 = false;
            if ((((ie1.h) yz3.j.c(ie1.h.class)).Xj0(h.c.W6, 0) & 1) != 0) {
                z15 = true;
            }
            return Boolean.valueOf(z15);
        }
    }

    public final class d extends f64.h0 {
        /* JADX WARN: Incorrect args count in method signature: ()V */
        public d() {
        }

        /* JADX WARNING: Removed duplicated region for block: B:31:0x00b4  */
        /* JADX WARNING: Removed duplicated region for block: B:32:0x00b9 A[SYNTHETIC, Splitter:B:32:0x00b9] */
        /* JADX WARNING: Removed duplicated region for block: B:69:0x017b  */
        /* JADX WARNING: Removed duplicated region for block: B:73:0x019b  */
        /* JADX WARNING: Removed duplicated region for block: B:74:0x01a0  */
        /* JADX WARNING: Removed duplicated region for block: B:76:0x01a3  */
        @Override // f64.h0
        public void a(WebView webView, int i15) {
            boolean z15;
            String str;
            boolean z16;
            boolean z17;
            boolean z18;
            int i16;
            String userAgentString;
            String str2;
            String str3;
            Integer f15;
            Integer f16;
            if (i15 >= 100 && !BaseWebViewController.this.g0()) {
                BaseWebViewController.this.getClass();
                Log.i(BaseWebViewController.this.E(), "Abe-Debug Progress 100");
                MMWebView mMWebView = BaseWebViewController.this.f164462a;
                lh4.m.g(mMWebView, "webView");
                if (mMWebView.supportFeature(2006)) {
                    z15 = true;
                    if (((ie1.h) yz3.j.c(ie1.h.class)).Xj0(h.c.R6, 0) == 1) {
                        z16 = true;
                    } else {
                        z16 = false;
                    }
                    if (z16 && mMWebView.isSysKernel()) {
                        int i17 = wq3.p.f334833a;
                        if (i17 <= 0) {
                            PackageInfo packageInfo = MMApplicationContext.getContext().getPackageManager().getPackageInfo("com.google.android.webview", 0);
                            if (packageInfo != null) {
                                try {
                                    String str4 = packageInfo.versionName;
                                    if (str4 != null) {
                                        String lowerCase = str4.toLowerCase();
                                        lh4.m.f(lowerCase, "this as java.lang.String).toLowerCase()");
                                        String str5 = (String) ek4.d0.X(lowerCase, new String[]{"."}, false, 0, 6, null).get(0);
                                        if (!(str5 == null || (f16 = ek4.x.f(str5)) == null)) {
                                            i16 = f16.intValue();
                                            if (i16 <= 0) {
                                                wq3.p.f334833a = i16;
                                                i17 = i16;
                                            } else {
                                                try {
                                                    WebSettings settings = mMWebView.getSettings();
                                                    if (!(settings == null || (userAgentString = settings.getUserAgentString()) == null)) {
                                                        String lowerCase2 = userAgentString.toLowerCase();
                                                        lh4.m.f(lowerCase2, "this as java.lang.String).toLowerCase()");
                                                        String str6 = (String) ek4.d0.X(lowerCase2, new String[]{"chrome/"}, false, 0, 6, null).get(1);
                                                        if (!(str6 == null || (str2 = (String) ek4.d0.X(str6, new String[]{" "}, false, 0, 6, null).get(0)) == null || (str3 = (String) ek4.d0.X(str2, new String[]{"."}, false, 0, 6, null).get(0)) == null || (f15 = ek4.x.f(str3)) == null)) {
                                                            i17 = f15.intValue();
                                                            wq3.p.f334833a = i17;
                                                        }
                                                    }
                                                    i17 = 0;
                                                } catch (Throwable th5) {
                                                    Log.i("MicroMsg.WebViewKernelUtil", "Get KernelVersion From UA Error:" + th5.getMessage());
                                                    i17 = i16;
                                                }
                                                wq3.p.f334833a = i17;
                                            }
                                        }
                                    }
                                } catch (Throwable th6) {
                                    Log.i("MicroMsg.WebViewKernelUtil", "Get KernelVersion From PKG Error:" + th6.getMessage());
                                }
                            }
                            i16 = 0;
                            if (i16 <= 0) {
                            }
                        }
                        if (i17 <= 86) {
                            Log.i("MicroMsg.WebViewKernelUtil", "WebView-Trace, inject time enable SysKernel86");
                        }
                    }
                    if (((ie1.h) yz3.j.c(ie1.h.class)).Xj0(h.c.S6, 1) == 1) {
                        z17 = true;
                    } else {
                        z17 = false;
                    }
                    if (!mMWebView.isSysKernel() || !z17) {
                        if (((ie1.h) yz3.j.c(ie1.h.class)).Xj0(h.c.T6, 0) == 1) {
                            z18 = true;
                        } else {
                            z18 = false;
                        }
                        if (z18) {
                            Log.i("MicroMsg.WebViewKernelUtil", "WebView-Trace, inject time enable AllKernel");
                        }
                        if (z15) {
                            v.b bVar = v.f164638a;
                            if (!x.a().getBoolean("webview_page_commit_mock", false)) {
                                return;
                            }
                        }
                        Log.i(BaseWebViewController.this.E(), "WebView-Trace not support onPageCommitVisible");
                        BaseWebViewController baseWebViewController = BaseWebViewController.this;
                        int i18 = baseWebViewController.f164495q0;
                        if (webView == null) {
                            str = webView.getUrl();
                        } else {
                            str = null;
                        }
                        if (str == null) {
                            str = "";
                        }
                        baseWebViewController.w(i18, baseWebViewController.F(str));
                    }
                    Log.i("MicroMsg.WebViewKernelUtil", "WebView-Trace, inject time enable SysKernel");
                }
                z15 = false;
                if (z15) {
                }
                Log.i(BaseWebViewController.this.E(), "WebView-Trace not support onPageCommitVisible");
                BaseWebViewController baseWebViewController2 = BaseWebViewController.this;
                int i182 = baseWebViewController2.f164495q0;
                if (webView == null) {
                }
                if (str == null) {
                }
                baseWebViewController2.w(i182, baseWebViewController2.F(str));
            }
        }
    }

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

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

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

        /* Return type fixed from 'java.lang.Object' to match base method */
        @Override // kh4.a
        public m invoke() {
            long j15;
            try {
                if (this.f164522d.U().Vy()) {
                    j15 = (long) this.f164522d.U().QV();
                } else {
                    j15 = 0;
                }
            } catch (Throwable th5) {
                String E = this.f164522d.E();
                Log.e(E, "Get Uin Error:" + th5.getLocalizedMessage());
                j15 = -1;
            }
            return new m(j15);
        }
    }

    public static final class e {

        /* renamed from: a  reason: collision with root package name */
        public final WebAction f164523a;

        /* renamed from: b  reason: collision with root package name */
        public final kh4.a<wg4.b0> f164524b;

        public e(WebAction webAction, kh4.a<wg4.b0> aVar) {
            lh4.m.g(webAction, "action");
            lh4.m.g(aVar, "block");
            this.f164523a = webAction;
            this.f164524b = aVar;
        }

        public boolean equals(Object obj) {
            if (this == obj) {
                return true;
            }
            if (!(obj instanceof e)) {
                return false;
            }
            e eVar = (e) obj;
            return lh4.m.b(this.f164523a, eVar.f164523a) && lh4.m.b(this.f164524b, eVar.f164524b);
        }

        public int hashCode() {
            return (this.f164523a.hashCode() * 31) + this.f164524b.hashCode();
        }

        public String toString() {
            return "WebEvent(action=" + this.f164523a + ", block=" + this.f164524b + ')';
        }
    }

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

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

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

        /* Return type fixed from 'java.lang.Object' to match base method */
        @Override // kh4.a
        public String invoke() {
            String stringExtra = this.f164525d.L().getStringExtra("KWebPrefetcherId");
            return stringExtra == null ? "" : stringExtra;
        }
    }

    public static final class f extends lh4.o implements kh4.a<vp3.c> {

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

        public f() {
            super(0);
        }

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

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

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

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public f0(BaseWebViewController baseWebViewController) {
            super(0);
            this.f164527d = baseWebViewController;
        }

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

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

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

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public g(BaseWebViewController baseWebViewController) {
            super(0);
            this.f164528d = baseWebViewController;
        }

        /* Return type fixed from 'java.lang.Object' to match base method */
        @Override // kh4.a
        public wg4.b0 invoke() {
            Iterator<z> it = this.f164528d.W.iterator();
            while (it.hasNext()) {
                it.next().m();
            }
            return wg4.b0.f332794a;
        }
    }

    public static final class g0 extends c0 {

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

        public g0(BaseWebViewController baseWebViewController) {
            this.f164529a = baseWebViewController;
        }
    }

    public /* synthetic */ class h extends lh4.l implements kh4.a<wg4.b0> {
        public h(Object obj) {
            super(0, obj, BaseWebViewController.class, "initEnviroment", "initEnviroment()V", 0);
        }

        /* Return type fixed from 'java.lang.Object' to match base method */
        @Override // kh4.a
        public wg4.b0 invoke() {
            ((BaseWebViewController) this.receiver).b0();
            return wg4.b0.f332794a;
        }
    }

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

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

        public h0() {
            super(0);
        }

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

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

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

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public i(BaseWebViewController baseWebViewController) {
            super(0);
            this.f164531d = baseWebViewController;
        }

        /* Return type fixed from 'java.lang.Object' to match base method */
        @Override // kh4.a
        public wg4.b0 invoke() {
            boolean z15;
            String str;
            LinkedList<h1> linkedList;
            BaseWebViewController baseWebViewController = this.f164531d;
            if (baseWebViewController.f164509x0.contains(Integer.valueOf(baseWebViewController.f164489n0))) {
                Log.i(this.f164531d.E(), "WebView-Trace PageLoadFull has commit status return");
            } else {
                String str2 = this.f164531d.B;
                if (str2 == null || ek4.y.n(str2)) {
                    z15 = true;
                } else {
                    z15 = false;
                }
                if (!z15) {
                    str = this.f164531d.B;
                } else {
                    str = this.f164531d.f164462a.getUrl();
                    if (str == null) {
                        str = "";
                    }
                }
                this.f164531d.C0(str);
                kp3.l N = this.f164531d.N();
                if (!(N == null || (linkedList = N.f247887e) == null)) {
                    linkedList.clear();
                }
                this.f164531d.K0(str);
            }
            return wg4.b0.f332794a;
        }
    }

    public static final class i0 implements View.OnTouchListener {

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

        public i0(BaseWebViewController baseWebViewController) {
            this.f164532d = baseWebViewController;
        }

        public final boolean onTouch(View view, MotionEvent motionEvent) {
            boolean z15;
            ArrayList arrayList = new ArrayList();
            arrayList.add(view);
            arrayList.add(motionEvent);
            Object[] array = arrayList.toArray();
            arrayList.clear();
            j30.a.b("com/tencent/mm/plugin/webview/core/BaseWebViewController$webPageOnTouchListener$1", "android/view/View$OnTouchListener", "onTouch", "(Landroid/view/View;Landroid/view/MotionEvent;)Z", this, array);
            if (motionEvent == null || motionEvent.getAction() != 0) {
                z15 = false;
            } else {
                z15 = true;
            }
            if (z15) {
                this.f164532d.Z.f164595b = System.currentTimeMillis();
                Point point = this.f164532d.Z.f164594a;
                point.x = (int) motionEvent.getX();
                point.y = (int) motionEvent.getY();
            }
            j30.a.h(false, this, "com/tencent/mm/plugin/webview/core/BaseWebViewController$webPageOnTouchListener$1", "android/view/View$OnTouchListener", "onTouch", "(Landroid/view/View;Landroid/view/MotionEvent;)Z");
            return false;
        }
    }

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

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

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public j(BaseWebViewController baseWebViewController) {
            super(0);
            this.f164533d = baseWebViewController;
        }

        /* Return type fixed from 'java.lang.Object' to match base method */
        @Override // kh4.a
        public wg4.b0 invoke() {
            String E = this.f164533d.E();
            Log.i(E, "WebView-Trace inject#" + this.f164533d.g());
            this.f164533d.M().c();
            this.f164533d.N().i();
            if (BuildInfo.DEBUG) {
                BaseWebViewController baseWebViewController = this.f164533d;
                baseWebViewController.y("console.log('inject:'+" + this.f164533d.g() + ')', null);
            }
            return wg4.b0.f332794a;
        }
    }

    public static final class j0 implements h.c {

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

        public j0(BaseWebViewController baseWebViewController) {
            this.f164534a = baseWebViewController;
        }

        @Override // vp3.h.c
        public String a() {
            return this.f164534a.C;
        }

        /* JADX WARNING: Code restructure failed: missing block: B:10:0x001c, code lost:
            if (r0 == true) goto L_0x0020;
         */
        @Override // vp3.h.c
        public String b() {
            String str;
            String str2;
            boolean z15;
            BaseWebViewController baseWebViewController = this.f164534a;
            if (ek4.y.n(baseWebViewController.E)) {
                str = baseWebViewController.C;
            } else {
                str = baseWebViewController.E;
            }
            boolean z16 = true;
            if (str != null) {
                if (str.length() > 0) {
                    z15 = true;
                } else {
                    z15 = false;
                }
            }
            z16 = false;
            BaseWebViewController baseWebViewController2 = this.f164534a;
            if (z16) {
                if (ek4.y.n(baseWebViewController2.E)) {
                    str2 = baseWebViewController2.C;
                } else {
                    str2 = baseWebViewController2.E;
                }
                lh4.m.d(str2);
                return str2;
            }
            String url = baseWebViewController2.f164462a.getUrl();
            if (url == null) {
                return BaseWebViewController.L0.a(this.f164534a.L());
            }
            return url;
        }
    }

    public /* synthetic */ class k extends lh4.l implements kh4.a<wg4.b0> {
        public k(Object obj) {
            super(0, obj, BaseWebViewController.class, "onBinded", "onBinded()V", 0);
        }

        /* Return type fixed from 'java.lang.Object' to match base method */
        @Override // kh4.a
        public wg4.b0 invoke() {
            ((BaseWebViewController) this.receiver).n0();
            return wg4.b0.f332794a;
        }
    }

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

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

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public l(BaseWebViewController baseWebViewController) {
            super(0);
            this.f164535d = baseWebViewController;
        }

        /* Return type fixed from 'java.lang.Object' to match base method */
        @Override // kh4.a
        public wg4.b0 invoke() {
            this.f164535d.M().a(this.f164535d.F);
            Iterator<z> it = this.f164535d.W.iterator();
            while (it.hasNext()) {
                it.next().d();
            }
            return wg4.b0.f332794a;
        }
    }

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

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

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

        /* Return type fixed from 'java.lang.Object' to match base method */
        @Override // kh4.a
        public wg4.b0 invoke() {
            BaseWebViewController baseWebViewController = this.f164536d;
            if (!baseWebViewController.f164462a.f187323e) {
                baseWebViewController.M().e();
            }
            this.f164536d.p0();
            return wg4.b0.f332794a;
        }
    }

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

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

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public n(BaseWebViewController baseWebViewController) {
            super(0);
            this.f164537d = baseWebViewController;
        }

        /* Return type fixed from 'java.lang.Object' to match base method */
        @Override // kh4.a
        public wg4.b0 invoke() {
            BaseWebViewController baseWebViewController = this.f164537d;
            MMWebView mMWebView = baseWebViewController.f164462a;
            if (mMWebView.f187323e) {
                String url = mMWebView.getUrl();
                if (url == null) {
                    url = "";
                }
                baseWebViewController.F0(url);
            }
            if (!this.f164537d.g0()) {
                this.f164537d.D0();
                this.f164537d.v0();
                this.f164537d.G0();
            }
            return wg4.b0.f332794a;
        }
    }

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

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

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public o(BaseWebViewController baseWebViewController) {
            super(0);
            this.f164538d = baseWebViewController;
        }

        /* Return type fixed from 'java.lang.Object' to match base method */
        @Override // kh4.a
        public wg4.b0 invoke() {
            this.f164538d.M().e();
            return wg4.b0.f332794a;
        }
    }

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

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

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public p(BaseWebViewController baseWebViewController) {
            super(0);
            this.f164539d = baseWebViewController;
        }

        /* Return type fixed from 'java.lang.Object' to match base method */
        @Override // kh4.a
        public wg4.b0 invoke() {
            Iterator<z> it = this.f164539d.W.iterator();
            while (it.hasNext()) {
                it.next().n();
            }
            return wg4.b0.f332794a;
        }
    }

    public static final class q extends lh4.o implements kh4.a<vp3.g<z62>> {

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

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

        /* Return type fixed from 'java.lang.Object' to match base method */
        @Override // kh4.a
        public vp3.g<z62> invoke() {
            BaseWebViewController baseWebViewController = this.f164540d;
            lh4.m.e(baseWebViewController, "null cannot be cast to non-null type com.tencent.mm.plugin.webview.permission.AuthCallback<com.tencent.mm.protocal.protobuf.GetA8KeyResp>");
            return new vp3.g(new WeakReference(baseWebViewController));
        }
    }

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

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

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public r(BaseWebViewController baseWebViewController) {
            super(0);
            this.f164541d = baseWebViewController;
        }

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

    public static final class s implements Runnable {

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

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

        public static final class a extends lh4.o implements kh4.l<kh4.a<? extends wg4.b0>, Boolean> {

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

            public a() {
                super(1);
            }

            /* Return type fixed from 'java.lang.Object' to match base method */
            /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
            @Override // kh4.l
            public Boolean invoke(kh4.a<? extends wg4.b0> aVar) {
                aVar.invoke();
                return Boolean.TRUE;
            }
        }

        public s(int i15, BaseWebViewController baseWebViewController) {
            this.f164542d = i15;
            this.f164543e = baseWebViewController;
        }

        public final void run() {
            boolean z15;
            String E = this.f164543e.E();
            Log.i(E, "checkStatus:" + this.f164542d + " to [" + xg4.c0.V(this.f164543e.f164511y0, ",", null, null, 0, null, null, 62, null) + "] [" + xg4.c0.V(this.f164543e.f164509x0, ",", null, null, 0, null, null, 62, null) + "] [" + xg4.c0.V(this.f164543e.f164513z0, ",", null, null, 0, null, null, 62, null) + ']');
            this.f164543e.f164511y0.add(Integer.valueOf(this.f164542d));
            BaseWebViewController baseWebViewController = this.f164543e;
            baseWebViewController.O0(baseWebViewController.f164505v0, baseWebViewController.A0, null);
            String str = this.f164543e.B;
            if (str == null || ek4.y.n(str)) {
                z15 = true;
            } else {
                z15 = false;
            }
            if (!z15) {
                BaseWebViewController baseWebViewController2 = this.f164543e;
                baseWebViewController2.O0(baseWebViewController2.f164507w0, baseWebViewController2.f164513z0, baseWebViewController2.B);
            }
            xg4.z.t(this.f164543e.W(this.f164542d), a.f164544d);
        }
    }

    public static final class t implements Runnable {

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

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

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

        public t(int i15, BaseWebViewController baseWebViewController, String str) {
            this.f164545d = i15;
            this.f164546e = baseWebViewController;
            this.f164547f = str;
        }

        public final void run() {
            String str;
            if (this.f164546e.s(this.f164545d, this.f164547f)) {
                Log.i(this.f164546e.E(), "checkStatus:" + this.f164545d + ' ' + this.f164547f + " to [" + xg4.c0.V(this.f164546e.f164511y0, ",", null, null, 0, null, null, 62, null) + "] [" + xg4.c0.V(this.f164546e.f164509x0, ",", null, null, 0, null, null, 62, null) + "] [" + xg4.c0.V(this.f164546e.f164513z0, ",", null, null, 0, null, null, 62, null) + ']');
                this.f164546e.f164509x0.add(Integer.valueOf(this.f164545d));
                BaseWebViewController baseWebViewController = this.f164546e;
                baseWebViewController.O0(baseWebViewController.f164507w0, baseWebViewController.f164513z0, baseWebViewController.B);
                return;
            }
            String E = this.f164546e.E();
            StringBuilder sb5 = new StringBuilder();
            sb5.append("checkStatus skip: ");
            sb5.append(this.f164545d);
            sb5.append(", url=");
            sb5.append(this.f164547f);
            sb5.append(", startUrl=");
            sb5.append(this.f164546e.B);
            sb5.append(' ');
            if (this.f164546e.f164497r0.contains(Integer.valueOf(this.f164545d))) {
                str = ", spaUrl=" + this.f164546e.D;
            } else {
                str = "";
            }
            sb5.append(str);
            Log.w(E, sb5.toString());
        }
    }

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

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

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

        /* Return type fixed from 'java.lang.Object' to match base method */
        @Override // kh4.a
        public String invoke() {
            return this.f164548d.L().getStringExtra("data");
        }
    }

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

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

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

        /* renamed from: f  reason: collision with root package name */
        public final /* synthetic */ kh4.l<String, wg4.b0> f164551f;

        /* JADX DEBUG: Multi-variable search result rejected for r3v0, resolved type: kh4.l<? super java.lang.String, wg4.b0> */
        /* JADX WARN: Multi-variable type inference failed */
        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public v(BaseWebViewController baseWebViewController, String str, kh4.l<? super String, wg4.b0> lVar) {
            super(0);
            this.f164549d = baseWebViewController;
            this.f164550e = str;
            this.f164551f = lVar;
        }

        /* Return type fixed from 'java.lang.Object' to match base method */
        @Override // kh4.a
        public wg4.b0 invoke() {
            b bVar;
            MMWebView mMWebView = this.f164549d.f164462a;
            String str = this.f164550e;
            kh4.l<String, wg4.b0> lVar = this.f164551f;
            if (lVar != null) {
                bVar = new b(lVar);
            } else {
                bVar = null;
            }
            mMWebView.evaluateJavascript(str, bVar);
            return wg4.b0.f332794a;
        }
    }

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

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

        public w() {
            super(0);
        }

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

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

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

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

        /* Return type fixed from 'java.lang.Object' to match base method */
        @Override // kh4.a
        public f1 invoke() {
            BaseWebViewController baseWebViewController = this.f164553d;
            return new f1(baseWebViewController.f164462a, baseWebViewController.N(), null, this.f164553d.f164462a.f187323e);
        }
    }

    public static final class y extends lh4.o implements kh4.a<kp3.l> {

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

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

        /* Return type fixed from 'java.lang.Object' to match base method */
        @Override // kh4.a
        public kp3.l invoke() {
            kp3.l lVar;
            lp3.a aVar;
            int i15;
            BaseWebViewController baseWebViewController = this.f164554d;
            if (baseWebViewController.f164466c == null) {
                lVar = new kp3.l(baseWebViewController.f164462a, baseWebViewController.O, baseWebViewController.g(), this.f164554d.f164468d);
            } else {
                MMWebView mMWebView = baseWebViewController.f164462a;
                vp3.h hVar = baseWebViewController.O;
                int g15 = baseWebViewController.g();
                Set<String> set = this.f164554d.f164466c;
                lVar = new kp3.l();
                lVar.f247883a = mMWebView;
                lVar.f247897o = hVar;
                lVar.f247901s = g15;
                if (set == null) {
                    set = new HashSet<>();
                }
                lVar.f247903u = set;
                lVar.f247904v = true;
                lVar.f247888f = new kp3.q(lVar, Looper.getMainLooper());
                Object[] objArr = new Object[2];
                if (mMWebView == null) {
                    i15 = 0;
                } else {
                    i15 = mMWebView.hashCode();
                }
                objArr[0] = Integer.valueOf(i15);
                objArr[1] = Integer.valueOf(lVar.hashCode());
                Log.i("MicroMsg.JsApiHandler", "Abe-Debug JsApiHandler<init>, webview: %d, this: %d, limitedJsApiListModeEnable = true", objArr);
            }
            BaseWebViewController baseWebViewController2 = this.f164554d;
            m10.c cVar = (m10.c) yz3.j.c(m10.c.class);
            if (cVar != null) {
                aVar = cVar.Id0();
            } else {
                aVar = null;
            }
            if (aVar != null && !((ArrayList) lVar.f247906x).contains(aVar)) {
                ((ArrayList) lVar.f247906x).add(aVar);
            }
            baseWebViewController2.f164462a.addJavascriptInterface(lVar, "__wx");
            if (lVar.t() != null) {
                baseWebViewController2.f164462a.addJavascriptInterface(lVar.t(), "__wxtag");
            }
            MMWebView mMWebView2 = baseWebViewController2.f164462a;
            if (lVar.E == null) {
                lVar.E = new l1();
            }
            l1 l1Var = lVar.E;
            l1Var.getClass();
            l1Var.f247989a = lVar;
            mMWebView2.addJavascriptInterface(lVar.E, "WXTransInterface");
            MMWebView mMWebView3 = baseWebViewController2.f164462a;
            if (lVar.D == null) {
                lVar.D = new mp3.a();
            }
            mp3.a aVar2 = lVar.D;
            aVar2.f266824a = lVar.f247883a;
            mMWebView3.addJavascriptInterface(aVar2, "CustomFullscreenApi");
            baseWebViewController2.f164462a.addJavascriptInterface(baseWebViewController2.f164482k, "__wxWebEnv");
            baseWebViewController2.f164462a.setRandomStr(lVar.f247899q);
            return lVar;
        }
    }

    public static final class z extends lh4.o implements kh4.a<aq3.c> {

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

        public z() {
            super(0);
        }

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

    public BaseWebViewController(MMWebView mMWebView, t.b bVar, Set<String> set, kp3.i iVar) {
        lh4.m.g(mMWebView, "viewWV");
        lh4.m.g(bVar, "options");
        this.f164462a = mMWebView;
        this.f164464b = bVar;
        this.f164466c = set;
        this.f164468d = iVar;
        boolean z15 = true;
        this.J = true;
        this.K = wg4.h.a(new x(this));
        this.L = wg4.h.a(new y(this));
        this.M = wg4.h.a(new r(this));
        this.N = wg4.h.a(w.f164552d);
        this.O = new vp3.h(new j0(this));
        this.P = new ConcurrentHashMap();
        this.Q = wg4.h.a(new f0(this));
        this.R = new g0(this);
        this.S = new wq3.v();
        this.T = wg4.h.a(new d0(this));
        this.U = new ConcurrentLinkedDeque<>();
        this.V = new ConcurrentLinkedDeque<>();
        this.W = new ConcurrentLinkedDeque<>();
        this.X = new ConcurrentHashMap<>();
        this.Z = new k();
        this.f164463a0 = new i0(this);
        this.f164465b0 = wg4.h.a(new u(this));
        this.f164467c0 = -1;
        this.f164469d0 = -2;
        this.f164471e0 = -3;
        this.f164473f0 = -10;
        this.f164475g0 = -5;
        this.f164477h0 = 1;
        this.f164479i0 = 2;
        this.f164481j0 = 3;
        this.f164483k0 = 4;
        this.f164485l0 = 6;
        this.f164487m0 = 7;
        this.f164489n0 = 10;
        this.f164491o0 = 11;
        this.f164493p0 = 12;
        this.f164495q0 = 13;
        this.f164497r0 = y0.d(11, 12, 10, 13);
        this.f164499s0 = y0.d(3, 4, 6);
        this.f164501t0 = true;
        this.f164503u0 = xg4.u.h(new e(new Init(), new h(this)), new e(new PageLoadEndForCommitNotSupport(), new i(this)), new e(new Inject(), new j(this)), new e(new Bind(), new k(this)), new e(new Auth(), new l(this)), new e(new Ready(), new m(this)), new e(new Start(), new n(this)), new e(new SPAUpdated(), new o(this)), new e(new ProgressBarStart(), new p(this)), new e(new ProgressBarEnd(), new g(this)));
        this.f164505v0 = new ConcurrentLinkedDeque<>();
        this.f164507w0 = new ConcurrentLinkedDeque<>();
        this.f164509x0 = new ConcurrentSkipListSet<>();
        this.f164511y0 = new ConcurrentSkipListSet<>();
        this.f164513z0 = new ConcurrentSkipListSet<>();
        this.A0 = new ConcurrentSkipListSet<>();
        this.B0 = B().f328014a.size() <= 0 ? false : z15;
        this.D0 = wg4.h.a(h0.f164530d);
        this.E0 = wg4.h.a(z.f164555d);
        this.J0 = wg4.h.a(c0.f164520d);
        this.K0 = wg4.h.a(b0.f164519d);
    }

    public static /* synthetic */ c$$d J0(BaseWebViewController baseWebViewController, String str, boolean z15, int i15, int i16, Object obj) {
        if (obj == null) {
            if ((i16 & 2) != 0) {
                z15 = false;
            }
            if ((i16 & 4) != 0) {
                i15 = baseWebViewController.C(str);
            }
            return baseWebViewController.I0(str, z15, i15);
        }
        throw new UnsupportedOperationException("Super calls with default arguments not supported in this target, function: startGetA8Key");
    }

    public final boolean A(String str) {
        lh4.m.g(str, "url");
        if (t(str)) {
            return false;
        }
        String E2 = E();
        Log.f(E2, "forceQuitOnUrlForbidden, canLoadUrl fail, url = " + str);
        Iterator<z> it = this.W.iterator();
        while (it.hasNext()) {
            it.next().h();
        }
        return true;
    }

    public final void A0(boolean z15) {
        try {
            U();
            if (!z15) {
                U().xi(g());
            }
            U().rF(g(), z15);
            Log.i(E(), "removeInvoker ok");
        } catch (Exception e15) {
            String E2 = E();
            Log.w(E2, "onDestroy, remove callback and invoke event on webview destroy, ex = " + e15);
        }
    }

    @Override // b10.t
    public void A3(u uVar) {
        lh4.m.g(uVar, ServiceSpecificExtraArgs.CastExtraArgs.LISTENER);
        if (this.V.contains(uVar)) {
            this.V.remove(uVar);
        }
    }

    public final vp3.c B() {
        return (vp3.c) this.f164508x.getValue();
    }

    public final void B0(int i15) {
        boolean z15;
        String currentUrl = getCurrentUrl();
        if (currentUrl == null || ek4.y.n(currentUrl)) {
            z15 = true;
        } else {
            z15 = false;
        }
        if (!z15 && !u(currentUrl) && a0(this.f164471e0) && B().r() && (true ^ ek4.y.n(y3()))) {
            ((aq3.c) ((wg4.n) this.E0).getValue()).a(this.f164462a, currentUrl, y3(), B(), i15, true);
        }
    }

    @Override // b10.t
    public void B3(float f15) {
        this.f164482k.f266834i = f15;
    }

    public final int C(String str) {
        Iterator<T> it = this.U.iterator();
        while (it.hasNext()) {
            int a15 = it.next().a(str);
            if (a15 != -1) {
                return a15;
            }
        }
        return B().k(str, false);
    }

    public void C0(String str) {
        lh4.m.g(str, "value");
        if (M0(str)) {
            E();
            this.C = str;
        }
    }

    @Override // b10.t
    public void C3(String str) {
        lh4.m.g(str, "jumperExtInfo");
        this.f164482k.f266836k = str;
    }

    public List<e> D() {
        return this.f164503u0;
    }

    public void D0() {
    }

    @Override // b10.t
    public String D3() {
        return this.f164506w;
    }

    public final String E() {
        return (String) ((wg4.n) this.f164470e).getValue();
    }

    public void E0(String str) {
        this.f164506w = str;
    }

    @Override // b10.t
    public synchronized void E3(z zVar) {
        lh4.m.g(zVar, ServiceSpecificExtraArgs.CastExtraArgs.LISTENER);
        if (!this.W.contains(zVar)) {
            zVar.f164729a = this;
            this.W.add(zVar);
            if (this.A0.contains(lh4.g0.a(Bind.class).k())) {
                Log.i(E(), "Abe-Debug Patch Call onBind");
                zVar.e();
            }
        }
    }

    public final String F(String str) {
        if (!M0(str)) {
            str = this.C;
        }
        if (!ek4.y.n(str) || !a0(this.f164471e0)) {
            return str;
        }
        return y3();
    }

    public final void F0(String str) {
        lh4.m.g(str, "value");
        if (N0(str)) {
            E();
            this.B = str;
        }
    }

    @Override // b10.t
    public b10.y F3() {
        return N();
    }

    public boolean G() {
        return this.f164501t0;
    }

    public final void G0() {
        if (this.G0 == null) {
            Log.i(E(), "WebView-Trace setWebViewPluginClient");
            this.G0 = hd.g.a(this.f164462a, vd.b.getInstance(), ((b10.g0) yz3.j.c(b10.g0.class)).j(), null);
        }
    }

    @Override // b10.t
    public void G3(float f15) {
        this.f164482k.f266835j = f15;
    }

    public final Context H() {
        Context activityContextIfHas = this.f164462a.getActivityContextIfHas();
        lh4.m.f(activityContextIfHas, "viewWV.activityContextIfHas");
        return activityContextIfHas;
    }

    public boolean H0(String str, boolean z15) {
        lh4.m.g(str, "url");
        return J0(this, str, z15, 0, 4, null) == c$$d.f328046f;
    }

    @Override // b10.t
    public void H3(String str, Map<String, String> map, boolean z15) {
        lh4.m.g(str, "url");
        Log.i(E(), "WebView-Trace loadUrl#" + g() + " url " + str);
        this.S.a("clientLoadUrl", System.currentTimeMillis());
        boolean z16 = true;
        if (z15) {
            this.f164462a.loadUrl(str, r0.e(new wg4.l("Pragma", "no-cache"), new wg4.l("Cache-Control", "no-cache")));
            return;
        }
        if (map != null && !map.isEmpty()) {
            z16 = false;
        }
        if (z16) {
            this.f164462a.loadUrl(str);
        } else {
            this.f164462a.loadUrl(str, map);
        }
    }

    public abstract Set<String> I();

    public final c$$d I0(String str, boolean z15, int i15) {
        lh4.m.g(str, "url");
        if (this.f164464b.f9916e) {
            String E2 = E();
            Log.w(E2, "startGetA8Key neverGetA8Key " + str);
            return c$$d.f328045e;
        }
        Iterator<T> it = this.U.iterator();
        while (it.hasNext()) {
            if (it.next().j(str, z15, i15)) {
                return c$$d.f328044d;
            }
        }
        if (this.f164492p > 0) {
            vp3.c B2 = B();
            d72 d722 = new d72();
            d722.f19047d = this.f164492p;
            d722.f19048e = (int) (System.currentTimeMillis() - this.f164494q);
            String E3 = E();
            Log.i(E3, "GetA8KeySecurityInfo KeyBackCounts=" + d722.f19047d + ", KeyBackTimes=" + d722.f19048e);
            B2.f328037x = d722;
        }
        String stringExtra = L().getStringExtra("KTemplateId");
        String stringExtra2 = L().getStringExtra("srcUsername");
        if (!Util.isNullOrNil(stringExtra) || !Util.isNullOrNil(stringExtra2)) {
            vp3.c B3 = B();
            b72 b722 = new b72();
            b722.f16985d = stringExtra2;
            b722.f16986e = stringExtra;
            String E4 = E();
            Log.i(E4, "GetA8KeySceneNote tmpl_appid=" + b722.f16985d + ", tmpl_id=" + b722.f16986e);
            B3.f328036w = b722;
        }
        return B().s(str, z15, i15, (vp3.g) ((wg4.n) this.f164480j).getValue());
    }

    @Override // b10.t
    public synchronized void I3(z zVar) {
        lh4.m.g(zVar, ServiceSpecificExtraArgs.CastExtraArgs.LISTENER);
        if (this.W.contains(zVar)) {
            this.W.remove(zVar);
        }
    }

    /* JADX WARNING: Removed duplicated region for block: B:10:0x001b A[Catch:{ Exception -> 0x0028 }] */
    /* JADX WARNING: Removed duplicated region for block: B:9:0x0016 A[Catch:{ Exception -> 0x0028 }] */
    public final byte[] J() {
        boolean z15;
        String str;
        try {
            vp3.c B2 = B();
            String currentUrl = getCurrentUrl();
            if (currentUrl != null) {
                if (!ek4.y.n(currentUrl)) {
                    z15 = false;
                    if (!z15) {
                        str = y3();
                    } else {
                        str = getCurrentUrl();
                    }
                    return B2.e(str).toByteArray();
                }
            }
            z15 = true;
            if (!z15) {
            }
            return B2.e(str).toByteArray();
        } catch (Exception e15) {
            String E2 = E();
            Log.w(E2, "saveLiveBarResp ex " + e15.getMessage());
            return null;
        }
    }

    @Override // b10.t
    public int J3() {
        return 0;
    }

    public final MMHandler K() {
        return (MMHandler) ((wg4.n) this.N).getValue();
    }

    public final void K0(String str) {
        boolean contains;
        kp3.l N2;
        if (((Boolean) ((wg4.n) this.D0).getValue()).booleanValue() && !this.f164462a.f187323e && !a0(this.f164473f0) && str != null && !ek4.y.v(str, "file:", false)) {
            synchronized (this) {
                contains = this.f164513z0.contains(lh4.g0.a(Inject.class).k());
            }
            if (!contains && (N2 = N()) != null) {
                N2.f247898p = true;
                String randomString = Util.getRandomString(16);
                N2.f247899q = randomString;
                N2.f247883a.setRandomStr(randomString);
                Log.i("MicroMsg.JsApiHandler", "WebView-Trace js digest updateDgtVerify randomStr = %s, hashCode: %d", N2.f247899q, Integer.valueOf(N2.hashCode()));
            }
        }
    }

    @Override // b10.t
    public vp3.h K3() {
        return this.O;
    }

    public final Intent L() {
        Intent intent = this.f164512z;
        if (intent != null) {
            return intent;
        }
        lh4.m.p("intent");
        throw null;
    }

    public void L0(boolean z15, String str, JsapiPermissionWrapper jsapiPermissionWrapper) {
        lh4.m.g(str, "uiConfig");
    }

    @Override // b10.t
    public void L3(u uVar) {
        lh4.m.g(uVar, ServiceSpecificExtraArgs.CastExtraArgs.LISTENER);
        if (!this.V.contains(uVar)) {
            this.V.add(uVar);
        }
    }

    public final f1 M() {
        return (f1) ((wg4.n) this.K).getValue();
    }

    public boolean M0(String str) {
        lh4.m.g(str, "url");
        if ((!ek4.y.n(str)) && !ek4.y.v(str, "data:text/html;charset=utf-8", false) && !ek4.y.v(str, "about:blank", false)) {
            if (!a0(this.f164473f0)) {
                return true;
            }
            String str2 = yp3.a.f347774a;
            lh4.m.f(str2, "HARDCODE_URL");
            if (!ek4.y.v(str, str2, false)) {
                return true;
            }
        }
        return false;
    }

    @Override // b10.t
    public int M3() {
        vp3.c B2 = B();
        int i15 = B2.f328023j;
        if (i15 == 0) {
            return B2.f328022i;
        }
        return i15;
    }

    public final kp3.l N() {
        return (kp3.l) ((wg4.n) this.L).getValue();
    }

    public boolean N0(String str) {
        lh4.m.g(str, "url");
        return true;
    }

    @Override // b10.t
    public boolean N3() {
        return !a0(this.f164473f0);
    }

    public final m O() {
        return (m) ((wg4.n) this.T).getValue();
    }

    public final synchronized <T extends WebAction> void O0(Iterable<? extends wg4.l<? extends T, ? extends kh4.a<wg4.b0>>> iterable, Set<String> set, String str) {
        Iterator<? extends wg4.l<? extends T, ? extends kh4.a<wg4.b0>>> it = iterable.iterator();
        while (it.hasNext()) {
            wg4.l lVar = (wg4.l) it.next();
            A a15 = lVar.f332807d;
            B b15 = lVar.f332808e;
            boolean z15 = false;
            if (a15 instanceof PageAction) {
                if (str != null && a15.verify(str)) {
                    z15 = true;
                }
            } else if (a15 instanceof ControllerAction) {
                z15 = a15.verify();
            }
            if (z15) {
                String E2 = E();
                Log.i(E2, "verify WebAction: " + lh4.g0.a(a15.getClass()).k() + " start");
                if (!a15.getKeep()) {
                    it.remove();
                }
                b15.invoke();
                String k15 = lh4.g0.a(a15.getClass()).k();
                if (k15 == null) {
                    k15 = "";
                }
                set.add(k15);
                E();
                lh4.g0.a(a15.getClass()).k();
            }
        }
    }

    @Override // b10.t
    public void O3(float f15) {
        this.f164482k.f266833h = f15;
    }

    public final int P() {
        if (!h0()) {
            return 0;
        }
        return this.f164496r ? 2 : 1;
    }

    public boolean P0() {
        return false;
    }

    @Override // b10.t
    public void P3(Intent intent) {
        JsapiPermissionWrapper jsapiPermissionWrapper;
        GeneralControlWrapper generalControlWrapper;
        JsapiPermissionWrapper jsapiPermissionWrapper2;
        lh4.m.g(intent, "intent");
        Log.i(E(), "startWebViewController#%s, isPreload: %s", Integer.valueOf(g()), Boolean.valueOf(this.f164482k.f266837l));
        this.G = true;
        this.f164512z = intent;
        r(new wp3.a(intent.getIntExtra(w.j.f187144j, -1)));
        vp3.h hVar = this.O;
        Parcelable parcelableExtra = intent.getParcelableExtra("hardcode_jspermission");
        GeneralControlWrapper generalControlWrapper2 = null;
        if (parcelableExtra instanceof JsapiPermissionWrapper) {
            jsapiPermissionWrapper = (JsapiPermissionWrapper) parcelableExtra;
        } else {
            jsapiPermissionWrapper = null;
        }
        Parcelable parcelableExtra2 = intent.getParcelableExtra("hardcode_general_ctrl");
        if (parcelableExtra2 instanceof GeneralControlWrapper) {
            generalControlWrapper = (GeneralControlWrapper) parcelableExtra2;
        } else {
            generalControlWrapper = null;
        }
        hVar.h(jsapiPermissionWrapper, generalControlWrapper);
        if (intent.hasExtra("scan_jspermission") && intent.hasExtra("scan_general_ctrl")) {
            vp3.h hVar2 = this.O;
            String y35 = y3();
            Parcelable parcelableExtra3 = intent.getParcelableExtra("scan_jspermission");
            if (parcelableExtra3 instanceof JsapiPermissionWrapper) {
                jsapiPermissionWrapper2 = (JsapiPermissionWrapper) parcelableExtra3;
            } else {
                jsapiPermissionWrapper2 = null;
            }
            Parcelable parcelableExtra4 = intent.getParcelableExtra("scan_general_ctrl");
            if (parcelableExtra4 instanceof GeneralControlWrapper) {
                generalControlWrapper2 = (GeneralControlWrapper) parcelableExtra4;
            }
            hVar2.g(y35, jsapiPermissionWrapper2, generalControlWrapper2);
        }
        v(this.f164471e0);
        xp3.c cVar = this.f164472f;
        wq3.v vVar = this.S;
        long j15 = vVar.f334866s;
        long j16 = vVar.f334869v;
        d.a aVar = vVar.f334864q;
        cVar.getClass();
        lh4.m.g(aVar, "procBootType");
        cVar.f340550a = System.currentTimeMillis();
        cVar.f340553d = j15;
        cVar.f340554e = j16;
        cVar.f340556g = aVar;
        cVar.f340555f.clear();
        cVar.f340558i = aq3.d.b();
        xp3.c cVar2 = this.f164472f;
        cVar2.f340560k = this.f164482k.f266837l;
        cVar2.f340559j = this.S.f334863p;
        String y36 = y3();
        lh4.m.g(y36, "<set-?>");
        cVar2.f340551b = y36;
        xp3.c cVar3 = this.f164472f;
        String str = (String) ((wg4.n) this.f164502u).getValue();
        lh4.m.f(str, "prefetchId");
        cVar3.getClass();
        cVar3.f340552c = str;
        xp3.c cVar4 = this.f164472f;
        d.a aVar2 = this.f164504v;
        cVar4.getClass();
        lh4.m.g(aVar2, "<set-?>");
        cVar4.f340557h = aVar2;
    }

    public final wq3.v Q() {
        return this.S;
    }

    public boolean Q0() {
        return false;
    }

    public int R(String str) {
        return 0;
    }

    @Override // b10.t
    public String S(String str) {
        return "";
    }

    public final String T() {
        vp3.c B2 = B();
        String currentUrl = getCurrentUrl();
        return B2.n(currentUrl == null || ek4.y.n(currentUrl) ? y3() : getCurrentUrl());
    }

    @Override // b10.t
    public com.tencent.mm.plugin.webview.stub.l U() {
        com.tencent.mm.plugin.webview.stub.l lVar = this.f164510y;
        if (lVar != null) {
            return lVar;
        }
        lh4.m.p("invoker");
        throw null;
    }

    public final String V() {
        return this.f164486m;
    }

    public final ConcurrentLinkedDeque<kh4.a<wg4.b0>> W(int i15) {
        ConcurrentLinkedDeque<kh4.a<wg4.b0>> concurrentLinkedDeque = this.X.get(Integer.valueOf(i15));
        if (concurrentLinkedDeque != null) {
            return concurrentLinkedDeque;
        }
        ConcurrentLinkedDeque<kh4.a<wg4.b0>> concurrentLinkedDeque2 = new ConcurrentLinkedDeque<>();
        this.X.put(Integer.valueOf(i15), concurrentLinkedDeque2);
        return concurrentLinkedDeque2;
    }

    public abstract Class<? extends Service> X();

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

    public final MMWebView Z() {
        return this.f164462a;
    }

    public final synchronized boolean a0(int i15) {
        return this.f164511y0.contains(Integer.valueOf(i15));
    }

    public void b0() {
        if (((yq.d) yz3.j.c(yq.d.class)).isInstalled("appbrand")) {
            r(new wp3.b());
            r(new com.tencent.mm.plugin.webview.webcompt.s());
        }
        this.f164462a.setWebViewClient(this);
        MMWebView mMWebView = this.f164462a;
        WebSettings settings = mMWebView.getSettings();
        settings.setJavaScriptEnabled(((Boolean) ((wg4.n) this.f164464b.f9912a.f9921c).getValue()).booleanValue());
        settings.setDomStorageEnabled(true);
        settings.setBuiltInZoomControls(((Boolean) ((wg4.n) this.f164464b.f9912a.f9920b).getValue()).booleanValue());
        settings.setUseWideViewPort(true);
        settings.setLoadWithOverviewMode(true);
        settings.setSavePassword(false);
        settings.setSaveFormData(false);
        settings.setGeolocationEnabled(true);
        settings.setJavaScriptCanOpenWindowsAutomatically(true);
        settings.setMixedContentMode(0);
        settings.setAppCacheMaxSize(10485760);
        settings.setAppCachePath(mMWebView.getContext().getDir("webviewcache", 0).getAbsolutePath());
        settings.setAppCacheEnabled(true);
        settings.setDatabaseEnabled(true);
        settings.setDatabasePath(z80.b.Z() + "databases/");
        settings.setAllowFileAccess(true);
        String userAgentString = settings.getUserAgentString();
        lh4.m.f(userAgentString, "currentUa");
        if (!ek4.d0.x(userAgentString, " MicroMessenger/", false)) {
            u.a aVar = (u.a) bb.e.a(u.a.class);
            if (aVar == null) {
                aVar = new com.tencent.mm.plugin.appbrand.luggage.customize.h(mMWebView.getContext());
            }
            j.b bVar = wq3.j.f334809f;
            ((MultiProcessMMKV) ((wg4.n) wq3.j.f334810g).getValue()).putString("key_web_prefetch_ua", userAgentString);
            String a15 = gx0.u.a(mMWebView.getContext(), userAgentString, aVar);
            N().f247884b = a15;
            settings.setUserAgentString(a15);
        }
        if (!((Boolean) ((wg4.n) this.f164464b.f9912a.f9922d).getValue()).booleanValue()) {
            mMWebView.setVerticalScrollBarEnabled(false);
            mMWebView.setHorizontalScrollBarEnabled(false);
        }
        CookieManager.getInstance().setAcceptCookie(true);
        CookieManager.getInstance().setAcceptThirdPartyCookies(mMWebView, true);
        MMWebView mMWebView2 = this.f164462a;
        if (mMWebView2.f187323e) {
            String url = mMWebView2.getUrl();
            if (url == null) {
                url = "";
            }
            C0(url);
        }
        MMWebView mMWebView3 = this.f164462a;
        ((HashSet) mMWebView3.f187328j).add(this.f164463a0);
        wq3.w wVar = this.f164478i;
        if (wVar != null) {
            wVar.f334879h = System.currentTimeMillis();
        }
        this.S.a("onTryBindServiceStart", System.currentTimeMillis());
        Log.i(E(), "WebView-Trace tryBindService");
        e0.f164567a.a(true, X(), new b(new WeakReference(this)));
        this.S.a("onTryBindServiceEnd", System.currentTimeMillis());
    }

    public final void c0(String str) {
        lh4.m.g(str, "url");
        try {
            if (U().Vy()) {
                k0(((a2) yz3.j.c(a2.class)).Ql(H(), U(), str));
            }
        } catch (Exception e15) {
            String E2 = E();
            Log.w(E2, "initFont, ex = " + e15.getMessage());
        }
    }

    public final void d0(Intent intent, long j15, long j16, boolean z15, String str) {
        d.a aVar;
        String str2;
        wq3.v vVar = this.S;
        String str3 = "";
        if (str == null) {
            str = str3;
        }
        vVar.getClass();
        vVar.f334862o = str;
        wq3.v vVar2 = this.S;
        vVar2.f334863p = z15;
        String valueOf = String.valueOf(g());
        vVar2.getClass();
        lh4.m.g(valueOf, "controllerId");
        vVar2.f334868u = valueOf;
        vVar2.f334866s = j15;
        vVar2.f334869v = j16;
        if (j15 <= 0) {
            aVar = d.a.None;
        } else if (d60.z.n().a().f224329e.f224335f - j15 > 0) {
            aVar = d.a.ColdBoot;
        } else {
            aVar = d.a.WarmBoot;
        }
        vVar2.f334864q = aVar;
        vVar2.f334865r = aq3.d.b();
        vVar2.a("onCreate", vVar2.f334869v);
        Log.i("MicroMsg.WebViewPerformanceHelper", "initPerformanceHelper#" + valueOf + " start: " + j15 + ", create: " + j16 + ", reCreateUI: " + vVar2.f334863p + ", processBootType: " + vVar2.f334864q);
        wq3.v vVar3 = this.S;
        int i15 = 0;
        if (intent != null) {
            i15 = intent.getIntExtra("KPageScene", 0);
        }
        vVar3.f334871x = i15;
        wq3.v vVar4 = this.S;
        if (intent != null) {
            str2 = intent.getStringExtra("KPageInfo");
        } else {
            str2 = null;
        }
        if (str2 != null) {
            str3 = str2;
        }
        vVar4.getClass();
        vVar4.f334870w = str3;
    }

    /* JADX WARNING: Removed duplicated region for block: B:41:0x013d  */
    @Override // com.tencent.xweb.WebViewClient
    public void doUpdateVisitedHistory(WebView webView, String str, boolean z15) {
        f1 M2;
        lh4.m.g(webView, "view");
        lh4.m.g(str, "url");
        String url = webView.getUrl();
        Log.i(E(), "WebView-Trace doUpdateVisitedHistory, url = " + str + ", wvUrl = " + url + ", isReload = " + z15);
        if (ek4.y.v(str, "data:text/html;charset=utf-8", false)) {
            Log.i(E(), "url starts with data:text, url : " + str);
        } else if (bd.d.c(str, "about:blank", true) || bd.d.c(str, "file:///android_asset/", true)) {
            Log.e(E(), "doUpdateVisitedHistory, url is invalid");
        } else {
            if (a0(this.f164473f0)) {
                String str2 = yp3.a.f347774a;
                lh4.m.f(str2, "HARDCODE_URL");
                if (bd.d.c(str, str2, true)) {
                    Log.i(E(), "doUpdateVisitedHistory, url is HARDCODE_URL");
                    return;
                }
            }
            super.doUpdateVisitedHistory(webView, str, z15);
            lh4.m.f(url, "wvUrl");
            if (bd.d.c(url, ProxyConfig.MATCH_HTTP, true)) {
                str = url;
            }
            if (!lh4.m.b(this.B, str)) {
                String str3 = this.C;
                if ((str3 == null || ek4.y.n(str3)) || lh4.m.b(com.tencent.mm.plugin.webview.webcompt.a.a(str), com.tencent.mm.plugin.webview.webcompt.a.a(this.C))) {
                    String str4 = this.B;
                    if ((str4 == null || ek4.y.n(str4)) || lh4.m.b(com.tencent.mm.plugin.webview.webcompt.a.a(str), com.tencent.mm.plugin.webview.webcompt.a.a(this.B))) {
                        this.E = str;
                        Log.i(E(), "update safeSpaUrl = " + this.E);
                        E();
                        if (this.O.e(str)) {
                            w(this.f164493p0, str);
                        }
                        M2 = M();
                        if (M2.f247849a != null || M2.f247850b == null) {
                            Log.e("MicroMsg.JsLoader", "auth, viewWV or jsapi is null");
                        } else {
                            Log.i("MicroMsg.JsLoader", "SPA-Trace, spaHistoryChanged");
                            M2.f247850b.d0("sys:spa:historyChanged", new HashMap(), null);
                        }
                        this.D = str;
                        d.c cVar = this.f164474g;
                        long currentTimeMillis = System.currentTimeMillis();
                        String title = this.f164462a.getTitle();
                        lh4.m.f(title, "viewWV.title");
                        cVar.a(new d.c.a(str, currentTimeMillis, title));
                    }
                }
                Log.w(E(), "dealSPAUpdate hot not equal, url=" + str + ", commitUrl=" + this.C + ", startUrl=" + this.B);
                E();
                if (this.O.e(str)) {
                }
                M2 = M();
                if (M2.f247849a != null) {
                }
                Log.e("MicroMsg.JsLoader", "auth, viewWV or jsapi is null");
                this.D = str;
                d.c cVar2 = this.f164474g;
                long currentTimeMillis2 = System.currentTimeMillis();
                String title2 = this.f164462a.getTitle();
                lh4.m.f(title2, "viewWV.title");
                cVar2.a(new d.c.a(str, currentTimeMillis2, title2));
            }
            if (!this.f164464b.f9916e && !B().f328033t.b(str)) {
                I0(str, false, B().k(str, true));
            }
            this.f164506w = str;
            for (T t15 : this.V) {
                if (i0()) {
                    t15.a(webView, str, z15);
                }
            }
            x(webView, str);
        }
    }

    public WebResourceResponse e0(WebView webView, WebResourceRequest webResourceRequest, Bundle bundle) {
        String uri;
        lh4.m.g(webView, "webView");
        lh4.m.g(webResourceRequest, "request");
        Log.i(E(), "shouldInterceptRequest, url = " + webResourceRequest.getUrl() + ", method = " + webResourceRequest.getMethod() + ", isForMainFrame = " + webResourceRequest.isForMainFrame());
        String uri2 = webResourceRequest.getUrl().toString();
        lh4.m.f(uri2, "request.url.toString()");
        if (A(uri2)) {
            return null;
        }
        if (bundle != null) {
            try {
                int i15 = bundle.getInt("resourceType");
                if (i15 == 1 || i15 == 7) {
                    Log.i(E(), "get resoutce type is iframe : %d, start geta8key", Integer.valueOf(i15));
                    vp3.c B2 = B();
                    String currentUrl = getCurrentUrl();
                    B2.getClass();
                    Log.i("MicroMsg.LuggageGetA8Key", "setOuterUrlForIframe(%s)", currentUrl);
                    B2.f328032s = currentUrl;
                    I0(uri2, false, 5);
                    if (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(uri2)) {
                            com.tencent.mm.plugin.webview.modeltools.o.f165951a.add(uri2);
                        }
                    }
                }
            } catch (Exception e15) {
                Log.w(E(), "get resource type failed Exception ; " + e15.getMessage());
            } catch (Throwable th5) {
                Log.w(E(), "get resource type failed Throwable ; " + th5.getMessage());
            }
        }
        Iterator<b0> it = this.U.iterator();
        while (it.hasNext()) {
            WebResourceResponse f15 = it.next().f(webView, webResourceRequest);
            if (f15 != null) {
                return f15;
            }
        }
        if (((Boolean) ((wg4.n) this.J0).getValue()).booleanValue()) {
            String[] strArr = M0;
            int i16 = 0;
            for (int i17 = 0; i17 < 4; i17++) {
                String str = strArr[i17];
                i16++;
                Uri url = webResourceRequest.getUrl();
                if (url != null && (uri = url.toString()) != null && ek4.y.v(uri, str, false)) {
                    Log.i(E(), "QuickAppInterceptor interceptor url = " + str);
                    com.tencent.mm.plugin.report.service.q.INSTANCE.v(1551, (long) i16, 1);
                    if (((Boolean) ((wg4.n) this.K0).getValue()).booleanValue()) {
                        Log.i(E(), "QuickAppInterceptor interceptor WebResourceResponse");
                        return new WebResourceResponse("", null, null);
                    }
                }
            }
        }
        return null;
    }

    public final b0.a f0(WebView webView, String str) {
        lh4.m.g(webView, "webView");
        lh4.m.g(str, "url");
        Iterator<T> it = this.U.iterator();
        while (it.hasNext()) {
            b0.a r15 = it.next().r(webView, str);
            if (r15.f164560a) {
                return r15;
            }
        }
        return new b0.a(false, false);
    }

    @Override // b10.t
    public int g() {
        return ((Number) ((wg4.n) this.M).getValue()).intValue();
    }

    public final boolean g0() {
        return this.I || this.H;
    }

    @Override // b10.t
    public String getCurrentUrl() {
        if (ek4.y.n(this.D)) {
            return this.C;
        }
        return this.D;
    }

    @Override // b10.t
    public Object getWebViewPluginClientProxy() {
        if (this.G0 == null) {
            G0();
        }
        return this.G0;
    }

    public boolean h0() {
        if (!a0(this.f164473f0) || !lh4.m.b(this.A, this.C)) {
            return false;
        }
        return true;
    }

    public final synchronized boolean i0() {
        return this.A0.contains(lh4.g0.a(Start.class).k());
    }

    @Override // b10.t
    public void init() {
        synchronized (this) {
            Log.i(E(), "resetActions");
            this.f164511y0.clear();
            this.A0.clear();
            this.f164505v0.clear();
            this.f164509x0.clear();
            this.f164513z0.clear();
            this.f164507w0.clear();
            try {
                System.currentTimeMillis();
                for (T t15 : D()) {
                    WebAction webAction = t15.f164523a;
                    webAction.setController(this);
                    if (webAction instanceof ControllerAction) {
                        this.f164505v0.add(new wg4.l<>(webAction, t15.f164524b));
                    } else if (webAction instanceof PageAction) {
                        this.f164507w0.add(new wg4.l<>(webAction, t15.f164524b));
                    }
                }
                E();
                System.currentTimeMillis();
            } catch (Exception e15) {
                String E2 = E();
                Log.i(E2, "resetActions ex" + e15.getMessage());
            }
        }
        v(this.f164467c0);
        MMWebView mMWebView = this.f164462a;
        ((ArrayList) mMWebView.f187332q).add(new d());
        kp3.l N2 = N();
        N2.getClass();
        N2.f247896n = this;
        kq3.a aVar = N2.f247908z;
        int g15 = g();
        aVar.getClass();
        Log.i("MicroMsg.WebViewExtEventHandler", "setWebViewId: " + g15);
        aVar.f248139a = g15;
    }

    public final boolean j0(String str) {
        Iterator<T> it = I().iterator();
        while (it.hasNext()) {
            if (bd.d.c(str, it.next(), true)) {
                return true;
            }
        }
        return false;
    }

    public void k0(int i15) {
        WebSettings webSettings;
        MMWebView mMWebView = this.f164462a;
        if (mMWebView != null) {
            webSettings = mMWebView.getSettings();
        } else {
            webSettings = null;
        }
        if (webSettings != null) {
            if (i15 < 1) {
                i15 = 2;
            }
            String E2 = E();
            Log.i(E2, "localSetFontSize, fontSize = " + i15);
            switch (i15) {
                case 1:
                    this.f164462a.getSettings().setTextZoom(80);
                    break;
                case 2:
                    this.f164462a.getSettings().setTextZoom(100);
                    break;
                case 3:
                    this.f164462a.getSettings().setTextZoom(110);
                    break;
                case 4:
                    this.f164462a.getSettings().setTextZoom(112);
                    break;
                case 5:
                    this.f164462a.getSettings().setTextZoom(113);
                    break;
                case 6:
                    this.f164462a.getSettings().setTextZoom(140);
                    break;
                case 7:
                    this.f164462a.getSettings().setTextZoom(155);
                    break;
                case 8:
                    this.f164462a.getSettings().setTextZoom(165);
                    break;
                default:
                    this.f164462a.getSettings().setTextZoom(100);
                    break;
            }
            mp3.b bVar = this.f164482k;
            int textZoom = this.f164462a.getSettings().getTextZoom();
            bVar.f266831f = i15;
            bVar.f266832g = textZoom;
        }
    }

    /* JADX DEBUG: Method arguments types fixed to match base method, original types: [int, boolean, java.lang.String, java.lang.String, java.lang.Object] */
    @Override // vp3.a
    public void l(int i15, boolean z15, String str, String str2, z62 z622) {
        z62 z623 = z622;
        lh4.m.g(str, "reqUrl");
        lh4.m.g(str2, "fullUrl");
        lh4.m.g(z623, "response");
        boolean z16 = true;
        if (!A(str2)) {
            Iterator<b0> it = this.U.iterator();
            while (true) {
                if (it.hasNext()) {
                    if (it.next().s(i15, z15, str, str2)) {
                        break;
                    }
                } else {
                    z16 = false;
                    break;
                }
            }
        } else {
            String E2 = E();
            Log.f(E2, "processGetA8Key qrcode, canLoadUrl fail, url = " + str2);
        }
        if (!z16) {
            E();
            t.a.a(this, str2, this.P, false, 4, null);
            Iterator<z> it4 = this.W.iterator();
            while (it4.hasNext()) {
                it4.next().q(i15, str, z623);
            }
        }
    }

    public boolean l0() {
        return true;
    }

    @Override // vp3.a
    public void m(int i15, String str, String str2) {
        if (str2 != null) {
            WebSettings settings = this.f164462a.getSettings();
            if (settings != null) {
                settings.setJavaScriptEnabled(false);
            }
            this.f164462a.loadData(str2, "text/html", "utf-8");
        }
    }

    public final String m0(String str) {
        boolean z15;
        if (str == null || ek4.y.n(str)) {
            z15 = true;
        } else {
            z15 = false;
        }
        if (z15 || bd.d.c(str, "about:blank", true) || bd.d.c(str, "data:text/html;charset=utf-8", true)) {
            return this.A;
        }
        return str;
    }

    @Override // vp3.a
    public void n(int i15, String str, int i16, int i17, String str2) {
        lh4.m.g(str, "reqUrl");
        lh4.m.g(str2, "errMsg");
        if (i15 == -1 || i15 == 0) {
            this.f164506w = null;
        }
        this.F = str;
        w(this.f164479i0, str);
        Iterator<T> it = this.W.iterator();
        while (it.hasNext()) {
            it.next().b(i15, str, i16, i17, str2);
        }
    }

    public void n0() {
    }

    @Override // vp3.a
    public void o(int i15, String str) {
        lh4.m.g(str, "reqUrl");
        this.S.a("getA8KeyStart", System.currentTimeMillis());
        if (i15 != 5) {
            w(this.f164483k0, str);
        }
        if (!lh4.m.b(this.D, str)) {
            ((xc4.j) xc4.j.f338034d).z(new a0(this, i15, str));
        }
    }

    public final void o0() {
        String E2 = E();
        Log.i(E2, "onFinish " + Util.getStack());
        Iterator<T> it = this.W.iterator();
        while (it.hasNext()) {
            it.next().f();
        }
    }

    /* JADX WARNING: Code restructure failed: missing block: B:11:0x0021, code lost:
        r2 = move-exception;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:12:0x0022, code lost:
        hh4.b.a(r1, r0);
     */
    /* JADX WARNING: Code restructure failed: missing block: B:13:0x0025, code lost:
        throw r2;
     */
    @Override // b10.t
    public void onDestroy() {
        this.H = true;
        if (!this.I) {
            A0(false);
        }
        i iVar = this.C0;
        if (iVar != null) {
            Log.i(E(), "unbindService");
            wg4.b0 b0Var = wg4.b0.f332794a;
            hh4.b.a(iVar, null);
        }
        K().removeCallbacksAndMessages((Runnable) ((wg4.n) this.Q).getValue());
        N().l();
        f1 M2 = M();
        M2.f247849a = null;
        M2.f247850b = null;
        M2.f247851c = null;
        B().f328028o = true;
        if (B().r()) {
            ((aq3.c) ((wg4.n) this.E0).getValue()).getClass();
        }
    }

    /* JADX WARNING: Removed duplicated region for block: B:29:0x00b8  */
    /* JADX WARNING: Removed duplicated region for block: B:33:0x00d1  */
    /* JADX WARNING: Removed duplicated region for block: B:35:0x00dc  */
    /* JADX WARNING: Removed duplicated region for block: B:52:0x0144  */
    @Override // com.tencent.xweb.WebViewClient
    public void onPageCommitVisible(WebView webView, String str) {
        String str2;
        boolean z15;
        Iterator<u> it;
        String str3;
        LinkedList<h1> linkedList;
        if (g0()) {
            Log.w(E(), "ActivityFinished");
            return;
        }
        kp3.l N2 = N();
        if (!(N2 == null || (linkedList = N2.f247887e) == null)) {
            linkedList.clear();
        }
        if (str == null) {
            str2 = "";
        } else {
            str2 = str;
        }
        String F2 = F(str2);
        Log.i(E(), "WebView-Trace onPageCommitVisible#" + g() + ": " + str + ", callbackUrl:" + F2);
        String str4 = this.E;
        boolean z16 = true;
        if (str4 == null || ek4.y.n(str4)) {
            z15 = true;
        } else {
            z15 = false;
        }
        if (!z15) {
            if (str != null) {
                str3 = com.tencent.mm.plugin.webview.webcompt.a.a(str);
            } else {
                str3 = null;
            }
            if (!lh4.m.b(str3, com.tencent.mm.plugin.webview.webcompt.a.a(this.E))) {
                Log.w(E(), "onPageCommitVisible hot not equal, url=" + str + ", safeSpaUrl=" + this.E);
                this.E = "";
                C0(F2);
                super.onPageCommitVisible(webView, str);
                v.b bVar = v.f164638a;
                if (x.a().getBoolean("webview_page_commit_mock", false)) {
                    if (s(this.f164489n0, m0(str))) {
                        K0(str);
                    }
                    w(this.f164489n0, m0(str));
                } else {
                    Log.i(E(), "WebView Page Commit Mock Enabled");
                }
                if (webView != null) {
                    if (!u(str) && a0(this.f164471e0) && B().r()) {
                        String y35 = y3();
                        if (y35 != null && !ek4.y.n(y35)) {
                            z16 = false;
                        }
                        if (!z16) {
                            ((aq3.c) ((wg4.n) this.E0).getValue()).a(webView, str, y3(), B(), 0, false);
                        }
                    }
                    d.c cVar = this.f164474g;
                    String str5 = this.C;
                    long currentTimeMillis = System.currentTimeMillis();
                    String title = webView.getTitle();
                    lh4.m.f(title, "view.title");
                    cVar.a(new d.c.a(str5, currentTimeMillis, title));
                }
                it = this.V.iterator();
                while (it.hasNext()) {
                    u next = it.next();
                    if (i0()) {
                        next.b(webView, F2);
                    }
                }
                x(webView, str);
            }
        }
        this.E = this.D;
        C0(F2);
        super.onPageCommitVisible(webView, str);
        v.b bVar2 = v.f164638a;
        if (x.a().getBoolean("webview_page_commit_mock", false)) {
        }
        if (webView != null) {
        }
        it = this.V.iterator();
        while (it.hasNext()) {
        }
        x(webView, str);
    }

    @Override // com.tencent.xweb.WebViewClient
    public void onPageFinished(WebView webView, String str) {
        String str2;
        String url;
        if (g0()) {
            Log.w(E(), "ActivityFinished");
            return;
        }
        if (!(webView == null || (url = webView.getUrl()) == null)) {
            str = url;
        }
        if (str == null) {
            str2 = "";
        } else {
            str2 = str;
        }
        String F2 = F(str2);
        String E2 = E();
        Log.i(E2, "WebView-Trace onPageFinished#" + g() + ": " + str + ", callbackUrl:" + F2);
        super.onPageFinished(webView, str);
        if (!this.f164509x0.contains(Integer.valueOf(this.f164489n0)) && !h0()) {
            com.tencent.mm.plugin.report.service.q.INSTANCE.idkeyStat(1200, 104, 1, false);
            String E3 = E();
            Log.i(E3, "WebView-Trace onPageFinished#" + g() + " callback before onPageCommitVisible");
        }
        w(this.f164491o0, m0(str));
        for (T t15 : this.V) {
            if (i0()) {
                t15.c(webView, F2);
            }
        }
        x(webView, str);
    }

    @Override // com.tencent.xweb.WebViewClient
    public void onPageStarted(WebView webView, String str, Bitmap bitmap) {
        lh4.m.g(webView, "view");
        lh4.m.g(str, "url");
        if (g0()) {
            Log.w(E(), "ActivityFinished");
            return;
        }
        w(this.f164481j0, str);
        String E2 = E();
        Log.i(E2, "WebView-Trace onPageStarted#" + g() + ": " + str);
        this.f164506w = str;
        synchronized (this) {
            String E3 = E();
            Log.i(E3, "resetPageActions clear status:" + str + ", [" + xg4.c0.V(this.f164509x0, ",", null, null, 0, null, null, 62, null) + "] actions: [" + xg4.c0.V(this.f164513z0, ",", null, null, 0, null, null, 62, null) + ']');
            this.f164509x0.clear();
            this.f164513z0.clear();
            this.f164507w0.clear();
            for (T t15 : D()) {
                WebAction webAction = t15.f164523a;
                webAction.setController(this);
                if (webAction instanceof PageAction) {
                    this.f164507w0.add(new wg4.l<>(webAction, t15.f164524b));
                }
            }
            F0(str);
            this.D = "";
        }
        for (T t16 : this.V) {
            if (i0()) {
                t16.d(webView, F(str));
            }
        }
        super.onPageStarted(webView, str, bitmap);
    }

    @Override // com.tencent.xweb.WebViewClient
    public void onReceivedError(WebView webView, int i15, String str, String str2) {
        int i16;
        super.onReceivedError(webView, i15, str, str2);
        if (!ck.e.c(23)) {
            String E2 = E();
            Log.i(E2, "WebView-Trace onReceivedError-old#" + g() + ", errCode:" + i15 + ", description:" + str + ", failingUrl:" + str2);
            if (!a0(this.f164471e0)) {
                Log.i(E(), "onReceivedError, intent not ready");
                return;
            }
            if (a0(this.f164469d0)) {
                m O2 = O();
                String S2 = S(getCurrentUrl());
                MMWebView mMWebView = this.f164462a;
                if (mMWebView == null) {
                    i16 = 0;
                } else {
                    i16 = mMWebView.isXWalkKernel() ? 2 : 3;
                }
                O2.c(i15, str, str2, S2, i16, P(), true);
            }
            for (T t15 : this.V) {
                if (i0()) {
                    t15.e(webView, i15, str, str2);
                }
            }
        }
    }

    @Override // com.tencent.xweb.WebViewClient
    public void onReceivedHttpAuthRequest(WebView webView, HttpAuthHandler httpAuthHandler, String str, String str2) {
        lh4.m.g(httpAuthHandler, "handler");
        super.onReceivedHttpAuthRequest(webView, httpAuthHandler, str, str2);
        com.tencent.mm.plugin.report.service.q.INSTANCE.v(155, 35, 1);
    }

    @Override // com.tencent.xweb.WebViewClient
    public void onReceivedHttpError(WebView webView, WebResourceRequest webResourceRequest, WebResourceResponse webResourceResponse) {
        int i15;
        super.onReceivedHttpError(webView, webResourceRequest, webResourceResponse);
        String E2 = E();
        StringBuilder sb5 = new StringBuilder();
        sb5.append("WebView-Trace onReceivedHttpError#");
        sb5.append(g());
        sb5.append(", errCode:");
        Uri uri = null;
        sb5.append(webResourceResponse != null ? Integer.valueOf(webResourceResponse.getStatusCode()) : null);
        sb5.append(", description:");
        sb5.append(webResourceResponse != null ? webResourceResponse.getReasonPhrase() : null);
        sb5.append(", failingUrl:");
        if (webResourceRequest != null) {
            uri = webResourceRequest.getUrl();
        }
        sb5.append(uri);
        Log.i(E2, sb5.toString());
        if (!a0(this.f164471e0)) {
            Log.i(E(), "onReceivedHttpError, intent not ready");
            return;
        }
        if (a0(this.f164469d0)) {
            m O2 = O();
            String S2 = S(getCurrentUrl());
            MMWebView mMWebView = this.f164462a;
            if (mMWebView == null) {
                i15 = 0;
            } else if (mMWebView.isXWalkKernel()) {
                i15 = 2;
            } else {
                i15 = 3;
            }
            int P2 = P();
            if (O2.d() && webResourceRequest != null) {
                ((xc4.j) xc4.j.f338034d).g(new o(webResourceRequest, O2, webResourceResponse, S2, i15, P2), "MicroMsg.WebPageErrorMonitor");
            }
        }
        for (T t15 : this.V) {
            if (i0()) {
                t15.g(webView, webResourceRequest, webResourceResponse);
            }
        }
    }

    @Override // com.tencent.xweb.WebViewClient
    public void onReceivedSslError(WebView webView, SslErrorHandler sslErrorHandler, SslError sslError) {
        String str;
        int i15;
        super.onReceivedSslError(webView, sslErrorHandler, sslError);
        String E2 = E();
        StringBuilder sb5 = new StringBuilder();
        sb5.append("WebView-Trace onReceivedSslError#");
        sb5.append(g());
        sb5.append(", ");
        if (sslError != null) {
            str = sslError.toString();
        } else {
            str = null;
        }
        sb5.append(str);
        Log.i(E2, sb5.toString());
        if (!a0(this.f164471e0)) {
            Log.i(E(), "onReceivedSslError, intent not ready");
            return;
        }
        if (a0(this.f164469d0)) {
            m O2 = O();
            String S2 = S(getCurrentUrl());
            MMWebView mMWebView = this.f164462a;
            if (mMWebView == null) {
                i15 = 0;
            } else if (mMWebView.isXWalkKernel()) {
                i15 = 2;
            } else {
                i15 = 3;
            }
            int P2 = P();
            if (O2.d() && sslError != null) {
                xc4.t tVar = xc4.j.f338034d;
                ((xc4.j) tVar).g(new p(sslError, O2, S2, i15, P2), "MicroMsg.WebPageErrorMonitor");
            }
        }
        for (T t15 : this.V) {
            if (i0()) {
                t15.h(webView, sslErrorHandler, sslError);
            }
        }
    }

    @Override // com.tencent.xweb.WebViewClient
    public boolean onRenderProcessGone(WebView webView, RenderProcessGoneDetail renderProcessGoneDetail) {
        boolean z15;
        if (this.I0) {
            return super.onRenderProcessGone(webView, renderProcessGoneDetail);
        }
        l lVar = this.H0;
        if (lVar != null) {
            WebViewUI$$e0 webViewUI$$e0 = (WebViewUI$$e0) lVar;
            WebViewUI webViewUI = webViewUI$$e0.f166531a;
            if (webViewUI.C1 || webViewUI.B1 || webViewUI.isFinishing()) {
                Log.e("MicroMsg.WebViewUI", "WebView-Trace RenderProcess has destroyed");
            } else if (webViewUI$$e0.f166531a.isPaused()) {
                Log.i("MicroMsg.WebViewUI", "WebView-Trace RenderProcess has pause");
            } else {
                webViewUI$$e0.f166531a.getClass();
                if (BuildInfo.DEBUG || BuildInfo.IS_FLAVOR_RED || ((ie1.h) yz3.j.c(ie1.h.class)).Xj0(h.c.Tv, 0) == 1) {
                    z15 = true;
                } else {
                    z15 = false;
                }
                if (!z15) {
                    Log.i("MicroMsg.WebViewUI", "WebView-Trace RenderProcess recover mode not enable");
                } else if (webViewUI$$e0.f166531a.F2) {
                    Log.e("MicroMsg.WebViewUI", "WebView-Trace RenderProcessGone, hasCallRenderProcessGone, return");
                } else {
                    com.tencent.mm.plugin.report.service.q qVar = com.tencent.mm.plugin.report.service.q.INSTANCE;
                    qVar.t(1009, 230);
                    WebViewUI webViewUI2 = webViewUI$$e0.f166531a;
                    webViewUI2.F2 = true;
                    Bundle extras = webViewUI2.getIntent().getExtras();
                    if (extras.getBoolean("renderRecoverMode", false)) {
                        qVar.t(1009, 232);
                        Log.e("MicroMsg.WebViewUI", "WebView-Trace RenderProcessGone, will not open new page to recover");
                    } else {
                        qVar.t(1009, 231);
                        Log.i("MicroMsg.WebViewUI", "WebView-Trace RenderProcessGone do , will not open new page to recover");
                        Intent intent = new Intent();
                        intent.putExtras(extras);
                        intent.putExtra("renderRecoverMode", true);
                        sv3.b.j(webViewUI$$e0.f166531a, "webview", ".ui.tools.WebViewUI", intent, null);
                        xc4.t tVar = xc4.j.f338034d;
                        i2 i2Var = new i2(webViewUI$$e0);
                        xc4.j jVar = (xc4.j) tVar;
                        jVar.getClass();
                        jVar.w(i2Var, 100, false);
                    }
                }
            }
            this.I0 = true;
        }
        return super.onRenderProcessGone(webView, renderProcessGoneDetail);
    }

    public void p0() {
        if (!this.F0) {
            q0();
            this.F0 = true;
        }
        Iterator<T> it = this.W.iterator();
        while (it.hasNext()) {
            it.next().j();
        }
    }

    @Override // vp3.a
    public void q(int i15, String str) {
        lh4.m.g(str, "reqUrl");
        this.S.a("getA8KeyEnd", System.currentTimeMillis());
        Iterator<T> it = this.W.iterator();
        while (it.hasNext()) {
            it.next().a(i15, str);
        }
    }

    public void q0() {
    }

    public final void r(b0 b0Var) {
        lh4.m.g(b0Var, "interceptor");
        this.U.add(b0Var);
        u b15 = b0Var.b();
        if (b15 != null) {
            L3(b15);
        }
        z d15 = b0Var.d();
        if (d15 != null) {
            E3(d15);
        }
        b0Var.f164558a = this;
        b0Var.h();
    }

    /* renamed from: r0 */
    public void i(int i15, String str, String str2, z62 z622) {
        boolean z15;
        lh4.m.g(str, "reqUrl");
        lh4.m.g(str2, "fullUrl");
        lh4.m.g(z622, "response");
        E();
        g();
        if (g0()) {
            E();
            return;
        }
        this.F = str2;
        this.O.g(str, B().g(str), B().d(str));
        this.O.g(str2, B().g(str2), B().d(str2));
        Iterator<T> it = this.W.iterator();
        while (it.hasNext()) {
            it.next().k(i15, str, z622);
        }
        w(this.f164477h0, str);
        w(this.f164477h0, str2);
        boolean z16 = true;
        if (!this.f164498s) {
            GeneralControlWrapper b15 = this.O.b();
            if (b15 == null || (b15.f173509d & 8388608) <= 0) {
                z15 = false;
            } else {
                z15 = true;
            }
            this.f164498s = z15;
        }
        if (!this.f164500t) {
            c72 c722 = B().f328039z;
            if (c722 == null || c722.f18025f != 1) {
                z16 = false;
            }
            this.f164500t = z16;
        }
        if (lh4.m.b(str, this.D)) {
            w(this.f164493p0, str);
            Log.i(E(), "WebAction:Ready onPermissionUpdated Patch: " + this.D);
        }
    }

    @Override // b10.t
    public void reload() {
        MMWebView mMWebView = this.f164462a;
        if (mMWebView != null && !Util.isNullOrNil(mMWebView.getUrl())) {
            Iterator<T> it = this.U.iterator();
            while (it.hasNext()) {
                String url = this.f164462a.getUrl();
                lh4.m.f(url, "viewWV.url");
                if (it.next().m(F(url))) {
                    return;
                }
            }
            Log.i(E(), "reload");
            this.f164462a.reload();
        }
    }

    public final boolean s(int i15, String str) {
        lh4.m.g(str, "url");
        if (lh4.m.b(str, this.B) || i15 == this.f164487m0 || ((this.f164497r0.contains(Integer.valueOf(i15)) && lh4.m.b(str, this.D)) || this.f164499s0.contains(Integer.valueOf(i15)))) {
            return true;
        }
        return false;
    }

    /* renamed from: s0 */
    public boolean j(int i15, String str, z62 z622) {
        lh4.m.g(str, "reqUrl");
        lh4.m.g(z622, "response");
        Log.i(E(), "onProcessResult, req reason = " + i15);
        ConcurrentHashMap concurrentHashMap = (ConcurrentHashMap) this.P;
        concurrentHashMap.clear();
        LinkedList<wu2> linkedList = z622.f44146x;
        lh4.m.f(linkedList, "response.HttpHeader");
        if (!linkedList.isEmpty()) {
            concurrentHashMap.putAll(vp3.c.f(z622.f44146x));
        } else if (L().getBooleanExtra("k_has_http_header", false)) {
            Log.i(E(), "use intent httpheader info");
            String[] stringArrayExtra = L().getStringArrayExtra("geta8key_result_http_header_key_list");
            String[] stringArrayExtra2 = L().getStringArrayExtra("geta8key_result_http_header_value_list");
            L().putExtra("k_has_http_header", false);
            L().putStringArrayListExtra("geta8key_result_http_header_key_list", null);
            L().putStringArrayListExtra("geta8key_result_http_header_value_list", null);
            if (!(stringArrayExtra == null || stringArrayExtra2 == null)) {
                if (!(stringArrayExtra.length == 0)) {
                    if ((!(stringArrayExtra2.length == 0)) && stringArrayExtra.length == stringArrayExtra2.length) {
                        int length = stringArrayExtra.length;
                        for (int i16 = 0; i16 < length; i16++) {
                            String str2 = stringArrayExtra[i16];
                            lh4.m.f(str2, "httpHeaderKey[i]");
                            String str3 = stringArrayExtra2[i16];
                            lh4.m.f(str3, "httpHeaderValue[i]");
                            concurrentHashMap.put(str2, str3);
                        }
                    }
                }
            }
        }
        Log.i(E(), "onProcessResult, HttpHeader = " + concurrentHashMap);
        if (w0(i15, str, z622)) {
            return true;
        }
        Iterator<T> it = this.W.iterator();
        while (it.hasNext()) {
            it.next().l(i15, str, z622);
        }
        return false;
    }

    @Override // com.tencent.xweb.WebViewClient
    public final boolean shouldInterceptLoadError(WebView webView, int i15, String str, String str2) {
        int i16;
        lh4.m.g(webView, "webview");
        lh4.m.g(str, "description");
        lh4.m.g(str2, "failingUrl");
        int i17 = 3;
        Log.e(E(), "shouldInterceptLoadError, failingUrl = %s, errorCode = %d, desc = %s", str2, Integer.valueOf(i15), str);
        String S2 = S(getCurrentUrl());
        MMWebView mMWebView = this.f164462a;
        if (mMWebView == null) {
            i16 = 0;
        } else {
            if (mMWebView.isXWalkKernel()) {
                i17 = 2;
            }
            i16 = i17;
        }
        m O2 = O();
        int P2 = P();
        if (O2.d()) {
            ((xc4.j) xc4.j.f338034d).g(new n(str2, i15, O2, str, S2, i16, P2), "MicroMsg.WebPageErrorMonitor");
        }
        Iterator<T> it = this.U.iterator();
        while (it.hasNext()) {
            if (it.next().g(webView, i15, str, str2)) {
                return true;
            }
        }
        return super.shouldInterceptLoadError(webView, i15, str, str2);
    }

    @Override // com.tencent.xweb.WebViewClient
    public final WebResourceResponse shouldInterceptRequest(WebView webView, WebResourceRequest webResourceRequest, Bundle bundle) {
        lh4.m.g(webView, "webview");
        lh4.m.g(webResourceRequest, "request");
        WebResourceResponse e05 = e0(webView, webResourceRequest, bundle);
        return e05 == null ? super.shouldInterceptRequest(webView, webResourceRequest, bundle) : e05;
    }

    /* JADX WARNING: Code restructure failed: missing block: B:20:0x005a, code lost:
        if (r4 == false) goto L_0x005d;
     */
    @Override // com.tencent.xweb.WebViewClient
    public final boolean shouldOverrideUrlLoading(WebView webView, String str) {
        boolean z15;
        lh4.m.g(webView, "view");
        lh4.m.g(str, "url");
        Log.i(E(), "shouldOverrideUrlLoading: " + str);
        E();
        boolean z16 = true;
        if (!x0(webView, str)) {
            if (H0(str, C(str) == 2)) {
                if (!this.f164464b.f9916e) {
                    int C2 = C(str);
                    if (C2 == 0 || C2 == 2 || C2 == 8) {
                        z15 = true;
                    }
                }
                z15 = false;
            }
            z16 = false;
        }
        if (!z16) {
            this.Z = new k();
            this.f164506w = str;
        }
        return z16;
    }

    public boolean t(String str) {
        lh4.m.g(str, "url");
        if (n0.f200775o) {
            Log.w(E(), "skipLoadUrlCheck");
            return true;
        } else if (this.f164464b.f9913b) {
            Log.i(E(), "albie: trust this url(%s)", str);
            return true;
        } else if (!bd.d.c(str, "file://", true) || j0(str)) {
            return true;
        } else {
            if (!j0(y3())) {
                return false;
            }
            Log.i(E(), "canLoadUrl rawUrl(%s) is in fileUrlWhiteList, url: %s", y3(), str);
            return true;
        }
    }

    public void t0(com.tencent.mm.plugin.webview.stub.l lVar) {
    }

    public boolean u(String str) {
        return false;
    }

    public boolean u0() {
        return false;
    }

    public final synchronized void v(int i15) {
        if (!g0()) {
            ((xc4.j) xc4.j.f338034d).z(new s(i15, this));
        }
    }

    public void v0() {
    }

    public final synchronized void w(int i15, String str) {
        lh4.m.g(str, "url");
        if (!g0()) {
            if (!ek4.y.n(str)) {
                ((xc4.j) xc4.j.f338034d).z(new t(i15, this, str));
                return;
            }
        }
        String E2 = E();
        Log.w(E2, "checkStatus return url=" + str);
    }

    public boolean w0(int i15, String str, z62 z622) {
        lh4.m.g(str, "reqUrl");
        lh4.m.g(z622, "resp");
        Iterator<T> it = this.U.iterator();
        while (it.hasNext()) {
            if (it.next().l(i15, str, z622)) {
                return true;
            }
        }
        return false;
    }

    public final void x(WebView webView, String str) {
        if (webView != null && this.Y && webView.canGoBack()) {
            String E2 = E();
            Log.i(E2, "clearHistory :" + str);
            webView.clearHistory();
            if (!Util.isEqual(str, "about:blank")) {
                this.Y = false;
            }
        }
    }

    public boolean x0(WebView webView, String str) {
        lh4.m.g(webView, "webView");
        lh4.m.g(str, "url");
        b0.a f05 = f0(webView, str);
        if (f05.f164560a) {
            return f05.f164561b;
        }
        return false;
    }

    @Override // b10.t
    public String x3() {
        return this.C;
    }

    public final void y(String str, kh4.l<? super String, wg4.b0> lVar) {
        lh4.m.g(str, "script");
        m60.d.O(new v(this, str, lVar));
    }

    public final void y0(String str) {
        lh4.m.g(str, "url");
        String E2 = E();
        Log.i(E2, "reload for:" + str);
        this.f164462a.loadUrl(str);
        this.Y = true;
    }

    @Override // b10.t
    public String y3() {
        try {
            return L0.a(L());
        } catch (Exception e15) {
            Log.e(E(), String.valueOf(e15.getMessage()));
            o0();
            return "";
        }
    }

    public final boolean z() {
        boolean remove;
        synchronized (this) {
            int i15 = this.f164475g0;
            synchronized (this) {
                this.f164511y0.remove(Integer.valueOf(i15));
            }
            return remove;
        }
        int i16 = this.f164473f0;
        synchronized (this) {
            remove = this.f164511y0.remove(Integer.valueOf(i16));
        }
        return remove;
    }

    public final void z0(b0 b0Var) {
        lh4.m.g(b0Var, "interceptor");
        this.U.remove(b0Var);
        u b15 = b0Var.b();
        if (b15 != null) {
            A3(b15);
        }
        z d15 = b0Var.d();
        if (d15 != null) {
            I3(d15);
        }
    }

    @Override // b10.t
    public boolean z3() {
        return this.f164484l;
    }

    @Override // com.tencent.xweb.WebViewClient
    public final WebResourceResponse shouldInterceptRequest(WebView webView, WebResourceRequest webResourceRequest) {
        lh4.m.g(webView, "webview");
        lh4.m.g(webResourceRequest, "request");
        WebResourceResponse e05 = e0(webView, webResourceRequest, null);
        return e05 == null ? super.shouldInterceptRequest(webView, webResourceRequest) : e05;
    }

    @Metadata(bv = {}, d1 = {"\u00002\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0010\b\n\u0000\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u000e\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\t\b%\u0018\u00002\u00020\u0001B\u0007¢\u0006\u0004\b\u0017\u0010\u0018J\u000e\u0010\u0005\u001a\u00020\u00042\u0006\u0010\u0003\u001a\u00020\u0002J\u0016\u0010\u0005\u001a\u00020\u00042\u000e\u0010\b\u001a\n\u0012\u0006\b\u0001\u0012\u00020\u00070\u0006J\u001e\u0010\u0005\u001a\u00020\u00042\u000e\u0010\b\u001a\n\u0012\u0006\b\u0001\u0012\u00020\t0\u00062\u0006\u0010\u000b\u001a\u00020\nR\u001a\u0010\f\u001a\u00020\u00048\u0016X–D¢\u0006\f\n\u0004\b\f\u0010\r\u001a\u0004\b\u000e\u0010\u000fR\"\u0010\u0011\u001a\u00020\u00108\u0006@\u0006X†.¢\u0006\u0012\n\u0004\b\u0011\u0010\u0012\u001a\u0004\b\u0013\u0010\u0014\"\u0004\b\u0015\u0010\u0016¨\u0006\u0019"}, d2 = {"Lcom/tencent/mm/plugin/webview/core/BaseWebViewController$WebAction;", "", "", "status", "", "waitFor", "Lsh4/d;", "Lcom/tencent/mm/plugin/webview/core/BaseWebViewController$ControllerAction;", "clazz", "Lcom/tencent/mm/plugin/webview/core/BaseWebViewController$PageAction;", "", "url", "keep", "Z", "getKeep", "()Z", "Lcom/tencent/mm/plugin/webview/core/BaseWebViewController;", "controller", "Lcom/tencent/mm/plugin/webview/core/BaseWebViewController;", "getController", "()Lcom/tencent/mm/plugin/webview/core/BaseWebViewController;", "setController", "(Lcom/tencent/mm/plugin/webview/core/BaseWebViewController;)V", "<init>", "()V", "webview-sdk_release"}, k = 1, mv = {1, 7, 1})
    public static abstract class WebAction {
        public BaseWebViewController controller;
        private final boolean keep;

        public final BaseWebViewController getController() {
            BaseWebViewController baseWebViewController = this.controller;
            if (baseWebViewController != null) {
                return baseWebViewController;
            }
            lh4.m.p("controller");
            throw null;
        }

        public boolean getKeep() {
            return this.keep;
        }

        public final void setController(BaseWebViewController baseWebViewController) {
            lh4.m.g(baseWebViewController, "<set-?>");
            this.controller = baseWebViewController;
        }

        public final boolean waitFor(int i15) {
            return getController().f164511y0.contains(Integer.valueOf(i15));
        }

        public final boolean waitFor(sh4.d<? extends ControllerAction> dVar) {
            lh4.m.g(dVar, "clazz");
            return getController().A0.contains(dVar.k());
        }

        public final boolean waitFor(sh4.d<? extends PageAction> dVar, String str) {
            lh4.m.g(dVar, "clazz");
            lh4.m.g(str, "url");
            return lh4.m.b(str, getController().B) && getController().f164513z0.contains(dVar.k());
        }
    }

    @Override // com.tencent.xweb.WebViewClient
    public final boolean shouldOverrideUrlLoading(WebView webView, WebResourceRequest webResourceRequest) {
        b0.a aVar;
        boolean z15 = false;
        if (webResourceRequest == null || webView == null) {
            return false;
        }
        String E2 = E();
        Object[] objArr = new Object[1];
        Uri url = webResourceRequest.getUrl();
        objArr[0] = url != null ? url.toString() : null;
        Log.i(E2, "shouldOverrideUrlLoading url: %s", objArr);
        Iterator<b0> it = this.U.iterator();
        while (true) {
            if (!it.hasNext()) {
                aVar = new b0.a(false, false);
                break;
            }
            aVar = it.next().q(webView, webResourceRequest);
            if (aVar.f164560a) {
                break;
            }
        }
        if (aVar.f164560a) {
            z15 = aVar.f164561b;
        }
        if (!z15) {
            return super.shouldOverrideUrlLoading(webView, webResourceRequest);
        }
        return true;
    }

    @Override // com.tencent.xweb.WebViewClient
    public void onReceivedError(WebView webView, WebResourceRequest webResourceRequest, WebResourceError webResourceError) {
        int i15;
        super.onReceivedError(webView, webResourceRequest, webResourceError);
        if (!(webResourceRequest == null || webResourceError == null || ck.e.a(23))) {
            int errorCode = webResourceError.getErrorCode();
            CharSequence description = webResourceError.getDescription();
            String obj = description != null ? description.toString() : null;
            Uri url = webResourceRequest.getUrl();
            String uri = url != null ? url.toString() : null;
            String E2 = E();
            Log.i(E2, "WebView-Trace onReceivedError#" + g() + ", errCode:" + errorCode + ", description:" + obj + ", failingUrl:" + uri);
            if (!a0(this.f164471e0)) {
                Log.i(E(), "onReceivedError, intent not ready");
                return;
            }
            if (a0(this.f164469d0)) {
                m O2 = O();
                String S2 = S(getCurrentUrl());
                MMWebView mMWebView = this.f164462a;
                if (mMWebView == null) {
                    i15 = 0;
                } else {
                    i15 = mMWebView.isXWalkKernel() ? 2 : 3;
                }
                O2.c(errorCode, obj, uri, S2, i15, P(), webResourceRequest.isForMainFrame());
            }
            for (T t15 : this.V) {
                if (i0()) {
                    t15.f(webView, webResourceRequest, webResourceError);
                }
            }
        }
    }
}