导航菜单

页面标题

页面副标题

Cantique de Louanges v12 - j.java 源代码

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

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


package com.vungle.ads.internal.presenter;

import android.content.Context;
import android.util.Log;
import android.view.MotionEvent;
import android.webkit.WebView;
import android.webkit.WebViewRenderProcess;
import com.mbridge.msdk.playercommon.exoplayer2.text.ttml.TtmlNode;
import com.vungle.ads.ServiceLocator;
import com.vungle.ads.b2;
import com.vungle.ads.internal.model.g;
import com.vungle.ads.internal.network.m;
import com.vungle.ads.internal.protos.Sdk$SDKMetric;
import com.vungle.ads.internal.ui.view.c;
import com.vungle.ads.internal.util.l;
import com.vungle.ads.o;
import com.vungle.ads.w1;
import com.vungle.ads.y0;
import ha.l0;
import ha.n;
import ha.p;
import ha.r;
import java.io.File;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.Executor;
import java.util.concurrent.atomic.AtomicBoolean;
import kotlin.jvm.internal.s;
import kotlin.jvm.internal.u;

public final class j implements c.a, c.b {
    private static final String ACTION = "action";
    public static final String ACTION_WITH_VALUE = "actionWithValue";
    public static final String CLOSE = "close";
    public static final String CONSENT_ACTION = "consentAction";
    public static final String CREATIVE_HEARTBEAT = "creativeHeartbeat";
    public static final a Companion = new a(null);
    public static final String ERROR = "error";
    private static final double HEARTBEAT_INTERVAL = 6.0d;
    public static final String OPEN = "open";
    private static final String OPEN_NON_MRAID = "openNonMraid";
    public static final String OPEN_PRIVACY = "openPrivacy";
    public static final String SET_ORIENTATION_PROPERTIES = "setOrientationProperties";
    public static final String SUCCESSFUL_VIEW = "successfulView";
    private static final String TAG = "MRAIDPresenter";
    public static final String TPAT = "tpat";
    private static final String USE_CUSTOM_CLOSE = "useCustomClose";
    private static final String USE_CUSTOM_PRIVACY = "useCustomPrivacy";
    public static final String VIDEO_LENGTH = "videoLength";
    public static final String VIDEO_VIEWED = "videoViewed";
    private Long adStartTime;
    private boolean adViewed;
    private final com.vungle.ads.internal.ui.view.b adWidget;
    private final com.vungle.ads.internal.model.b advertisement;
    private boolean backEnabled;
    private final com.vungle.ads.internal.model.e bidPayload;
    private com.vungle.ads.internal.presenter.a bus;
    private final n clickCoordinateTracker$delegate;
    private Executor executor;
    private final n executors$delegate;
    private boolean heartbeatEnabled;
    private final AtomicBoolean isDestroying;
    private final z9.c omTracker;
    private final n pathProvider$delegate;
    private final com.vungle.ads.internal.model.j placement;
    private k presenterDelegate;
    private final n scheduler$delegate;
    private final AtomicBoolean sendReportIncentivized;
    private final n suspendableTimer$delegate;
    private String userId;
    private final n vungleApiClient$delegate;
    private final com.vungle.ads.internal.ui.h vungleWebClient;

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

        public a(kotlin.jvm.internal.k kVar) {
            this();
        }

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

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

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

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

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

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

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

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

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

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

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

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

    static final class b extends u implements ta.a {
        b() {
            super(0);
        }

        @Override
        public final com.vungle.ads.internal.b invoke() {
            Context context = j.this.adWidget.getContext();
            s.e(context, "adWidget.context");
            return new com.vungle.ads.internal.b(context, j.this.advertisement, j.this.executor);
        }
    }

    public static final class c implements com.vungle.ads.internal.ui.b {
        c() {
        }

        @Override
        public void onDeeplinkClick(boolean z) {
            List<String> tpatUrls = j.this.advertisement.getTpatUrls("deeplink.click", String.valueOf(z));
            com.vungle.ads.internal.network.h hVar = new com.vungle.ads.internal.network.h(j.this.getVungleApiClient$vungle_ads_release(), j.this.placement.getReferenceId(), j.this.advertisement.getCreativeId(), j.this.advertisement.eventId(), j.this.getExecutors().getIoExecutor(), j.this.getPathProvider());
            if (tpatUrls != null) {
                j jVar = j.this;
                Iterator<T> it = tpatUrls.iterator();
                while (it.hasNext()) {
                    hVar.sendTpat((String) it.next(), jVar.executor);
                }
            }
        }
    }

