导航菜单

页面标题

页面副标题

Cantique de Louanges v12 - h.java 源代码

正在查看: Cantique de Louanges v12 应用的 h.java JAVA 源代码文件

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


package com.vungle.ads.internal.ui;

import android.annotation.TargetApi;
import android.net.Uri;
import android.os.Build;
import android.os.Handler;
import android.os.Looper;
import android.util.Log;
import android.webkit.RenderProcessGoneDetail;
import android.webkit.WebResourceError;
import android.webkit.WebResourceRequest;
import android.webkit.WebResourceResponse;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.webkit.WebViewRenderProcess;
import android.webkit.WebViewRenderProcessClient;
import com.google.gson.mediation.vungle.BuildConfig;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import com.unity3d.ads.metadata.MediationMetaData;
import com.unity3d.services.core.network.model.HttpRequest;
import com.vungle.ads.internal.model.j;
import com.vungle.ads.internal.ui.view.c;
import com.vungle.ads.o;
import java.util.concurrent.ExecutorService;
import kotlin.jvm.internal.k;
import kotlin.jvm.internal.s;
import kotlinx.serialization.json.u;
import kotlinx.serialization.json.v;
import ld.m;
import org.json.o2;
import org.json.v4;
import x3.q;

public final class h extends WebViewClient implements com.vungle.ads.internal.ui.view.c {
    public static final a Companion = new a(null);
    private static final String TAG = "VungleWebClient";
    private final com.vungle.ads.internal.model.b advertisement;
    private boolean collectConsent;
    private c.b errorHandler;
    private String gdprAccept;
    private String gdprBody;
    private String gdprDeny;
    private String gdprTitle;
    private Boolean isViewable;
    private WebView loadedWebView;
    private c.a mraidDelegate;
    private final ExecutorService offloadExecutor;
    private final j placement;
    private boolean ready;
    private z9.e webViewObserver;

    public static final class a {
        private a() {
        }

        public a(k kVar) {
            this();
        }
    }

    public static final class b extends WebViewRenderProcessClient {
        private c.b errorHandler;

        public b(c.b bVar) {
            this.errorHandler = bVar;
        }

        public final c.b getErrorHandler() {
            return this.errorHandler;
        }

        @Override
        public void onRenderProcessResponsive(WebView webView, WebViewRenderProcess webViewRenderProcess) {
            s.f(webView, "webView");
        }

        @Override
        public void onRenderProcessUnresponsive(WebView webView, WebViewRenderProcess webViewRenderProcess) {
            s.f(webView, "webView");
            StringBuilder sb = new StringBuilder();
            sb.append("onRenderProcessUnresponsive(Title = ");
            sb.append(webView.getTitle());
            sb.append(", URL = ");
            sb.append(webView.getOriginalUrl());
            sb.append(", (webViewRenderProcess != null) = ");
            sb.append(webViewRenderProcess != null);
            Log.w(h.TAG, sb.toString());
            c.b bVar = this.errorHandler;
            if (bVar != null) {
                bVar.onRenderProcessUnresponsive(webView, webViewRenderProcess);
            }
        }

        public final void setErrorHandler(c.b bVar) {
            this.errorHandler = bVar;
        }
    }

    public h(com.vungle.ads.internal.model.b advertisement, j placement, ExecutorService offloadExecutor) {
        s.f(advertisement, "advertisement");
        s.f(placement, "placement");
        s.f(offloadExecutor, "offloadExecutor");
        this.advertisement = advertisement;
        this.placement = placement;
        this.offloadExecutor = offloadExecutor;
    }

    public static void getCollectConsent$vungle_ads_release$annotations() {
    }

    public static void getErrorHandler$vungle_ads_release$annotations() {
    }

    public static void getGdprAccept$vungle_ads_release$annotations() {
    }

    public static void getGdprBody$vungle_ads_release$annotations() {
    }

    public static void getGdprDeny$vungle_ads_release$annotations() {
    }

    public static void getGdprTitle$vungle_ads_release$annotations() {
    }

    public static void getLoadedWebView$vungle_ads_release$annotations() {
    }

    public static void getMraidDelegate$vungle_ads_release$annotations() {
    }

    public static void getReady$vungle_ads_release$annotations() {
    }

    public static void getWebViewObserver$vungle_ads_release$annotations() {
    }

    private final void handleWebViewError(String str, String str2, boolean z) {
        String str3 = str2 + ' ' + str;
        c.b bVar = this.errorHandler;
        if (bVar != null) {
            bVar.onReceivedError(str3, z);
        }
    }

