TikTok.apk(点击下载) / C48283Ixc.java


package X;

import android.app.Activity;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.net.Uri;
import android.net.http.SslError;
import android.os.Build;
import android.os.Bundle;
import android.os.Environmenu;
import android.text.TextUtils;
import android.webkit.RenderProcessGoneDetail;
import android.webkit.SslErrorHandler;
import android.webkit.WebResourceError;
import android.webkit.WebResourceRequest;
import android.webkit.WebResourceResponse;
import android.webkit.WebView;
import com.bytedance.covode.number.Covode;
import com.bytedance.ies.abmock.SettingsManager;
import com.bytedance.router.SmartRouter;
import com.ss.android.agilelogger.ALog;
import com.ss.android.ugc.aweme.CrossPlatformLegacyServiceImpl;
import com.ss.android.ugc.aweme.ICrossPlatformLegacyService;
import com.ss.android.ugc.aweme.ad.settings.TypeEnum;
import com.ss.android.ugc.aweme.awemeservice.AwemeService;
import com.ss.android.ugc.aweme.awemeservice.api.IAwemeService;
import com.ss.android.ugc.aweme.commercialize.ILegacyCommercializeService;
import com.ss.android.ugc.aweme.commercialize.LegacyCommercializeServiceImpl;
import com.ss.android.ugc.aweme.crossplatform.business.DouPlusMonitorBusiness;
import com.ss.android.ugc.aweme.crossplatform.business.LoadEventBusiness;
import com.ss.android.ugc.aweme.crossplatform.business.PassBackWebInfoBusiness;
import com.ss.android.ugc.aweme.crossplatform.business.PlayableBusiness;
import com.ss.android.ugc.aweme.crossplatform.business.PreRenderWebViewBusiness;
import com.ss.android.ugc.aweme.crossplatform.platform.webview.CWebViewInterceptor;
import com.ss.android.ugc.aweme.feed.model.Aweme;
import com.ss.android.ugc.aweme.feed.model.AwemeRawAd;
import com.ss.android.ugc.aweme.web.GeckoXClientManager;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import kotlin.g.b.m;
import org.json.JSONObject;

/* renamed from: X.Ixc  reason: case insensitive filesystem */
public final class C48283Ixc extends C48293Ixm {
    public static final C48317IyA LJIIJJI = new C48317IyA((byte) 0);
    public final List<AbstractC48129Iv8> LIZ = new ArrayList();
    public AnonymousClass1IX<? super WebView, ? super String, Boolean> LIZIZ;
    public AbstractC45051Hma LIZJ;
    public AbstractC45051Hma LJ;
    public C84513Ui LJFF;
    public C48328IyL LJI;
    public C69292oA LJII;
    public boolean LJIIIIZZ;
    public AbstractC48272IxR LJIIIZ;
    public AbstractC48266IxL LJIIJ;
    public final AbstractC48129Iv8 LJIIL = new C48241Iww(this);
    public final AbstractC23460wR LJIILIIL = AnonymousClass1PN.LIZ((AnonymousClass1IL) C48282Ixb.LIZ);

    static {
        Covode.recordClassIndex(55656);
    }

    public C48283Ixc() {
        GeckoXClientManager.LIZ();
        AnonymousClass2IT r0 = AnonymousClass2IT.LIZ;
        if (r0 != null) {
            C84513Ui LIZ2 = new C84513Ui(r0.LIZ()).LIZ(AnonymousClass2IT.LIZIZ).LIZ(AnonymousClass2IU.LIZIZ());
            LIZ2.LIZ = new C48306Ixz(this);
            this.LJFF = LIZ2;
        }
    }

    public static Bundle LIZ(Intent intent) {
        try {
            return intent.getExtras();
        } catch (Exception unused) {
            return null;
        }
    }

    public static String LIZ(Intent intent, String str) {
        try {
            return intent.getStringExtra(str);
        } catch (Exception unused) {
            return null;
        }
    }

    private final void LIZ(Aweme aweme, Uri uri, String str, WebView webView) {
        AbstractC48266IxL ixL = this.LJIIJ;
        if (ixL != null) {
            if (ixL == null) {
                m.LIZIZ();
            }
            if (ixL.getCrossPlatformParams() != null) {
                AbstractC48266IxL ixL2 = this.LJIIJ;
                if (ixL2 == null) {
                    m.LIZIZ();
                }
                if (ixL2.getCrossPlatformParams() == null) {
                    m.LIZIZ();
                }
                AbstractC48266IxL ixL3 = this.LJIIJ;
                if (ixL3 == null) {
                    m.LIZIZ();
                }
                if (ixL3.getCrossPlatformParams() == null) {
                    m.LIZIZ();
                }
            }
        }
        String str2 = "";
        if (!(aweme == null || aweme.getAwemeRawAd() == null)) {
            AwemeRawAd awemeRawAd = aweme.getAwemeRawAd();
            if (awemeRawAd == null) {
                m.LIZIZ();
            }
            m.LIZIZ(awemeRawAd, str2);
            if (awemeRawAd.getGroupId() != null) {
                AwemeRawAd awemeRawAd2 = aweme.getAwemeRawAd();
                if (awemeRawAd2 == null) {
                    m.LIZIZ();
                }
                m.LIZIZ(awemeRawAd2, str2);
                str2 = String.valueOf(awemeRawAd2.getGroupId().longValue());
            }
        }
        ALog.d("commerce_jump", "【filterUrl】 = " + str + " 【market】 special handle");
        C48292Ixl ixl = C48292Ixl.LIZ;
        C69292oA r2 = this.LJII;
        C21090sc.LIZ(webView, str2);
        Intent intent = new Intent("android.intent.action.VIEW");
        intent.setData(uri);
        intent.addFlags(268435456);
        ixl.LIZ(str, r2);
        C48292Ixl.LIZ(webView.getContext(), intent);
    }

