导航菜单

页面标题

页面副标题

MX Player v1.97.8 - n6.java 源代码

正在查看: MX Player v1.97.8 应用的 n6.java JAVA 源代码文件

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


package com.inmobi.media;

import android.R;
import android.annotation.TargetApi;
import android.app.Activity;
import android.content.Context;
import android.media.AudioManager;
import android.os.Build;
import android.os.Handler;
import android.os.Looper;
import android.os.SystemClock;
import android.view.View;
import android.view.ViewTreeObserver;
import android.webkit.JavascriptInterface;
import android.webkit.URLUtil;
import android.widget.FrameLayout;
import com.inmobi.media.e1;
import com.inmobi.media.f8.a;
import com.inmobi.media.f8.b;
import com.inmobi.media.f8.c;
import com.inmobi.media.n6;
import com.inmobi.media.ub;
import com.inmobi.media.xa;
import com.microsoft.identity.common.java.authscheme.PopAuthenticationSchemeInternal;
import com.microsoft.identity.common.java.eststelemetry.SchemaConstants;
import com.microsoft.identity.common.java.providers.microsoft.azureactivedirectory.AzureActiveDirectoryAuthorizationRequest;
import com.microsoft.identity.common.java.telemetry.TelemetryEventStrings;
import com.mxtech.videoplayer.ad.online.model.bean.next.Poster;
import defpackage.fya;
import defpackage.sq0;
import defpackage.tf;
import defpackage.vz5;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Locale;
import java.util.Map;
import java.util.concurrent.ScheduledExecutorService;
import kotlin.Pair;
import kotlin.Unit;
import kotlin.jvm.internal.Intrinsics;
import org.jetbrains.annotations.NotNull;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

public final class n6 {

    @NotNull
    public final ub a;
    public final int b;
    public xa c;
    public l5 d;

    @TargetApi(16)
    public static final class a implements ViewTreeObserver.OnGlobalLayoutListener {

        @NotNull
        public final View a;
        public final l5 b;
        public int c;
        public int d;

        public a(@NotNull View view, l5 l5Var) {
            this.a = view;
            this.b = l5Var;
        }

        @Override
        public void onGlobalLayout() {
            try {
                l5 l5Var = this.b;
                if (l5Var != null) {
                    l5Var.c(o6.a, "close called");
                }
                this.c = w3.b(this.a.getWidth());
                this.d = w3.b(this.a.getHeight());
                this.a.getViewTreeObserver().removeOnGlobalLayoutListener(this);
                Boolean bool = Boolean.FALSE;
                synchronized (bool) {
                    bool.notify();
                    Unit unit = Unit.INSTANCE;
                }
            } catch (Exception e) {
                l5 l5Var2 = this.b;
                if (l5Var2 == null) {
                    return;
                }
                c80.f(e, "SDK encountered unexpected error in JavaScriptBridge$1.onGlobalLayout(); ", l5Var2, o6.a);
            }
        }
    }

    public static final class b implements e1.a {
        public b() {
        }

        @Override
        public void a(fa faVar) {
            l5 l5Var = n6.this.d;
            if (l5Var == null) {
                return;
            }
            l5Var.b(o6.a, "asyncPing Failed");
        }

        @Override
        public void b(fa faVar) {
            l5 l5Var = n6.this.d;
            if (l5Var == null) {
                return;
            }
            l5Var.c(o6.a, "asyncPing Successful");
        }
    }

    public n6(@NotNull ub ubVar, int i) {
        this.a = ubVar;
        this.b = i;
    }

    public static final void a(n6 n6Var, String str, String str2) {
        try {
            n6Var.a.f(str);
        } catch (Exception e) {
            n6Var.a.b(str2, "Unexpected error", "expand");
            p7.a((byte) 1, "InMobi", "Failed to expand ad; SDK encountered an unexpected error");
            l5 l5Var = n6Var.d;
            if (l5Var == null) {
                return;
            }
            c80.f(e, "SDK encountered unexpected error in handling expand() request; ", l5Var, o6.a);
        }
    }

    public static final void b(n6 n6Var, String str, String str2) {
        x6.a(n6Var.a.getLandingPageHandler(), "open", str, str2, false, 8);
    }

    public static final void c(n6 n6Var, String str, String str2) {
        try {
            n6Var.a.getLandingPageHandler().f("openEmbedded", str, str2);
        } catch (Exception e) {
            n6Var.a.b(str, "Unexpected error", "openEmbedded");
            p7.a((byte) 1, "InMobi", "Failed to open URL; SDK encountered unexpected error");
            l5 l5Var = n6Var.d;
            if (l5Var == null) {
                return;
            }
            c80.f(e, "SDK encountered unexpected error in handling openEmbedded() request from creative; ", l5Var, o6.a);
        }
    }

    public static final void d(n6 n6Var, String str, String str2) {
        x6.a(n6Var.a.getLandingPageHandler(), "openWithoutTracker", str, str2, false, 8);
    }

    public static final void e(n6 n6Var, String str, String str2) {
        try {
            ub ubVar = n6Var.a;
            int length = str2.length() - 1;
            int i = 0;
            boolean z = false;
            while (i <= length) {
                boolean z2 = Intrinsics.c(str2.charAt(!z ? i : length), 32) <= 0;
                if (z) {
                    if (!z2) {
                        break;
                    } else {
                        length--;
                    }
                } else if (z2) {
                    i++;
                } else {
                    z = true;
                }
            }
            ubVar.b(str, str2.subSequence(i, length + 1).toString());
        } catch (Exception e) {
            n6Var.a.b(str, "Unexpected error", "playVideo");
            p7.a((byte) 1, "InMobi", "Error playing video; SDK encountered an unexpected error");
            l5 l5Var = n6Var.d;
            if (l5Var == null) {
                return;
            }
            c80.f(e, "SDK encountered unexpected error in handling playVideo() request from creative; ", l5Var, o6.a);
        }
    }

    @JavascriptInterface
    public final void asyncPing(String str, @NotNull String str2) {
        l5 l5Var = this.d;
        if (l5Var != null) {
            l5Var.c(o6.a, Intrinsics.f(str2, "asyncPing called: "));
        }
        if (!URLUtil.isValidUrl(str2)) {
            this.a.b(str, "Invalid url", "asyncPing");
            return;
        }
        try {
            ea eaVar = new ea("GET", str2, false, this.d, null);
            eaVar.x = false;
            eaVar.t = false;
            eaVar.u = false;
            e1 e1Var = new e1(eaVar, new b());
            e1Var.a.a(new f1(e1Var));
        } catch (Exception e) {
            this.a.b(str, "Unexpected error", "asyncPing");
            l5 l5Var2 = this.d;
            if (l5Var2 == null) {
                return;
            }
            c80.f(e, "SDK encountered internal error in handling asyncPing() request from creative; ", l5Var2, o6.a);
        }
    }

    @JavascriptInterface
    public final void cancelSaveContent(String str, @NotNull String str2) {
        l5 l5Var = this.d;
        if (l5Var == null) {
            return;
        }
        l5Var.c(o6.a, Intrinsics.f(str2, "cancelSaveContent called. mediaId:"));
    }

    @JavascriptInterface
    public final void close(String str) {
        l5 l5Var = this.d;
        if (l5Var != null) {
            l5Var.c(o6.a, "close called");
        }
        new Handler(this.a.getContainerContext().getMainLooper()).post(new sq0(6, this, str));
    }

    @JavascriptInterface
    public final void closeAll(String str) {
        l5 l5Var = this.d;
        if (l5Var != null) {
            l5Var.c(o6.a, "closeAll is called");
        }
        ub ubVar = this.a;
        l5 l5Var2 = ubVar.j;
        if (l5Var2 != null) {
            l5Var2.c(ub.P0, Intrinsics.f(ubVar, "closeAll "));
        }
        y yVar = ubVar.d0;
        if (yVar != null) {
            yVar.f();
        }
        Activity activity = ubVar.m.get();
        if (activity == null) {
            return;
        }
        activity.finish();
    }

    @JavascriptInterface
    public final void closeCustomExpand(String str) {
        l5 l5Var = this.d;
        if (l5Var != null) {
            l5Var.c(o6.a, "closeCustomExpand called.");
        }
        int i = this.b;
        if (i != 1) {
            l5 l5Var2 = this.d;
            if (l5Var2 == null) {
                return;
            }
            l5Var2.b(o6.a, Intrinsics.f(Integer.valueOf(i), "closeCustomExpand called in incorrect Ad type: "));
            return;
        }
        if (this.a != null) {
            new Handler(this.a.getContainerContext().getMainLooper()).post(new fj0(this, 10));
            return;
        }
        l5 l5Var3 = this.d;
        if (l5Var3 == null) {
            return;
        }
        l5Var3.b(o6.a, "Found a null instance of render view!");
    }

