导航菜单

页面标题

页面副标题

RummyCircle v11000.89 - OverlayWebviewActivity$initialize$client$1.java 源代码

正在查看: RummyCircle v11000.89 应用的 OverlayWebviewActivity$initialize$client$1.java JAVA 源代码文件

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


package com.games24x7.pgwebview.ui;

import android.content.Intent;
import android.graphics.Bitmap;
import android.net.Uri;
import android.util.Log;
import android.view.ViewGroup;
import android.view.ViewParent;
import android.webkit.RenderProcessGoneDetail;
import android.webkit.WebResourceRequest;
import android.webkit.WebResourceResponse;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.RelativeLayout;
import androidx.appcompat.app.j;
import androidx.camera.camera2.internal.w;
import com.games24x7.pgwebview.a;
import com.games24x7.pgwebview.communication.internal.eventbus.event.OverlayWebviewEvent;
import com.games24x7.pgwebview.custom.PGWebView;
import com.games24x7.pgwebview.enums.AnalyticsConstants;
import com.games24x7.pgwebview.enums.AnalyticsFormatType;
import com.games24x7.pgwebview.enums.WebviewEventType;
import java.util.Locale;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.jvm.internal.Intrinsics;
import kotlin.text.StringsKt;
import org.jetbrains.annotations.NotNull;
import org.json.JSONObject;

@Metadata
public final class OverlayWebviewActivity$initialize$client$1 extends WebViewClient {
    private boolean loadHtml;
    public final OverlayWebviewActivity this$0;

    public OverlayWebviewActivity$initialize$client$1(OverlayWebviewActivity overlayWebviewActivity) {
        this.this$0 = overlayWebviewActivity;
    }

    public static final void m34shouldInterceptRequest$lambda2(WebView webView, OverlayWebviewActivity overlayWebviewActivity) {
        Intrinsics.checkNotNullParameter(webView, "$view");
        Intrinsics.checkNotNullParameter(overlayWebviewActivity, "this$0");
        webView.loadUrl(OverlayWebviewActivity.access$getRemoveMandateMobileHeader$p(overlayWebviewActivity));
    }

    public static final void m35shouldInterceptRequest$lambda4(OverlayWebviewActivity overlayWebviewActivity, WebView webView) {
        Intrinsics.checkNotNullParameter(overlayWebviewActivity, "this$0");
        Intrinsics.checkNotNullParameter(webView, "$view");
        try {
            PGWebView access$getWebview$p = OverlayWebviewActivity.access$getWebview$p(overlayWebviewActivity);
            if (access$getWebview$p == null) {
                Intrinsics.q("webview");
                throw null;
            }
            access$getWebview$p.loadUrl("javascript:document.addEventListener(\"DOMContentLoaded\", function(event) {Android.documentLoaded();});");
            String access$getWebviewId$p = OverlayWebviewActivity.access$getWebviewId$p(overlayWebviewActivity);
            WebviewEventType webviewEventType = WebviewEventType.SHOULD_INTERCEPT_REQUEST;
            JSONObject jSONObject = new JSONObject();
            jSONObject.put("webviewId", OverlayWebviewActivity.access$getWebviewId$p(overlayWebviewActivity));
            jSONObject.put("url", webView.getUrl());
            Unit unit = Unit.a;
            OverlayWebviewActivity.access$sendWebviewEvent(overlayWebviewActivity, new OverlayWebviewEvent(access$getWebviewId$p, webviewEventType, jSONObject, null, true, 8, null));
        } catch (Exception e) {
            e.printStackTrace();
            JSONObject put = new JSONObject().put("errorCode", "WEBVIEW_URL_ERROR_CODE");
            put.put("errorMsg", "PGWebview Exception - Error while loading the Url.");
            OverlayWebviewActivity.access$sendWebviewEvent(overlayWebviewActivity, new OverlayWebviewEvent(OverlayWebviewActivity.access$getWebviewId$p(overlayWebviewActivity), WebviewEventType.EXCEPTION, put, null, false, 8, null));
        }
    }