    private final void LIZ(String str, String str2, C48302Ixv ixv) {
        String shortClassName;
        String packageName;
        String className;
        if (str2 != null && !AnonymousClass1ZS.LIZ((CharSequence) str2) && str != null && !AnonymousClass1ZS.LIZ((CharSequence) str)) {
            JSONObject jSONObject = new JSONObject();
            jSONObject.put("url", str);
            jSONObject.put("scheme", str2);
            jSONObject.put("from", C48283Ixc.class.getSimpleName());
            if (ixv != null) {
                jSONObject.put("pattern", ixv.LIZ);
                jSONObject.put("config_type", ixv.LIZIZ);
            }
            if (m.LIZ((Object) "intent", (Object) str2)) {
                try {
                    Intent parseUri = Intent.parseUri(str, 1);
                    if (parseUri != null) {
                        String str3 = parseUri.getPackage();
                        if (str3 != null && !AnonymousClass1ZS.LIZ((CharSequence) str3)) {
                            jSONObject.put("package", parseUri.getPackage());
                        }
                        if (LIZ(parseUri) != null) {
                            jSONObject.put("extra", String.valueOf(LIZ(parseUri)));
                        }
                        ComponentName component = parseUri.getComponent();
                        String str4 = null;
                        if (!(component == null || (className = component.getClassName()) == null || !(!AnonymousClass1ZS.LIZ((CharSequence) className)))) {
                            ComponentName component2 = parseUri.getComponent();
                            jSONObject.put("className", component2 != null ? component2.getClassName() : null);
                        }
                        ComponentName component3 = parseUri.getComponent();
                        if (!(component3 == null || (packageName = component3.getPackageName()) == null || !(!AnonymousClass1ZS.LIZ((CharSequence) packageName)))) {
                            ComponentName component4 = parseUri.getComponent();
                            jSONObject.put("packageName", component4 != null ? component4.getPackageName() : null);
                        }
                        ComponentName component5 = parseUri.getComponent();
                        if (!(component5 == null || (shortClassName = component5.getShortClassName()) == null || !(!AnonymousClass1ZS.LIZ((CharSequence) shortClassName)))) {
                            ComponentName component6 = parseUri.getComponent();
                            if (component6 != null) {
                                str4 = component6.getShortClassName();
                            }
                            jSONObject.put("shortClassName", str4);
                        }
                        String action = parseUri.getAction();
                        if (action != null && !AnonymousClass1ZS.LIZ((CharSequence) action)) {
                            jSONObject.put("action", parseUri.getAction());
                        }
                        Set<String> categories = parseUri.getCategories();
                        if (categories != null && !categories.isEmpty()) {
                            jSONObject.put("categories", parseUri.getCategories().toString());
                        }
                        String dataString = parseUri.getDataString();
                        if (dataString != null && !AnonymousClass1ZS.LIZ((CharSequence) dataString)) {
                            jSONObject.put("data", parseUri.getDataString());
                        }
                        String type = parseUri.getType();
                        if (type != null && !AnonymousClass1ZS.LIZ((CharSequence) type)) {
                            jSONObject.put("type", parseUri.getType());
                        }
                        jSONObject.put("flag", parseUri.getFlags());
                    }
                } catch (Exception e) {
                    jSONObject.put("exception_name", e.getClass().getSimpleName());
                    String message = e.getMessage();
                    if (message == null) {
                        message = Environmenu.MEDIA_UNKNOWN;
                    }
                    jSONObject.put("exception_message", message);
                }
            }
            AnonymousClass0FY.LIZ("webview_intent_scheme_log", jSONObject);
        }
    }

    /* JADX WARNING: Removed duplicated region for block: B:68:0x010c  */
    /* JADX WARNING: Removed duplicated region for block: B:70:0x0110  */
    private final boolean LIZ(WebView webView, String str) {
        String str2;
        String str3;
        AbstractC48291Ixk ixk;
        Context context;
        Intent intent;
        Object obj;
        Throwable th;
        Boolean LIZ2;
        AbstractC45051Hma hma = this.LIZJ;
        Activity activity = null;
        if (hma != null && (LIZ2 = hma.LIZ(str)) != null) {
            return LIZ2.booleanValue();
        }
        if (this.LIZIZ == null) {
            try {
                Uri parse = Uri.parse(str);
                m.LIZIZ(parse, "");
                String scheme = parse.getScheme();
                if (scheme != null) {
                    Locale locale = Locale.getDefault();
                    m.LIZIZ(locale, "");
                    if (scheme != null) {
                        str2 = scheme.toLowerCase(locale);
                        m.LIZIZ(str2, "");
                    } else {
                        throw new NullPointerException("null cannot be cast to non-null type java.lang.String");
                    }
                } else {
                    str2 = null;
                }
                try {
                    C23790wy.m3constructorimpl(C23860x5.LIZ);
                } catch (Throwable th2) {
                    th = th2;
                }
            } catch (Throwable th3) {
                th = th3;
                str2 = null;
                C23790wy.m3constructorimpl(C23800wz.LIZ(th));
                if (!(!m.LIZ((Object) "http", (Object) str2))) {
                }
                if (!C17640n3.LIZ.LIZ.enableBoe()) {
                }
            }
            if (!(!m.LIZ((Object) "http", (Object) str2)) && (!m.LIZ((Object) "https", (Object) str2)) && (!m.LIZ((Object) "bytedance", (Object) str2)) && SmartRouter.canOpen(str)) {
                Bundle bundle = new Bundle();
                if (SettingsManager.LIZ().LIZ("enable_seclink_config_inherit_after_jump", true) && (context = webView.getContext()) != null) {
                    if (context instanceof Activity) {
                        activity = context;
                    }
                    Activity activity2 = activity;
                    if (!(activity2 == null || (intent = activity2.getIntent()) == null)) {
                        try {
                            if (intent.hasExtra("need_sec_link")) {
                                bundle.putBoolean("need_sec_link", intent.getBooleanExtra("need_sec_link", false));
                            }
                            if (intent.hasExtra("need_detect_2_jump")) {
                                bundle.putBoolean("need_detect_2_jump", intent.getBooleanExtra("need_detect_2_jump", false));
                            }
                            if (intent.hasExtra("sec_link_scene")) {
                                bundle.putString("sec_link_scene", LIZ(intent, "sec_link_scene"));
                            }
                            obj = C23790wy.m3constructorimpl(C23860x5.LIZ);
                        } catch (Throwable th4) {
                            obj = C23790wy.m3constructorimpl(C23800wz.LIZ(th4));
                        }
                        C23790wy.m2boximpl(obj);
                    }
                }
                SmartRouter.buildRoute(webView.getContext(), str).withParam(bundle).open();
                return true;
            } else if (!C17640n3.LIZ.LIZ.enableBoe()) {
                LIZIZ(webView, str);
                return true;
            } else {
                if (TextUtils.isEmpty(str) || !(AnonymousClass1ZS.LIZ((CharSequence) str, (CharSequence) "__back_url__", false))) {
                    str3 = str;
                } else {
                    String encode = Uri.encode("snssdk" + AnonymousClass0WE.LJIILJJIL + "://adx");
                    m.LIZIZ(encode, "");
                    str3 = AnonymousClass1ZS.LIZ(str, "__back_url__", encode);
                }
                boolean LIZJ2 = LIZJ(webView, str3);
                if (!LIZJ2) {
                    C48289Ixi.LIZIZ.LIZ().LIZ(webView, str, 3);
                    C69292oA r1 = this.LJII;
                    if (!(r1 == null || (ixk = (AbstractC48291Ixk) r1.LIZ(AbstractC48291Ixk.class)) == null)) {
                        ixk.LIZIZ(str);
                    }
                }
                return LIZJ2;
            }
        } else if (super.shouldOverrideUrlLoading(webView, str)) {
            return true;
        } else {
            AnonymousClass1IX<? super WebView, ? super String, Boolean> r0 = this.LIZIZ;
            if (r0 == null) {
                m.LIZIZ();
            }
            return r0.invoke(webView, str).booleanValue();
        }
    }