    @JavascriptInterface
    public final void customExpand(final String str, final String str2, final int i, final float f, boolean z, final boolean z2) {
        l5 l5Var = this.d;
        if (l5Var != null) {
            l5Var.c(o6.a, "customExpand called");
        }
        int i2 = this.b;
        if (i2 != 1) {
            l5 l5Var2 = this.d;
            if (l5Var2 == null) {
                return;
            }
            l5Var2.b(o6.a, Intrinsics.f(Integer.valueOf(i2), "customExpand called in incorrect Ad type: "));
            return;
        }
        if (str2 != null) {
            int length = str2.length() - 1;
            int i3 = 0;
            boolean z3 = false;
            while (i3 <= length) {
                boolean z4 = Intrinsics.c(str2.charAt(!z3 ? i3 : length), 32) <= 0;
                if (z3) {
                    if (!z4) {
                        break;
                    } else {
                        length--;
                    }
                } else if (z4) {
                    i3++;
                } else {
                    z3 = true;
                }
            }
            if (str2.subSequence(i3, length + 1).toString().length() != 0) {
                if (i < 0 || i >= z3.values().length) {
                    this.a.b(str, "Invalid inputType", "customExpand");
                    return;
                } else if (f < 0.0f || f > 1.0f) {
                    this.a.b(str, "Invalid screenPercentage", "customExpand");
                    return;
                } else {
                    this.a.getLandingPageHandler().a("clickStartCalled", o6b.e(new Pair[]{new Pair("trigger", x6.h.a(str2, this.a.getLandingPageHandler().b.b))}));
                    new Handler(this.a.getContainerContext().getMainLooper()).post(new Runnable() {
                        @Override
                        public final void run() {
                            n6.a(n6.this, str2, i, str, f, z2);
                        }
                    });
                    return;
                }
            }
        }
        this.a.b(str, Intrinsics.f(Integer.valueOf(i), "Invalid "), "customExpand");
    }

    @JavascriptInterface
    public final void disableBackButton(String str, boolean z) {
        l5 l5Var = this.d;
        if (l5Var != null) {
            l5Var.c(o6.a, "disableBackButton called");
        }
        ub ubVar = this.a;
        if (ubVar != null) {
            ubVar.setDisableBackButton(z);
            return;
        }
        l5 l5Var2 = this.d;
        if (l5Var2 == null) {
            return;
        }
        l5Var2.b(o6.a, "Found a null instance of render view!");
    }

    @JavascriptInterface
    public final void disableCloseRegion(final String str, final boolean z) {
        l5 l5Var = this.d;
        if (l5Var != null) {
            l5Var.c(o6.a, "disableCloseRegion called");
        }
        if (this.a != null) {
            new Handler(this.a.getContainerContext().getMainLooper()).post(new Runnable() {
                @Override
                public final void run() {
                    n6.a(n6.this, z, str);
                }
            });
            return;
        }
        l5 l5Var2 = this.d;
        if (l5Var2 == null) {
            return;
        }
        l5Var2.b(o6.a, "Found a null instance of render view!");
    }

    @JavascriptInterface
    public final void expand(String str, String str2) {
        l5 l5Var = this.d;
        if (l5Var != null) {
            l5Var.c(o6.a, "expand called");
        }
        if (this.b != 1) {
            ub ubVar = this.a;
            if (ubVar == null) {
                l5 l5Var2 = this.d;
                if (l5Var2 == null) {
                    return;
                }
                l5Var2.b(o6.a, "Found a null instance of render view!");
                return;
            }
            if (!ubVar.n()) {
                this.a.a("expand");
                return;
            }
            l5 l5Var3 = this.d;
            if (l5Var3 != null) {
                l5Var3.c(o6.a, Intrinsics.f(str2, "expand called. Url:"));
            }
            if (!this.a.p()) {
                this.a.b(str, "Creative is not visible. Ignoring request.", "expand");
                return;
            }
            if (str2 != null && str2.length() > 0 && !kotlin.text.c.o(str2, "http", false)) {
                this.a.b(str, "Invalid URL", "expand");
                return;
            }
            if (URLUtil.isValidUrl(str2)) {
                this.a.l();
            }
            new Handler(this.a.getContainerContext().getMainLooper()).post(new r8j(this, str2, str, 1));
        }
    }

    @JavascriptInterface
    public final void fireAdFailed(String str) {
        try {
            l5 l5Var = this.d;
            if (l5Var != null) {
                l5Var.c(o6.a, "fireAdFailed called.");
            }
            ub ubVar = this.a;
            ac acVar = ubVar.T;
            if (acVar != null) {
                Map<String, Object> a2 = acVar.a();
                long j = acVar.b;
                ScheduledExecutorService scheduledExecutorService = me.a;
                a2.put("latency", Long.valueOf(SystemClock.elapsedRealtime() - j));
                fd.a("FireAdFailed", a2, (r3 & 4) != 0 ? id.SDK : null);
            }
            ubVar.getListener().h(ubVar);
        } catch (Exception e) {
            this.a.b(str, "Unexpected error", "fireAdFailed");
            l5 l5Var2 = this.d;
            if (l5Var2 == null) {
                return;
            }
            c80.f(e, "SDK encountered unexpected error in handling fireAdFailed() signal from creative; ", l5Var2, o6.a);
        }
    }

    @JavascriptInterface
    public final void fireAdReady(String str) {
        try {
            l5 l5Var = this.d;
            if (l5Var != null) {
                l5Var.c(o6.a, "fireAdReady called.");
            }
            this.a.k();
        } catch (Exception e) {
            this.a.b(str, "Unexpected error", "fireAdReady");
            l5 l5Var2 = this.d;
            if (l5Var2 == null) {
                return;
            }
            c80.f(e, "SDK encountered unexpected error in handling fireAdReady() signal from creative; ", l5Var2, o6.a);
        }
    }

    @JavascriptInterface
    public final void fireComplete(String str) {
        l5 l5Var = this.d;
        if (l5Var != null) {
            l5Var.c(o6.a, "fireComplete is called");
        }
        ub ubVar = this.a;
        if (ubVar == null) {
            l5 l5Var2 = this.d;
            if (l5Var2 == null) {
                return;
            }
            l5Var2.b(o6.a, "Found a null instance of render view!");
            return;
        }
        l5 l5Var3 = ubVar.j;
        if (l5Var3 != null) {
            l5Var3.a(ub.P0, Intrinsics.f(ubVar, "completeFromInterActive "));
        }
        c3 c3Var = ubVar.I0;
        if (c3Var != null) {
            c3Var.d();
        }
        l5 l5Var4 = ubVar.j;
        if (l5Var4 == null) {
            return;
        }
        l5Var4.c(ub.P0, "completeFromInterActive");
    }

    @JavascriptInterface
    public final void fireSkip(String str) {
        l5 l5Var;
        l5 l5Var2 = this.d;
        if (l5Var2 != null) {
            l5Var2.c(o6.a, "fireSkip is called");
        }
        if (this.a == null && (l5Var = this.d) != null) {
            l5Var.b(o6.a, "Found a null instance of render view!");
        }
        ub ubVar = this.a;
        l5 l5Var3 = ubVar.j;
        if (l5Var3 != null) {
            l5Var3.a(ub.P0, Intrinsics.f(ubVar, "skipFromInterActive "));
        }
        c3 c3Var = ubVar.I0;
        if (c3Var != null) {
            c3Var.e();
        }
        l5 l5Var4 = ubVar.j;
        if (l5Var4 == null) {
            return;
        }
        l5Var4.c(ub.P0, "skipFromInterActive");
    }

    @JavascriptInterface
    public final String getAdContext(String str) {
        l5 l5Var = this.d;
        if (l5Var != null) {
            l5Var.c(o6.a, "getAdContext is called");
        }
        y adPodHandler = this.a.getAdPodHandler();
        if (adPodHandler == null) {
            return null;
        }
        return adPodHandler.e();
    }

    @JavascriptInterface
    public final void getBlob(String str, String str2) {
        c2 c2Var;
        l5 l5Var = this.d;
        if (l5Var != null) {
            l5Var.c(o6.a, "getBlob is called");
        }
        ub ubVar = this.a;
        if (ubVar == null) {
            l5 l5Var2 = this.d;
            if (l5Var2 == null) {
                return;
            }
            l5Var2.b(o6.a, "Found a null instance of render view!");
            return;
        }
        l5 l5Var3 = ubVar.j;
        if (l5Var3 != null) {
            l5Var3.c(ub.P0, "getBlob");
        }
        if (str == null || str2 == null || (c2Var = ubVar.W) == null) {
            return;
        }
        c2Var.a(str, str2, ubVar, ubVar.getImpressionId());
    }

    @JavascriptInterface
    @NotNull
    public final String getCurrentPosition(String str) {
        ub ubVar;
        l5 l5Var = this.d;
        if (l5Var != null) {
            l5Var.c(o6.a, "getCurrentPosition called");
        }
        ub ubVar2 = this.a;
        if (ubVar2 == null) {
            l5 l5Var2 = this.d;
            if (l5Var2 == null) {
                return "";
            }
            l5Var2.b(o6.a, "Found a null instance of render view!");
            return "";
        }
        synchronized (ubVar2.getCurrentPositionMonitor()) {
            this.a.B = true;
            new Handler(this.a.getContainerContext().getMainLooper()).post(new fya(this, 6));
            while (true) {
                ubVar = this.a;
                if (ubVar.B) {
                    try {
                        ubVar.getCurrentPositionMonitor().wait();
                    } catch (InterruptedException unused) {
                    }
                } else {
                    Unit unit = Unit.INSTANCE;
                }
            }
        }
        return ubVar.getCurrentPosition();
    }

    @JavascriptInterface
    public final int getCurrentRenderingIndex(String str) {
        l5 l5Var = this.d;
        if (l5Var != null) {
            l5Var.c(o6.a, "getCurrentRenderingIndex is called");
        }
        return this.a.getCurrentRenderingPodAdIndex();
    }

