导航菜单

页面标题

页面副标题

Oolka v2.4.42 - t3.java 源代码

正在查看: Oolka v2.4.42 应用的 t3.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package one.upswing.sdk;

import android.content.Context;
import android.graphics.Bitmap;
import android.net.Uri;
import android.net.http.SslError;
import android.webkit.SafeBrowsingResponse;
import android.webkit.SslErrorHandler;
import android.webkit.WebResourceError;
import android.webkit.WebResourceRequest;
import android.webkit.WebResourceResponse;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.Toast;
import java.net.URI;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Objects;
import kotlin.LazyKt__LazyJVMKt;
import kotlin.text.StringsKt__StringsJVMKt;
import kotlin.text.StringsKt__StringsKt;
import one.upswing.sdk.webviewcore.webclient.WebViewErrorData;

public final class t3 extends WebViewClient {
    public final Context a;
    public final b0 b;
    public final l4 c;
    public final o4 d;
    public final c e;
    public boolean f;
    public final kotlin.e g;

    public t3(Context context, b0 b0Var, l4 l4Var, o4 o4Var, c cVar) {
        kotlin.e lazy;
        this.a = context;
        this.b = b0Var;
        this.c = l4Var;
        this.d = o4Var;
        this.e = cVar;
        lazy = LazyKt__LazyJVMKt.lazy(new p3(this));
        this.g = lazy;
    }

    public final void a(String str, int i, String str2, String str3) {
        String str4;
        if (i == -8) {
            str4 = "Error: Timeout";
        } else if (i == -6) {
            str4 = "Connection failed";
        } else if (i == -2) {
            str4 = "No Internet, Please check your connection/wifi";
        } else if (i != -1) {
            switch (i) {
                case -15:
                    str4 = "Too many requests";
                    break;
                case -14:
                    str4 = "File not found";
                    break;
                case -13:
                    str4 = "File error";
                    break;
                case -12:
                    str4 = "Bad URL";
                    break;
                case -11:
                    str4 = "Failed SSL handshake";
                    break;
                case -10:
                    str4 = "Unsupported scheme";
                    break;
                default:
                    str4 = "Something went wrong";
                    break;
            }
        } else {
            str4 = "Unknown error";
        }
        WebViewErrorData webViewErrorData = new WebViewErrorData(str, i, str4, str2, str3);
        webViewErrorData.toString();
        this.c.invoke(webViewErrorData);
    }

    @Override
    public final void onPageFinished(WebView webView, String str) {
        boolean contains$default;
        boolean contains$default2;
        super.onPageFinished(webView, str);
        try {
            if (this.f && (str == null || !StringsKt__StringsJVMKt.startsWith$default(str, "https://webapp.upswing.one", false, 2, null))) {
                return;
            }
            this.d.invoke();
            if (webView != null) {
                webView.setVisibility(0);
            }
            contains$default = StringsKt__StringsKt.contains$default((CharSequence) new URI(str).getPath(), (CharSequence) "auth/logout", false, 2, (Object) null);
            if (contains$default) {
                if (webView != null) {
                    webView.clearHistory();
                }
            } else {
                contains$default2 = StringsKt__StringsKt.contains$default((CharSequence) new URI(str).toString(), (CharSequence) "https://webapp.upswing.one", false, 2, (Object) null);
                if (!contains$default2 || webView == null) {
                    return;
                }
                webView.clearHistory();
            }
        } catch (Exception e) {
            e.getLocalizedMessage();
        }
    }

    @Override
    public final void onPageStarted(WebView webView, String str, Bitmap bitmap) {
        super.onPageStarted(webView, str, bitmap);
        this.f = false;
    }

    @Override
    public final void onReceivedError(WebView webView, WebResourceRequest webResourceRequest, WebResourceError webResourceError) {
        String str;
        Uri url;
        CharSequence charSequence;
        super.onReceivedError(webView, webResourceRequest, webResourceError);
        str = "";
        if (webResourceRequest == null || !webResourceRequest.isForMainFrame()) {
            if (webResourceRequest != null && (url = webResourceRequest.getUrl()) != null) {
                str = url;
            }
            str.toString();
            return;
        }
        this.f = true;
        int errorCode = webResourceError != null ? webResourceError.getErrorCode() : -6;
        if (webResourceError == null || (charSequence = webResourceError.getDescription()) == null) {
            charSequence = "";
        }
        String obj = charSequence.toString();
        Object url2 = webResourceRequest.getUrl();
        if (url2 == null) {
            url2 = "";
        }
        a("onReceivedError", errorCode, obj, url2.toString());
        Uri url3 = webResourceRequest.getUrl();
        (url3 != null ? url3 : "").toString();
    }