    private final boolean LIZ(Aweme aweme, Uri uri, String str, boolean z, String str2, WebView webView) {
        Intent intent;
        String LIZ2;
        if (uri != null && !TextUtils.isEmpty(str) && !TextUtils.isEmpty(str2)) {
            if (m.LIZ((Object) "market", (Object) str)) {
                LIZ(aweme, uri, str2, webView);
                return true;
            } else if (m.LIZ((Object) "intent", (Object) str) && z) {
                ALog.d("commerce_jump", "【filterUrl】 = " + str2 + " 【intent】 special handle");
                ICrossPlatformLegacyService LJFF2 = CrossPlatformLegacyServiceImpl.LJFF();
                String str3 = null;
                try {
                    intent = Intent.parseUri(str2, 1);
                } catch (URISyntaxException e) {
                    e.printStackTrace();
                    intent = null;
                }
                Activity LIZ3 = C45170HoV.LIZ(webView.getContext());
                PackageManager packageManager = LIZ3 != null ? LIZ3.getPackageManager() : null;
                if (packageManager == null || intent == null || intent.resolveActivity(packageManager) == null) {
                    Intent intent2 = new Intent("android.intent.action.VIEW");
                    C48292Ixl ixl = C48292Ixl.LIZ;
                    m.LIZIZ(LJFF2, "");
                    C69292oA r1 = this.LJII;
                    C21090sc.LIZ(LJFF2, webView, intent2);
                    if (intent != null && LJFF2.LIZ(webView.getContext())) {
                        intent2.setData(Uri.parse("market://details?id=" + intent.getPackage()));
                        if (!(packageManager == null || intent2.resolveActivity(packageManager) == null)) {
                            intent.addFlags(268435456);
                            ixl.LIZ(str2, r1);
                            C48292Ixl.LIZ(webView.getContext(), intent2);
                            return true;
                        }
                    }
                    if (intent == null || (LIZ2 = LIZ(intent, "browser_fallback_url")) == null || !C69672om.LIZ(LIZ2)) {
                        C21090sc.LIZ(LJFF2, webView);
                        if (!LJFF2.LIZ(webView.getContext())) {
                            Context context = webView.getContext();
                            if (intent != null) {
                                str3 = intent.getPackage();
                            }
                            return LJFF2.LIZ(context, str3);
                        }
                    } else {
                        LIZIZ(webView, LIZ2);
                        return true;
                    }
                } else {
                    intent.addFlags(268435456);
                    if (str2 != null) {
                        C68942nb LIZ4 = C68942nb.LJII.LIZ();
                        C69292oA r12 = this.LJII;
                        AbstractC48291Ixk ixk = r12 != null ? (AbstractC48291Ixk) r12.LIZ(AbstractC48291Ixk.class) : null;
                        Uri parse = Uri.parse(str2);
                        m.LIZIZ(parse, "");
                        LIZ4.LIZ(ixk, "webview_safe_log", "filter_scheme", new C49254JVr(parse, "intent_scheme_", null, 4).getFormatData(), null, null);
                    }
                    Context context2 = webView.getContext();
                    m.LIZIZ(context2, "");
                    String packageName = context2.getPackageName();
                    ComponentName component = intent.getComponent();
                    if (component != null) {
                        str3 = component.getPackageName();
                    }
                    if (m.LIZ((Object) packageName, (Object) str3)) {
                        return false;
                    }
                    Context context3 = webView.getContext();
                    C21280sv.LIZ(intent, context3);
                    context3.startActivity(intent);
                    return true;
                }
            }
        }
        return false;
    }

    private final boolean LIZ(Aweme aweme, Uri uri, boolean z, WebView webView, C48236Iwr iwr, boolean z2, boolean z3) {
        String scheme;
        String str = null;
        String uri2 = uri != null ? uri.toString() : null;
        if (!(uri == null || (scheme = uri.getScheme()) == null)) {
            Locale locale = Locale.getDefault();
            m.LIZIZ(locale, "");
            Objects.requireNonNull(scheme, "null cannot be cast to non-null type java.lang.String");
            str = scheme.toLowerCase(locale);
            m.LIZIZ(str, "");
        }
        boolean LIZ2 = LIZ(uri2, str, iwr);
        if ((iwr == null || !z2 || !iwr.isJumpControlEnabled() || LIZ2 || z) && ((iwr != null || !z2 || LIZ2 || z) && !C69672om.LIZ(uri2))) {
            if (m.LIZ((Object) "market", (Object) str)) {
                LIZ(aweme, uri, uri2, webView);
                return true;
            } else if (!CrossPlatformLegacyServiceImpl.LJFF().LIZJ(webView.getContext(), Uri.parse(uri2))) {
                return false;
            } else {
                C47248Igv.LIZIZ();
                C47248Igv.LIZ();
                try {
                    C64222fz.LIZIZ(webView.getContext(), uri2);
                } catch (Exception unused) {
                }
                ALog.d("commerce_jump", "【filterUrl】 = " + uri2 + " 【open scheme final】");
                return true;
            }
        } else if (!z3 || !C69672om.LIZ(uri2) || TextUtils.isEmpty(uri2)) {
            return false;
        } else {
            if (uri2 == null) {
                m.LIZIZ();
            }
            LIZIZ(webView, uri2);
            return true;
        }
    }

    /* JADX WARNING: Removed duplicated region for block: B:19:0x003f  */
    /* JADX WARNING: Removed duplicated region for block: B:27:0x005b A[RETURN] */
    private final boolean LIZ(Aweme aweme, String str, boolean z, String str2, WebView webView, C48236Iwr iwr, boolean z2) {
        Uri uri;
        Intent intent;
        if (TextUtils.isEmpty(str) || TextUtils.isEmpty(str2) || !m.LIZ((Object) "intent", (Object) str) || z) {
            return false;
        }
        String str3 = null;
        try {
            intent = Intent.parseUri(str2, 1);
            if (intent != null) {
                uri = intent.getData();
                if (!LIZ(aweme, uri, z, webView, iwr, z2, false)) {
                    return true;
                }
                if (intent != null) {
                    str3 = LIZ(intent, "browser_fallback_url");
                }
                return !TextUtils.isEmpty(str3) && LIZ(aweme, Uri.parse(str3), z, webView, iwr, z2, true);
            }
        } catch (URISyntaxException e) {
            e.printStackTrace();
            intent = null;
        }
        uri = null;
        if (!LIZ(aweme, uri, z, webView, iwr, z2, false)) {
        }
    }

    private final boolean LIZ(String str, String str2, C48236Iwr iwr) {
        String str3;
        C48131IvA crossPlatformParams;
        C48119Iuy iuy;
        AbstractC48266IxL ixL = this.LJIIJ;
        if (ixL == null || (crossPlatformParams = ixL.getCrossPlatformParams()) == null || (iuy = crossPlatformParams.LIZIZ) == null || (str3 = iuy.LJJJJI) == null) {
            str3 = "";
        }
        return C49281wz.LIZ(str, str2, iwr != null ? iwr.getClickJumpAllowList() : null) || C49281wz.LIZ(str, str2, C47611Imm.LIZ(str3));
    }

    public static void LIZIZ(WebView webView, String str) {
        String LIZ2 = C82193Lk.LIZ.LIZ(webView, str);
        if (!TextUtils.isEmpty(LIZ2)) {
            str = LIZ2;
        }
        webView.loadUrl(str);
    }