    @JavascriptInterface
    @NotNull
    public final String getDefaultPosition(String str) {
        ub ubVar;
        l5 l5Var = this.d;
        if (l5Var != null) {
            l5Var.c(o6.a, "getDefaultPosition called");
        }
        ub ubVar2 = this.a;
        if (ubVar2 == null) {
            l5 l5Var2 = this.d;
            if (l5Var2 != null) {
                l5Var2.b(o6.a, "Found a null instance of render view!");
            }
            return new JSONObject().toString();
        }
        synchronized (ubVar2.getDefaultPositionMonitor()) {
            this.a.A = true;
            new Handler(this.a.getContainerContext().getMainLooper()).post(new tf(this, 13));
            while (true) {
                ubVar = this.a;
                if (ubVar.A) {
                    try {
                        ubVar.getDefaultPositionMonitor().wait();
                    } catch (InterruptedException unused) {
                    }
                } else {
                    Unit unit = Unit.INSTANCE;
                }
            }
        }
        return ubVar.getDefaultPosition();
    }

    @android.webkit.JavascriptInterface
    public final int getDeviceVolume(java.lang.String r6) {
        throw new UnsupportedOperationException("Method not decompiled: com.inmobi.media.n6.getDeviceVolume(java.lang.String):int");
    }

    @JavascriptInterface
    @NotNull
    public final String getExpandProperties(String str) {
        l5 l5Var = this.d;
        if (l5Var != null) {
            l5Var.c(o6.a, "getExpandedProperties called");
        }
        ub ubVar = this.a;
        if (ubVar != null) {
            return ubVar.getExpandProperties().b;
        }
        l5 l5Var2 = this.d;
        if (l5Var2 == null) {
            return "";
        }
        l5Var2.b(o6.a, "Found a null instance of render view!");
        return "";
    }

    @JavascriptInterface
    public final int getMaxDeviceVolume(String str) {
        l5 l5Var = this.d;
        if (l5Var != null) {
            l5Var.c(o6.a, "getMaxDeviceVolume called");
        }
        try {
            return u3.a.m();
        } catch (Exception e) {
            this.a.b(str, "Unexpected error", "getMaxDeviceVolume");
            l5 l5Var2 = this.d;
            if (l5Var2 == null) {
                return 0;
            }
            c80.f(e, "SDK encountered unexpected error in handling getMaxDeviceVolume() request from creative; ", l5Var2, o6.a);
            return 0;
        }
    }

    @JavascriptInterface
    @NotNull
    public final String getMaxSize(String str) {
        int i;
        int i2;
        l5 l5Var = this.d;
        if (l5Var != null) {
            l5Var.c(o6.a, "getMaxSize called");
        }
        JSONObject jSONObject = new JSONObject();
        try {
            Activity fullScreenActivity = this.a.getFullScreenActivity();
            if (fullScreenActivity == null) {
                Context containerContext = this.a.getContainerContext();
                if ((containerContext instanceof Activity ? (Activity) containerContext : null) == null) {
                    return getScreenSize(str);
                }
                fullScreenActivity = (Activity) this.a.getContainerContext();
            }
            FrameLayout frameLayout = (FrameLayout) fullScreenActivity.findViewById(R.id.content);
            int b2 = w3.b(frameLayout.getWidth());
            int b3 = w3.b(frameLayout.getHeight());
            if (this.a.getFullScreenActivity() != null && (b2 == 0 || b3 == 0)) {
                a aVar = new a(frameLayout, this.d);
                frameLayout.getViewTreeObserver().addOnGlobalLayoutListener(aVar);
                Boolean bool = Boolean.FALSE;
                synchronized (bool) {
                    try {
                        bool.wait();
                    } catch (InterruptedException unused) {
                    }
                    i = aVar.c;
                    i2 = aVar.d;
                    Unit unit = Unit.INSTANCE;
                }
                b3 = i2;
                b2 = i;
            }
            try {
                jSONObject.put("width", b2);
                jSONObject.put("height", b3);
            } catch (JSONException e) {
                l5 l5Var2 = this.d;
                if (l5Var2 != null) {
                    l5Var2.a(o6.a, "Error while creating max size Json.", e);
                }
            }
            l5 l5Var3 = this.d;
            if (l5Var3 != null) {
                l5Var3.c(o6.a, Intrinsics.f(jSONObject, "getMaxSize called:"));
            }
        } catch (Exception e2) {
            this.a.b(str, "Unexpected error", "getMaxSize");
            l5 l5Var4 = this.d;
            if (l5Var4 != null) {
                c80.f(e2, "SDK encountered unexpected error in handling getMaxSize() request from creative; ", l5Var4, o6.a);
            }
        }
        return jSONObject.toString();
    }

    @JavascriptInterface
    @NotNull
    public final String getOrientation(String str) {
        l5 l5Var = this.d;
        if (l5Var != null) {
            l5Var.c(o6.a, "getOrientation called");
        }
        byte h = w3.a.h();
        return h == 1 ? SchemaConstants.Value.FALSE : h == 3 ? "90" : h == 2 ? "180" : h == 4 ? "270" : "-1";
    }

    @JavascriptInterface
    @NotNull
    public final String getOrientationProperties(String str) {
        xa xaVar = this.c;
        String str2 = xaVar == null ? null : xaVar.d;
        l5 l5Var = this.d;
        if (l5Var != null) {
            l5Var.c(o6.a, Intrinsics.f(str2, "getOrientationProperties called: "));
        }
        return str2;
    }

    @JavascriptInterface
    @NotNull
    public final String getPlacementType(String str) {
        l5 l5Var = this.d;
        if (l5Var != null) {
            l5Var.c(o6.a, "getPlacementType called");
        }
        return 1 == this.b ? "interstitial" : "inline";
    }

    @JavascriptInterface
    @NotNull
    public final String getPlatform(String str) {
        l5 l5Var = this.d;
        if (l5Var == null) {
            return TelemetryEventStrings.Os.OS_NAME;
        }
        l5Var.c(o6.a, "getPlatform. Platform:android");
        return TelemetryEventStrings.Os.OS_NAME;
    }

    @JavascriptInterface
    @NotNull
    public final String getPlatformVersion(String str) {
        String valueOf = String.valueOf(Build.VERSION.SDK_INT);
        l5 l5Var = this.d;
        if (l5Var != null) {
            l5Var.c(o6.a, Intrinsics.f(valueOf, "getPlatformVersion. Version:"));
        }
        return valueOf;
    }

    @JavascriptInterface
    @NotNull
    public final String getRenderableAdIndexes(String str) {
        l5 l5Var = this.d;
        if (l5Var != null) {
            l5Var.c(o6.a, "getRenderableAdIndexes is called");
        }
        JSONArray renderableAdIndexes = this.a.getRenderableAdIndexes();
        l5 l5Var2 = this.d;
        if (l5Var2 != null) {
            l5Var2.c(o6.a, Intrinsics.f(renderableAdIndexes, "renderableAdIndexes called:"));
        }
        return renderableAdIndexes.toString();
    }

    @JavascriptInterface
    @NotNull
    public final String getResizeProperties(String str) {
        JSONObject a2;
        String jSONObject;
        l5 l5Var = this.d;
        if (l5Var != null) {
            l5Var.c(o6.a, "getResizeProperties called");
        }
        ub ubVar = this.a;
        if (ubVar != null) {
            fc resizeProperties = ubVar.getResizeProperties();
            return (resizeProperties == null || (a2 = new m6().a((m6) resizeProperties)) == null || (jSONObject = a2.toString()) == null) ? "" : jSONObject;
        }
        l5 l5Var2 = this.d;
        if (l5Var2 != null) {
            l5Var2.b(o6.a, "Found a null instance of render view!");
        }
        return "";
    }

    @JavascriptInterface
    public final String getSafeArea(String str) {
        ub ubVar = this.a;
        if (!ubVar.E0) {
            return null;
        }
        Integer navBarTypeViaSettings = ubVar.getNavBarTypeViaSettings();
        if (navBarTypeViaSettings == null) {
            navBarTypeViaSettings = this.a.getNavBarTypeViaInsets();
        }
        JSONObject jSONObject = this.a.getSafeArea().get(navBarTypeViaSettings);
        l5 l5Var = this.d;
        if (l5Var != null) {
            l5Var.c(o6.a, Intrinsics.f(jSONObject, "getSafeArea called:"));
        }
        if (jSONObject == null) {
            return null;
        }
        return jSONObject.toString();
    }

    @JavascriptInterface
    @NotNull
    public final String getScreenSize(String str) {
        JSONObject jSONObject = new JSONObject();
        try {
            w3 w3Var = w3.a;
            jSONObject.put("width", w3Var.i().a);
            jSONObject.put("height", w3Var.i().b);
        } catch (JSONException unused) {
        } catch (Exception e) {
            this.a.b(str, "Unexpected error", "getScreenSize");
            l5 l5Var = this.d;
            if (l5Var != null) {
                c80.f(e, "SDK encountered unexpected error while getting screen dimensions; ", l5Var, o6.a);
            }
        }
        String jSONObject2 = jSONObject.toString();
        l5 l5Var2 = this.d;
        if (l5Var2 != null) {
            l5Var2.c(o6.a, Intrinsics.f(jSONObject2, "getScreenSize called:"));
        }
        return jSONObject2;
    }

    @JavascriptInterface
    @NotNull
    public final String getSdkVersion(String str) {
        l5 l5Var = this.d;
        if (l5Var == null) {
            return "10.7.5";
        }
        l5Var.c(o6.a, "getSdkVersion called. Version:10.7.5");
        return "10.7.5";
    }

    @JavascriptInterface
    public final long getShowTimeStamp(String str) {
        l5 l5Var = this.d;
        if (l5Var != null) {
            l5Var.c(o6.a, "getShowTimeStamp is called");
        }
        long showTimeStamp = this.a.getShowTimeStamp();
        l5 l5Var2 = this.d;
        if (l5Var2 != null) {
            l5Var2.c(o6.a, Intrinsics.f(Long.valueOf(showTimeStamp), "getShowTimeStamp is "));
        }
        return showTimeStamp;
    }