    public static final class d implements com.vungle.ads.internal.network.b {
        d() {
        }

        @Override
        public void onFailure(com.vungle.ads.internal.network.a aVar, Throwable th) {
            Log.d(j.TAG, "send RI Failure");
        }

        @Override
        public void onResponse(com.vungle.ads.internal.network.a aVar, com.vungle.ads.internal.network.d dVar) {
            Log.d(j.TAG, "send RI success");
        }
    }

    static final class e extends u implements ta.a {
        public static final e INSTANCE = new e();

        e() {
            super(0);
        }

        @Override
        public final com.vungle.ads.internal.util.i invoke() {
            return new com.vungle.ads.internal.util.i();
        }
    }

    public static final class f extends u implements ta.a {
        final Context $context;

        public f(Context context) {
            super(0);
            this.$context = context;
        }

        @Override
        public final m invoke() {
            return ServiceLocator.Companion.getInstance(this.$context).getOrBuild$vungle_ads_release(m.class);
        }
    }

    public static final class g extends u implements ta.a {
        final Context $context;

        public g(Context context) {
            super(0);
            this.$context = context;
        }

        @Override
        public final x9.a invoke() {
            return ServiceLocator.Companion.getInstance(this.$context).getOrBuild$vungle_ads_release(x9.a.class);
        }
    }

    public static final class h extends u implements ta.a {
        final Context $context;

        public h(Context context) {
            super(0);
            this.$context = context;
        }

        @Override
        public final l invoke() {
            return ServiceLocator.Companion.getInstance(this.$context).getOrBuild$vungle_ads_release(l.class);
        }
    }

    static final class i extends u implements ta.a {

        static final class a extends u implements ta.a {
            final j this$0;

            a(j jVar) {
                super(0);
                this.this$0 = jVar;
            }

            @Override
            public Object invoke() {
                m115invoke();
                return l0.a;
            }

            public final void m115invoke() {
                o.INSTANCE.logError$vungle_ads_release(318, "Error ad template missing Heartbeat", this.this$0.placement.getReferenceId(), this.this$0.advertisement.getCreativeId(), this.this$0.advertisement.eventId());
                this.this$0.reportErrorAndCloseAd(new y0(b2.HEARTBEAT_ERROR, null, 2, null));
            }
        }

        i() {
            super(0);
        }

        @Override
        public final com.vungle.ads.internal.util.n invoke() {
            return new com.vungle.ads.internal.util.n(j.HEARTBEAT_INTERVAL, true, null, new a(j.this), 4, null);
        }
    }

    public j(com.vungle.ads.internal.ui.view.b adWidget, com.vungle.ads.internal.model.b advertisement, com.vungle.ads.internal.model.j placement, com.vungle.ads.internal.ui.h vungleWebClient, Executor executor, z9.c omTracker, com.vungle.ads.internal.model.e eVar) {
        n a2;
        n a3;
        n a4;
        n b2;
        n b3;
        n b4;
        s.f(adWidget, "adWidget");
        s.f(advertisement, "advertisement");
        s.f(placement, "placement");
        s.f(vungleWebClient, "vungleWebClient");
        s.f(executor, "executor");
        s.f(omTracker, "omTracker");
        this.adWidget = adWidget;
        this.advertisement = advertisement;
        this.placement = placement;
        this.vungleWebClient = vungleWebClient;
        this.executor = executor;
        this.omTracker = omTracker;
        this.bidPayload = eVar;
        this.isDestroying = new AtomicBoolean(false);
        this.sendReportIncentivized = new AtomicBoolean(false);
        ServiceLocator.Companion companion = ServiceLocator.Companion;
        Context context = adWidget.getContext();
        s.e(context, "adWidget.context");
        r rVar = r.a;
        a2 = p.a(rVar, new f(context));
        this.vungleApiClient$delegate = a2;
        Context context2 = adWidget.getContext();
        s.e(context2, "adWidget.context");
        a3 = p.a(rVar, new g(context2));
        this.executors$delegate = a3;
        Context context3 = adWidget.getContext();
        s.e(context3, "adWidget.context");
        a4 = p.a(rVar, new h(context3));
        this.pathProvider$delegate = a4;
        b2 = p.b(e.INSTANCE);
        this.scheduler$delegate = b2;
        b3 = p.b(new i());
        this.suspendableTimer$delegate = b3;
        b4 = p.b(new b());
        this.clickCoordinateTracker$delegate = b4;
    }