    /* JADX WARNING: Code restructure failed: missing block: B:132:0x027b, code lost:
        if (r0.LJII().LIZIZ(r5) != false) goto L_0x027d;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:156:0x030d, code lost:
        if (r0.LJII().LIZIZ(r5) != false) goto L_0x030f;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:167:0x0342, code lost:
        if (r0.LJII().LIZIZ(r5) != false) goto L_0x0344;
     */
    /* JADX WARNING: Removed duplicated region for block: B:106:0x0196 A[Catch:{ Exception -> 0x04c1 }] */
    /* JADX WARNING: Removed duplicated region for block: B:108:0x019d A[Catch:{ Exception -> 0x04c1 }] */
    /* JADX WARNING: Removed duplicated region for block: B:110:0x01a0 A[Catch:{ Exception -> 0x04c1 }] */
    /* JADX WARNING: Removed duplicated region for block: B:111:0x01a5 A[Catch:{ Exception -> 0x04c1 }] */
    /* JADX WARNING: Removed duplicated region for block: B:114:0x01a9 A[Catch:{ Exception -> 0x04c1 }] */
    /* JADX WARNING: Removed duplicated region for block: B:129:0x025b A[Catch:{ Exception -> 0x04bf }] */
    /* JADX WARNING: Removed duplicated region for block: B:134:0x027f A[Catch:{ Exception -> 0x04bf }] */
    /* JADX WARNING: Removed duplicated region for block: B:137:0x029c A[Catch:{ Exception -> 0x04bf }] */
    /* JADX WARNING: Removed duplicated region for block: B:144:0x02c9 A[Catch:{ Exception -> 0x04bf }] */
    /* JADX WARNING: Removed duplicated region for block: B:185:0x037e A[Catch:{ Exception -> 0x04bf }] */
    /* JADX WARNING: Removed duplicated region for block: B:249:0x04bd A[RETURN] */
    /* JADX WARNING: Removed duplicated region for block: B:259:? A[RETURN, SYNTHETIC] */
    /* JADX WARNING: Removed duplicated region for block: B:75:0x0114 A[Catch:{ Exception -> 0x04c1 }] */
    /* JADX WARNING: Removed duplicated region for block: B:76:0x0115 A[Catch:{ Exception -> 0x04c1 }] */
    /* JADX WARNING: Removed duplicated region for block: B:80:0x0121 A[Catch:{ Exception -> 0x04c1 }] */
    /* JADX WARNING: Removed duplicated region for block: B:86:0x0131 A[ADDED_TO_REGION, Catch:{ Exception -> 0x04c1 }] */
    /* JADX WARNING: Removed duplicated region for block: B:99:0x0180 A[Catch:{ Exception -> 0x04c1 }] */
    private final boolean LIZJ(WebView webView, String str) {
        String str2;
        String str3;
        boolean z;
        boolean z2;
        boolean z3;
        boolean z4;
        C71902sN r1;
        C48131IvA crossPlatformParams;
        C48119Iuy iuy;
        C48131IvA crossPlatformParams2;
        C48119Iuy iuy2;
        C48131IvA crossPlatformParams3;
        C48119Iuy iuy3;
        ALog.d("commerce_jump", "filterUrl = ".concat(String.valueOf(str)));
        if (super.shouldOverrideUrlLoading(webView, str) || LegacyCommercializeServiceImpl.LJIIJJI().LIZJ().LIZIZ(webView.getContext(), str)) {
            return true;
        }
        if (str != null) {
            Uri parse = Uri.parse(str);
            m.LIZIZ(parse, "");
            if (TextUtils.equals(parse.getScheme(), "bytedance") && TextUtils.equals(parse.getHost(), "adPageHtmlContent")) {
                PassBackWebInfoBusiness LIZIZ2 = LIZIZ();
                if (!(LIZIZ2 == null || !LIZIZ2.LIZLLL() || parse == null)) {
                    String queryParameter = parse.getQueryParameter("url");
                    String queryParameter2 = parse.getQueryParameter("html");
                    if (!TextUtils.isEmpty(queryParameter) && !TextUtils.isEmpty(queryParameter2)) {
                        if (queryParameter == null) {
                            m.LIZIZ();
                        }
                        if (queryParameter2 == null) {
                            m.LIZIZ();
                        }
                        LIZIZ2.LIZ(queryParameter, queryParameter2);
                    }
                }
                return true;
            }
        }
        try {
            Uri parse2 = Uri.parse(str);
            m.LIZIZ(parse2, "");
            String scheme = parse2.getScheme();
            if (scheme != null) {
                Locale locale = Locale.getDefault();
                m.LIZIZ(locale, "");
                if (scheme != null) {
                    str2 = scheme.toLowerCase(locale);
                    m.LIZIZ(str2, "");
                } else {
                    throw new NullPointerException("null cannot be cast to non-null type java.lang.String");
                }
            } else {
                str2 = null;
            }
            if (TextUtils.isEmpty(str2) || m.LIZ((Object) "about", (Object) str2)) {
                return false;
            }
            C48236Iwr LIZ2 = C47514IlD.LIZ();
            EB7 eb7 = (EB7) (!(webView instanceof EB7) ? null : webView);
            boolean hasClickInTimeInterval = eb7 != null ? eb7.hasClickInTimeInterval() : true;
            if (this.LJIIIIZZ && !hasClickInTimeInterval) {
                this.LJIIIIZZ = false;
                hasClickInTimeInterval = true;
            }
            AbstractC48266IxL ixL = this.LJIIJ;
            boolean z5 = (ixL == null || (crossPlatformParams3 = ixL.getCrossPlatformParams()) == null || (iuy3 = crossPlatformParams3.LIZIZ) == null) ? false : iuy3.LJIILJJIL;
            AbstractC48266IxL ixL2 = this.LJIIJ;
            if (!(ixL2 == null || (crossPlatformParams2 = ixL2.getCrossPlatformParams()) == null || (iuy2 = crossPlatformParams2.LIZIZ) == null)) {
                str3 = iuy2.LJJJJI;
                if (str3 == null) {
                }
                if (!C49281wz.LIZ(str, str2, LIZ2 == null ? LIZ2.getClickJumpAllowList() : null)) {
                    if (!C49281wz.LIZ(str, str2, C47611Imm.LIZ(str3))) {
                        z = false;
                        z2 = (LIZ2 == null && z5 && LIZ2.isJumpControlEnabled() && !z && !hasClickInTimeInterval) || (LIZ2 == null && z5 && !z && !hasClickInTimeInterval);
                        ALog.d("commerce_jump", "【filterUrl】 = " + str + " 【forbidJump】= " + z5 + " 【inAllowList】= " + z + " 【blockJump】= " + z2);
                        IAwemeService LIZIZ3 = AwemeService.LIZIZ();
                        AbstractC48266IxL ixL3 = this.LJIIJ;
                        Aweme LJ2 = LIZIZ3.LJ((ixL3 != null || (crossPlatformParams = ixL3.getCrossPlatformParams()) == null || (iuy = crossPlatformParams.LIZIZ) == null) ? null : String.valueOf(iuy.LIZ));
                        boolean isJumpControlEnabled = LIZ2 != null ? LIZ2.isJumpControlEnabled() : true;
                        boolean isClickControlEnabled = LIZ2 != null ? LIZ2.isClickControlEnabled() : true;
                        if (str != null) {
                            if (str.length() != 0) {
                                if (parse2 != null) {
                                    if (hasClickInTimeInterval) {
                                        r1 = new C71902sN(str, "second jump:no limit(forbidJump=" + z5 + " isClickControlEnabled=" + isClickControlEnabled + " blockJump=" + z2 + ')');
                                    } else if (z) {
                                        try {
                                            r1 = new C71902sN(str, "first jump: in allowList(forbidJump=" + z5 + " inAllowList=" + z + " isJumpControlEnabled=" + isJumpControlEnabled + " blockJump=" + z2 + ')');
                                        } catch (Exception unused) {
                                            return false;
                                        }
                                    } else {
                                        r1 = new C71902sN(str, "first jump:not in allowList(forbidJump=" + z5 + " inAllowList=" + z + " isJumpControlEnabled=" + isJumpControlEnabled + " blockJump=" + z2 + ')');
                                    }
                                    KMV.LIZ(r1);
                                }
                            }
                        }
                        if (z2) {
                            ILegacyCommercializeService LJIIJJI2 = LegacyCommercializeServiceImpl.LJIIJJI();
                            m.LIZIZ(LJIIJJI2, "");
                            if (!LJIIJJI2.LJII().LIZ(LJ2)) {
                                ILegacyCommercializeService LJIIJJI3 = LegacyCommercializeServiceImpl.LJIIJJI();
                                m.LIZIZ(LJIIJJI3, "");
                            }
                        }
                        if (str2 == null) {
                            m.LIZIZ();
                        }
                        Context context = webView.getContext();
                        m.LIZIZ(context, "");
                        C21090sc.LIZ(parse2, str2, context);
                        ICrossPlatformLegacyService LJFF2 = CrossPlatformLegacyServiceImpl.LJFF();
                        if (m.LIZ((Object) parse2.getScheme(), (Object) "market")) {
                            if (!LJFF2.LIZ(context)) {
                                LJFF2.LIZIZ(context, LJ2, str);
                            } else if (LJFF2.LJ(context, parse2)) {
                                LJFF2.LIZ(context, LJ2, str);
                            }
                        } else if (LJFF2.LIZ(parse2)) {
                            if (LJFF2.LIZ(context)) {
                                if (LJFF2.LJFF(context, parse2)) {
                                    LJFF2.LIZ(context, LJ2, str);
                                }
                            }
                            if ((!m.LIZ((Object) "http", (Object) str2)) || !(!m.LIZ((Object) "https", (Object) str2))) {
                                return this.LJIIL.LIZIZ(webView, str);
                            }
                            if (str != null) {
                                C48302Ixv[] LIZ3 = C48304Ixx.LIZIZ.LIZ();
                                for (C48302Ixv ixv : LIZ3) {
                                    int i2 = ixv.LIZIZ;
                                    if (i2 == TypeEnum.START_WITH.getType()) {
                                        z4 = AnonymousClass1ZS.LIZIZ(str, ixv.LIZ, false);
                                    } else if (i2 == TypeEnum.CONTAINS.getType()) {
                                        z4 = AnonymousClass1ZS.LIZ((CharSequence) str, (CharSequence) ixv.LIZ, false);
                                    } else if (i2 == TypeEnum.REGEX_MATCHES.getType()) {
                                        z4 = new C23710wq(ixv.LIZ).matches(str);
                                    } else if (i2 == TypeEnum.REGEX_CONTAINS_MATCH_IN.getType()) {
                                        z4 = new C23710wq(ixv.LIZ).containsMatchIn(str);
                                    } else if (i2 == TypeEnum.EQUAL.getType()) {
                                        z4 = m.LIZ((Object) ixv.LIZ, (Object) str);
                                    } else {
                                        continue;
                                    }
                                    if (z4) {
                                        LIZ(str, str2, ixv);
                                        return false;
                                    }
                                }
                                LIZ(str, str2, (C48302Ixv) null);
                            }
                            if (LIZ(LJ2, str2, hasClickInTimeInterval, str, webView, LIZ2, z5)) {
                                return true;
                            }
                            if (z2) {
                                C47391IjE.LIZ(str, hasClickInTimeInterval, false);
                                return true;
                            }
                            if ((LIZ2 == null || LIZ2.isClickControlEnabled()) && !hasClickInTimeInterval) {
                                if (str == null) {
                                    m.LIZIZ();
                                }
                                z3 = false;
                                if (AnonymousClass1ZS.LIZJ(str, ".apk", false)) {
                                    C47391IjE.LIZIZ(str, hasClickInTimeInterval, false);
                                    return true;
                                }
                            } else {
                                z3 = false;
                            }
                            C47391IjE.LIZJ(str, hasClickInTimeInterval, z3);
                            String LIZ4 = (m.LIZ("sslocal", str2) || m.LIZ("localsdk", str2)) ? C64222fz.LIZ(str) : str;
                            if (LIZ(LJ2, parse2, str2, hasClickInTimeInterval, LIZ4, webView)) {
                                return true;
                            }
                            if (C11450d4.LIZ(webView.getContext(), new Intent("android.intent.action.VIEW", Uri.parse(LIZ4)))) {
                                C47248Igv.LIZIZ();
                                C47248Igv.LIZ();
                            }
                            webView.getUrl();
                            C21090sc.LIZ(webView);
                            try {
                                C64222fz.LIZIZ(webView.getContext(), LIZ4);
                            } catch (Exception unused2) {
                            }
                            ALog.d("commerce_jump", "【filterUrl】 = " + str + " 【open scheme final】");
                            return true;
                        } else if (LegacyCommercializeServiceImpl.LJIIJJI().LIZJ().LIZ(parse2)) {
                            ILegacyCommercializeService LJIIJJI4 = LegacyCommercializeServiceImpl.LJIIJJI();
                            m.LIZIZ(LJIIJJI4, "");
                            if (!LJIIJJI4.LJII().LIZ(LJ2)) {
                                ILegacyCommercializeService LJIIJJI5 = LegacyCommercializeServiceImpl.LJIIJJI();
                                m.LIZIZ(LJIIJJI5, "");
                            }
                            if (LJFF2.LIZ(context, parse2)) {
                                if (!z) {
                                    LJFF2.LIZJ(context, LJ2, str);
                                } else if (LJFF2.LIZIZ(context, parse2)) {
                                    LJFF2.LIZ(context, LJ2, str);
                                }
                            }
                            if (!m.LIZ((Object) "http", (Object) str2)) {
                            }
                            if (this.LJIIL.LIZIZ(webView, str)) {
                            }
                        } else {
                            ILegacyCommercializeService LJIIJJI6 = LegacyCommercializeServiceImpl.LJIIJJI();
                            m.LIZIZ(LJIIJJI6, "");
                            if (!LJIIJJI6.LJII().LIZ(LJ2)) {
                                ILegacyCommercializeService LJIIJJI7 = LegacyCommercializeServiceImpl.LJIIJJI();
                                m.LIZIZ(LJIIJJI7, "");
                            }
                            if (LJFF2.LIZJ(context, parse2)) {
                                if (!z) {
                                    LJFF2.LIZJ(context, LJ2, str);
                                } else if (LJFF2.LIZLLL(context, parse2)) {
                                    LJFF2.LIZ(context, LJ2, str);
                                }
                            } else if ((!m.LIZ((Object) "sslocal", (Object) str2)) && (!m.LIZ((Object) "localsdk", (Object) str2))) {
                                LJFF2.LIZIZ(context, LJ2, str);
                            }
                            if (!m.LIZ((Object) "http", (Object) str2)) {
                            }
                            if (this.LJIIL.LIZIZ(webView, str)) {
                            }
                        }
                        ALog.d("commerce_jump", "【filterUrl】 = " + str + " 【handleOpenVastApp】= true");
                        return true;
                    }
                }
                z = true;
                if (LIZ2 == null) {
                }
                ALog.d("commerce_jump", "【filterUrl】 = " + str + " 【forbidJump】= " + z5 + " 【inAllowList】= " + z + " 【blockJump】= " + z2);
                IAwemeService LIZIZ32 = AwemeService.LIZIZ();
                AbstractC48266IxL ixL32 = this.LJIIJ;
                Aweme LJ22 = LIZIZ32.LJ((ixL32 != null || (crossPlatformParams = ixL32.getCrossPlatformParams()) == null || (iuy = crossPlatformParams.LIZIZ) == null) ? null : String.valueOf(iuy.LIZ));
                if (LIZ2 != null) {
                }
                if (LIZ2 != null) {
                }
                if (str != null) {
                }
                if (z2) {
                }
                if (str2 == null) {
                }
                Context context2 = webView.getContext();
                m.LIZIZ(context2, "");
                C21090sc.LIZ(parse2, str2, context2);
                ICrossPlatformLegacyService LJFF22 = CrossPlatformLegacyServiceImpl.LJFF();
                if (m.LIZ((Object) parse2.getScheme(), (Object) "market")) {
                }
                ALog.d("commerce_jump", "【filterUrl】 = " + str + " 【handleOpenVastApp】= true");
                return true;
            }
            str3 = "";
            if (!C49281wz.LIZ(str, str2, LIZ2 == null ? LIZ2.getClickJumpAllowList() : null)) {
            }
            z = true;
            if (LIZ2 == null) {
            }
            ALog.d("commerce_jump", "【filterUrl】 = " + str + " 【forbidJump】= " + z5 + " 【inAllowList】= " + z + " 【blockJump】= " + z2);
            IAwemeService LIZIZ322 = AwemeService.LIZIZ();
            AbstractC48266IxL ixL322 = this.LJIIJ;
            Aweme LJ222 = LIZIZ322.LJ((ixL322 != null || (crossPlatformParams = ixL322.getCrossPlatformParams()) == null || (iuy = crossPlatformParams.LIZIZ) == null) ? null : String.valueOf(iuy.LIZ));
            if (LIZ2 != null) {
            }
            if (LIZ2 != null) {
            }
            if (str != null) {
            }
            if (z2) {
            }
            if (str2 == null) {
            }
            Context context22 = webView.getContext();
            m.LIZIZ(context22, "");
            C21090sc.LIZ(parse2, str2, context22);
            ICrossPlatformLegacyService LJFF222 = CrossPlatformLegacyServiceImpl.LJFF();
            if (m.LIZ((Object) parse2.getScheme(), (Object) "market")) {
            }
            ALog.d("commerce_jump", "【filterUrl】 = " + str + " 【handleOpenVastApp】= true");
            return true;
        } catch (Exception unused3) {
            return false;
        }
    }