    @JavascriptInterface
    @NotNull
    public final String getState(String str) {
        String viewState = this.a.getViewState();
        Locale locale = Locale.ENGLISH;
        if (viewState == null) {
            throw new NullPointerException("null cannot be cast to non-null type java.lang.String");
        }
        String lowerCase = viewState.toLowerCase(locale);
        l5 l5Var = this.d;
        if (l5Var != null) {
            l5Var.a(o6.a, Intrinsics.f(lowerCase, "getState called:"));
        }
        return lowerCase;
    }

    @JavascriptInterface
    @NotNull
    public final String getVersion(String str) {
        l5 l5Var = this.d;
        if (l5Var == null) {
            return "2.0";
        }
        l5Var.c(o6.a, "getVersion called. Version:2.0");
        return "2.0";
    }

    @JavascriptInterface
    public final void impressionFired(String str) {
        l5 l5Var = this.d;
        if (l5Var != null) {
            l5Var.c(o6.a, "impressionFired is called");
        }
        ub ubVar = this.a;
        l5 l5Var2 = ubVar.j;
        if (l5Var2 != null) {
            l5Var2.c(ub.P0, Intrinsics.f(ubVar, "onImpressionFired "));
        }
        ubVar.r();
        ubVar.getListener().a(ubVar.getTelemetryOnAdImpression());
    }

    @JavascriptInterface
    public final void incentCompleted(String str, String str2) {
        l5 l5Var = this.d;
        if (l5Var != null) {
            l5Var.c(o6.a, Intrinsics.f(str2, "incentCompleted called. IncentData:"));
        }
        if (str2 == null) {
            try {
                this.a.getListener().b(new HashMap<>());
                return;
            } catch (Exception e) {
                this.a.b(str, "Unexpected error", "incentCompleted");
                l5 l5Var2 = this.d;
                if (l5Var2 == null) {
                    return;
                }
                c80.f(e, "SDK encountered unexpected error in handling onUserInteraction() signal from creative; ", l5Var2, o6.a);
                return;
            }
        }
        try {
            JSONObject jSONObject = new JSONObject(str2);
            HashMap<Object, Object> hashMap = new HashMap<>();
            Iterator<String> keys = jSONObject.keys();
            while (keys.hasNext()) {
                String next = keys.next();
                if (next == null) {
                    throw new NullPointerException("null cannot be cast to non-null type kotlin.String");
                }
                String str3 = next;
                hashMap.put(str3, jSONObject.get(str3));
            }
            try {
                try {
                    this.a.getListener().b(hashMap);
                } catch (Exception e2) {
                    this.a.b(str, "Unexpected error", "incentCompleted");
                    l5 l5Var3 = this.d;
                    if (l5Var3 == null) {
                        return;
                    }
                    l5Var3.b(o6.a, Intrinsics.f(e2.getMessage(), "SDK encountered unexpected error in handling onUserInteraction() signal from creative; "));
                }
            } catch (Exception e3) {
                this.a.b(str, "Unexpected error", "incentCompleted");
                l5 l5Var4 = this.d;
                if (l5Var4 == null) {
                    return;
                }
                c80.f(e3, "SDK encountered unexpected error in handling onUserInteraction() signal from creative; ", l5Var4, o6.a);
            }
        } catch (JSONException unused) {
            this.a.getListener().b(new HashMap<>());
        }
    }

    @JavascriptInterface
    public final boolean isBackButtonDisabled(String str) {
        l5 l5Var = this.d;
        if (l5Var != null) {
            l5Var.c(o6.a, "isBackButtonDisabled called");
        }
        ub ubVar = this.a;
        if (ubVar != null) {
            return ubVar.G;
        }
        l5 l5Var2 = this.d;
        if (l5Var2 == null) {
            return false;
        }
        l5Var2.b(o6.a, "Found a null instance of render view!");
        return false;
    }

    @JavascriptInterface
    @NotNull
    public final String isDeviceMuted(String str) {
        l5 l5Var = this.d;
        if (l5Var != null) {
            l5Var.c(o6.a, "isDeviceMuted called");
        }
        if (this.a == null) {
            l5 l5Var2 = this.d;
            if (l5Var2 == null) {
                return TelemetryEventStrings.Value.FALSE;
            }
            l5Var2.b(o6.a, "Found a null instance of render view!");
            return TelemetryEventStrings.Value.FALSE;
        }
        l5 l5Var3 = this.d;
        if (l5Var3 != null) {
            l5Var3.c(o6.a, "JavaScript called: isDeviceMuted()");
        }
        boolean z = false;
        try {
            l5 l5Var4 = this.a.getMediaProcessor().b;
            if (l5Var4 != null) {
                l5Var4.a("MraidMediaProcessor", "isVolumeMuted");
            }
            Context d = vc.d();
            if (d != null) {
                Object systemService = d.getSystemService("audio");
                AudioManager audioManager = systemService instanceof AudioManager ? (AudioManager) systemService : null;
                if (audioManager != null) {
                    if (2 != audioManager.getRingerMode()) {
                        z = true;
                    }
                }
            }
        } catch (Exception e) {
            l5 l5Var5 = this.d;
            if (l5Var5 != null) {
                c80.f(e, "SDK encountered unexpected error in checking if device is muted; ", l5Var5, o6.a);
            }
        }
        return String.valueOf(z);
    }

    @JavascriptInterface
    @NotNull
    public final String isHeadphonePlugged(String str) {
        l5 l5Var = this.d;
        if (l5Var != null) {
            l5Var.c(o6.a, "isHeadphonePlugged called");
        }
        if (this.a == null) {
            l5 l5Var2 = this.d;
            if (l5Var2 == null) {
                return TelemetryEventStrings.Value.FALSE;
            }
            l5Var2.b(o6.a, "Found a null instance of render view!");
            return TelemetryEventStrings.Value.FALSE;
        }
        l5 l5Var3 = this.d;
        if (l5Var3 != null) {
            l5Var3.c(o6.a, "JavaScript called: isHeadphonePlugged()");
        }
        boolean z = false;
        try {
            this.a.getMediaProcessor();
            Context d = vc.d();
            if (d != null) {
                Object systemService = d.getSystemService("audio");
                AudioManager audioManager = systemService instanceof AudioManager ? (AudioManager) systemService : null;
                if (audioManager != null) {
                    if (audioManager.isWiredHeadsetOn()) {
                        z = true;
                    }
                }
            }
        } catch (Exception e) {
            l5 l5Var4 = this.d;
            if (l5Var4 != null) {
                c80.f(e, "SDK encountered unexpected error in checking if headphones are plugged-in; ", l5Var4, o6.a);
            }
        }
        return String.valueOf(z);
    }

    @JavascriptInterface
    public final boolean isViewable(String str) {
        l5 l5Var = this.d;
        if (l5Var != null) {
            l5Var.c(o6.a, "isViewable called");
        }
        ub ubVar = this.a;
        if (ubVar != null) {
            return ubVar.p();
        }
        l5 l5Var2 = this.d;
        if (l5Var2 == null) {
            return false;
        }
        l5Var2.b(o6.a, "Found a null instance of render view!");
        return false;
    }

    @JavascriptInterface
    public final void loadAd(String str, int i) {
        y yVar;
        l5 l5Var = this.d;
        if (l5Var != null) {
            l5Var.c(o6.a, "loadAd is called");
        }
        ub ubVar = this.a;
        l5 l5Var2 = ubVar.j;
        if (l5Var2 != null) {
            l5Var2.c(ub.P0, Intrinsics.f(ubVar, "loadPodAd "));
        }
        if (ubVar.p() && (yVar = ubVar.d0) != null) {
            yVar.a(i, ubVar);
            return;
        }
        l5 l5Var3 = ubVar.j;
        if (l5Var3 != null) {
            l5Var3.b(ub.P0, "Cannot load index pod ad as the current ad is not viewable");
        }
        ubVar.a(false);
    }

    @JavascriptInterface
    public final void log(String str, @NotNull String str2) {
        l5 l5Var = this.d;
        if (l5Var != null) {
            l5Var.a(o6.a, Intrinsics.f(str2, "Log called. Message:"));
        }
        ub ubVar = this.a;
        ubVar.getClass();
        ub.c cVar = ub.N0;
        cVar.getClass();
        if (!ub.R0.getValue(cVar, ub.c.a[0]).booleanValue() || str2 == null) {
            return;
        }
        ubVar.getListener().b(str2);
    }

    @android.webkit.JavascriptInterface
    public final void logTelemetryEvent(java.lang.String r7, java.lang.String r8, java.lang.String r9) {
        throw new UnsupportedOperationException("Method not decompiled: com.inmobi.media.n6.logTelemetryEvent(java.lang.String, java.lang.String, java.lang.String):void");
    }

    @JavascriptInterface
    public final void onAudioStateChanged(String str, int i) {
        l5 l5Var = this.d;
        if (l5Var != null) {
            l5Var.c(o6.a, Intrinsics.f(Integer.valueOf(i), "onAudioStateChanged is called: "));
        }
        com.inmobi.ads.banner.a aVar = (com.inmobi.ads.banner.a) com.inmobi.ads.banner.a.c.get(i);
        if (aVar == null) {
            aVar = com.inmobi.ads.banner.a.d;
        }
        if (aVar != com.inmobi.ads.banner.a.d) {
            this.a.getListener().a(aVar);
        }
    }