    private final boolean isCriticalAsset(String str) {
        if (str.length() > 0) {
            return this.advertisement.getDownloadableUrls().containsValue(str);
        }
        return false;
    }

    public static void isViewable$vungle_ads_release$annotations() {
    }

    private final void runJavascriptOnWebView(WebView webView, String str) {
        if (webView != null) {
            try {
                webView.evaluateJavascript(str, null);
            } catch (Exception e) {
                o.INSTANCE.logError$vungle_ads_release(313, "Evaluate js failed " + e.getLocalizedMessage(), this.placement.getReferenceId(), this.advertisement.getCreativeId(), this.advertisement.eventId());
            }
        }
    }

    public static final void m121shouldOverrideUrlLoading$lambda4$lambda3$lambda2(c.a it, String command, u args, Handler handler, final h this$0, final WebView webView) {
        s.f(it, "$it");
        s.f(command, "$command");
        s.f(args, "$args");
        s.f(handler, "$handler");
        s.f(this$0, "this$0");
        if (it.processCommand(command, args)) {
            handler.post(new Runnable() {
                @Override
                public final void run() {
                    h.m122shouldOverrideUrlLoading$lambda4$lambda3$lambda2$lambda1(h.this, webView);
                }
            });
        }
    }

    public static final void m122shouldOverrideUrlLoading$lambda4$lambda3$lambda2$lambda1(h this$0, WebView webView) {
        s.f(this$0, "this$0");
        this$0.runJavascriptOnWebView(webView, "window.vungle.mraidBridge.notifyCommandComplete()");
    }

    public final boolean getCollectConsent$vungle_ads_release() {
        return this.collectConsent;
    }

    public final c.b getErrorHandler$vungle_ads_release() {
        return this.errorHandler;
    }

    public final String getGdprAccept$vungle_ads_release() {
        return this.gdprAccept;
    }

    public final String getGdprBody$vungle_ads_release() {
        return this.gdprBody;
    }

    public final String getGdprDeny$vungle_ads_release() {
        return this.gdprDeny;
    }

    public final String getGdprTitle$vungle_ads_release() {
        return this.gdprTitle;
    }

    public final WebView getLoadedWebView$vungle_ads_release() {
        return this.loadedWebView;
    }

    public final c.a getMraidDelegate$vungle_ads_release() {
        return this.mraidDelegate;
    }

    public final boolean getReady$vungle_ads_release() {
        return this.ready;
    }

    public final z9.e getWebViewObserver$vungle_ads_release() {
        return this.webViewObserver;
    }

    public final Boolean isViewable$vungle_ads_release() {
        return this.isViewable;
    }

    @Override
    public void notifyPropertiesChange(boolean z) {
        WebView webView = this.loadedWebView;
        if (webView != null) {
            v vVar = new v();
            v vVar2 = new v();
            kotlinx.serialization.json.i.b(vVar2, "width", Integer.valueOf(webView.getWidth()));
            kotlinx.serialization.json.i.b(vVar2, "height", Integer.valueOf(webView.getHeight()));
            u a2 = vVar2.a();
            v vVar3 = new v();
            kotlinx.serialization.json.i.b(vVar3, "x", 0);
            kotlinx.serialization.json.i.b(vVar3, "y", 0);
            kotlinx.serialization.json.i.b(vVar3, "width", Integer.valueOf(webView.getWidth()));
            kotlinx.serialization.json.i.b(vVar3, "height", Integer.valueOf(webView.getHeight()));
            u a3 = vVar3.a();
            v vVar4 = new v();
            Boolean bool = Boolean.FALSE;
            kotlinx.serialization.json.i.a(vVar4, "sms", bool);
            kotlinx.serialization.json.i.a(vVar4, "tel", bool);
            kotlinx.serialization.json.i.a(vVar4, "calendar", bool);
            kotlinx.serialization.json.i.a(vVar4, "storePicture", bool);
            kotlinx.serialization.json.i.a(vVar4, "inlineVideo", bool);
            u a4 = vVar4.a();
            vVar.b("maxSize", a2);
            vVar.b("screenSize", a2);
            vVar.b("defaultPosition", a3);
            vVar.b("currentPosition", a3);
            vVar.b("supports", a4);
            kotlinx.serialization.json.i.c(vVar, "placementType", this.advertisement.templateType());
            Boolean bool2 = this.isViewable;
            if (bool2 != null) {
                kotlinx.serialization.json.i.a(vVar, o2.h.o, Boolean.valueOf(bool2.booleanValue()));
            }
            kotlinx.serialization.json.i.c(vVar, v4.x, "android");
            kotlinx.serialization.json.i.c(vVar, "osVersion", String.valueOf(Build.VERSION.SDK_INT));
            kotlinx.serialization.json.i.a(vVar, "incentivized", this.placement.getIncentivized());
            kotlinx.serialization.json.i.b(vVar, "enableBackImmediately", Integer.valueOf(this.advertisement.getShowCloseDelay(this.placement.getIncentivized())));
            kotlinx.serialization.json.i.c(vVar, MediationMetaData.KEY_VERSION, "1.0");
            if (this.collectConsent) {
                kotlinx.serialization.json.i.a(vVar, "consentRequired", Boolean.TRUE);
                kotlinx.serialization.json.i.c(vVar, "consentTitleText", this.gdprTitle);
                kotlinx.serialization.json.i.c(vVar, "consentBodyText", this.gdprBody);
                kotlinx.serialization.json.i.c(vVar, "consentAcceptButtonText", this.gdprAccept);
                kotlinx.serialization.json.i.c(vVar, "consentDenyButtonText", this.gdprDeny);
            } else {
                kotlinx.serialization.json.i.a(vVar, "consentRequired", bool);
            }
            kotlinx.serialization.json.i.c(vVar, "sdkVersion", BuildConfig.ADAPTER_VERSION);
            u a5 = vVar.a();
            Log.d(TAG, "loadJs->javascript:window.vungle.mraidBridge.notifyPropertiesChange(" + a5 + ',' + z + ')');
            runJavascriptOnWebView(webView, "window.vungle.mraidBridge.notifyPropertiesChange(" + a5 + ',' + z + ')');
        }
    }