    public final C72882tx LIZ() {
        return (C72882tx) this.LJIILIIL.getValue();
    }

    public final PassBackWebInfoBusiness LIZIZ() {
        AbstractC47918Irj crossPlatformBusiness;
        AbstractC48266IxL ixL = this.LJIIJ;
        if (ixL == null || (crossPlatformBusiness = ixL.getCrossPlatformBusiness()) == null) {
            return null;
        }
        return (PassBackWebInfoBusiness) crossPlatformBusiness.LIZ(PassBackWebInfoBusiness.class);
    }

    public final void doUpdateVisitedHistory(WebView webView, String str, boolean z) {
        AbstractC48272IxR ixR;
        super.doUpdateVisitedHistory(webView, str, z);
        if (str != null && (ixR = this.LJIIIZ) != null) {
            ixR.LIZ(str);
        }
    }

    public final void onPageCommitVisible(WebView webView, String str) {
        super.onPageCommitVisible(webView, str);
        this.LJIIL.LIZJ(webView, str);
    }

    @Override // X.C48293Ixm
    public final void onPageFinished(WebView webView, String str) {
        AbstractC47918Irj crossPlatformBusiness;
        AbstractC47918Irj crossPlatformBusiness2;
        PlayableBusiness playableBusiness;
        AbstractC47918Irj crossPlatformBusiness3;
        DouPlusMonitorBusiness douPlusMonitorBusiness;
        AbstractC48291Ixk ixk;
        super.onPageFinished(webView, str);
        if (str != null) {
            C48289Ixi.LIZIZ.LIZ().LIZ(webView, str, 2);
            C69292oA r1 = this.LJII;
            if (!(r1 == null || (ixk = (AbstractC48291Ixk) r1.LIZ(AbstractC48291Ixk.class)) == null)) {
                ixk.LIZIZ(C48276IxV.LIZ.LIZ(str));
            }
        }
        this.LJIIL.LIZ(webView, str);
        AbstractC48266IxL ixL = this.LJIIJ;
        if (!(ixL == null || (crossPlatformBusiness3 = ixL.getCrossPlatformBusiness()) == null || (douPlusMonitorBusiness = (DouPlusMonitorBusiness) crossPlatformBusiness3.LIZ(DouPlusMonitorBusiness.class)) == null)) {
            douPlusMonitorBusiness.LIZIZ(str);
        }
        AbstractC48266IxL ixL2 = this.LJIIJ;
        if (!(ixL2 == null || (crossPlatformBusiness2 = ixL2.getCrossPlatformBusiness()) == null || (playableBusiness = (PlayableBusiness) crossPlatformBusiness2.LIZ(PlayableBusiness.class)) == null)) {
            playableBusiness.LIZ(this.LIZLLL);
        }
        AbstractC48266IxL ixL3 = this.LJIIJ;
        if (ixL3 != null) {
            ixL3.getCrossPlatformParams();
        }
        PassBackWebInfoBusiness LIZIZ2 = LIZIZ();
        if (LIZIZ2 != null) {
            LIZIZ2.LIZ(webView, true);
        }
        AbstractC48266IxL ixL4 = this.LJIIJ;
        if (!(ixL4 == null || (crossPlatformBusiness = ixL4.getCrossPlatformBusiness()) == null)) {
            crossPlatformBusiness.LIZ(LoadEventBusiness.class);
        }
        AbstractC48272IxR ixR = this.LJIIIZ;
        if (ixR != null) {
            ixR.LIZIZ();
        }
    }