    private final void closeView() {
        this.adWidget.close();
    }

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

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

    public static void getBus$annotations() {
    }

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

    public final x9.a getExecutors() {
        return (x9.a) this.executors$delegate.getValue();
    }

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

    public final l getPathProvider() {
        return (l) this.pathProvider$delegate.getValue();
    }

    private final com.vungle.ads.internal.util.i getScheduler() {
        return (com.vungle.ads.internal.util.i) this.scheduler$delegate.getValue();
    }

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

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

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

    private final void handleWebViewException(b2 b2Var, boolean z, String str) {
        Log.e(TAG, "handleWebViewException: " + b2Var.getLocalizedMessage() + ", fatal: " + z + ", errorMsg: " + str);
        if (z) {
            makeBusError(b2Var);
            closeView();
        }
    }

    static void handleWebViewException$default(j jVar, b2 b2Var, boolean z, String str, int i2, Object obj) {
        if ((i2 & 4) != 0) {
            str = null;
        }
        jVar.handleWebViewException(b2Var, z, str);
    }

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

    private final boolean loadMraid(File file) {
        String parent = file.getParent();
        File file2 = parent != null ? new File(parent) : null;
        StringBuilder sb = new StringBuilder();
        sb.append(file2 != null ? file2.getPath() : null);
        sb.append(File.separator);
        sb.append("index.html");
        File file3 = new File(sb.toString());
        if (file3.exists()) {
            this.adWidget.showWebsite(com.vungle.ads.internal.model.b.FILE_SCHEME + file3.getPath());
            return true;
        }
        o.INSTANCE.logError$vungle_ads_release(310, "Fail to load html " + file3.getPath(), this.placement.getReferenceId(), this.advertisement.getCreativeId(), this.advertisement.eventId());
        return false;
    }

    private final void makeBusError(b2 b2Var) {
        com.vungle.ads.internal.presenter.a aVar = this.bus;
        if (aVar != null) {
            aVar.onError(b2Var, this.placement.getReferenceId());
        }
    }

    public static final void m109prepare$lambda11(j this$0) {
        s.f(this$0, "this$0");
        this$0.backEnabled = true;
    }

    public static final void m110processCommand$lambda3(j this$0) {
        s.f(this$0, "this$0");
        this$0.vungleWebClient.notifyPropertiesChange(true);
    }

    public static final void m111processCommand$lambda4(j this$0) {
        s.f(this$0, "this$0");
        this$0.adWidget.setVisibility(0);
    }

    public static final void m112processCommand$lambda6(j this$0) {
        s.f(this$0, "this$0");
        String referenceId = this$0.placement.getReferenceId();
        com.vungle.ads.internal.network.a ri = this$0.getVungleApiClient$vungle_ads_release().ri(new g.C0088g((List) null, (Boolean) null, (String) null, this$0.adStartTime, this$0.advertisement.appId(), referenceId, this$0.userId, 7, (kotlin.jvm.internal.k) null));
        if (ri == null) {
            Log.e(TAG, "Invalid ri call.");
        } else {
            ri.enqueue(new d());
        }
    }

    public static final void m113processCommand$lambda7(j this$0, boolean z, String str, String str2) {
        s.f(this$0, "this$0");
        this$0.handleWebViewException(new y0(b2.CREATIVE_ERROR, null, 2, null), z, str + " : " + str2);
    }

    public static final void m114processCommand$lambda8(j this$0) {
        s.f(this$0, "this$0");
        this$0.getSuspendableTimer$vungle_ads_release().reset();
    }

    private final void recordPlayAssetMetric() {
        o.INSTANCE.logMetric$vungle_ads_release(new w1(this.advertisement.getAssetsFullyDownloaded() ? Sdk$SDKMetric.b.LOCAL_ASSETS_USED : Sdk$SDKMetric.b.REMOTE_ASSETS_USED), (r13 & 2) != 0 ? null : this.placement.getReferenceId(), (r13 & 4) != 0 ? null : this.advertisement.getCreativeId(), (r13 & 8) != 0 ? null : this.advertisement.eventId(), (r13 & 16) != 0 ? null : null);
    }

