导航菜单

页面标题

页面副标题

Cantique de Louanges v12 - b.java 源代码

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

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


package com.vungle.ads.internal.ui.view;

import android.annotation.SuppressLint;
import android.content.Context;
import android.os.Build;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.RelativeLayout;
import com.vungle.ads.internal.ui.view.b;
import com.vungle.ads.internal.util.i;
import com.vungle.ads.internal.util.r;
import kotlin.jvm.internal.k;
import kotlin.jvm.internal.s;

public final class b extends RelativeLayout {
    public static final C0096b Companion = new C0096b(null);
    private static final String TAG = "MRAIDAdWidget";
    private a closeDelegate;
    private d onViewTouchListener;
    private e orientationDelegate;
    private WebView webView;

    public interface a {
        void close();
    }

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

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

    private static final class c implements Runnable {
        private final WebView webView;

        public c(WebView webView) {
            s.f(webView, "webView");
            this.webView = webView;
        }

        @Override
        public void run() {
            try {
                this.webView.stopLoading();
                if (Build.VERSION.SDK_INT >= 29) {
                    this.webView.setWebViewRenderProcessClient(null);
                }
                this.webView.loadData("", null, null);
                this.webView.destroy();
            } catch (Throwable unused) {
            }
        }
    }

    public interface d {
        boolean onTouch(MotionEvent motionEvent);
    }

    public interface e {
        void setOrientation(int i);
    }

    public b(Context context) throws InstantiationException {
        super(context);
        s.f(context, "context");
        ViewGroup.LayoutParams layoutParams = new RelativeLayout.LayoutParams(-1, -1);
        setLayoutParams(layoutParams);
        WebView webView = r.INSTANCE.getWebView(context);
        this.webView = webView;
        if (webView != null) {
            webView.setLayoutParams(layoutParams);
        }
        if (webView != null) {
            webView.setTag("VungleWebView");
        }
        addView(webView, layoutParams);
        bindListeners();
        prepare();
    }

    private final void applyDefault(WebView webView) {
        WebSettings settings = webView.getSettings();
        s.e(settings, "webView.settings");
        settings.setBuiltInZoomControls(false);
        settings.setJavaScriptEnabled(true);
        settings.setLoadWithOverviewMode(true);
        settings.setSaveFormData(true);
        settings.setUseWideViewPort(false);
        settings.setAllowFileAccess(true);
        webView.setVisibility(4);
        settings.setMediaPlaybackRequiresUserGesture(false);
    }

    @SuppressLint({"ClickableViewAccessibility"})
    private final void bindListeners() {
        WebView webView;
        final d dVar = this.onViewTouchListener;
        if (dVar == null || (webView = this.webView) == null) {
            return;
        }
        webView.setOnTouchListener(new View.OnTouchListener() {
            @Override
            public final boolean onTouch(View view, MotionEvent motionEvent) {
                boolean m123bindListeners$lambda1$lambda0;
                m123bindListeners$lambda1$lambda0 = b.m123bindListeners$lambda1$lambda0(b.d.this, view, motionEvent);
                return m123bindListeners$lambda1$lambda0;
            }
        });
    }

    public static final boolean m123bindListeners$lambda1$lambda0(d it, View view, MotionEvent motionEvent) {
        s.f(it, "$it");
        return it.onTouch(motionEvent);
    }

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

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

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

    private final void prepare() {
        WebView webView = this.webView;
        if (webView != null) {
            webView.setLayerType(2, null);
            webView.setBackgroundColor(0);
            webView.getSettings().setMediaPlaybackRequiresUserGesture(false);
            webView.setVisibility(8);
        }
    }

    public final void close() {
        a aVar = this.closeDelegate;
        if (aVar != null) {
            aVar.close();
        }
    }

    public final void destroyWebView(long j) {
        WebView webView = this.webView;
        if (webView != null) {
            webView.setWebChromeClient(null);
            removeAllViews();
            if (j <= 0) {
                new c(webView).run();
            } else {
                new i().schedule(new c(webView), j);
            }
        }
    }

    public final a getCloseDelegate$vungle_ads_release() {
        return this.closeDelegate;
    }

    public final d getOnViewTouchListener$vungle_ads_release() {
        return this.onViewTouchListener;
    }

    public final e getOrientationDelegate$vungle_ads_release() {
        return this.orientationDelegate;
    }

    public final String getUrl() {
        WebView webView = this.webView;
        if (webView != null) {
            return webView.getUrl();
        }
        return null;
    }

    public final void linkWebView(WebViewClient vngWebViewClient) {
        s.f(vngWebViewClient, "vngWebViewClient");
        WebView webView = this.webView;
        if (webView != null) {
            applyDefault(webView);
            webView.setWebViewClient(vngWebViewClient);
        }
    }

    @Override
    protected void onAttachedToWindow() {
        ViewGroup.LayoutParams layoutParams;
        super.onAttachedToWindow();
        ViewGroup.LayoutParams layoutParams2 = getLayoutParams();
        if (layoutParams2 != null) {
            layoutParams2.height = -1;
            layoutParams2.width = -1;
        }
        WebView webView = this.webView;
        if (webView == null || (layoutParams = webView.getLayoutParams()) == null) {
            return;
        }
        layoutParams.height = -1;
        layoutParams.width = -1;
    }

    public final void pauseWeb() {
        WebView webView = this.webView;
        if (webView != null) {
            webView.onPause();
        }
    }

    public final void resumeWeb() {
        WebView webView = this.webView;
        if (webView != null) {
            webView.onResume();
        }
    }

    public final void setCloseDelegate(a closeDelegate) {
        s.f(closeDelegate, "closeDelegate");
        this.closeDelegate = closeDelegate;
    }

    public final void setCloseDelegate$vungle_ads_release(a aVar) {
        this.closeDelegate = aVar;
    }

    public final void setOnViewTouchListener(d dVar) {
        this.onViewTouchListener = dVar;
    }

    public final void setOnViewTouchListener$vungle_ads_release(d dVar) {
        this.onViewTouchListener = dVar;
    }

    public final void setOrientation(int i) {
        e eVar = this.orientationDelegate;
        if (eVar != null) {
            eVar.setOrientation(i);
        }
    }

    public final void setOrientationDelegate(e eVar) {
        this.orientationDelegate = eVar;
    }

    public final void setOrientationDelegate$vungle_ads_release(e eVar) {
        this.orientationDelegate = eVar;
    }

    public final void showWebsite(String url) {
        s.f(url, "url");
        Log.d(TAG, "loadUrl: " + url);
        WebView webView = this.webView;
        if (webView != null) {
            webView.setVisibility(0);
            webView.loadUrl(url);
        }
    }
}