    @JavascriptInterface
    public final void onOrientationChange(String str) {
        l5 l5Var = this.d;
        if (l5Var == null) {
            return;
        }
        l5Var.c(o6.a, ">>> onOrientationChange() >>> This API is deprecated!");
    }

    @JavascriptInterface
    public final void onUserAudioMuteInteraction(String str, boolean z) {
        l5 l5Var = this.d;
        if (l5Var != null) {
            l5Var.c(o6.a, Intrinsics.f(Boolean.valueOf(z), "onAudioMuteInteraction is called: "));
        }
        this.a.getListener().a(z);
    }

    @JavascriptInterface
    public final void onUserInteraction(String str, String str2) {
        l5 l5Var = this.d;
        if (l5Var != null) {
            l5Var.c(o6.a, "onUserInteraction called");
        }
        ub ubVar = this.a;
        if (ubVar != null && !ubVar.n()) {
            this.a.a("onUserInteraction");
            return;
        }
        l5 l5Var2 = this.d;
        if (l5Var2 != null) {
            l5Var2.c(o6.a, Intrinsics.f(str2, "onUserInteraction called. Params:"));
        }
        if (str2 == null) {
            try {
                this.a.getListener().a(new HashMap<>());
                return;
            } catch (Exception e) {
                this.a.b(str, "Unexpected error", "onUserInteraction");
                l5 l5Var3 = this.d;
                if (l5Var3 == null) {
                    return;
                }
                c80.f(e, "SDK encountered unexpected error in handling onUserInteraction() signal from creative; ", l5Var3, o6.a);
                return;
            }
        }
        try {
            try {
                JSONObject jSONObject = new JSONObject(str2);
                HashMap<Object, Object> hashMap = new HashMap<>();
                Iterator<String> keys = jSONObject.keys();
                while (keys.hasNext()) {
                    String next = keys.next();
                    if (next == null) {
                        throw new NullPointerException("null cannot be cast to non-null type kotlin.String");
                    }
                    String str3 = next;
                    hashMap.put(str3, jSONObject.get(str3));
                }
                try {
                    this.a.getListener().a(hashMap);
                } catch (Exception e2) {
                    this.a.b(str, "Unexpected error", "onUserInteraction");
                    l5 l5Var4 = this.d;
                    if (l5Var4 == null) {
                        return;
                    }
                    l5Var4.b(o6.a, Intrinsics.f(e2.getMessage(), "SDK encountered unexpected error in handling onUserInteraction() signal from creative; "));
                }
            } catch (JSONException unused) {
                this.a.getListener().a(new HashMap<>());
            }
        } catch (Exception e3) {
            this.a.b(str, "Unexpected error", "onUserInteraction");
            l5 l5Var5 = this.d;
            if (l5Var5 == null) {
                return;
            }
            c80.f(e3, "SDK encountered unexpected error in handling onUserInteraction() signal from creative; ", l5Var5, o6.a);
        }
    }

    @JavascriptInterface
    public final void open(String str, String str2) {
        l5 l5Var = this.d;
        if (l5Var != null) {
            l5Var.c(o6.a, "open called");
        }
        String a2 = x6.h.a(str2, this.a.getLandingPageHandler().b.b);
        this.a.getLandingPageHandler().a("clickStartCalled", o6b.e(new Pair[]{new Pair("trigger", a2)}));
        if (this.a.n()) {
            this.a.l();
            ed.a(new o3j(this, str, str2, 3));
        } else {
            this.a.a("open");
            this.a.getLandingPageHandler().a("landingsStartFailed", o6b.e(new Pair[]{new Pair("errorCode", 8), new Pair("trigger", a2)}));
        }
    }

    @JavascriptInterface
    public final void openEmbedded(final String str, final String str2) {
        l5 l5Var = this.d;
        if (l5Var != null) {
            l5Var.c(o6.a, "openEmbedded called");
        }
        if (!this.a.n()) {
            this.a.a("openEmbedded");
        } else {
            this.a.l();
            ed.a(new Runnable() {
                @Override
                public final void run() {
                    n6.c(n6.this, str, str2);
                }
            });
        }
    }

    @JavascriptInterface
    public final void openExternal(String str, @NotNull String str2, String str3) {
        l5 l5Var = this.d;
        if (l5Var != null) {
            l5Var.c(o6.a, "open External");
        }
        ub ubVar = this.a;
        if (ubVar == null) {
            l5 l5Var2 = this.d;
            if (l5Var2 == null) {
                return;
            }
            l5Var2.b(o6.a, "Found a null instance of render view!");
            return;
        }
        if (!ubVar.n()) {
            this.a.a("openExternal");
            return;
        }
        this.a.l();
        l5 l5Var3 = this.d;
        if (l5Var3 != null) {
            l5Var3.c(o6.a, Intrinsics.f(str2, "openExternal called with url: "));
        }
        x6 landingPageHandler = this.a.getLandingPageHandler();
        landingPageHandler.getClass();
        if (str2 != null) {
            landingPageHandler.a("openExternal", str, str2, str3);
            return;
        }
        if (str3 != null) {
            landingPageHandler.a("openExternal", str, str3, (String) null);
            return;
        }
        w6 w6Var = landingPageHandler.d;
        if (w6Var != null) {
            w6Var.a(str, "Empty url and fallback url", "openExternal");
        }
        l5 l5Var4 = landingPageHandler.g;
        if (l5Var4 == null) {
            return;
        }
        l5Var4.b("x6", "Empty deeplink and fallback urls");
    }

    @JavascriptInterface
    public final void openWithoutTracker(String str, String str2) {
        l5 l5Var = this.d;
        if (l5Var != null) {
            l5Var.c(o6.a, "openWithoutTracker called");
        }
        String a2 = x6.h.a(str2, this.a.getLandingPageHandler().b.b);
        this.a.getLandingPageHandler().a("clickStartCalled", new HashMap());
        ub ubVar = this.a;
        if (ubVar == null) {
            l5 l5Var2 = this.d;
            if (l5Var2 != null) {
                l5Var2.b(o6.a, "Found a null instance of render view!");
            }
            this.a.getLandingPageHandler().a("landingsStartFailed", o6b.e(new Pair[]{new Pair("errorCode", 11), new Pair("trigger", a2)}));
            return;
        }
        if (ubVar.n()) {
            ed.a(new w46(this, str, str2, 3));
        } else {
            this.a.a("openWithoutTracker");
            this.a.getLandingPageHandler().a("landingsStartFailed", o6b.e(new Pair[]{new Pair("errorCode", 8), new Pair("trigger", a2)}));
        }
    }

    @JavascriptInterface
    public final void ping(String str, String str2, boolean z) {
        l5 l5Var = this.d;
        if (l5Var != null) {
            l5Var.c(o6.a, "ping called");
        }
        if (this.a == null) {
            l5 l5Var2 = this.d;
            if (l5Var2 == null) {
                return;
            }
            l5Var2.b(o6.a, "Found a null instance of render view!");
            return;
        }
        if (str2 != null) {
            int length = str2.length() - 1;
            int i = 0;
            boolean z2 = false;
            while (i <= length) {
                boolean z3 = Intrinsics.c(str2.charAt(!z2 ? i : length), 32) <= 0;
                if (z2) {
                    if (!z3) {
                        break;
                    } else {
                        length--;
                    }
                } else if (z3) {
                    i++;
                } else {
                    z2 = true;
                }
            }
            if (str2.subSequence(i, length + 1).toString().length() != 0 && URLUtil.isValidUrl(str2)) {
                l5 l5Var3 = this.d;
                if (l5Var3 != null) {
                    l5Var3.c(o6.a, "JavaScript called ping() URL: >>> " + ((Object) str2) + " <<<");
                }
                try {
                    m2.a.a(str2, z, this.d);
                    return;
                } catch (Exception e) {
                    this.a.b(str, "Unexpected error", "ping");
                    p7.a((byte) 1, "InMobi", "Failed to fire ping; SDK encountered unexpected error");
                    l5 l5Var4 = this.d;
                    if (l5Var4 == null) {
                        return;
                    }
                    c80.f(e, "SDK encountered unexpected error in handling ping() request from creative; ", l5Var4, o6.a);
                    return;
                }
            }
        }
        this.a.b(str, Intrinsics.f(str2, "Invalid URL:"), "ping");
    }

    @JavascriptInterface
    public final void pingInWebView(String str, String str2, boolean z) {
        l5 l5Var = this.d;
        if (l5Var != null) {
            l5Var.c(o6.a, "openInWebView called");
        }
        if (this.a == null) {
            l5 l5Var2 = this.d;
            if (l5Var2 == null) {
                return;
            }
            l5Var2.b(o6.a, "Found a null instance of render view!");
            return;
        }
        if (str2 != null) {
            int length = str2.length() - 1;
            int i = 0;
            boolean z2 = false;
            while (i <= length) {
                boolean z3 = Intrinsics.c(str2.charAt(!z2 ? i : length), 32) <= 0;
                if (z2) {
                    if (!z3) {
                        break;
                    } else {
                        length--;
                    }
                } else if (z3) {
                    i++;
                } else {
                    z2 = true;
                }
            }
            if (str2.subSequence(i, length + 1).toString().length() != 0 && URLUtil.isValidUrl(str2)) {
                l5 l5Var3 = this.d;
                if (l5Var3 != null) {
                    l5Var3.c(o6.a, "JavaScript called pingInWebView() URL: >>> " + ((Object) str2) + " <<<");
                }
                try {
                    m2.a.b(str2, z, this.d);
                    return;
                } catch (Exception e) {
                    this.a.b(str, "Unexpected error", "pingInWebView");
                    p7.a((byte) 1, "InMobi", "Failed to fire ping; SDK encountered unexpected error");
                    l5 l5Var4 = this.d;
                    if (l5Var4 == null) {
                        return;
                    }
                    c80.f(e, "SDK encountered unexpected error in handling pingInWebView() request from creative; ", l5Var4, o6.a);
                    return;
                }
            }
        }
        this.a.b(str, Intrinsics.f(str2, "Invalid URL:"), "pingInWebView");
    }