    @Override // X.C48293Ixm
    public final void onPageStarted(WebView webView, String str, Bitmap bitmap) {
        AbstractC47918Irj crossPlatformBusiness;
        DouPlusMonitorBusiness douPlusMonitorBusiness;
        C69292oA r1;
        AbstractC48291Ixk ixk;
        super.onPageStarted(webView, str, bitmap);
        if (!(str == null || (r1 = this.LJII) == null || (ixk = (AbstractC48291Ixk) r1.LIZ(AbstractC48291Ixk.class)) == null)) {
            ixk.LIZ(C48276IxV.LIZ.LIZ(str));
        }
        this.LJIIL.LIZ(webView, str, bitmap);
        AbstractC48266IxL ixL = this.LJIIJ;
        if (!(ixL == null || (crossPlatformBusiness = ixL.getCrossPlatformBusiness()) == null || (douPlusMonitorBusiness = (DouPlusMonitorBusiness) crossPlatformBusiness.LIZ(DouPlusMonitorBusiness.class)) == null)) {
            douPlusMonitorBusiness.LIZ(str);
        }
        PreRenderWebViewBusiness LIZ2 = PreRenderWebViewBusiness.LIZJ.LIZ(this.LJIIJ);
        if (LIZ2 != null) {
            AnonymousClass197 r12 = this.LIZLLL;
            m.LIZIZ(r12, "");
            C21090sc.LIZ(r12);
            LIZ2.LIZ = r12;
        }
    }