    @Override
    public void onPageFinished(WebView webView, String str) {
        super.onPageFinished(webView, str);
        if (webView == null) {
            return;
        }
        this.loadedWebView = webView;
        webView.setVisibility(0);
        notifyPropertiesChange(true);
        if (Build.VERSION.SDK_INT >= 29) {
            webView.setWebViewRenderProcessClient(d.a(new b(this.errorHandler)));
        }
        z9.e eVar = this.webViewObserver;
        if (eVar != null) {
            eVar.onPageFinished(webView);
        }
    }

    @Override
    public void onReceivedError(WebView webView, int i, String description, String failingUrl) {
        s.f(description, "description");
        s.f(failingUrl, "failingUrl");
        super.onReceivedError(webView, i, description, failingUrl);
        if (Build.VERSION.SDK_INT < 23) {
            boolean isCriticalAsset = isCriticalAsset(failingUrl);
            Log.e(TAG, "Error desc " + description + " for URL " + failingUrl);
            handleWebViewError(description, failingUrl, isCriticalAsset);
        }
    }

    @Override
    public void onReceivedHttpError(WebView webView, WebResourceRequest webResourceRequest, WebResourceResponse webResourceResponse) {
        super.onReceivedHttpError(webView, webResourceRequest, webResourceResponse);
        String valueOf = String.valueOf(webResourceResponse != null ? Integer.valueOf(webResourceResponse.getStatusCode()) : null);
        String valueOf2 = String.valueOf(webResourceRequest != null ? webResourceRequest.getUrl() : null);
        boolean z = webResourceRequest != null && webResourceRequest.isForMainFrame();
        Log.e(TAG, "Http Error desc " + valueOf + ' ' + z + " for URL " + valueOf2);
        handleWebViewError(valueOf, valueOf2, isCriticalAsset(valueOf2) && z);
    }

    @Override
    @TargetApi(26)
    public boolean onRenderProcessGone(WebView webView, RenderProcessGoneDetail renderProcessGoneDetail) {
        StringBuilder sb = new StringBuilder();
        sb.append("onRenderProcessGone url: ");
        sb.append(webView != null ? webView.getUrl() : null);
        sb.append(", did crash: ");
        sb.append(renderProcessGoneDetail != null ? Boolean.valueOf(com.adcolony.sdk.v.a(renderProcessGoneDetail)) : null);
        Log.w(TAG, sb.toString());
        this.loadedWebView = null;
        c.b bVar = this.errorHandler;
        if (bVar != null) {
            return bVar.onWebRenderingProcessGone(webView, renderProcessGoneDetail != null ? Boolean.valueOf(com.adcolony.sdk.v.a(renderProcessGoneDetail)) : null);
        }
        return super.onRenderProcessGone(webView, renderProcessGoneDetail);
    }

    @Override
    public void setAdVisibility(boolean z) {
        this.isViewable = Boolean.valueOf(z);
        notifyPropertiesChange(false);
    }

    public final void setCollectConsent$vungle_ads_release(boolean z) {
        this.collectConsent = z;
    }