    @Override
    public void onPageFinished(@NotNull WebView webView, @NotNull String str) {
        Intrinsics.checkNotNullParameter(webView, "view");
        Intrinsics.checkNotNullParameter(str, "interceptURL");
        if (OverlayWebviewActivity.access$getShowLoaderView$p(this.this$0)) {
            Log.d(OverlayWebviewActivity.access$getTAG$p(this.this$0), "Loader view : page finished " + str);
            JSONObject jSONObject = new JSONObject();
            jSONObject.put("timeDiff", System.currentTimeMillis() - OverlayWebviewActivity.access$getLoaderStartTimeStamp$p(this.this$0));
            String jSONObject2 = jSONObject.toString();
            Intrinsics.checkNotNullExpressionValue(jSONObject2, "JSONObject().apply {\n   …             }.toString()");
            String str2 = com.games24x7.pgwebview.util.b.a;
            String a = com.games24x7.pgwebview.util.b.a(AnalyticsConstants.EVENT_NAME_LOADER_SHOWN_TO_PLO, AnalyticsConstants.EVENT_ID_LOADER_SHOWN_TO_PLO, jSONObject2, AnalyticsFormatType.TAXONOMY_CLICKSTREAM);
            OverlayWebviewActivity overlayWebviewActivity = this.this$0;
            String access$getWebviewId$p = OverlayWebviewActivity.access$getWebviewId$p(overlayWebviewActivity);
            WebviewEventType webviewEventType = WebviewEventType.ANALYTICS_EVENT;
            JSONObject jSONObject3 = new JSONObject();
            OverlayWebviewActivity overlayWebviewActivity2 = this.this$0;
            jSONObject3.put("webviewId", OverlayWebviewActivity.access$getWebviewId$p(overlayWebviewActivity2));
            jSONObject3.put("url", OverlayWebviewActivity.access$getUrl$p(overlayWebviewActivity2));
            jSONObject3.put("analyticsPayload", a);
            Unit unit = Unit.a;
            OverlayWebviewActivity.access$sendWebviewEvent(overlayWebviewActivity, new OverlayWebviewEvent(access$getWebviewId$p, webviewEventType, jSONObject3, null, false, 24, null));
        }
        OverlayWebviewActivity.access$setUrl$p(this.this$0, str);
        if (this.this$0.isFinishing()) {
            return;
        }
        super.onPageFinished(webView, str);
        if (OverlayWebviewActivity.access$isFirstLoad$p(this.this$0)) {
            OverlayWebviewActivity.access$configureWebviewUI(this.this$0);
            OverlayWebviewActivity.access$setFirstLoad$p(this.this$0, false);
        }
        if (this.this$0.isBackGroundTransparent()) {
            webView.setBackgroundColor(0);
        } else {
            webView.setBackgroundColor(-1);
        }
        try {
            PGWebView access$getWebview$p = OverlayWebviewActivity.access$getWebview$p(this.this$0);
            if (access$getWebview$p == null) {
                Intrinsics.q("webview");
                throw null;
            }
            access$getWebview$p.loadUrl("javascript:document.addEventListener(\"DOMContentLoaded\", function(event) { Android.documentLoaded();});");
            Locale locale = Locale.getDefault();
            Intrinsics.checkNotNullExpressionValue(locale, "getDefault()");
            String lowerCase = str.toLowerCase(locale);
            Intrinsics.checkNotNullExpressionValue(lowerCase, "this as java.lang.String).toLowerCase(locale)");
            String access$getUrl$p = OverlayWebviewActivity.access$getUrl$p(this.this$0);
            if (access$getUrl$p == null) {
                access$getUrl$p = "";
            }
            if (StringsKt.E(lowerCase, access$getUrl$p, false)) {
                webView.clearHistory();
            }
            OverlayWebviewActivity overlayWebviewActivity3 = this.this$0;
            String access$getWebviewId$p2 = OverlayWebviewActivity.access$getWebviewId$p(overlayWebviewActivity3);
            WebviewEventType webviewEventType2 = WebviewEventType.LOADED;
            JSONObject jSONObject4 = new JSONObject();
            OverlayWebviewActivity overlayWebviewActivity4 = this.this$0;
            jSONObject4.put("webviewId", OverlayWebviewActivity.access$getWebviewId$p(overlayWebviewActivity4));
            jSONObject4.put("url", OverlayWebviewActivity.access$getUrl$p(overlayWebviewActivity4));
            Unit unit2 = Unit.a;
            OverlayWebviewActivity.access$sendWebviewEvent(overlayWebviewActivity3, new OverlayWebviewEvent(access$getWebviewId$p2, webviewEventType2, jSONObject4, null, false, 24, null));
            RelativeLayout access$getOverlay$p = OverlayWebviewActivity.access$getOverlay$p(this.this$0);
            if (access$getOverlay$p == null) {
                Intrinsics.q("overlay");
                throw null;
            }
            access$getOverlay$p.setVisibility(0);
            RelativeLayout access$getInnerOverlayRelativeLayout$p = OverlayWebviewActivity.access$getInnerOverlayRelativeLayout$p(this.this$0);
            if (access$getInnerOverlayRelativeLayout$p != null) {
                access$getInnerOverlayRelativeLayout$p.setVisibility(0);
            } else {
                Intrinsics.q("innerOverlayRelativeLayout");
                throw null;
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    @Override
    public void onPageStarted(@NotNull WebView webView, @NotNull String str, Bitmap bitmap) {
        Intrinsics.checkNotNullParameter(webView, "view");
        Intrinsics.checkNotNullParameter(str, "url");
        super.onPageStarted(webView, str, bitmap);
        OverlayWebviewActivity overlayWebviewActivity = this.this$0;
        String access$getWebviewId$p = OverlayWebviewActivity.access$getWebviewId$p(overlayWebviewActivity);
        WebviewEventType webviewEventType = WebviewEventType.STARTED_LOADING;
        JSONObject jSONObject = new JSONObject();
        jSONObject.put("webviewId", OverlayWebviewActivity.access$getWebviewId$p(this.this$0));
        jSONObject.put("url", str);
        Unit unit = Unit.a;
        OverlayWebviewActivity.access$sendWebviewEvent(overlayWebviewActivity, new OverlayWebviewEvent(access$getWebviewId$p, webviewEventType, jSONObject, null, true, 8, null));
        OverlayWebviewActivity.access$setWebviewLoadError$p(this.this$0, false);
    }

    @Override
    public void onReceivedError(@NotNull WebView webView, int i, @NotNull String str, @NotNull String str2) {
        Intrinsics.checkNotNullParameter(webView, "view");
        Intrinsics.checkNotNullParameter(str, "description");
        Intrinsics.checkNotNullParameter(str2, "failingUrl");
        super.onReceivedError(webView, i, str, str2);
        OverlayWebviewActivity.access$setWebviewLoadError$p(this.this$0, true);
        webView.setBackgroundColor(-1);
        JSONObject put = new JSONObject().put("errorCode", i);
        put.put("description", str);
        put.put("failingUrl", str2);
        OverlayWebviewActivity overlayWebviewActivity = this.this$0;
        OverlayWebviewActivity.access$sendWebviewEvent(overlayWebviewActivity, new OverlayWebviewEvent(OverlayWebviewActivity.access$getWebviewId$p(overlayWebviewActivity), WebviewEventType.LOADERROR, put, null, false, 24, null));
    }

    @Override
    public boolean onRenderProcessGone(WebView webView, @NotNull RenderProcessGoneDetail renderProcessGoneDetail) {
        ViewParent parent;
        Intrinsics.checkNotNullParameter(renderProcessGoneDetail, "detail");
        String access$getTAG$p = OverlayWebviewActivity.access$getTAG$p(this.this$0);
        StringBuilder a = a.a("onRenderProcessGone ::  Stopping WebView crash :: Webview Id is :: ");
        a.append(OverlayWebviewActivity.access$getWebviewId$p(this.this$0));
        a.append(" :: Crash Details are :: ");
        a.append(j.c(renderProcessGoneDetail));
        Log.e(access$getTAG$p, a.toString());
        OverlayWebviewActivity overlayWebviewActivity = this.this$0;
        String access$getWebviewId$p = OverlayWebviewActivity.access$getWebviewId$p(overlayWebviewActivity);
        WebviewEventType webviewEventType = WebviewEventType.WEBVIEW_CRASH;
        JSONObject jSONObject = new JSONObject();
        OverlayWebviewActivity overlayWebviewActivity2 = this.this$0;
        jSONObject.put("webviewId", OverlayWebviewActivity.access$getWebviewId$p(overlayWebviewActivity2));
        jSONObject.put("url", OverlayWebviewActivity.access$getUrl$p(overlayWebviewActivity2));
        Unit unit = Unit.a;
        OverlayWebviewActivity.access$sendWebviewEvent(overlayWebviewActivity, new OverlayWebviewEvent(access$getWebviewId$p, webviewEventType, jSONObject, null, false, 8, null));
        if (webView != null && (parent = webView.getParent()) != null && (parent instanceof ViewGroup)) {
            ((ViewGroup) parent).removeView(webView);
        }
        this.this$0.closeOverlay();
        return true;
    }

    @Override
    public WebResourceResponse shouldInterceptRequest(@NotNull WebView webView, @NotNull WebResourceRequest webResourceRequest) {
        Intrinsics.checkNotNullParameter(webView, "view");
        Intrinsics.checkNotNullParameter(webResourceRequest, "webResourceRequest");
        Log.i("interceptURL", webResourceRequest.getUrl().toString());
        int i = 1;
        if (OverlayWebviewActivity.access$getRemoveMandateMobileHeader$p(this.this$0).length() > 0) {
            OverlayWebviewActivity overlayWebviewActivity = this.this$0;
            overlayWebviewActivity.runOnUiThread(new f(webView, overlayWebviewActivity, i));
        }
        if (this.loadHtml) {
            this.loadHtml = false;
            OverlayWebviewActivity overlayWebviewActivity2 = this.this$0;
            overlayWebviewActivity2.runOnUiThread(new w(overlayWebviewActivity2, webView, 4));
        }
        if (Intrinsics.a(webResourceRequest.getUrl().toString(), OverlayWebviewActivity.access$getUrl$p(this.this$0))) {
            this.loadHtml = true;
        }
        return super.shouldInterceptRequest(webView, webResourceRequest);
    }

    @Override
    public boolean shouldOverrideUrlLoading(@NotNull WebView webView, WebResourceRequest webResourceRequest) {
        Intrinsics.checkNotNullParameter(webView, "view");
        try {
            String access$getUrl$p = OverlayWebviewActivity.access$getUrl$p(this.this$0);
            if (access$getUrl$p != null) {
                OverlayWebviewActivity overlayWebviewActivity = this.this$0;
                if (StringsKt.E(access$getUrl$p, "mailto:", false)) {
                    Uri parse = Uri.parse(OverlayWebviewActivity.access$getUrl$p(overlayWebviewActivity));
                    Intent intent = new Intent("android.intent.action.SENDTO");
                    intent.setData(parse);
                    webView.stopLoading();
                    overlayWebviewActivity.startActivity(Intent.createChooser(intent, "Send email"));
                    return shouldOverrideUrlLoading(webView, OverlayWebviewActivity.access$getUrl$p(overlayWebviewActivity));
                }
                if (StringsKt.E(access$getUrl$p, "tel:", false)) {
                    new Intent("android.intent.action.DIAL").setData(Uri.parse(OverlayWebviewActivity.access$getUrl$p(overlayWebviewActivity)));
                    webView.stopLoading();
                    overlayWebviewActivity.startActivity(new Intent("android.intent.action.VIEW", Uri.parse(OverlayWebviewActivity.access$getUrl$p(overlayWebviewActivity))));
                    return shouldOverrideUrlLoading(webView, OverlayWebviewActivity.access$getUrl$p(overlayWebviewActivity));
                }
            }
        } catch (Exception e) {
            Log.e(OverlayWebviewActivity.access$getTAG$p(this.this$0), "shouldOverrideUrlLoading :: Got crash :: Crash");
            e.printStackTrace();
        }
        OverlayWebviewActivity overlayWebviewActivity2 = this.this$0;
        String access$getWebviewId$p = OverlayWebviewActivity.access$getWebviewId$p(overlayWebviewActivity2);
        WebviewEventType webviewEventType = WebviewEventType.SHOULD_OVERRIDE_URL;
        JSONObject jSONObject = new JSONObject();
        jSONObject.put("webviewId", OverlayWebviewActivity.access$getWebviewId$p(this.this$0));
        jSONObject.put("url", webResourceRequest != null ? webResourceRequest.getUrl() : null);
        Unit unit = Unit.a;
        OverlayWebviewActivity.access$sendWebviewEvent(overlayWebviewActivity2, new OverlayWebviewEvent(access$getWebviewId$p, webviewEventType, jSONObject, null, true, 8, null));
        return super.shouldOverrideUrlLoading(webView, webResourceRequest);
    }
}