    @JavascriptInterface
    public final void playVideo(String str, String str2) {
        if (this.a == null) {
            l5 l5Var = this.d;
            if (l5Var == null) {
                return;
            }
            l5Var.b(o6.a, "Found a null instance of render view!");
            return;
        }
        if (str2 != null) {
            int length = str2.length() - 1;
            int i = 0;
            boolean z = false;
            while (i <= length) {
                boolean z2 = Intrinsics.c(str2.charAt(!z ? i : length), 32) <= 0;
                if (z) {
                    if (!z2) {
                        break;
                    } else {
                        length--;
                    }
                } else if (z2) {
                    i++;
                } else {
                    z = true;
                }
            }
            if (str2.subSequence(i, length + 1).toString().length() != 0 && kotlin.text.c.o(str2, "http", false) && (kotlin.text.c.i(str2, "mp4", false) || kotlin.text.c.i(str2, "avi", false) || kotlin.text.c.i(str2, "m4v", false))) {
                l5 l5Var2 = this.d;
                if (l5Var2 != null) {
                    l5Var2.c(o6.a, "JavaScript called: playVideo (" + ((Object) str2) + ')');
                }
                new Handler(this.a.getContainerContext().getMainLooper()).post(new ft(this, str, str2, 3));
                return;
            }
        }
        this.a.b(str, "Null or empty or invalid media playback URL supplied", "playVideo");
    }

    @JavascriptInterface
    public final void registerBackButtonPressedEventListener(String str) {
        l5 l5Var = this.d;
        if (l5Var != null) {
            l5Var.c(o6.a, "registerBackButtonPressedEventListener called");
        }
        ub ubVar = this.a;
        if (ubVar == null) {
            l5 l5Var2 = this.d;
            if (l5Var2 == null) {
                return;
            }
            l5Var2.b(o6.a, "Found a null instance of render view!");
            return;
        }
        try {
            l5 l5Var3 = ubVar.j;
            if (l5Var3 != null) {
                l5Var3.c(ub.P0, Intrinsics.f(ubVar, "registerBackButtonPressedEventListener "));
            }
            ubVar.H = str;
        } catch (Exception e) {
            this.a.b(str, "Unexpected error", "registerBackButtonPressedEventListener");
            l5 l5Var4 = this.d;
            if (l5Var4 == null) {
                return;
            }
            c80.f(e, "SDK encountered unexpected error in handling registerBackButtonPressedEventListener() request from creative; ", l5Var4, o6.a);
        }
    }

    @JavascriptInterface
    public final void registerDeviceMuteEventListener(String str) {
        l5 l5Var = this.d;
        if (l5Var != null) {
            l5Var.c(o6.a, "registerDeviceMuteEventListener called");
        }
        ub ubVar = this.a;
        if (ubVar == null) {
            l5 l5Var2 = this.d;
            if (l5Var2 == null) {
                return;
            }
            l5Var2.b(o6.a, "Found a null instance of render view!");
            return;
        }
        if (str != null) {
            try {
                f8 mediaProcessor = ubVar.getMediaProcessor();
                if (mediaProcessor != null && mediaProcessor.d == null) {
                    x7 x7Var = new x7(mediaProcessor.new b(str));
                    mediaProcessor.d = x7Var;
                    x7Var.b();
                }
            } catch (Exception e) {
                this.a.b(str, "Unexpected error", "registerDeviceMuteEventListener");
                l5 l5Var3 = this.d;
                if (l5Var3 == null) {
                    return;
                }
                c80.f(e, "SDK encountered unexpected error in handling registerDeviceMuteEventListener() request from creative; ", l5Var3, o6.a);
            }
        }
    }

    @JavascriptInterface
    public final void registerDeviceVolumeChangeEventListener(String str) {
        Context d;
        l5 l5Var = this.d;
        if (l5Var != null) {
            l5Var.c(o6.a, "registerDeviceVolumeChangeEventListener called");
        }
        ub ubVar = this.a;
        if (ubVar == null) {
            l5 l5Var2 = this.d;
            if (l5Var2 == null) {
                return;
            }
            l5Var2.b(o6.a, "Found a null instance of render view!");
            return;
        }
        if (str != null) {
            try {
                f8 mediaProcessor = ubVar.getMediaProcessor();
                if (mediaProcessor == null || (d = vc.d()) == null || mediaProcessor.e != null) {
                    return;
                }
                x7 x7Var = new x7(mediaProcessor.new c(str, d, new Handler(Looper.getMainLooper())));
                mediaProcessor.e = x7Var;
                x7Var.b();
            } catch (Exception e) {
                this.a.b(str, "Unexpected error", "registerDeviceVolumeChangeEventListener");
                l5 l5Var3 = this.d;
                if (l5Var3 == null) {
                    return;
                }
                c80.f(e, "SDK encountered unexpected error in handling registerDeviceVolumeChangeEventListener() request from creative; ", l5Var3, o6.a);
            }
        }
    }

    @JavascriptInterface
    public final void registerHeadphonePluggedEventListener(String str) {
        l5 l5Var = this.d;
        if (l5Var != null) {
            l5Var.c(o6.a, "registerHeadphonePluggedEventListener called");
        }
        ub ubVar = this.a;
        if (ubVar == null) {
            l5 l5Var2 = this.d;
            if (l5Var2 == null) {
                return;
            }
            l5Var2.b(o6.a, "Found a null instance of render view!");
            return;
        }
        if (str != null) {
            try {
                f8 mediaProcessor = ubVar.getMediaProcessor();
                if (mediaProcessor != null && mediaProcessor.f == null) {
                    x7 x7Var = new x7(mediaProcessor.new a(str));
                    mediaProcessor.f = x7Var;
                    x7Var.b();
                }
            } catch (Exception e) {
                this.a.b(str, "Unexpected error", "registerHeadphonePluggedEventListener");
                l5 l5Var3 = this.d;
                if (l5Var3 == null) {
                    return;
                }
                c80.f(e, "SDK encountered unexpected error in handling registerHeadphonePluggedEventListener() request from creative; ", l5Var3, o6.a);
            }
        }
    }

    @JavascriptInterface
    public final void resize(String str) {
        l5 l5Var = this.d;
        if (l5Var != null) {
            l5Var.c(o6.a, "resize called");
        }
        if (this.b != 1) {
            if (this.a != null) {
                new Handler(Looper.getMainLooper()).post(new dt(6, this, str));
                return;
            }
            l5 l5Var2 = this.d;
            if (l5Var2 == null) {
                return;
            }
            l5Var2.b(o6.a, "Found a null instance of render view!");
        }
    }

    @JavascriptInterface
    public final void saveBlob(String str, String str2) {
        c2 c2Var;
        l5 l5Var = this.d;
        if (l5Var != null) {
            l5Var.c(o6.a, "saveBlob is called");
        }
        ub ubVar = this.a;
        if (ubVar == null) {
            l5 l5Var2 = this.d;
            if (l5Var2 == null) {
                return;
            }
            l5Var2.b(o6.a, "Found a null instance of render view!");
            return;
        }
        l5 l5Var3 = ubVar.j;
        if (l5Var3 != null) {
            l5Var3.c(ub.P0, "saveBlob");
        }
        if (str2 == null || (c2Var = ubVar.W) == null) {
            return;
        }
        c2Var.a(str2, ubVar.getImpressionId());
    }

    @JavascriptInterface
    public final void saveContent(String str, String str2, String str3) {
        if (str2 != null && str2.length() != 0 && str3 != null && str3.length() != 0) {
            try {
                this.a.c(str, str2, str3);
                return;
            } catch (Exception e) {
                this.a.b(str, "Unexpected error", "saveContent");
                l5 l5Var = this.d;
                if (l5Var == null) {
                    return;
                }
                c80.f(e, "SDK encountered unexpected error in handling saveContent() request from creative; ", l5Var, o6.a);
                return;
            }
        }
        l5 l5Var2 = this.d;
        if (l5Var2 != null) {
            l5Var2.c(o6.a, "saveContent called with invalid parameters");
        }
        JSONObject jSONObject = new JSONObject();
        if (str3 == null) {
            str3 = "";
        }
        try {
            jSONObject.put(PopAuthenticationSchemeInternal.SerializedNames.URL, str3);
            jSONObject.put("reason", 8);
        } catch (JSONException unused) {
        }
        String m = kotlin.text.c.m(jSONObject.toString(), "\"", "\\\"");
        StringBuilder sb = new StringBuilder("sendSaveContentResult(\"saveContent_");
        if (str2 == null) {
            str2 = "";
        }
        this.a.a(str, my1.i(sb, str2, "\", 'failed', \"", m, "\");"));
    }

    @JavascriptInterface
    public final void setAdContext(String str, @NotNull String str2) {
        l5 l5Var = this.d;
        if (l5Var != null) {
            l5Var.c(o6.a, Intrinsics.f(str2, "setAdContext is called "));
        }
        y adPodHandler = this.a.getAdPodHandler();
        if (adPodHandler == null) {
            return;
        }
        adPodHandler.a(str2);
    }

