导航菜单

页面标题

页面副标题

RummyCircle v11000.89 - b.java 源代码

正在查看: RummyCircle v11000.89 应用的 b.java JAVA 源代码文件

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


package com.games24x7.pgwebview.webviewHost;

import android.graphics.Bitmap;
import android.util.Log;
import android.view.ViewGroup;
import android.view.ViewParent;
import android.webkit.RenderProcessGoneDetail;
import android.webkit.ValueCallback;
import android.webkit.WebResourceRequest;
import android.webkit.WebResourceResponse;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import com.games24x7.pgwebview.communication.external.eventbus.events.CloseWebViewRequest;
import com.games24x7.pgwebview.communication.external.eventbus.events.CloseWebviewPGEvent;
import com.games24x7.pgwebview.communication.internal.eventbus.event.OverlayWebviewEvent;
import com.games24x7.pgwebview.controller.d;
import com.games24x7.pgwebview.custom.PGWebView;
import com.games24x7.pgwebview.enums.WebviewEventType;
import com.games24x7.pgwebview.webviewHost.a;
import com.games24x7.pgwebview.webviewHost.b;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.intrinsics.IntrinsicsKt;
import kotlin.coroutines.jvm.internal.DebugMetadata;
import kotlin.coroutines.jvm.internal.SuspendLambda;
import kotlin.j;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.internal.B;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlinx.coroutines.BuildersKt;
import kotlinx.coroutines.CoroutineScope;
import kotlinx.coroutines.CoroutineStart;
import kotlinx.coroutines.Dispatchers;
import org.jetbrains.annotations.NotNull;
import org.json.JSONObject;

public final class b extends WebViewClient {
    public boolean a;
    public final com.games24x7.pgwebview.webviewHost.a b;

    @DebugMetadata(c = "com.games24x7.pgwebview.webviewHost.PLOWebViewHost$initializeWebview$client$1$onPageFinished$2", f = "PLOWebviewHost.kt", i = {}, l = {}, m = "invokeSuspend", n = {}, s = {})
    public static final class a extends SuspendLambda implements Function2<CoroutineScope, Continuation<? super Unit>, Object> {
        public final WebView a;
        public final B<String> b;
        public final com.games24x7.pgwebview.webviewHost.a c;

        public a(WebView webView, B<String> b, com.games24x7.pgwebview.webviewHost.a aVar, Continuation<? super a> continuation) {
            super(2, continuation);
            this.a = webView;
            this.b = b;
            this.c = aVar;
        }

        public static final void a(com.games24x7.pgwebview.webviewHost.a aVar, String str) {
            Log.d(aVar.d, "Done loading html with result " + str);
            if (com.games24x7.pgwebview.webviewHost.a.i == null) {
                Log.d(aVar.d, "Webview killed");
            } else {
                Log.d(aVar.d, "webview alive");
                aVar.a.a();
            }
        }

        @NotNull
        public final Continuation<Unit> create(Object obj, @NotNull Continuation<?> continuation) {
            return new a(this.a, this.b, this.c, continuation);
        }

        public final Object invoke(Object obj, Object obj2) {
            return create((CoroutineScope) obj, (Continuation) obj2).invokeSuspend(Unit.a);
        }

        public final Object invokeSuspend(@NotNull Object obj) {
            IntrinsicsKt.getCOROUTINE_SUSPENDED();
            j.b(obj);
            WebView webView = this.a;
            String str = (String) this.b.a;
            final com.games24x7.pgwebview.webviewHost.a aVar = this.c;
            webView.evaluateJavascript(str, new ValueCallback() {
                @Override
                public final void onReceiveValue(Object obj2) {
                    b.a.a(a.this, (String) obj2);
                }
            });
            return Unit.a;
        }
    }

    @DebugMetadata(c = "com.games24x7.pgwebview.webviewHost.PLOWebViewHost$initializeWebview$client$1$shouldInterceptRequest$1", f = "PLOWebviewHost.kt", i = {}, l = {}, m = "invokeSuspend", n = {}, s = {})
    public static final class C0007b extends SuspendLambda implements Function2<CoroutineScope, Continuation<? super Unit>, Object> {
        public final com.games24x7.pgwebview.webviewHost.a a;
        public final WebView b;