    @Override // X.C48293Ixm
    public final void onReceivedError(WebView webView, int i2, String str, String str2) {
        AbstractC47918Irj crossPlatformBusiness;
        DouPlusMonitorBusiness douPlusMonitorBusiness;
        C69292oA r1;
        AbstractC48291Ixk ixk;
        super.onReceivedError(webView, i2, str, str2);
        if (!(Build.VERSION.SDK_INT >= 23 || (r1 = this.LJII) == null || (ixk = (AbstractC48291Ixk) r1.LIZ(AbstractC48291Ixk.class)) == null)) {
            ixk.LIZ(i2, str2);
        }
        this.LJIIL.LIZ(webView, i2, str, str2);
        AbstractC48266IxL ixL = this.LJIIJ;
        if (ixL != null && (crossPlatformBusiness = ixL.getCrossPlatformBusiness()) != null && (douPlusMonitorBusiness = (DouPlusMonitorBusiness) crossPlatformBusiness.LIZ(DouPlusMonitorBusiness.class)) != null) {
            douPlusMonitorBusiness.LIZ(i2, str2, webView);
        }
    }

    @Override // X.C48293Ixm
    public final void onReceivedError(WebView webView, WebResourceRequest webResourceRequest, WebResourceError webResourceError) {
        AbstractC47918Irj crossPlatformBusiness;
        DouPlusMonitorBusiness douPlusMonitorBusiness;
        AbstractC48291Ixk ixk;
        super.onReceivedError(webView, webResourceRequest, webResourceError);
        C69292oA r1 = this.LJII;
        if (!(r1 == null || (ixk = (AbstractC48291Ixk) r1.LIZ(AbstractC48291Ixk.class)) == null)) {
            ixk.LIZ(webResourceRequest, webResourceError);
        }
        this.LJIIL.LIZ(webView, webResourceRequest, webResourceError);
        AbstractC48266IxL ixL = this.LJIIJ;
        if (ixL != null && (crossPlatformBusiness = ixL.getCrossPlatformBusiness()) != null && (douPlusMonitorBusiness = (DouPlusMonitorBusiness) crossPlatformBusiness.LIZ(DouPlusMonitorBusiness.class)) != null && douPlusMonitorBusiness.LIZ && webResourceRequest != null && webResourceError != null && webResourceRequest.isForMainFrame()) {
            Uri url = webResourceRequest.getUrl();
            if (url == null) {
                douPlusMonitorBusiness.LIZ(webResourceError.getErrorCode(), null, webView);
            } else {
                douPlusMonitorBusiness.LIZ(webResourceError.getErrorCode(), url.toString(), webView);
            }
        }
    }

    public final void onReceivedHttpError(WebView webView, WebResourceRequest webResourceRequest, WebResourceResponse webResourceResponse) {
        AbstractC48291Ixk ixk;
        super.onReceivedHttpError(webView, webResourceRequest, webResourceResponse);
        C69292oA r1 = this.LJII;
        if (!(r1 == null || (ixk = (AbstractC48291Ixk) r1.LIZ(AbstractC48291Ixk.class)) == null)) {
            ixk.LIZ(webResourceRequest, webResourceResponse);
        }
        this.LJIIL.LIZ(webView, webResourceRequest, webResourceResponse);
    }

    public final void onReceivedSslError(WebView webView, SslErrorHandler sslErrorHandler, SslError sslError) {
        AbstractC48291Ixk ixk;
        super.onReceivedSslError(webView, sslErrorHandler, sslError);
        C69292oA r1 = this.LJII;
        if (!(r1 == null || (ixk = (AbstractC48291Ixk) r1.LIZ(AbstractC48291Ixk.class)) == null)) {
            ixk.LIZ(sslError);
        }
        this.LJIIL.LIZ(webView, sslErrorHandler, sslError);
    }

    @Override // X.C48249Ix4, X.C48293Ixm
    public final boolean onRenderProcessGone(WebView webView, RenderProcessGoneDetail renderProcessGoneDetail) {
        JWP LIZ2 = C48410Izf.LIZ.LIZ();
        AnonymousClass2ZL.LIZIZ("WebViewMonitorHelper", "handleRenderProcessGone: " + AnonymousClass2ZL.LIZ(webView) + ", detail: " + renderProcessGoneDetail);
        if (!LIZ2.LIZIZ() || !LIZ2.LIZIZ.LJFF(webView)) {
            LIZ2.LIZ(webView, renderProcessGoneDetail);
        }
        super.onRenderProcessGone(webView, renderProcessGoneDetail);
        return C45324Hqz.LIZ(webView, renderProcessGoneDetail);
    }

    @Override // android.webkit.WebViewClient
    public final WebResourceResponse shouldInterceptRequest(WebView webView, WebResourceRequest webResourceRequest) {
        AbstractC48272IxR ixR;
        WebResourceResponse LIZ2;
        PassBackWebInfoBusiness LIZIZ2;
        String str;
        C48131IvA crossPlatformParams;
        C48119Iuy iuy;
        WebResourceResponse LIZ3;
        C17990nc<WebResourceRequest, WebResourceResponse> LJIILJJIL = AnonymousClass1NM.LJ.LJIILJJIL(new C17990nc<>(webResourceRequest, webView, null, EnumC17980nb.CONTINUE));
        if (LJIILJJIL.LJFF == EnumC17980nb.INTERCEPT && LJIILJJIL.LIZIZ != null) {
            return LJIILJJIL.LIZIZ;
        }
        if (LJIILJJIL.LJFF != EnumC17980nb.EXCEPTION || LJIILJJIL.LJ == null) {
            WebView webView2 = LJIILJJIL.LIZJ;
            Q q = LJIILJJIL.LIZ;
            AbstractC48266IxL ixL = this.LJIIJ;
            if (!(ixL == null || (crossPlatformParams = ixL.getCrossPlatformParams()) == null || (iuy = crossPlatformParams.LIZIZ) == null || Build.VERSION.SDK_INT < 21 || iuy.LIZ == 0 || q == null)) {
                CWebViewInterceptor cWebViewInterceptor = CWebViewInterceptor.LIZJ;
                m.LIZIZ(iuy, "");
                C21090sc.LIZ(q, iuy);
                if (q.getUrl() != null) {
                    String uri = q.getUrl().toString();
                    m.LIZIZ(uri, "");
                    if (AnonymousClass1ZS.LIZ((CharSequence) uri, (CharSequence) "https://securepubads.g.doubleclick.net/gampad/ads", false) && (LIZ3 = cWebViewInterceptor.LIZ(uri, q, iuy)) != null) {
                        return LIZ3;
                    }
                }
            }
            if (!(Build.VERSION.SDK_INT < 21 || q == null || q.getUrl() == null || q.getRequestHeaders() == null || (LIZIZ2 = LIZIZ()) == null)) {
                String uri2 = q.getUrl().toString();
                m.LIZIZ(uri2, "");
                Map<String, String> requestHeaders = q.getRequestHeaders();
                m.LIZIZ(requestHeaders, "");
                C21090sc.LIZ(uri2, requestHeaders);
                if (LIZIZ2.LIZLLL() && LIZIZ2.LIZIZ().size() < LIZIZ2.LIZJ && !AnonymousClass1ZS.LIZ((CharSequence) uri2) && !m.LIZ((Object) "about:blank", (Object) uri2) && !AnonymousClass1ZS.LIZJ(uri2, ".js", false) && !AnonymousClass1ZS.LIZJ(uri2, ".css", false) && (str = requestHeaders.get("Accept")) != null && AnonymousClass1ZS.LIZ((CharSequence) str, (CharSequence) "html", false)) {
                    Map<String, Map<String, String>> LIZJ2 = LIZIZ2.LIZJ();
                    String LIZ4 = AnonymousClass26K.LIZ(uri2);
                    m.LIZIZ(LIZ4, "");
                    LIZJ2.put(LIZ4, requestHeaders);
                }
            }
            return (Build.VERSION.SDK_INT < 21 || (ixR = this.LJIIIZ) == null || (LIZ2 = ixR.LIZ(q)) == null) ? super.shouldInterceptRequest(webView2, (WebResourceRequest) q) : LIZ2;
        }
        throw LJIILJJIL.LJ;
    }

