package com.bytedance.sdk.component.utils;

import android.annotation.TargetApi;
import android.webkit.WebView;

/* JADX INFO: loaded from: classes.dex */
public class onz {
    private static final fm fm = new ro();

    public static class fm {
        private fm() {
        }

        public void fm(WebView webView, String str) {
            if (webView == null) {
                return;
            }
            try {
                webView.loadUrl(str);
            } catch (Throwable unused) {
            }
        }
    }

    @TargetApi(19)
    public static class ro extends fm {
        private ro() {
            super();
        }

        @Override // com.bytedance.sdk.component.utils.onz.fm
        public void fm(WebView webView, String str) {
            if (webView == null) {
                return;
            }
            if (str != null && str.startsWith("javascript:")) {
                try {
                    webView.evaluateJavascript(str, null);
                    return;
                } catch (Throwable th) {
                    boolean z10 = th instanceof IllegalStateException;
                }
            }
            try {
                webView.loadUrl(str);
            } catch (Throwable unused) {
            }
        }
    }

    public static void fm(WebView webView, String str) {
        fm.fm(webView, str);
    }
}