    public final void reportErrorAndCloseAd(b2 b2Var) {
        makeBusError(b2Var);
        closeView();
    }

    public final void detach(int i2) {
        com.vungle.ads.internal.presenter.a aVar;
        Log.d(TAG, "detach()");
        boolean z = (i2 & 1) != 0;
        boolean z2 = (i2 & 2) != 0;
        this.vungleWebClient.setWebViewObserver(null);
        this.vungleWebClient.setMraidDelegate(null);
        if (!z && z2 && !this.isDestroying.getAndSet(true) && (aVar = this.bus) != null) {
            aVar.onNext(TtmlNode.END, null, this.placement.getReferenceId());
        }
        this.adWidget.destroyWebView(this.omTracker.stop());
        if (this.heartbeatEnabled) {
            getSuspendableTimer$vungle_ads_release().cancel();
        }
    }

    public final Long getAdStartTime$vungle_ads_release() {
        return this.adStartTime;
    }

    public final boolean getBackEnabled$vungle_ads_release() {
        return this.backEnabled;
    }

    public final com.vungle.ads.internal.presenter.a getBus() {
        return this.bus;
    }

    public final com.vungle.ads.internal.b getClickCoordinateTracker$vungle_ads_release() {
        return (com.vungle.ads.internal.b) this.clickCoordinateTracker$delegate.getValue();
    }

    public final boolean getHeartbeatEnabled$vungle_ads_release() {
        return this.heartbeatEnabled;
    }

    public final com.vungle.ads.internal.util.n getSuspendableTimer$vungle_ads_release() {
        return (com.vungle.ads.internal.util.n) this.suspendableTimer$delegate.getValue();
    }

    public final String getUserId$vungle_ads_release() {
        return this.userId;
    }

    public final m getVungleApiClient$vungle_ads_release() {
        return (m) this.vungleApiClient$delegate.getValue();
    }

    public final void handleExit() {
        if (this.backEnabled) {
            this.adWidget.showWebsite("javascript:window.vungle.mraidBridgeExt.requestMRAIDClose()");
        }
    }

    public final AtomicBoolean isDestroying$vungle_ads_release() {
        return this.isDestroying;
    }

    @Override
    public void onReceivedError(String errorDesc, boolean z) {
        s.f(errorDesc, "errorDesc");
        if (z) {
            reportErrorAndCloseAd(new y0(b2.AD_RENDER_NETWORK_ERROR, null, 2, null));
        }
    }

    @Override
    public void onRenderProcessUnresponsive(WebView webView, WebViewRenderProcess webViewRenderProcess) {
        handleWebViewException$default(this, new y0(b2.WEBVIEW_RENDER_UNRESPONSIVE, null, 2, null), true, null, 4, null);
    }

    public final void onViewConfigurationChanged() {
        this.vungleWebClient.notifyPropertiesChange(true);
    }

    public final void onViewTouched(MotionEvent motionEvent) {
        if (motionEvent != null) {
            getClickCoordinateTracker$vungle_ads_release().trackCoordinate(motionEvent);
        }
    }

    @Override
    public boolean onWebRenderingProcessGone(WebView webView, Boolean bool) {
        handleWebViewException$default(this, new y0(b2.WEB_CRASH, null, 2, null), true, null, 4, null);
        return true;
    }