    @Override
    public final void onReceivedHttpError(WebView webView, WebResourceRequest webResourceRequest, WebResourceResponse webResourceResponse) {
        String str;
        Uri url;
        String str2;
        super.onReceivedHttpError(webView, webResourceRequest, webResourceResponse);
        str = "";
        if (webResourceRequest == null || !webResourceRequest.isForMainFrame()) {
            if (webResourceRequest != null && (url = webResourceRequest.getUrl()) != null) {
                str = url;
            }
            str.toString();
            return;
        }
        this.f = true;
        int statusCode = webResourceResponse != null ? webResourceResponse.getStatusCode() : -6;
        if (webResourceResponse == null || (str2 = webResourceResponse.getReasonPhrase()) == null) {
            str2 = "";
        }
        Object url2 = webResourceRequest.getUrl();
        if (url2 == null) {
            url2 = "";
        }
        a("onReceivedHttpError", statusCode, str2, url2.toString());
        Uri url3 = webResourceRequest.getUrl();
        (url3 != null ? url3 : "").toString();
    }

    @Override
    public final void onReceivedSslError(WebView webView, SslErrorHandler sslErrorHandler, SslError sslError) {
        String str;
        super.onReceivedSslError(webView, sslErrorHandler, sslError);
        Objects.toString(sslError);
        if (sslErrorHandler != null) {
            sslErrorHandler.cancel();
        }
        x2 x2Var = this.e.a;
        StringBuilder sb = new StringBuilder("onReceivedSslError: Something went wrong, SSL Error code: ");
        sb.append(sslError);
        sb.append(" ,SSL error while redirecting, url: ");
        if (webView == null || (str = webView.getUrl()) == null) {
            str = "";
        }
        sb.append(str);
        x2Var.b(sb.toString());
        Toast.makeText(this.a.getApplicationContext(), "Something went wrong", 0).show();
    }

    @Override
    public final void onSafeBrowsingHit(WebView webView, WebResourceRequest webResourceRequest, int i, SafeBrowsingResponse safeBrowsingResponse) {
        String str;
        super.onSafeBrowsingHit(webView, webResourceRequest, i, safeBrowsingResponse);
        Toast.makeText(this.a.getApplicationContext(), "Something went wrong", 0).show();
        x2 x2Var = this.e.a;
        StringBuilder sb = new StringBuilder("onSafeBrowsingHit-> threatType: ");
        sb.append(i);
        sb.append("  url ");
        if (webView == null || (str = webView.getUrl()) == null) {
            str = "";
        }
        sb.append(str);
        sb.append(", ");
        x2Var.b(sb.toString());
        if (safeBrowsingResponse != null) {
            safeBrowsingResponse.backToSafety(true);
        }
    }

    @Override
    public final boolean shouldOverrideUrlLoading(WebView webView, WebResourceRequest webResourceRequest) {
        Uri url;
        if (webResourceRequest == null || (url = webResourceRequest.getUrl()) == null) {
            return super.shouldOverrideUrlLoading(webView, webResourceRequest);
        }
        String uri = url.toString();
        ArrayList arrayList = d5.a;
        if (!(arrayList instanceof Collection) || !arrayList.isEmpty()) {
            Iterator it = arrayList.iterator();
            while (it.hasNext()) {
                if (StringsKt__StringsJVMKt.startsWith$default(uri, (String) it.next(), false, 2, null)) {
                    i6 i6Var = (i6) this.g.getValue();
                    String d = androidx.browser.customtabs.b.d(i6Var.a, (List) null);
                    if (d == null ? false : androidx.browser.customtabs.b.a(i6Var.a, d, new d6(i6Var))) {
                        url.toString();
                        ((i6) this.g.getValue()).a(url);
                        return true;
                    }
                    ((i0) ((g2) this.b.d.getValue())).b(k0.r, "{}");
                    Toast.makeText(this.a.getApplicationContext(), "Your default browser does not support this feature. Please use Chrome", 0).show();
                    return true;
                }
            }
        }
        return super.shouldOverrideUrlLoading(webView, webResourceRequest);
    }
}