        public C0007b(com.games24x7.pgwebview.webviewHost.a aVar, WebView webView, Continuation<? super C0007b> continuation) {
            super(2, continuation);
            this.a = aVar;
            this.b = webView;
        }

        @NotNull
        public final Continuation<Unit> create(Object obj, @NotNull Continuation<?> continuation) {
            return new C0007b(this.a, this.b, continuation);
        }

        public final Object invoke(Object obj, Object obj2) {
            return create((CoroutineScope) obj, (Continuation) obj2).invokeSuspend(Unit.a);
        }

        public final Object invokeSuspend(@NotNull Object obj) {
            IntrinsicsKt.getCOROUTINE_SUSPENDED();
            j.b(obj);
            try {
                PGWebView a = a.C0005a.a();
                if (a != null) {
                    a.loadUrl("javascript:document.addEventListener(\"DOMContentLoaded\", function(event) {Android.documentLoaded();});");
                }
                d b = this.a.b();
                String str = this.a.g;
                WebviewEventType webviewEventType = WebviewEventType.SHOULD_INTERCEPT_REQUEST;
                JSONObject jSONObject = new JSONObject();
                com.games24x7.pgwebview.webviewHost.a aVar = this.a;
                WebView webView = this.b;
                jSONObject.put("webviewId", aVar.g);
                jSONObject.put("url", webView.getUrl());
                Unit unit = Unit.a;
                b.a(new OverlayWebviewEvent(str, 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.");
                this.a.b().a(new OverlayWebviewEvent(this.a.g, WebviewEventType.EXCEPTION, put, null, false, 8, null));
            }
            return Unit.a;
        }
    }

    public b(com.games24x7.pgwebview.webviewHost.a aVar) {
        this.b = aVar;
    }

    @Override
    public final void onPageFinished(@NotNull WebView webView, @NotNull String str) {
        boolean z;
        CoroutineScope coroutineScope;
        Intrinsics.checkNotNullParameter(webView, "view");
        Intrinsics.checkNotNullParameter(str, "interceptURL");
        this.b.e = str;
        super.onPageFinished(webView, str);
        webView.setBackgroundColor(0);
        try {
            d b = this.b.b();
            String str2 = this.b.g;
            WebviewEventType webviewEventType = WebviewEventType.LOADED;
            JSONObject jSONObject = new JSONObject();
            com.games24x7.pgwebview.webviewHost.a aVar = this.b;
            jSONObject.put("webviewId", aVar.g);
            jSONObject.put("url", aVar.e);
            Unit unit = Unit.a;
            b.a(new OverlayWebviewEvent(str2, webviewEventType, jSONObject, null, false, 24, null));
            z = this.b.f;
            if (z) {
                Log.d(this.b.d, "PLO base container loaded, load plo HTML content");
                if (a.C0005a.a() == null) {
                    Log.d(this.b.d, "Webview was destroyed for PLO");
                    return;
                }
                B b2 = new B();
                b2.a = "";
                b2.a = ((String) b2.a) + "console.log(document.readyState); if(document.readyState == 'loading'){ document.addEventListener(\"DOMContentLoaded\", function(event) { console.log('DOMContentLoaded called >> htmlContent = " + this.b.c() + "'); ";
                b2.a = ((String) b2.a) + "document.body.insertAdjacentHTML('beforeend','" + this.b.c() + "');";
                StringBuilder sb = new StringBuilder();
                sb.append((String) b2.a);
                sb.append("}); } else {");
                b2.a = sb.toString();
                b2.a = ((String) b2.a) + "document.body.insertAdjacentHTML('beforeend','" + this.b.c() + "');";
                StringBuilder sb2 = new StringBuilder();
                sb2.append((String) b2.a);
                sb2.append('}');
                b2.a = sb2.toString();
                Log.d(this.b.d, "new PLO html : " + this.b.c());
                coroutineScope = this.b.c;
                BuildersKt.launch$default(coroutineScope, Dispatchers.getMain(), (CoroutineStart) null, new a(webView, b2, this.b, null), 2, (Object) null);
                this.b.f = false;
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    @Override
    public final void onPageStarted(@NotNull WebView webView, @NotNull String str, Bitmap bitmap) {
        Intrinsics.checkNotNullParameter(webView, "view");
        Intrinsics.checkNotNullParameter(str, "url");
        super.onPageStarted(webView, str, bitmap);
        d b = this.b.b();
        String str2 = this.b.g;
        WebviewEventType webviewEventType = WebviewEventType.STARTED_LOADING;
        JSONObject jSONObject = new JSONObject();
        jSONObject.put("webviewId", this.b.g);
        jSONObject.put("url", str);
        Unit unit = Unit.a;
        b.a(new OverlayWebviewEvent(str2, webviewEventType, jSONObject, null, true, 8, null));
    }

    @Override
    public final 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);
        webView.setBackgroundColor(-1);
        JSONObject put = new JSONObject().put("errorCode", i);
        put.put("description", str);
        put.put("failingUrl", str2);
        this.b.b().a(new OverlayWebviewEvent(this.b.g, WebviewEventType.LOADERROR, put, null, false, 24, null));
        if (this.b.b().b().get()) {
            return;
        }
        Log.d(this.b.d, "onReceivedError :: failing url: " + str2);
        this.b.a();
    }

    @Override
    public final boolean onRenderProcessGone(WebView webView, @NotNull RenderProcessGoneDetail renderProcessGoneDetail) {
        ViewParent parent;
        Intrinsics.checkNotNullParameter(renderProcessGoneDetail, "detail");
        String str = this.b.d;
        StringBuilder a2 = com.games24x7.pgwebview.a.a("onRenderProcessGone ::  Stopping WebView crash :: Webview Id is :: ");
        a2.append(this.b.g);
        a2.append(" :: Crash Details are :: ");
        a2.append(androidx.appcompat.app.j.c(renderProcessGoneDetail));
        Log.e(str, a2.toString());
        d b = this.b.b();
        String str2 = this.b.g;
        WebviewEventType webviewEventType = WebviewEventType.WEBVIEW_CRASH;
        JSONObject jSONObject = new JSONObject();
        com.games24x7.pgwebview.webviewHost.a aVar = this.b;
        jSONObject.put("webviewId", aVar.g);
        jSONObject.put("url", aVar.e);
        Unit unit = Unit.a;
        b.a(new OverlayWebviewEvent(str2, webviewEventType, jSONObject, null, false, 8, null));
        if (webView != null && (parent = webView.getParent()) != null && (parent instanceof ViewGroup)) {
            ((ViewGroup) parent).removeView(webView);
        }
        if (this.b.b().b().get()) {
            Log.d(this.b.d, "onRenderProcessGone :: Attached to overlay , closing overlay");
            this.b.b().a(new CloseWebviewPGEvent(new CloseWebViewRequest(this.b.g, "CLOSE", (String) null, 4, (DefaultConstructorMarker) null)));
            return true;
        }
        Log.d(this.b.d, "onRenderProcessGone :: destroy unattached webview ");
        this.b.a();
        return true;
    }

    @Override
    public final WebResourceResponse shouldInterceptRequest(@NotNull WebView webView, @NotNull WebResourceRequest webResourceRequest) {
        CoroutineScope coroutineScope;
        Intrinsics.checkNotNullParameter(webView, "view");
        Intrinsics.checkNotNullParameter(webResourceRequest, "webResourceRequest");
        Log.i("interceptURL", webResourceRequest.getUrl().toString());
        if (this.a) {
            this.a = false;
            coroutineScope = this.b.c;
            BuildersKt.launch$default(coroutineScope, Dispatchers.getMain(), (CoroutineStart) null, new C0007b(this.b, webView, null), 2, (Object) null);
        }
        if (Intrinsics.a(webResourceRequest.getUrl().toString(), this.b.e)) {
            this.a = true;
        }
        return super.shouldInterceptRequest(webView, webResourceRequest);
    }

    @Override
    public final boolean shouldOverrideUrlLoading(@NotNull WebView webView, WebResourceRequest webResourceRequest) {
        Intrinsics.checkNotNullParameter(webView, "view");
        d b = this.b.b();
        String str = this.b.g;
        WebviewEventType webviewEventType = WebviewEventType.SHOULD_OVERRIDE_URL;
        JSONObject jSONObject = new JSONObject();
        jSONObject.put("webviewId", this.b.g);
        jSONObject.put("url", webResourceRequest != null ? webResourceRequest.getUrl() : null);
        Unit unit = Unit.a;
        b.a(new OverlayWebviewEvent(str, webviewEventType, jSONObject, null, true, 8, null));
        return super.shouldOverrideUrlLoading(webView, webResourceRequest);
    }
}