    @Override
    public void setConsentStatus(boolean z, String str, String str2, String str3, String str4) {
        this.collectConsent = z;
        this.gdprTitle = str;
        this.gdprBody = str2;
        this.gdprAccept = str3;
        this.gdprDeny = str4;
    }

    @Override
    public void setErrorHandler(c.b errorHandler) {
        s.f(errorHandler, "errorHandler");
        this.errorHandler = errorHandler;
    }

    public final void setErrorHandler$vungle_ads_release(c.b bVar) {
        this.errorHandler = bVar;
    }

    public final void setGdprAccept$vungle_ads_release(String str) {
        this.gdprAccept = str;
    }

    public final void setGdprBody$vungle_ads_release(String str) {
        this.gdprBody = str;
    }

    public final void setGdprDeny$vungle_ads_release(String str) {
        this.gdprDeny = str;
    }

    public final void setGdprTitle$vungle_ads_release(String str) {
        this.gdprTitle = str;
    }

    public final void setLoadedWebView$vungle_ads_release(WebView webView) {
        this.loadedWebView = webView;
    }

    @Override
    public void setMraidDelegate(c.a aVar) {
        this.mraidDelegate = aVar;
    }

    public final void setMraidDelegate$vungle_ads_release(c.a aVar) {
        this.mraidDelegate = aVar;
    }

    public final void setReady$vungle_ads_release(boolean z) {
        this.ready = z;
    }

    public final void setViewable$vungle_ads_release(Boolean bool) {
        this.isViewable = bool;
    }

    @Override
    public void setWebViewObserver(z9.e eVar) {
        this.webViewObserver = eVar;
    }

    public final void setWebViewObserver$vungle_ads_release(z9.e eVar) {
        this.webViewObserver = eVar;
    }

    @Override
    public boolean shouldOverrideUrlLoading(final WebView webView, String str) {
        Log.d(TAG, "MRAID Command " + str);
        if (str == null || str.length() == 0) {
            Log.e(TAG, "Invalid URL ");
            return false;
        }
        Uri parse = Uri.parse(str);
        if (parse == null || parse.getScheme() == null) {
            return false;
        }
        String scheme = parse.getScheme();
        if (s.a(scheme, CampaignEx.JSON_KEY_MRAID)) {
            final String host = parse.getHost();
            if (host != null) {
                if (!s.a("propertiesChangeCompleted", host)) {
                    final c.a aVar = this.mraidDelegate;
                    if (aVar != null) {
                        v vVar = new v();
                        for (String param : parse.getQueryParameterNames()) {
                            s.e(param, "param");
                            kotlinx.serialization.json.i.c(vVar, param, parse.getQueryParameter(param));
                        }
                        final u a2 = vVar.a();
                        final Handler handler = new Handler(Looper.getMainLooper());
                        this.offloadExecutor.submit(new Runnable() {
                            @Override
                            public final void run() {
                                h.m121shouldOverrideUrlLoading$lambda4$lambda3$lambda2(c.a.this, host, a2, handler, this, webView);
                            }
                        });
                    }
                } else if (!this.ready) {
                    runJavascriptOnWebView(webView, "window.vungle.mraidBridge.notifyReadyEvent(" + this.advertisement.createMRAIDArgs() + ')');
                    this.ready = true;
                }
                return true;
            }
        } else if (m.t("http", scheme, true) || m.t(HttpRequest.DEFAULT_SCHEME, scheme, true)) {
            Log.d(TAG, "Open URL" + str);
            c.a aVar2 = this.mraidDelegate;
            if (aVar2 != null) {
                v vVar2 = new v();
                kotlinx.serialization.json.i.c(vVar2, "url", str);
                aVar2.processCommand("openNonMraid", vVar2.a());
            }
            return true;
        }
        return false;
    }

    @Override
    public void onReceivedError(WebView webView, WebResourceRequest webResourceRequest, WebResourceError webResourceError) {
        super.onReceivedError(webView, webResourceRequest, webResourceError);
        if (Build.VERSION.SDK_INT >= 23) {
            String valueOf = String.valueOf(webResourceError != null ? q.a(webResourceError) : null);
            String valueOf2 = String.valueOf(webResourceRequest != null ? webResourceRequest.getUrl() : null);
            boolean z = webResourceRequest != null && webResourceRequest.isForMainFrame();
            Log.e(TAG, "Error desc " + valueOf + ' ' + z + " for URL " + valueOf2);
            handleWebViewError(valueOf, valueOf2, isCriticalAsset(valueOf2) && z);
        }
    }
}