    @JavascriptInterface
    public final void setCloseEndCardTracker(String str, String str2) {
        l5 l5Var = this.d;
        if (l5Var != null) {
            l5Var.c(o6.a, "setCloseEndCardTracker is called");
        }
        ub ubVar = this.a;
        if (ubVar == null) {
            l5 l5Var2 = this.d;
            if (l5Var2 == null) {
                return;
            }
            l5Var2.b(o6.a, "Found a null instance of render view!");
            return;
        }
        try {
            ubVar.setCloseEndCardTracker(str2);
        } catch (Exception e) {
            this.a.b(str, "Unexpected error", "getDownloadStatus");
            l5 l5Var3 = this.d;
            if (l5Var3 == null) {
                return;
            }
            c80.f(e, "SDK encountered unexpected error in handling getDownloadStatus() request from creative; ", l5Var3, o6.a);
        }
    }

    @JavascriptInterface
    public final void setExpandProperties(String str, @NotNull String str2) {
        l5 l5Var = this.d;
        if (l5Var != null) {
            l5Var.c(o6.a, Intrinsics.f(str2, "setExpandProperties called. Params:"));
        }
        ub ubVar = this.a;
        if (ubVar == null) {
            l5 l5Var2 = this.d;
            if (l5Var2 == null) {
                return;
            }
            l5Var2.b(o6.a, "Found a null instance of render view!");
            return;
        }
        if ("Expanded".equals(ubVar.getViewState())) {
            l5 l5Var3 = this.d;
            if (l5Var3 == null) {
                return;
            }
            l5Var3.b(o6.a, "setExpandProperties can't be called on an already expanded ad.");
            return;
        }
        try {
            this.a.setExpandProperties(o4.e.a(str2));
        } catch (Exception e) {
            this.a.b(str, "Unexpected error", "setExpandProperties");
            l5 l5Var4 = this.d;
            if (l5Var4 == null) {
                return;
            }
            c80.f(e, "SDK encountered unexpected error in setExpandProperties(); ", l5Var4, o6.a);
        }
    }

    @JavascriptInterface
    public final void setOrientationProperties(String str, @NotNull String str2) {
        l5 l5Var = this.d;
        if (l5Var != null) {
            l5Var.c(o6.a, Intrinsics.f(str2, "setOrientationProperties called: "));
        }
        new Handler(this.a.getContainerContext().getMainLooper()).post(new vz5(7, this, str2));
    }

    @android.webkit.JavascriptInterface
    public final void setResizeProperties(java.lang.String r4, @org.jetbrains.annotations.NotNull java.lang.String r5) {
        throw new UnsupportedOperationException("Method not decompiled: com.inmobi.media.n6.setResizeProperties(java.lang.String, java.lang.String):void");
    }

    @JavascriptInterface
    public final void showAd(String str, int i) {
        y yVar;
        l5 l5Var = this.d;
        if (l5Var != null) {
            l5Var.c(o6.a, "showAd is called");
        }
        ub ubVar = this.a;
        l5 l5Var2 = ubVar.j;
        if (l5Var2 != null) {
            l5Var2.c(ub.P0, "showPodAdAtIndex " + ubVar + ' ' + i);
        }
        if (ubVar.p() && (yVar = ubVar.d0) != null) {
            yVar.a(i, ubVar, ubVar.getFullScreenActivity());
            return;
        }
        l5 l5Var3 = ubVar.j;
        if (l5Var3 != null) {
            l5Var3.b(ub.P0, "Cannot show index pod ad as the current ad is not viewable");
        }
        ubVar.b(false);
    }

    @JavascriptInterface
    public final void showAlert(String str, @NotNull String str2) {
        l5 l5Var = this.d;
        if (l5Var == null) {
            return;
        }
        l5Var.c(o6.a, Intrinsics.f(str2, "showAlert: "));
    }

    @JavascriptInterface
    public final void showEndCard(String str) {
        l5 l5Var = this.d;
        if (l5Var != null) {
            l5Var.c(o6.a, "showEndCard is called");
        }
        ub ubVar = this.a;
        if (ubVar == null) {
            l5 l5Var2 = this.d;
            if (l5Var2 == null) {
                return;
            }
            l5Var2.b(o6.a, "Found a null instance of render view!");
            return;
        }
        l5 l5Var3 = ubVar.j;
        if (l5Var3 != null) {
            l5Var3.c(ub.P0, "showEndCardFromInterActive");
        }
        i referenceContainer = ubVar.getReferenceContainer();
        if (referenceContainer instanceof i8) {
            ((i8) referenceContainer).v();
        }
    }

    @JavascriptInterface
    public final void storePicture(String str, String str2) {
        l5 l5Var = this.d;
        if (l5Var == null) {
            return;
        }
        l5Var.c(o6.a, "storePicture is deprecated and no-op. ");
    }

    @JavascriptInterface
    public final void submitAdReport(String str, @NotNull String str2, @NotNull String str3, @NotNull String str4) {
        Activity activity;
        l5 l5Var = this.d;
        if (l5Var != null) {
            l5Var.c(o6.a, "submitAdReport called");
        }
        ub ubVar = this.a;
        boolean b2 = Intrinsics.b(str3, "1");
        ubVar.getClass();
        try {
            JSONObject jSONObject = new JSONObject(str4);
            l5 l5Var2 = ubVar.j;
            if (l5Var2 != null) {
                l5Var2.c(ub.P0, "report - " + ((Object) ubVar.getAdType()) + " type - sdk - " + Build.VERSION.SDK_INT);
            }
            if (Intrinsics.b(ubVar.getAdType(), "int") && Build.VERSION.SDK_INT >= 29 && (activity = ubVar.m.get()) != null) {
                c0.a.a(activity, ubVar, str2, b2, jSONObject, ubVar.z0);
                return;
            }
            c0.a.a(ubVar, ubVar, str2, b2, jSONObject, ubVar.z0);
        } catch (Exception e) {
            l5 l5Var3 = ubVar.j;
            if (l5Var3 == null) {
                return;
            }
            l5Var3.a(ub.P0, "issue wile reporting ad", e);
        }
    }

    @JavascriptInterface
    @NotNull
    public final String supports(String str, @NotNull String str2) {
        l5 l5Var = this.d;
        if (l5Var != null) {
            l5Var.c(o6.a, Intrinsics.f(str2, "Checking support for: "));
        }
        return String.valueOf(this.a.g(str2));
    }

    @JavascriptInterface
    public final long timeSinceShow(String str) {
        l5 l5Var = this.d;
        if (l5Var != null) {
            l5Var.c(o6.a, "timeSinceShow is called");
        }
        ub ubVar = this.a;
        l5 l5Var2 = ubVar.j;
        if (l5Var2 != null) {
            l5Var2.a(ub.P0, Intrinsics.f(ubVar, "timeSincePodShow "));
        }
        y yVar = ubVar.d0;
        if (yVar == null) {
            return 0L;
        }
        return yVar.g();
    }

    @JavascriptInterface
    public final void unregisterBackButtonPressedEventListener(String str) {
        l5 l5Var = this.d;
        if (l5Var != null) {
            l5Var.c(o6.a, "unregisterBackButtonPressedEventListener called");
        }
        ub ubVar = this.a;
        if (ubVar == null) {
            l5 l5Var2 = this.d;
            if (l5Var2 == null) {
                return;
            }
            l5Var2.b(o6.a, "Found a null instance of render view!");
            return;
        }
        try {
            l5 l5Var3 = ubVar.j;
            if (l5Var3 != null) {
                l5Var3.c(ub.P0, Intrinsics.f(ubVar, "unregisterBackButtonPressedEventListener "));
            }
            ubVar.H = null;
        } catch (Exception e) {
            this.a.b(str, "Unexpected error", "unregisterBackButtonPressedEventListener");
            l5 l5Var4 = this.d;
            if (l5Var4 == null) {
                return;
            }
            c80.f(e, "SDK encountered unexpected error in handling unregisterBackButtonPressedEventListener() request from creative; ", l5Var4, o6.a);
        }
    }

    @JavascriptInterface
    public final void unregisterDeviceMuteEventListener(String str) {
        l5 l5Var = this.d;
        if (l5Var != null) {
            l5Var.c(o6.a, "unregisterDeviceMuteEventListener called");
        }
        if (this.a == null) {
            l5 l5Var2 = this.d;
            if (l5Var2 == null) {
                return;
            }
            l5Var2.b(o6.a, "Found a null instance of render view!");
            return;
        }
        l5 l5Var3 = this.d;
        if (l5Var3 != null) {
            l5Var3.c(o6.a, "Unregister device mute event listener ...");
        }
        try {
            f8 mediaProcessor = this.a.getMediaProcessor();
            if (mediaProcessor == null) {
                return;
            }
            w7 w7Var = mediaProcessor.d;
            if (w7Var != null) {
                w7Var.a();
            }
            mediaProcessor.d = null;
        } catch (Exception e) {
            this.a.b(str, "Unexpected error", "unRegisterDeviceMuteEventListener");
            l5 l5Var4 = this.d;
            if (l5Var4 == null) {
                return;
            }
            c80.f(e, "SDK encountered unexpected error in handling unregisterDeviceMuteEventListener() request from creative; ", l5Var4, o6.a);
        }
    }