    public final void prepare() {
        String str;
        String str2;
        String str3;
        String str4;
        int settings;
        boolean z = false;
        this.isDestroying.set(false);
        this.adWidget.linkWebView(this.vungleWebClient);
        com.vungle.ads.c adConfig = this.advertisement.getAdConfig();
        if (adConfig != null && (settings = adConfig.getSettings()) > 0) {
            this.backEnabled = (settings & 2) == 2;
        }
        com.vungle.ads.internal.c cVar = com.vungle.ads.internal.c.INSTANCE;
        this.heartbeatEnabled = cVar.heartbeatEnabled();
        com.vungle.ads.c adConfig2 = this.advertisement.getAdConfig();
        Integer valueOf = adConfig2 != null ? Integer.valueOf(adConfig2.getAdOrientation()) : null;
        this.adWidget.setOrientation((valueOf != null && valueOf.intValue() == 0) ? 7 : (valueOf != null && valueOf.intValue() == 1) ? 6 : 4);
        this.omTracker.start();
        this.vungleWebClient.setMraidDelegate(this);
        this.vungleWebClient.setErrorHandler(this);
        File assetDirectory = this.advertisement.getAssetDirectory();
        if (assetDirectory == null || !assetDirectory.exists()) {
            reportErrorAndCloseAd(new com.vungle.ads.h());
            return;
        }
        if (!loadMraid(new File(assetDirectory.getPath() + File.separator + "template"))) {
            reportErrorAndCloseAd(new com.vungle.ads.h());
            return;
        }
        this.adStartTime = Long.valueOf(System.currentTimeMillis());
        k kVar = this.presenterDelegate;
        this.userId = kVar != null ? kVar.getUserId() : null;
        k kVar2 = this.presenterDelegate;
        if (kVar2 == null || (str = kVar2.getAlertTitleText()) == null) {
            str = "";
        }
        k kVar3 = this.presenterDelegate;
        if (kVar3 == null || (str2 = kVar3.getAlertBodyText()) == null) {
            str2 = "";
        }
        k kVar4 = this.presenterDelegate;
        if (kVar4 == null || (str3 = kVar4.getAlertContinueButtonText()) == null) {
            str3 = "";
        }
        k kVar5 = this.presenterDelegate;
        if (kVar5 == null || (str4 = kVar5.getAlertCloseButtonText()) == null) {
            str4 = "";
        }
        this.advertisement.setIncentivizedText(str, str2, str3, str4);
        if (cVar.getGDPRIsCountryDataProtected() && s.a("unknown", ba.c.INSTANCE.getConsentStatus())) {
            z = true;
        }
        this.vungleWebClient.setConsentStatus(z, cVar.getGDPRConsentTitle(), cVar.getGDPRConsentMessage(), cVar.getGDPRButtonAccept(), cVar.getGDPRButtonDeny());
        if (z) {
            ba.c.INSTANCE.updateGdprConsent("opted_out_by_timeout", "vungle_modal", "");
        }
        int showCloseDelay = this.advertisement.getShowCloseDelay(Boolean.valueOf(this.placement.isIncentivized()));
        if (showCloseDelay > 0) {
            getScheduler().schedule(new Runnable() {
                @Override
                public final void run() {
                    j.m109prepare$lambda11(j.this);
                }
            }, showCloseDelay);
        } else {
            this.backEnabled = true;
        }
        com.vungle.ads.internal.presenter.a aVar = this.bus;
        if (aVar != null) {
            aVar.onNext("start", null, this.placement.getReferenceId());
        }
        if (this.heartbeatEnabled) {
            getSuspendableTimer$vungle_ads_release().start();
        }
    }

    @Override
    public boolean processCommand(java.lang.String r21, kotlinx.serialization.json.u r22) {
        throw new UnsupportedOperationException("Method not decompiled: com.vungle.ads.internal.presenter.j.processCommand(java.lang.String, kotlinx.serialization.json.u):boolean");
    }

    public final void setAdStartTime$vungle_ads_release(Long l) {
        this.adStartTime = l;
    }

    public final void setAdVisibility(boolean z) {
        this.vungleWebClient.setAdVisibility(z);
    }

    public final void setBackEnabled$vungle_ads_release(boolean z) {
        this.backEnabled = z;
    }

    public final void setBus(com.vungle.ads.internal.presenter.a aVar) {
        this.bus = aVar;
    }

    public final void setEventListener(com.vungle.ads.internal.presenter.a aVar) {
        this.bus = aVar;
    }

    public final void setHeartbeatEnabled$vungle_ads_release(boolean z) {
        this.heartbeatEnabled = z;
    }

    public final void setPresenterDelegate$vungle_ads_release(k kVar) {
        this.presenterDelegate = kVar;
    }

    public final void setUserId$vungle_ads_release(String str) {
        this.userId = str;
    }

    public final void start() {
        Log.d(TAG, "start()");
        this.adWidget.resumeWeb();
        setAdVisibility(true);
        if (com.vungle.ads.internal.c.INSTANCE.adLoadOptimizationEnabled()) {
            recordPlayAssetMetric();
        }
    }

    public final void stop() {
        Log.d(TAG, "stop()");
        this.adWidget.pauseWeb();
        setAdVisibility(false);
    }
}