    @Override // android.webkit.WebViewClient
    public final WebResourceResponse shouldInterceptRequest(WebView webView, String str) {
        AbstractC48291Ixk ixk;
        AbstractC48291Ixk ixk2;
        WebResourceResponse LIZ2;
        AbstractC48291Ixk ixk3;
        WebResourceResponse LIZ3;
        AbstractC48291Ixk ixk4;
        AbstractC48291Ixk ixk5;
        C17990nc<String, WebResourceResponse> LJIILIIL2 = AnonymousClass1NM.LJ.LJIILIIL(new C17990nc<>(str, webView, null, EnumC17980nb.CONTINUE));
        if (LJIILIIL2.LJFF == EnumC17980nb.INTERCEPT && LJIILIIL2.LIZIZ != null) {
            return LJIILIIL2.LIZIZ;
        }
        if (LJIILIIL2.LJFF != EnumC17980nb.EXCEPTION || LJIILIIL2.LJ == null) {
            WebView webView2 = LJIILIIL2.LIZJ;
            Q q = LJIILIIL2.LIZ;
            C69292oA r1 = this.LJII;
            if (!(r1 == null || (ixk5 = (AbstractC48291Ixk) r1.LIZ(AbstractC48291Ixk.class)) == null)) {
                ixk5.LJFF();
            }
            C84513Ui r0 = this.LJFF;
            if (r0 == null || (LIZ3 = r0.LIZ(webView2, q)) == null) {
                C48328IyL iyL = this.LJI;
                if (iyL != null) {
                    String valueOf = String.valueOf(q);
                    C21090sc.LIZ(valueOf);
                    AnonymousClass2Q0 r02 = AnonymousClass2Q0.LIZIZ;
                    String str2 = iyL.LIZ;
                    C21090sc.LIZ(str2, valueOf);
                    if (!TextUtils.isEmpty(valueOf) && !TextUtils.isEmpty(str2) && ((AnonymousClass1ZS.LIZ((CharSequence) str2, (CharSequence) "https", false) || AnonymousClass1ZS.LIZ((CharSequence) str2, (CharSequence) "http", false)) && ((AnonymousClass1ZS.LIZ((CharSequence) valueOf, (CharSequence) "http", false) || AnonymousClass1ZS.LIZ((CharSequence) valueOf, (CharSequence) "https", false)) && !AnonymousClass1ZS.LIZ((CharSequence) valueOf, (CharSequence) "/v1/list?rdn", false) && !AnonymousClass1ZS.LIZ((CharSequence) valueOf, (CharSequence) "google-analytics.com", false) && !AnonymousClass1ZS.LIZ((CharSequence) valueOf, (CharSequence) "cdn.polyfill.io", false) && AnonymousClass0VL.LIZ().LIZ(true, "is_ttnet_intercept_webview", false)))) {
                        if (AnonymousClass0VL.LIZ().LIZ(true, "is_ttnet_intercept_all", false)) {
                            if (!AnonymousClass1ZS.LIZ((CharSequence) str2, (CharSequence) "ttnet_intercept=0", false)) {
                                if (!C13430gG.LIZ(AnonymousClass2Q0.LIZLLL)) {
                                    Iterator<String> it = AnonymousClass2Q0.LIZLLL.iterator();
                                    while (true) {
                                        if (!it.hasNext()) {
                                            break;
                                        }
                                        String next = it.next();
                                        m.LIZIZ(next, "");
                                        if (AnonymousClass1ZS.LIZ((CharSequence) str2, (CharSequence) next, false)) {
                                            break;
                                        }
                                    }
                                }
                            }
                        } else if (!AnonymousClass1ZS.LIZ((CharSequence) str2, (CharSequence) "ttnet_intercept=1", false)) {
                            if (!C13430gG.LIZ(AnonymousClass2Q0.LIZJ)) {
                                Iterator<String> it2 = AnonymousClass2Q0.LIZJ.iterator();
                                while (true) {
                                    if (!it2.hasNext()) {
                                        break;
                                    }
                                    String next2 = it2.next();
                                    m.LIZIZ(next2, "");
                                    if (AnonymousClass1ZS.LIZ((CharSequence) str2, (CharSequence) next2, false)) {
                                        break;
                                    }
                                }
                            }
                        }
                        C82093La r12 = new C82093La();
                        C21090sc.LIZ(str2, valueOf);
                        if (!TextUtils.isEmpty(valueOf) && !TextUtils.isEmpty(str2) && (LIZ2 = r12.LIZ(r12.LIZ(str2, valueOf))) != null) {
                            C69292oA r13 = this.LJII;
                            if (!(r13 == null || (ixk3 = (AbstractC48291Ixk) r13.LIZ(AbstractC48291Ixk.class)) == null)) {
                                ixk3.LJII();
                            }
                            return LIZ2;
                        }
                    }
                }
                WebResourceResponse LIZ4 = C57842Pt.LIZ.LIZ(q);
                if (LIZ4 != null) {
                    return LIZ4;
                }
                C69292oA r14 = this.LJII;
                if (!(r14 == null || (ixk2 = (AbstractC48291Ixk) r14.LIZ(AbstractC48291Ixk.class)) == null)) {
                    ixk2.LJIIIIZZ();
                }
                C69292oA r15 = this.LJII;
                if (!(r15 == null || (ixk = (AbstractC48291Ixk) r15.LIZ(AbstractC48291Ixk.class)) == null)) {
                    ixk.LIZ((String) q);
                }
                return super.shouldInterceptRequest(webView2, (String) q);
            }
            C69292oA r16 = this.LJII;
            if (!(r16 == null || (ixk4 = (AbstractC48291Ixk) r16.LIZ(AbstractC48291Ixk.class)) == null)) {
                ixk4.LJI();
            }
            return LIZ3;
        }
        throw LJIILIIL2.LJ;
    }

    @Override // android.webkit.WebViewClient
    public final boolean shouldOverrideUrlLoading(WebView webView, WebResourceRequest webResourceRequest) {
        return super.shouldOverrideUrlLoading(webView, webResourceRequest);
    }

    @Override // X.C48249Ix4, X.C48293Ixm, android.webkit.WebViewClient
    public final boolean shouldOverrideUrlLoading(WebView webView, String str) {
        C21090sc.LIZ(webView, str);
        AbstractC45051Hma hma = this.LJ;
        if (hma != null) {
            hma.LIZ(str);
        }
        return LIZ(webView, str);
    }
}