    @JavascriptInterface
    public final void unregisterDeviceVolumeChangeEventListener(String str) {
        l5 l5Var = this.d;
        if (l5Var != null) {
            l5Var.c(o6.a, "unregisterDeviceVolumeChangeEventListener called");
        }
        if (this.a == null) {
            l5 l5Var2 = this.d;
            if (l5Var2 == null) {
                return;
            }
            l5Var2.b(o6.a, "Found a null instance of render view!");
            return;
        }
        l5 l5Var3 = this.d;
        if (l5Var3 != null) {
            l5Var3.c(o6.a, "Unregister device volume change listener ...");
        }
        try {
            f8 mediaProcessor = this.a.getMediaProcessor();
            if (mediaProcessor == null) {
                return;
            }
            w7 w7Var = mediaProcessor.e;
            if (w7Var != null) {
                w7Var.a();
            }
            mediaProcessor.e = null;
        } catch (Exception e) {
            this.a.b(str, "Unexpected error", "unregisterDeviceVolumeChangeEventListener");
            l5 l5Var4 = this.d;
            if (l5Var4 == null) {
                return;
            }
            c80.f(e, "SDK encountered unexpected error in handling unregisterDeviceVolumeChangeEventListener() request from creative; ", l5Var4, o6.a);
        }
    }

    @JavascriptInterface
    public final void unregisterHeadphonePluggedEventListener(String str) {
        l5 l5Var = this.d;
        if (l5Var != null) {
            l5Var.c(o6.a, "unregisterHeadphonePluggedEventListener called");
        }
        if (this.a == null) {
            l5 l5Var2 = this.d;
            if (l5Var2 == null) {
                return;
            }
            l5Var2.b(o6.a, "Found a null instance of render view!");
            return;
        }
        l5 l5Var3 = this.d;
        if (l5Var3 != null) {
            l5Var3.c(o6.a, "Unregister headphone plugged event listener ...");
        }
        try {
            f8 mediaProcessor = this.a.getMediaProcessor();
            if (mediaProcessor == null) {
                return;
            }
            w7 w7Var = mediaProcessor.f;
            if (w7Var != null) {
                w7Var.a();
            }
            mediaProcessor.f = null;
        } catch (Exception e) {
            this.a.b(str, "Unexpected error", "unregisterHeadphonePluggedEventListener");
            l5 l5Var4 = this.d;
            if (l5Var4 == null) {
                return;
            }
            c80.f(e, "SDK encountered unexpected error in handling unregisterHeadphonePluggedEventListener() request from creative; ", l5Var4, o6.a);
        }
    }

    @JavascriptInterface
    public final void useCustomClose(final String str, final boolean z) {
        l5 l5Var = this.d;
        if (l5Var != null) {
            l5Var.c(o6.a, Intrinsics.f(Boolean.valueOf(z), "useCustomClose called:"));
        }
        new Handler(this.a.getContainerContext().getMainLooper()).post(new Runnable() {
            @Override
            public final void run() {
                n6.b(n6.this, z, str);
            }
        });
    }

    @JavascriptInterface
    public final void zoom(@NotNull String str, final int i) {
        l5 l5Var = this.d;
        if (l5Var != null) {
            l5Var.c(o6.a, "zoom is called " + str + ' ' + i);
        }
        ed.a(new Runnable() {
            @Override
            public final void run() {
                n6.a(n6.this, i);
            }
        });
    }

    public static final void b(n6 n6Var) {
        try {
            n6Var.a.v();
        } catch (Exception e) {
            l5 l5Var = n6Var.d;
            if (l5Var == null) {
                return;
            }
            c80.f(e, "SDK encountered unexpected error in getting/setting current position; ", l5Var, o6.a);
        }
    }

    public static final void b(n6 n6Var, String str) {
        try {
            n6Var.a.q();
        } catch (Exception e) {
            n6Var.a.b(str, "Unexpected error", "resize");
            String str2 = o6.a;
            p7.a((byte) 1, str2, "Could not resize ad; SDK encountered an unexpected error");
            l5 l5Var = n6Var.d;
            if (l5Var == null) {
                return;
            }
            c80.f(e, "SDK encountered an unexpected error in handling resize() request; ", l5Var, str2);
        }
    }

    public static final void a(n6 n6Var, String str, int i, String str2, float f, boolean z) {
        try {
            if (n6Var.a.getEmbeddedBrowserJSCallbacks() == null) {
                l5 l5Var = n6Var.d;
                if (l5Var == null) {
                    return;
                }
                l5Var.b(o6.a, "Found a null instance of EmbeddedBrowserJSCallback instance to customExpand");
                return;
            }
            l5 l5Var2 = n6Var.d;
            if (l5Var2 != null) {
                l5Var2.c(o6.a, Intrinsics.f(str, "Custom expand called. Url: "));
            }
            z3 z3Var = z3.values()[i];
            if (z3Var == z3.URL) {
                if (n6Var.a.getLandingPageHandler().d("customExpand", str2, str) == 3) {
                    a4 embeddedBrowserJSCallbacks = n6Var.a.getEmbeddedBrowserJSCallbacks();
                    if (embeddedBrowserJSCallbacks == null) {
                        return;
                    }
                    embeddedBrowserJSCallbacks.a(str, z3Var, f, z, n6Var.a.getViewTouchTimestamp(), n6Var.a.u());
                    return;
                }
                a4 embeddedBrowserJSCallbacks2 = n6Var.a.getEmbeddedBrowserJSCallbacks();
                if (embeddedBrowserJSCallbacks2 == null) {
                    return;
                }
                embeddedBrowserJSCallbacks2.a();
                return;
            }
            a4 embeddedBrowserJSCallbacks3 = n6Var.a.getEmbeddedBrowserJSCallbacks();
            if (embeddedBrowserJSCallbacks3 == null) {
                return;
            }
            embeddedBrowserJSCallbacks3.a(str, z3Var, f, z, n6Var.a.getViewTouchTimestamp(), n6Var.a.u());
        } catch (Exception e) {
            n6Var.a.b(str2, "Unexpected error", "customExpand");
            p7.a((byte) 1, "InMobi", "Failed to custom expand ad; SDK encountered an unexpected error");
            l5 l5Var3 = n6Var.d;
            if (l5Var3 == null) {
                return;
            }
            c80.f(e, "SDK encountered unexpected error in handling customExpand() request; ", l5Var3, o6.a);
        }
    }

    public static final void c(n6 n6Var) {
        try {
            n6Var.a.w();
        } catch (Exception e) {
            l5 l5Var = n6Var.d;
            if (l5Var == null) {
                return;
            }
            c80.f(e, "SDK encountered unexpected error in getting/setting default position; ", l5Var, o6.a);
        }
    }

    public static final void c(n6 n6Var, String str) {
        xa orientationProperties = n6Var.a.getOrientationProperties();
        if (orientationProperties != null) {
            xa xaVar = new xa();
            xaVar.d = str;
            try {
                JSONObject jSONObject = new JSONObject(str);
                xaVar.b = jSONObject.optString("forceOrientation", orientationProperties.b);
                xaVar.a = jSONObject.optBoolean("allowOrientationChange", orientationProperties.a);
                xaVar.c = jSONObject.optString("direction", orientationProperties.c);
                if (!Intrinsics.b(xaVar.b, Poster.TYPE_PORTRAIT) && !Intrinsics.b(xaVar.b, Poster.TYPE_LANDSCAPE)) {
                    xaVar.b = AzureActiveDirectoryAuthorizationRequest.Prompt.AUTO;
                }
                if (!Intrinsics.b(xaVar.c, "left") && !Intrinsics.b(xaVar.c, "right")) {
                    xaVar.c = "right";
                }
            } catch (JSONException unused) {
                xa.a aVar = xa.e;
                xaVar = null;
            }
            n6Var.c = xaVar;
        }
        xa xaVar2 = n6Var.c;
        if (xaVar2 != null) {
            n6Var.a.setOrientationProperties(xaVar2);
        }
    }

    public static final void b(n6 n6Var, boolean z, String str) {
        try {
            n6Var.a.e(z);
        } catch (Exception e) {
            n6Var.a.b(str, "Unexpected error", "useCustomClose");
            l5 l5Var = n6Var.d;
            if (l5Var == null) {
                return;
            }
            c80.f(e, "SDK encountered internal error in handling useCustomClose() request from creative; ", l5Var, o6.a);
        }
    }

    public static final void a(n6 n6Var) {
        if (n6Var.a.getEmbeddedBrowserJSCallbacks() == null) {
            l5 l5Var = n6Var.d;
            if (l5Var == null) {
                return;
            }
            l5Var.b(o6.a, "Found a null instance of EmbeddedBrowserJSCallback instance to closeCustomExpand");
            return;
        }
        a4 embeddedBrowserJSCallbacks = n6Var.a.getEmbeddedBrowserJSCallbacks();
        if (embeddedBrowserJSCallbacks == null) {
            return;
        }
        embeddedBrowserJSCallbacks.a();
    }

    public static final void a(n6 n6Var, String str) {
        try {
            i referenceContainer = n6Var.a.getReferenceContainer();
            if (referenceContainer == null) {
                return;
            }
            referenceContainer.a();
        } catch (Exception e) {
            n6Var.a.b(str, "Unexpected error", "close");
            p7.a((byte) 1, "InMobi", "Failed to close ad; SDK encountered an unexpected error");
            l5 l5Var = n6Var.d;
            if (l5Var == null) {
                return;
            }
            c80.f(e, "SDK encountered an expected error in handling the close() request from creative; ", l5Var, o6.a);
        }
    }

    public static final void a(n6 n6Var, boolean z, String str) {
        try {
            n6Var.a.d(z);
        } catch (Exception e) {
            n6Var.a.b(str, "Unexpected error", "disableCloseRegion");
            l5 l5Var = n6Var.d;
            if (l5Var == null) {
                return;
            }
            c80.f(e, "SDK encountered unexpected error in handling disableCloseRegion() request from creative; ", l5Var, o6.a);
        }
    }

    public static final void a(n6 n6Var, int i) {
        n6Var.a.setInitialScale(i);
    }
}