导航菜单

页面标题

页面副标题

CallApp v2.226 - X5.java 源代码

正在查看: CallApp v2.226 应用的 X5.java JAVA 源代码文件

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


package com.inmobi.media;

import android.R;
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.webkit.JavascriptInterface;
import android.webkit.URLUtil;
import android.widget.FrameLayout;
import com.inmobi.commons.core.configs.RootConfig;
import com.inmobi.media.X5;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Locale;
import kotlin.Unit;
import kotlin.jvm.functions.Function2;
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 X5 {
    public final Ya a;
    public final int b;
    public K9 c;
    public InterfaceC0239f5 d;

    public X5(int i, Ya mRenderView) {
        Intrinsics.checkNotNullParameter(mRenderView, "mRenderView");
        this.a = mRenderView;
        this.b = i;
    }

    public static final void a(X5 this$0, String str, String str2) {
        Intrinsics.checkNotNullParameter(this$0, "this$0");
        C0375o6.a(this$0.a.getLandingPageHandler(), "open", str, str2, null, false, 24);
    }

    public static final void b(X5 this$0, String str, String str2) {
        Intrinsics.checkNotNullParameter(this$0, "this$0");
        try {
            this$0.a.getLandingPageHandler().d("openEmbedded", str, str2, null);
        } catch (Exception e) {
            this$0.a.a(str, "Unexpected error", "openEmbedded");
            I6.a((byte) 1, "InMobi", "Failed to open URL; SDK encountered unexpected error");
            InterfaceC0239f5 interfaceC0239f5 = this$0.d;
            if (interfaceC0239f5 != null) {
                String str3 = Y5.a;
                ((C0254g5) interfaceC0239f5).b(str3, Ed.a(e, AbstractC0300j6.a(str3, "access$getTAG$p(...)", "SDK encountered unexpected error in handling openEmbedded() request from creative; ")));
            }
        }
    }

    public static final void c(X5 this$0, String str, String str2) {
        Intrinsics.checkNotNullParameter(this$0, "this$0");
        C0375o6.a(this$0.a.getLandingPageHandler(), "openWithoutTracker", str, str2, null, true, 8);
    }

    public static final void d(X5 this$0, String str, String str2) {
        Intrinsics.checkNotNullParameter(this$0, "this$0");
        try {
            Ya ya = this$0.a;
            int length = str2.length() - 1;
            int i = 0;
            boolean z = false;
            while (i <= length) {
                boolean z2 = Intrinsics.f(str2.charAt(!z ? i : length), 32) <= 0;
                if (z) {
                    if (!z2) {
                        break;
                    } else {
                        length--;
                    }
                } else if (z2) {
                    i++;
                } else {
                    z = true;
                }
            }
            ya.b(str, str2.subSequence(i, length + 1).toString());
        } catch (Exception e) {
            this$0.a.a(str, "Unexpected error", "playVideo");
            I6.a((byte) 1, "InMobi", "Error playing video; SDK encountered an unexpected error");
            InterfaceC0239f5 interfaceC0239f5 = this$0.d;
            if (interfaceC0239f5 != null) {
                String str3 = Y5.a;
                ((C0254g5) interfaceC0239f5).b(str3, Ed.a(e, AbstractC0300j6.a(str3, "access$getTAG$p(...)", "SDK encountered unexpected error in handling playVideo() request from creative; ")));
            }
        }
    }

    @JavascriptInterface
    public final void asyncPing(String str, @NotNull String url) {
        Intrinsics.checkNotNullParameter(url, "url");
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 != null) {
            String str2 = Y5.a;
            ((C0254g5) interfaceC0239f5).a(str2, AbstractC0315k6.a(str2, "access$getTAG$p(...)", "asyncPing called: ", url));
        }
        if (!URLUtil.isValidUrl(url)) {
            this.a.a(str, "Invalid url", "asyncPing");
            return;
        }
        try {
            C0333l9 c0333l9 = new C0333l9(url, this.d);
            c0333l9.x = false;
            c0333l9.t = false;
            c0333l9.u = false;
            c0333l9.a(new C0441t1(new C0455u1(c0333l9, new W5(this))));
        } catch (Exception e) {
            this.a.a(str, "Unexpected error", "asyncPing");
            InterfaceC0239f5 interfaceC0239f52 = this.d;
            if (interfaceC0239f52 != null) {
                String str3 = Y5.a;
                ((C0254g5) interfaceC0239f52).b(str3, Ed.a(e, AbstractC0300j6.a(str3, "access$getTAG$p(...)", "SDK encountered internal error in handling asyncPing() request from creative; ")));
            }
        }
    }

    @JavascriptInterface
    public final void cancelSaveContent(String str, @NotNull String mediaId) {
        Intrinsics.checkNotNullParameter(mediaId, "mediaId");
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 != null) {
            String str2 = Y5.a;
            ((C0254g5) interfaceC0239f5).a(str2, AbstractC0315k6.a(str2, "access$getTAG$p(...)", "cancelSaveContent called. mediaId:", mediaId));
        }
    }

    @JavascriptInterface
    public final void close(String str) {
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 != null) {
            String str2 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str2, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f5).a(str2, "close called");
        }
        if (!this.a.z0) {
            new Handler(this.a.getContainerContext().getMainLooper()).post(new gn.d0(this, str, 0));
            return;
        }
        InterfaceC0239f5 interfaceC0239f52 = this.d;
        if (interfaceC0239f52 != null) {
            String str3 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str3, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f52).b(str3, "close called on unloaded ad");
        }
    }

    @JavascriptInterface
    public final void closeAll(String str) {
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 != null) {
            String str2 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str2, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f5).a(str2, "closeAll is called");
        }
        Ya ya = this.a;
        InterfaceC0239f5 interfaceC0239f52 = ya.i;
        if (interfaceC0239f52 != null) {
            String str3 = Ya.P0;
            ((C0254g5) interfaceC0239f52).a(str3, Wa.a(ya, str3, "TAG", "closeAll "));
        }
        Z z = ya.V;
        if (z != null) {
            z.b();
        }
        Activity activity = (Activity) ya.k.get();
        if (activity != null) {
            activity.finish();
        }
    }

    @JavascriptInterface
    public final void closeCustomExpand(String str) {
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 != null) {
            String str2 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str2, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f5).a(str2, "closeCustomExpand called.");
        }
        if (this.b != 1) {
            InterfaceC0239f5 interfaceC0239f52 = this.d;
            if (interfaceC0239f52 != null) {
                String str3 = Y5.a;
                StringBuilder a = AbstractC0300j6.a(str3, "access$getTAG$p(...)", "closeCustomExpand called in incorrect Ad type: ");
                a.append(this.b);
                ((C0254g5) interfaceC0239f52).b(str3, a.toString());
                return;
            }
            return;
        }
        if (this.a != null) {
            new Handler(this.a.getContainerContext().getMainLooper()).post(new gn.h0(this, 0));
            return;
        }
        InterfaceC0239f5 interfaceC0239f53 = this.d;
        if (interfaceC0239f53 != null) {
            String str4 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str4, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f53).b(str4, "Found a null instance of render view!");
        }
    }

    @JavascriptInterface
    public final void customExpand(String str, String str2, int i, float f, boolean z, boolean z2) {
        C0446t6 c0446t6;
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 != null) {
            String str3 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str3, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f5).a(str3, "customExpand called");
        }
        if (this.a.z0) {
            InterfaceC0239f5 interfaceC0239f52 = this.d;
            if (interfaceC0239f52 != null) {
                String str4 = Y5.a;
                Intrinsics.checkNotNullExpressionValue(str4, "access$getTAG$p(...)");
                ((C0254g5) interfaceC0239f52).b(str4, "customExpand called on unloaded ad");
                return;
            }
            return;
        }
        if (this.b != 1) {
            InterfaceC0239f5 interfaceC0239f53 = this.d;
            if (interfaceC0239f53 != null) {
                String str5 = Y5.a;
                StringBuilder a = AbstractC0300j6.a(str5, "access$getTAG$p(...)", "customExpand called in incorrect Ad type: ");
                a.append(this.b);
                ((C0254g5) interfaceC0239f53).b(str5, a.toString());
                return;
            }
            return;
        }
        if (str2 != null) {
            int length = str2.length() - 1;
            int i2 = 0;
            boolean z3 = false;
            while (i2 <= length) {
                boolean z4 = Intrinsics.f(str2.charAt(!z3 ? i2 : length), 32) <= 0;
                if (z3) {
                    if (!z4) {
                        break;
                    } else {
                        length--;
                    }
                } else if (z4) {
                    i2++;
                } else {
                    z3 = true;
                }
            }
            if (str2.subSequence(i2, length + 1).toString().length() != 0) {
                if (i < 0 || i >= R3.values().length) {
                    this.a.a(str, "Invalid inputType", "customExpand");
                    return;
                }
                if (f < 0.0f || f > 1.0f) {
                    this.a.a(str, "Invalid screenPercentage", "customExpand");
                    return;
                }
                C0460u6 c0460u6 = this.a.getLandingPageHandler().f;
                if (c0460u6 != null) {
                    String a2 = C0330l6.a(str2);
                    C0375o6 landingPageHandler = this.a.getLandingPageHandler();
                    int i3 = landingPageHandler.h + 1;
                    landingPageHandler.h = i3;
                    c0446t6 = new C0446t6(c0460u6, a2, i3, 8);
                } else {
                    c0446t6 = null;
                }
                C0446t6 c0446t62 = c0446t6;
                if (c0446t62 != null) {
                    c0446t62.g = "IN_CUSTOM";
                }
                C0375o6 landingPageHandler2 = this.a.getLandingPageHandler();
                EnumC0270h6 funnelState = EnumC0270h6.d;
                landingPageHandler2.getClass();
                Intrinsics.checkNotNullParameter(funnelState, "funnelState");
                C0330l6.a(funnelState, c0446t62, (Integer) 8008, (Function2) new C0360n6(landingPageHandler2));
                a(str, str2, i, f, z2, c0446t62);
                return;
            }
        }
        this.a.a(str, "Invalid " + i, "customExpand");
    }

    @JavascriptInterface
    public final void customExpandInNative(String str, @NotNull String url, float f, boolean z) {
        C0446t6 c0446t6;
        Intrinsics.checkNotNullParameter(url, "url");
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 != null) {
            String str2 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str2, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f5).a(str2, "customExpandInNative called");
        }
        Ya ya = this.a;
        if (ya.z0) {
            InterfaceC0239f5 interfaceC0239f52 = this.d;
            if (interfaceC0239f52 != null) {
                String str3 = Y5.a;
                Intrinsics.checkNotNullExpressionValue(str3, "access$getTAG$p(...)");
                ((C0254g5) interfaceC0239f52).b(str3, "customExpandInNative called on unloaded ad");
                return;
            }
            return;
        }
        if (this.b != 1) {
            InterfaceC0239f5 interfaceC0239f53 = this.d;
            if (interfaceC0239f53 != null) {
                String str4 = Y5.a;
                StringBuilder a = AbstractC0300j6.a(str4, "access$getTAG$p(...)", "customExpandInNative called in incorrect Ad type: ");
                a.append(this.b);
                ((C0254g5) interfaceC0239f53).b(str4, a.toString());
                return;
            }
            return;
        }
        if (f < 0.0f || f > 1.0f) {
            ya.a(str, "Invalid screenPercentage", "customExpandInNative");
            return;
        }
        C0460u6 c0460u6 = ya.getLandingPageHandler().f;
        if (c0460u6 != null) {
            String a2 = C0330l6.a(url);
            C0375o6 landingPageHandler = this.a.getLandingPageHandler();
            int i = landingPageHandler.h + 1;
            landingPageHandler.h = i;
            c0446t6 = new C0446t6(c0460u6, a2, i, 8);
        } else {
            c0446t6 = null;
        }
        C0446t6 c0446t62 = c0446t6;
        if (c0446t62 != null) {
            c0446t62.g = "IN_NATIVE";
        }
        C0375o6 landingPageHandler2 = this.a.getLandingPageHandler();
        EnumC0270h6 funnelState = EnumC0270h6.d;
        landingPageHandler2.getClass();
        Intrinsics.checkNotNullParameter(funnelState, "funnelState");
        C0330l6.a(funnelState, c0446t62, (Integer) 8010, (Function2) new C0360n6(landingPageHandler2));
        int a3 = this.a.getLandingPageHandler().a("customExpandInNative", str, url, c0446t62, new C0251g2(f, z));
        InterfaceC0239f5 interfaceC0239f54 = this.d;
        if (interfaceC0239f54 != null) {
            String str5 = Y5.a;
            ((C0254g5) interfaceC0239f54).a(str5, AbstractC0504x8.a(str5, "access$getTAG$p(...)", "customExpandInNativeRequest: ", a3));
        }
        if (a3 == 3) {
            R3 r3 = R3.a;
            a(str, url, 0, f, !z, c0446t62);
        }
    }

    @JavascriptInterface
    public final void disableBackButton(String str, boolean z) {
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 != null) {
            String str2 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str2, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f5).a(str2, "disableBackButton called");
        }
        Ya ya = this.a;
        if (ya != null) {
            ya.setDisableBackButton(z);
            return;
        }
        InterfaceC0239f5 interfaceC0239f52 = this.d;
        if (interfaceC0239f52 != null) {
            String str3 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str3, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f52).b(str3, "Found a null instance of render view!");
        }
    }

    @JavascriptInterface
    public final void disableCloseRegion(String str, boolean z) {
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 != null) {
            String str2 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str2, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f5).a(str2, "disableCloseRegion called");
        }
        if (this.a != null) {
            new Handler(this.a.getContainerContext().getMainLooper()).post(new gn.f0(this, z, str, 1));
            return;
        }
        InterfaceC0239f5 interfaceC0239f52 = this.d;
        if (interfaceC0239f52 != null) {
            String str3 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str3, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f52).b(str3, "Found a null instance of render view!");
        }
    }

    @JavascriptInterface
    public final void fireAdFailed(String str) {
        try {
            InterfaceC0239f5 interfaceC0239f5 = this.d;
            if (interfaceC0239f5 != null) {
                String str2 = Y5.a;
                Intrinsics.checkNotNullExpressionValue(str2, "access$getTAG$p(...)");
                ((C0254g5) interfaceC0239f5).a(str2, "fireAdFailed called.");
            }
            this.a.g();
        } catch (Exception e) {
            this.a.a(str, "Unexpected error", "fireAdFailed");
            InterfaceC0239f5 interfaceC0239f52 = this.d;
            if (interfaceC0239f52 != null) {
                String str3 = Y5.a;
                ((C0254g5) interfaceC0239f52).b(str3, Ed.a(e, AbstractC0300j6.a(str3, "access$getTAG$p(...)", "SDK encountered unexpected error in handling fireAdFailed() signal from creative; ")));
            }
        }
    }

    @JavascriptInterface
    public final void fireAdReady(String str) {
        try {
            InterfaceC0239f5 interfaceC0239f5 = this.d;
            if (interfaceC0239f5 != null) {
                String str2 = Y5.a;
                Intrinsics.checkNotNullExpressionValue(str2, "access$getTAG$p(...)");
                ((C0254g5) interfaceC0239f5).a(str2, "fireAdReady called.");
            }
            this.a.h();
        } catch (Exception e) {
            this.a.a(str, "Unexpected error", "fireAdReady");
            InterfaceC0239f5 interfaceC0239f52 = this.d;
            if (interfaceC0239f52 != null) {
                String str3 = Y5.a;
                ((C0254g5) interfaceC0239f52).b(str3, Ed.a(e, AbstractC0300j6.a(str3, "access$getTAG$p(...)", "SDK encountered unexpected error in handling fireAdReady() signal from creative; ")));
            }
        }
    }

    @JavascriptInterface
    public final void fireComplete(String str) {
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 != null) {
            String str2 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str2, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f5).a(str2, "fireComplete is called");
        }
        Ya ya = this.a;
        if (ya == null) {
            InterfaceC0239f5 interfaceC0239f52 = this.d;
            if (interfaceC0239f52 != null) {
                String str3 = Y5.a;
                Intrinsics.checkNotNullExpressionValue(str3, "access$getTAG$p(...)");
                ((C0254g5) interfaceC0239f52).b(str3, "Found a null instance of render view!");
                return;
            }
            return;
        }
        InterfaceC0239f5 interfaceC0239f53 = ya.i;
        if (interfaceC0239f53 != null) {
            String str4 = Ya.P0;
            ((C0254g5) interfaceC0239f53).c(str4, Wa.a(ya, str4, "TAG", "completeFromInterActive "));
        }
        Z2 z2 = ya.I0;
        if (z2 != null && !z2.g.get()) {
            z2.d.i = 1;
            Intrinsics.c(z2.c);
        }
        InterfaceC0239f5 interfaceC0239f54 = ya.i;
        if (interfaceC0239f54 != null) {
            String TAG = Ya.P0;
            Intrinsics.checkNotNullExpressionValue(TAG, "TAG");
            ((C0254g5) interfaceC0239f54).a(TAG, "completeFromInterActive");
        }
    }

    @JavascriptInterface
    public final void fireSkip(String str) {
        InterfaceC0239f5 interfaceC0239f5;
        InterfaceC0239f5 interfaceC0239f52 = this.d;
        if (interfaceC0239f52 != null) {
            String str2 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str2, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f52).a(str2, "fireSkip is called");
        }
        if (this.a == null && (interfaceC0239f5 = this.d) != null) {
            String str3 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str3, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f5).b(str3, "Found a null instance of render view!");
        }
        Ya ya = this.a;
        InterfaceC0239f5 interfaceC0239f53 = ya.i;
        if (interfaceC0239f53 != null) {
            String str4 = Ya.P0;
            ((C0254g5) interfaceC0239f53).c(str4, Wa.a(ya, str4, "TAG", "skipFromInterActive "));
        }
        Z2 z2 = ya.I0;
        if (z2 != null && !z2.g.get()) {
            z2.d.h = 1;
            Intrinsics.c(z2.c);
        }
        InterfaceC0239f5 interfaceC0239f54 = ya.i;
        if (interfaceC0239f54 != null) {
            String TAG = Ya.P0;
            Intrinsics.checkNotNullExpressionValue(TAG, "TAG");
            ((C0254g5) interfaceC0239f54).a(TAG, "skipFromInterActive");
        }
    }

    @JavascriptInterface
    public final String getAdContext(String str) {
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 != null) {
            String str2 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str2, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f5).a(str2, "getAdContext is called");
        }
        Z adPodHandler = this.a.getAdPodHandler();
        if (adPodHandler != null) {
            return ((Q0) adPodHandler).K();
        }
        return null;
    }

    @JavascriptInterface
    public final void getBlob(String str, String str2) {
        Z1 z1;
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 != null) {
            String str3 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str3, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f5).a(str3, "getBlob is called");
        }
        Ya ya = this.a;
        if (ya == null) {
            InterfaceC0239f5 interfaceC0239f52 = this.d;
            if (interfaceC0239f52 != null) {
                String str4 = Y5.a;
                Intrinsics.checkNotNullExpressionValue(str4, "access$getTAG$p(...)");
                ((C0254g5) interfaceC0239f52).b(str4, "Found a null instance of render view!");
                return;
            }
            return;
        }
        InterfaceC0239f5 interfaceC0239f53 = ya.i;
        if (interfaceC0239f53 != null) {
            String TAG = Ya.P0;
            Intrinsics.checkNotNullExpressionValue(TAG, "TAG");
            ((C0254g5) interfaceC0239f53).a(TAG, "getBlob");
        }
        if (str == null || str2 == null || (z1 = ya.R) == null) {
            return;
        }
        ((Q0) z1).a(str, str2, ya, ya.getImpressionId());
    }

    @JavascriptInterface
    @NotNull
    public final String getCurrentPosition(String str) {
        Ya ya;
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 != null) {
            String str2 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str2, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f5).a(str2, "getCurrentPosition called");
        }
        Ya ya2 = this.a;
        if (ya2 == null) {
            InterfaceC0239f5 interfaceC0239f52 = this.d;
            if (interfaceC0239f52 == null) {
                return RootConfig.DEFAULT_URL;
            }
            String str3 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str3, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f52).b(str3, "Found a null instance of render view!");
            return RootConfig.DEFAULT_URL;
        }
        synchronized (ya2.getCurrentPositionMonitor()) {
            this.a.w = true;
            new Handler(this.a.getContainerContext().getMainLooper()).post(new gn.h0(this, 1));
            while (true) {
                ya = this.a;
                if (ya.w) {
                    try {
                        ya.getCurrentPositionMonitor().wait();
                    } catch (InterruptedException unused) {
                    }
                } else {
                    Unit unit = Unit.a;
                }
            }
        }
        return ya.getCurrentPosition();
    }

    @JavascriptInterface
    public final int getCurrentRenderingIndex(String str) {
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 != null) {
            String str2 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str2, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f5).a(str2, "getCurrentRenderingIndex is called");
        }
        return this.a.getCurrentRenderingPodAdIndex();
    }

    @JavascriptInterface
    @NotNull
    public final String getDefaultPosition(String str) {
        Ya ya;
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 != null) {
            String str2 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str2, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f5).a(str2, "getDefaultPosition called");
        }
        Ya ya2 = this.a;
        if (ya2 == null) {
            InterfaceC0239f5 interfaceC0239f52 = this.d;
            if (interfaceC0239f52 != null) {
                String str3 = Y5.a;
                Intrinsics.checkNotNullExpressionValue(str3, "access$getTAG$p(...)");
                ((C0254g5) interfaceC0239f52).b(str3, "Found a null instance of render view!");
            }
            String jSONObject = new JSONObject().toString();
            Intrinsics.checkNotNullExpressionValue(jSONObject, "toString(...)");
            return jSONObject;
        }
        synchronized (ya2.getDefaultPositionMonitor()) {
            this.a.v = true;
            new Handler(this.a.getContainerContext().getMainLooper()).post(new gn.h0(this, 2));
            while (true) {
                ya = this.a;
                if (ya.v) {
                    try {
                        ya.getDefaultPositionMonitor().wait();
                    } catch (InterruptedException unused) {
                    }
                } else {
                    Unit unit = Unit.a;
                }
            }
        }
        return ya.getDefaultPosition();
    }

    @JavascriptInterface
    public final int getDeviceVolume(String str) {
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 != null) {
            String str2 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str2, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f5).a(str2, "getDeviceVolume called");
        }
        Ya ya = this.a;
        if (ya == null) {
            InterfaceC0239f5 interfaceC0239f52 = this.d;
            if (interfaceC0239f52 != null) {
                String str3 = Y5.a;
                Intrinsics.checkNotNullExpressionValue(str3, "access$getTAG$p(...)");
                ((C0254g5) interfaceC0239f52).b(str3, "Found a null instance of render view!");
            }
            return -1;
        }
        try {
            C0241f7 mediaProcessor = ya.getMediaProcessor();
            if (mediaProcessor != null) {
                return mediaProcessor.a();
            }
        } catch (Exception e) {
            this.a.a(str, "Unexpected error", "getDeviceVolume");
            InterfaceC0239f5 interfaceC0239f53 = this.d;
            if (interfaceC0239f53 != null) {
                String str4 = Y5.a;
                ((C0254g5) interfaceC0239f53).b(str4, Ed.a(e, AbstractC0300j6.a(str4, "access$getTAG$p(...)", "SDK encountered unexpected error in handling getDeviceVolume() request from creative; ")));
            }
        }
        return -1;
    }

    @JavascriptInterface
    public final int getMaxDeviceVolume(String str) {
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 != null) {
            String str2 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str2, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f5).a(str2, "getMaxDeviceVolume called");
        }
        try {
            return E3.a.m();
        } catch (Exception e) {
            this.a.a(str, "Unexpected error", "getMaxDeviceVolume");
            InterfaceC0239f5 interfaceC0239f52 = this.d;
            if (interfaceC0239f52 == null) {
                return 0;
            }
            String str3 = Y5.a;
            ((C0254g5) interfaceC0239f52).b(str3, Ed.a(e, AbstractC0300j6.a(str3, "access$getTAG$p(...)", "SDK encountered unexpected error in handling getMaxDeviceVolume() request from creative; ")));
            return 0;
        }
    }

    @JavascriptInterface
    @NotNull
    public final String getMaxSize(String str) {
        int i;
        int i2;
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 != null) {
            String str2 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str2, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f5).a(str2, "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);
                }
                Context containerContext2 = this.a.getContainerContext();
                Intrinsics.d(containerContext2, "null cannot be cast to non-null type android.app.Activity");
                fullScreenActivity = (Activity) containerContext2;
            }
            FrameLayout frameLayout = (FrameLayout) fullScreenActivity.findViewById(R.id.content);
            int b = AbstractC0512y2.b(frameLayout.getWidth() / N3.b());
            int b2 = AbstractC0512y2.b(frameLayout.getHeight() / N3.b());
            if (this.a.getFullScreenActivity() != null && (b == 0 || b2 == 0)) {
                V5 v5 = new V5(frameLayout, this.d);
                frameLayout.getViewTreeObserver().addOnGlobalLayoutListener(v5);
                Boolean bool = Boolean.FALSE;
                synchronized (bool) {
                    try {
                        bool.wait();
                    } catch (InterruptedException unused) {
                    }
                    i = v5.c;
                    i2 = v5.d;
                    Unit unit = Unit.a;
                }
                b2 = i2;
                b = i;
            }
            try {
                jSONObject.put("width", b);
                jSONObject.put("height", b2);
            } catch (JSONException e) {
                InterfaceC0239f5 interfaceC0239f52 = this.d;
                if (interfaceC0239f52 != null) {
                    String str3 = Y5.a;
                    Intrinsics.checkNotNullExpressionValue(str3, "access$getTAG$p(...)");
                    ((C0254g5) interfaceC0239f52).a(str3, "Error while creating max size Json.", e);
                }
            }
            InterfaceC0239f5 interfaceC0239f53 = this.d;
            if (interfaceC0239f53 != null) {
                String str4 = Y5.a;
                Intrinsics.checkNotNullExpressionValue(str4, "access$getTAG$p(...)");
                ((C0254g5) interfaceC0239f53).a(str4, "getMaxSize called:" + jSONObject);
            }
        } catch (Exception e2) {
            this.a.a(str, "Unexpected error", "getMaxSize");
            InterfaceC0239f5 interfaceC0239f54 = this.d;
            if (interfaceC0239f54 != null) {
                String str5 = Y5.a;
                ((C0254g5) interfaceC0239f54).b(str5, Ed.a(e2, AbstractC0300j6.a(str5, "access$getTAG$p(...)", "SDK encountered unexpected error in handling getMaxSize() request from creative; ")));
            }
        }
        String jSONObject2 = jSONObject.toString();
        Intrinsics.checkNotNullExpressionValue(jSONObject2, "toString(...)");
        return jSONObject2;
    }

    @JavascriptInterface
    @NotNull
    public final String getOrientation(String str) {
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 != null) {
            String str2 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str2, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f5).a(str2, "getOrientation called");
        }
        byte g = N3.g();
        return g == 1 ? "0" : g == 3 ? "90" : g == 2 ? "180" : g == 4 ? "270" : "-1";
    }

    @JavascriptInterface
    @NotNull
    public final String getOrientationProperties(String str) {
        K9 k9 = this.c;
        String str2 = k9 != null ? k9.d : null;
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 != null) {
            String str3 = Y5.a;
            ((C0254g5) interfaceC0239f5).a(str3, AbstractC0315k6.a(str3, "access$getTAG$p(...)", "getOrientationProperties called: ", str2));
        }
        Intrinsics.c(str2);
        return str2;
    }

    @JavascriptInterface
    @NotNull
    public final String getPlacementType(String str) {
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 != null) {
            String str2 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str2, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f5).a(str2, "getPlacementType called");
        }
        return 1 == this.b ? "interstitial" : "inline";
    }

    @JavascriptInterface
    @NotNull
    public final String getPlatform(String str) {
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 == null) {
            return "android";
        }
        String str2 = Y5.a;
        Intrinsics.checkNotNullExpressionValue(str2, "access$getTAG$p(...)");
        ((C0254g5) interfaceC0239f5).a(str2, "getPlatform. Platform:android");
        return "android";
    }

    @JavascriptInterface
    @NotNull
    public final String getPlatformVersion(String str) {
        String valueOf = String.valueOf(Build.VERSION.SDK_INT);
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 != null) {
            String str2 = Y5.a;
            ((C0254g5) interfaceC0239f5).a(str2, AbstractC0315k6.a(str2, "access$getTAG$p(...)", "getPlatformVersion. Version:", valueOf));
        }
        return valueOf;
    }

    @JavascriptInterface
    @NotNull
    public final String getRenderableAdIndexes(String str) {
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 != null) {
            String str2 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str2, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f5).a(str2, "getRenderableAdIndexes is called");
        }
        JSONArray renderableAdIndexes = this.a.getRenderableAdIndexes();
        InterfaceC0239f5 interfaceC0239f52 = this.d;
        if (interfaceC0239f52 != null) {
            String str3 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str3, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f52).a(str3, "renderableAdIndexes called:" + renderableAdIndexes);
        }
        String jSONArray = renderableAdIndexes.toString();
        Intrinsics.checkNotNullExpressionValue(jSONArray, "toString(...)");
        return jSONArray;
    }

    @JavascriptInterface
    public final String getSafeArea(String str) {
        JSONObject safeArea = this.a.getSafeArea();
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 != null) {
            String str2 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str2, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f5).a(str2, "getSafeArea called:" + safeArea);
        }
        if (safeArea != null) {
            return safeArea.toString();
        }
        return null;
    }

    @JavascriptInterface
    @NotNull
    public final String getScreenSize(String str) {
        JSONObject jSONObject = new JSONObject();
        try {
            jSONObject.put("width", N3.h().a);
            jSONObject.put("height", N3.h().b);
            InterfaceC0239f5 interfaceC0239f5 = this.d;
            if (interfaceC0239f5 != null) {
                String str2 = Y5.a;
                Intrinsics.checkNotNullExpressionValue(str2, "access$getTAG$p(...)");
                ((C0254g5) interfaceC0239f5).c(str2, "Message:Width x Height : " + N3.h().a + 'x' + N3.h().b);
            }
        } catch (JSONException unused) {
        } catch (Exception e) {
            this.a.a(str, "Unexpected error", "getScreenSize");
            InterfaceC0239f5 interfaceC0239f52 = this.d;
            if (interfaceC0239f52 != null) {
                String str3 = Y5.a;
                ((C0254g5) interfaceC0239f52).b(str3, Ed.a(e, AbstractC0300j6.a(str3, "access$getTAG$p(...)", "SDK encountered unexpected error while getting screen dimensions; ")));
            }
        }
        String jSONObject2 = jSONObject.toString();
        Intrinsics.checkNotNullExpressionValue(jSONObject2, "toString(...)");
        InterfaceC0239f5 interfaceC0239f53 = this.d;
        if (interfaceC0239f53 != null) {
            String str4 = Y5.a;
            ((C0254g5) interfaceC0239f53).a(str4, AbstractC0315k6.a(str4, "access$getTAG$p(...)", "getScreenSize called:", jSONObject2));
        }
        return jSONObject2;
    }

    @JavascriptInterface
    @NotNull
    public final String getSdkVersion(String str) {
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 == null) {
            return "10.8.3";
        }
        String str2 = Y5.a;
        Intrinsics.checkNotNullExpressionValue(str2, "access$getTAG$p(...)");
        ((C0254g5) interfaceC0239f5).a(str2, "getSdkVersion called. Version:10.8.3");
        return "10.8.3";
    }

    @JavascriptInterface
    public final long getShowTimeStamp(String str) {
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 != null) {
            String str2 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str2, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f5).a(str2, "getShowTimeStamp is called");
        }
        long showTimeStamp = this.a.getShowTimeStamp();
        InterfaceC0239f5 interfaceC0239f52 = this.d;
        if (interfaceC0239f52 != null) {
            String str3 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str3, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f52).a(str3, "getShowTimeStamp is " + showTimeStamp);
        }
        return showTimeStamp;
    }

    @JavascriptInterface
    @NotNull
    public final String getState(String str) {
        String viewState = this.a.getViewState();
        Locale locale = Locale.ENGLISH;
        String f = s4.y.f(locale, "ENGLISH", viewState, locale, "this as java.lang.String).toLowerCase(locale)");
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 != null) {
            String str2 = Y5.a;
            ((C0254g5) interfaceC0239f5).c(str2, AbstractC0315k6.a(str2, "access$getTAG$p(...)", "getState called:", f));
        }
        return f;
    }

    @JavascriptInterface
    @NotNull
    public final String getVersion(String str) {
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 == null) {
            return "2.0";
        }
        String str2 = Y5.a;
        Intrinsics.checkNotNullExpressionValue(str2, "access$getTAG$p(...)");
        ((C0254g5) interfaceC0239f5).a(str2, "getVersion called. Version:2.0");
        return "2.0";
    }

    @JavascriptInterface
    public final void impressionFired(String str) {
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 != null) {
            String str2 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str2, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f5).a(str2, "impressionFired is called");
        }
        Ya ya = this.a;
        InterfaceC0239f5 interfaceC0239f52 = ya.i;
        if (interfaceC0239f52 != null) {
            String str3 = Ya.P0;
            ((C0254g5) interfaceC0239f52).a(str3, Wa.a(ya, str3, "TAG", "onImpressionFired "));
        }
        InterfaceC0239f5 interfaceC0239f53 = ya.i;
        if (interfaceC0239f53 != null) {
            String str4 = Ya.P0;
            ((C0254g5) interfaceC0239f53).a(str4, Wa.a(ya, str4, "TAG", "recordContextualData "));
        }
        Z2 z2 = ya.I0;
        if (z2 != null) {
            z2.a();
        }
        ya.getListener().a(ya.getTelemetryOnAdImpression());
    }

    @JavascriptInterface
    public final void incentCompleted(String str, String str2) {
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 != null) {
            String str3 = Y5.a;
            ((C0254g5) interfaceC0239f5).a(str3, AbstractC0315k6.a(str3, "access$getTAG$p(...)", "incentCompleted called. IncentData:", str2));
        }
        if (str2 == null) {
            try {
                this.a.getListener().b(new HashMap());
                return;
            } catch (Exception e) {
                this.a.a(str, "Unexpected error", "incentCompleted");
                InterfaceC0239f5 interfaceC0239f52 = this.d;
                if (interfaceC0239f52 != null) {
                    String str4 = Y5.a;
                    ((C0254g5) interfaceC0239f52).b(str4, Ed.a(e, AbstractC0300j6.a(str4, "access$getTAG$p(...)", "SDK encountered unexpected error in handling onUserInteraction() signal from creative; ")));
                    return;
                }
                return;
            }
        }
        try {
            JSONObject jSONObject = new JSONObject(str2);
            HashMap hashMap = new HashMap();
            Iterator<String> keys = jSONObject.keys();
            Intrinsics.checkNotNullExpressionValue(keys, "keys(...)");
            while (keys.hasNext()) {
                String next = keys.next();
                Intrinsics.d(next, "null cannot be cast to non-null type kotlin.String");
                String str5 = next;
                Object obj = jSONObject.get(str5);
                Intrinsics.c(obj);
                hashMap.put(str5, obj);
            }
            try {
                try {
                    this.a.getListener().b(hashMap);
                } catch (Exception e2) {
                    this.a.a(str, "Unexpected error", "incentCompleted");
                    InterfaceC0239f5 interfaceC0239f53 = this.d;
                    if (interfaceC0239f53 != null) {
                        String str6 = Y5.a;
                        Intrinsics.checkNotNullExpressionValue(str6, "access$getTAG$p(...)");
                        ((C0254g5) interfaceC0239f53).b(str6, "SDK encountered unexpected error in handling onUserInteraction() signal from creative; " + e2.getMessage());
                    }
                }
            } catch (Exception e3) {
                this.a.a(str, "Unexpected error", "incentCompleted");
                InterfaceC0239f5 interfaceC0239f54 = this.d;
                if (interfaceC0239f54 != null) {
                    String str7 = Y5.a;
                    ((C0254g5) interfaceC0239f54).b(str7, Ed.a(e3, AbstractC0300j6.a(str7, "access$getTAG$p(...)", "SDK encountered unexpected error in handling onUserInteraction() signal from creative; ")));
                }
            }
        } catch (JSONException unused) {
            this.a.getListener().b(new HashMap());
        }
    }

    @JavascriptInterface
    public final boolean isBackButtonDisabled(String str) {
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 != null) {
            String str2 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str2, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f5).a(str2, "isBackButtonDisabled called");
        }
        Ya ya = this.a;
        if (ya != null) {
            return ya.B;
        }
        InterfaceC0239f5 interfaceC0239f52 = this.d;
        if (interfaceC0239f52 == null) {
            return false;
        }
        String str3 = Y5.a;
        Intrinsics.checkNotNullExpressionValue(str3, "access$getTAG$p(...)");
        ((C0254g5) interfaceC0239f52).b(str3, "Found a null instance of render view!");
        return false;
    }

    @JavascriptInterface
    @NotNull
    public final String isDeviceMuted(String str) {
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 != null) {
            String str2 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str2, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f5).a(str2, "isDeviceMuted called");
        }
        if (this.a == null) {
            InterfaceC0239f5 interfaceC0239f52 = this.d;
            if (interfaceC0239f52 == null) {
                return "false";
            }
            String str3 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str3, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f52).b(str3, "Found a null instance of render view!");
            return "false";
        }
        InterfaceC0239f5 interfaceC0239f53 = this.d;
        if (interfaceC0239f53 != null) {
            String str4 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str4, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f53).a(str4, "JavaScript called: isDeviceMuted()");
        }
        boolean z = false;
        try {
            C0241f7 mediaProcessor = this.a.getMediaProcessor();
            Intrinsics.c(mediaProcessor);
            InterfaceC0239f5 interfaceC0239f54 = mediaProcessor.b;
            if (interfaceC0239f54 != null) {
                ((C0254g5) interfaceC0239f54).c("MraidMediaProcessor", "isVolumeMuted");
            }
            Context d = Kb.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) {
            InterfaceC0239f5 interfaceC0239f55 = this.d;
            if (interfaceC0239f55 != null) {
                String str5 = Y5.a;
                ((C0254g5) interfaceC0239f55).b(str5, Ed.a(e, AbstractC0300j6.a(str5, "access$getTAG$p(...)", "SDK encountered unexpected error in checking if device is muted; ")));
            }
        }
        return String.valueOf(z);
    }

    @JavascriptInterface
    @NotNull
    public final String isHeadphonePlugged(String str) {
        boolean z;
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 != null) {
            String str2 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str2, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f5).a(str2, "isHeadphonePlugged called");
        }
        if (this.a == null) {
            InterfaceC0239f5 interfaceC0239f52 = this.d;
            if (interfaceC0239f52 == null) {
                return "false";
            }
            String str3 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str3, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f52).b(str3, "Found a null instance of render view!");
            return "false";
        }
        InterfaceC0239f5 interfaceC0239f53 = this.d;
        if (interfaceC0239f53 != null) {
            String str4 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str4, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f53).a(str4, "JavaScript called: isHeadphonePlugged()");
        }
        try {
            Intrinsics.c(this.a.getMediaProcessor());
            z = C0241f7.b();
        } catch (Exception e) {
            InterfaceC0239f5 interfaceC0239f54 = this.d;
            if (interfaceC0239f54 != null) {
                String str5 = Y5.a;
                ((C0254g5) interfaceC0239f54).b(str5, Ed.a(e, AbstractC0300j6.a(str5, "access$getTAG$p(...)", "SDK encountered unexpected error in checking if headphones are plugged-in; ")));
            }
            z = false;
        }
        return String.valueOf(z);
    }

    @JavascriptInterface
    public final boolean isViewable(String str) {
        String str2 = Y5.a;
        Intrinsics.checkNotNullExpressionValue(str2, "access$getTAG$p(...)");
        Ya ya = this.a;
        if (ya != null) {
            return ya.z == qd.c;
        }
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 != null) {
            Intrinsics.checkNotNullExpressionValue(str2, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f5).b(str2, "Found a null instance of render view!");
        }
        return false;
    }

    @JavascriptInterface
    public final void loadAd(String str, int i) {
    }

    @JavascriptInterface
    public final void log(String str, @NotNull String message) {
        Intrinsics.checkNotNullParameter(message, "message");
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 != null) {
            String str2 = Y5.a;
            ((C0254g5) interfaceC0239f5).c(str2, AbstractC0315k6.a(str2, "access$getTAG$p(...)", "Log called. Message:", message));
        }
        Ya ya = this.a;
        ya.getClass();
        Ia ia = Ya.N0;
        ia.getClass();
        if (!((Boolean) Ya.Q0.getValue(ia, Ia.a[0])).booleanValue() || message == null) {
            return;
        }
        ya.getListener().a(message);
    }

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

    @JavascriptInterface
    public final void onAudioStateChanged(String str, int i) {
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 != null) {
            String str2 = Y5.a;
            ((C0254g5) interfaceC0239f5).a(str2, AbstractC0504x8.a(str2, "access$getTAG$p(...)", "onAudioStateChanged is called: ", i));
        }
        B1.b.getClass();
        B1 b1 = (B1) B1.c.get(i);
        if (b1 == null) {
            b1 = B1.d;
        }
        if (b1 != B1.d) {
            this.a.getListener().a(b1);
        }
    }

    @JavascriptInterface
    public final void onOrientationChange(String str) {
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 != null) {
            String str2 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str2, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f5).a(str2, ">>> onOrientationChange() >>> This API is deprecated!");
        }
    }

    @JavascriptInterface
    public final void onUserAudioMuteInteraction(String str, boolean z) {
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 != null) {
            String str2 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str2, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f5).a(str2, "onAudioMuteInteraction is called: " + z);
        }
        this.a.getListener().a(z);
    }

    @JavascriptInterface
    public final void onUserInteraction(String str, String str2) {
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 != null) {
            String str3 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str3, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f5).a(str3, "onUserInteraction called");
        }
        Ya ya = this.a;
        if (ya != null && !ya.k()) {
            this.a.a("onUserInteraction");
            return;
        }
        InterfaceC0239f5 interfaceC0239f52 = this.d;
        if (interfaceC0239f52 != null) {
            String str4 = Y5.a;
            ((C0254g5) interfaceC0239f52).a(str4, AbstractC0315k6.a(str4, "access$getTAG$p(...)", "onUserInteraction called. Params:", str2));
        }
        if (str2 == null) {
            try {
                this.a.getListener().a(new HashMap());
                return;
            } catch (Exception e) {
                this.a.a(str, "Unexpected error", "onUserInteraction");
                InterfaceC0239f5 interfaceC0239f53 = this.d;
                if (interfaceC0239f53 != null) {
                    String str5 = Y5.a;
                    ((C0254g5) interfaceC0239f53).b(str5, Ed.a(e, AbstractC0300j6.a(str5, "access$getTAG$p(...)", "SDK encountered unexpected error in handling onUserInteraction() signal from creative; ")));
                    return;
                }
                return;
            }
        }
        try {
            JSONObject jSONObject = new JSONObject(str2);
            HashMap hashMap = new HashMap();
            Iterator<String> keys = jSONObject.keys();
            Intrinsics.checkNotNullExpressionValue(keys, "keys(...)");
            while (keys.hasNext()) {
                String next = keys.next();
                Intrinsics.d(next, "null cannot be cast to non-null type kotlin.String");
                String str6 = next;
                Object obj = jSONObject.get(str6);
                Intrinsics.c(obj);
                hashMap.put(str6, obj);
            }
            try {
                try {
                    this.a.getListener().a(hashMap);
                } catch (Exception e2) {
                    this.a.a(str, "Unexpected error", "onUserInteraction");
                    InterfaceC0239f5 interfaceC0239f54 = this.d;
                    if (interfaceC0239f54 != null) {
                        String str7 = Y5.a;
                        Intrinsics.checkNotNullExpressionValue(str7, "access$getTAG$p(...)");
                        ((C0254g5) interfaceC0239f54).b(str7, "SDK encountered unexpected error in handling onUserInteraction() signal from creative; " + e2.getMessage());
                    }
                }
            } catch (Exception e3) {
                this.a.a(str, "Unexpected error", "onUserInteraction");
                InterfaceC0239f5 interfaceC0239f55 = this.d;
                if (interfaceC0239f55 != null) {
                    String str8 = Y5.a;
                    ((C0254g5) interfaceC0239f55).b(str8, Ed.a(e3, AbstractC0300j6.a(str8, "access$getTAG$p(...)", "SDK encountered unexpected error in handling onUserInteraction() signal from creative; ")));
                }
            }
        } catch (JSONException unused) {
            this.a.getListener().a(new HashMap());
        }
    }

    @JavascriptInterface
    public final void open(String str, String str2) {
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 != null) {
            String str3 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str3, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f5).a(str3, "open called");
        }
        if (!this.a.k()) {
            this.a.a("open");
            return;
        }
        Ya ya = this.a;
        if (!ya.z0) {
            ya.i();
            AbstractC0246fc.a(new gn.e0(this, str, str2, 1));
            return;
        }
        InterfaceC0239f5 interfaceC0239f52 = this.d;
        if (interfaceC0239f52 != null) {
            String str4 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str4, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f52).b(str4, "open called on unloaded ad");
        }
    }

    @JavascriptInterface
    public final void openEmbedded(String str, String str2) {
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 != null) {
            String str3 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str3, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f5).a(str3, "openEmbedded called");
        }
        if (!this.a.k()) {
            this.a.a("openEmbedded");
            return;
        }
        Ya ya = this.a;
        if (!ya.z0) {
            ya.i();
            AbstractC0246fc.a(new gn.e0(this, str, str2, 0));
            return;
        }
        InterfaceC0239f5 interfaceC0239f52 = this.d;
        if (interfaceC0239f52 != null) {
            String str4 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str4, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f52).b(str4, "openEmbedded called on unloaded ad");
        }
    }

    @JavascriptInterface
    public final void openExternal(String str, @NotNull String url, String str2) {
        C0446t6 c0446t6;
        Intrinsics.checkNotNullParameter(url, "url");
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 != null) {
            String str3 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str3, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f5).a(str3, "open External");
        }
        Ya ya = this.a;
        if (ya == null) {
            InterfaceC0239f5 interfaceC0239f52 = this.d;
            if (interfaceC0239f52 != null) {
                String str4 = Y5.a;
                Intrinsics.checkNotNullExpressionValue(str4, "access$getTAG$p(...)");
                ((C0254g5) interfaceC0239f52).b(str4, "Found a null instance of render view!");
                return;
            }
            return;
        }
        if (!ya.k()) {
            this.a.a("openExternal");
            return;
        }
        this.a.i();
        InterfaceC0239f5 interfaceC0239f53 = this.d;
        if (interfaceC0239f53 != null) {
            String str5 = Y5.a;
            ((C0254g5) interfaceC0239f53).a(str5, AbstractC0315k6.a(str5, "access$getTAG$p(...)", "openExternal called with url: ", url));
        }
        C0460u6 c0460u6 = this.a.getLandingPageHandler().f;
        if (c0460u6 != null) {
            String a = C0330l6.a(url);
            C0375o6 landingPageHandler = this.a.getLandingPageHandler();
            int i = landingPageHandler.h + 1;
            landingPageHandler.h = i;
            c0446t6 = new C0446t6(c0460u6, a, i, 8);
        } else {
            c0446t6 = null;
        }
        if (c0446t6 != null) {
            c0446t6.g = "EX_NATIVE";
        }
        C0375o6 landingPageHandler2 = this.a.getLandingPageHandler();
        EnumC0270h6 funnelState = EnumC0270h6.d;
        landingPageHandler2.getClass();
        Intrinsics.checkNotNullParameter(funnelState, "funnelState");
        C0330l6.a(funnelState, c0446t6, (Integer) null, new C0360n6(landingPageHandler2));
        C0375o6 landingPageHandler3 = this.a.getLandingPageHandler();
        landingPageHandler3.getClass();
        Intrinsics.checkNotNullParameter("openExternal", "api");
        if (url != null) {
            landingPageHandler3.e(str, url, str2, c0446t6);
            return;
        }
        if (str2 != null) {
            landingPageHandler3.e(str, str2, null, c0446t6);
            return;
        }
        EnumC0270h6 funnelState2 = EnumC0270h6.e;
        Intrinsics.checkNotNullParameter(funnelState2, "funnelState");
        C0330l6.a(funnelState2, c0446t6, (Integer) 2, (Function2) new C0360n6(landingPageHandler3));
        Ra ra = landingPageHandler3.d;
        if (ra != null) {
            Intrinsics.checkNotNullParameter("Empty url and fallback url", "message");
            ra.a.a(str, "Empty url and fallback url", "openExternal");
        }
        InterfaceC0239f5 interfaceC0239f54 = landingPageHandler3.g;
        if (interfaceC0239f54 != null) {
            Intrinsics.checkNotNullExpressionValue("o6", "TAG");
            ((C0254g5) interfaceC0239f54).b("o6", "Empty deeplink and fallback urls");
        }
    }

    @JavascriptInterface
    public final void openWithoutTracker(String str, String str2) {
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 != null) {
            String str3 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str3, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f5).a(str3, "openWithoutTracker called");
        }
        if (!this.a.k()) {
            this.a.a("openWithoutTracker");
            return;
        }
        if (!this.a.z0) {
            AbstractC0246fc.a(new gn.e0(this, str, str2, 2));
            return;
        }
        InterfaceC0239f5 interfaceC0239f52 = this.d;
        if (interfaceC0239f52 != null) {
            String str4 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str4, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f52).b(str4, "openWithoutTracker called on unloaded ad");
        }
    }

    @JavascriptInterface
    public final void ping(String str, String str2, boolean z) {
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 != null) {
            String str3 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str3, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f5).a(str3, "ping called");
        }
        if (this.a == null) {
            InterfaceC0239f5 interfaceC0239f52 = this.d;
            if (interfaceC0239f52 != null) {
                String str4 = Y5.a;
                Intrinsics.checkNotNullExpressionValue(str4, "access$getTAG$p(...)");
                ((C0254g5) interfaceC0239f52).b(str4, "Found a null instance of render view!");
                return;
            }
            return;
        }
        if (str2 != null) {
            int length = str2.length() - 1;
            int i = 0;
            boolean z2 = false;
            while (i <= length) {
                boolean z3 = Intrinsics.f(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)) {
                InterfaceC0239f5 interfaceC0239f53 = this.d;
                if (interfaceC0239f53 != null) {
                    String str5 = Y5.a;
                    Intrinsics.checkNotNullExpressionValue(str5, "access$getTAG$p(...)");
                    ((C0254g5) interfaceC0239f53).a(str5, "JavaScript called ping() URL: >>> " + str2 + " <<<");
                }
                try {
                    C0456u2.a.a(str2, z, this.d);
                    return;
                } catch (Exception e) {
                    this.a.a(str, "Unexpected error", "ping");
                    I6.a((byte) 1, "InMobi", "Failed to fire ping; SDK encountered unexpected error");
                    InterfaceC0239f5 interfaceC0239f54 = this.d;
                    if (interfaceC0239f54 != null) {
                        String str6 = Y5.a;
                        ((C0254g5) interfaceC0239f54).b(str6, Ed.a(e, AbstractC0300j6.a(str6, "access$getTAG$p(...)", "SDK encountered unexpected error in handling ping() request from creative; ")));
                        return;
                    }
                    return;
                }
            }
        }
        this.a.a(str, "Invalid URL:" + str2, "ping");
    }

    @JavascriptInterface
    public final void pingInWebView(String str, String str2, boolean z) {
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 != null) {
            String str3 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str3, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f5).a(str3, "openInWebView called");
        }
        if (this.a == null) {
            InterfaceC0239f5 interfaceC0239f52 = this.d;
            if (interfaceC0239f52 != null) {
                String str4 = Y5.a;
                Intrinsics.checkNotNullExpressionValue(str4, "access$getTAG$p(...)");
                ((C0254g5) interfaceC0239f52).b(str4, "Found a null instance of render view!");
                return;
            }
            return;
        }
        if (str2 != null) {
            int length = str2.length() - 1;
            int i = 0;
            boolean z2 = false;
            while (i <= length) {
                boolean z3 = Intrinsics.f(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)) {
                InterfaceC0239f5 interfaceC0239f53 = this.d;
                if (interfaceC0239f53 != null) {
                    String str5 = Y5.a;
                    Intrinsics.checkNotNullExpressionValue(str5, "access$getTAG$p(...)");
                    ((C0254g5) interfaceC0239f53).a(str5, "JavaScript called pingInWebView() URL: >>> " + str2 + " <<<");
                }
                try {
                    C0456u2.a.b(str2, z, this.d);
                    return;
                } catch (Exception e) {
                    this.a.a(str, "Unexpected error", "pingInWebView");
                    I6.a((byte) 1, "InMobi", "Failed to fire ping; SDK encountered unexpected error");
                    InterfaceC0239f5 interfaceC0239f54 = this.d;
                    if (interfaceC0239f54 != null) {
                        String str6 = Y5.a;
                        ((C0254g5) interfaceC0239f54).b(str6, Ed.a(e, AbstractC0300j6.a(str6, "access$getTAG$p(...)", "SDK encountered unexpected error in handling pingInWebView() request from creative; ")));
                        return;
                    }
                    return;
                }
            }
        }
        this.a.a(str, "Invalid URL:" + str2, "pingInWebView");
    }

    @JavascriptInterface
    public final void playVideo(String str, String str2) {
        if (this.a == null) {
            InterfaceC0239f5 interfaceC0239f5 = this.d;
            if (interfaceC0239f5 != null) {
                String str3 = Y5.a;
                Intrinsics.checkNotNullExpressionValue(str3, "access$getTAG$p(...)");
                ((C0254g5) interfaceC0239f5).b(str3, "Found a null instance of render view!");
                return;
            }
            return;
        }
        if (str2 != null) {
            int length = str2.length() - 1;
            int i = 0;
            boolean z = false;
            while (i <= length) {
                boolean z2 = Intrinsics.f(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.s.r(str2, "http", false) && (kotlin.text.s.j(str2, "mp4") || kotlin.text.s.j(str2, "avi") || kotlin.text.s.j(str2, "m4v"))) {
                InterfaceC0239f5 interfaceC0239f52 = this.d;
                if (interfaceC0239f52 != null) {
                    String str4 = Y5.a;
                    Intrinsics.checkNotNullExpressionValue(str4, "access$getTAG$p(...)");
                    ((C0254g5) interfaceC0239f52).a(str4, "JavaScript called: playVideo (" + str2 + ')');
                }
                new Handler(this.a.getContainerContext().getMainLooper()).post(new gn.e0(this, str, str2, 3));
                return;
            }
        }
        this.a.a(str, "Null or empty or invalid media playback URL supplied", "playVideo");
    }

    @JavascriptInterface
    public final void registerBackButtonPressedEventListener(String str) {
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 != null) {
            String str2 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str2, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f5).a(str2, "registerBackButtonPressedEventListener called");
        }
        Ya ya = this.a;
        if (ya == null) {
            InterfaceC0239f5 interfaceC0239f52 = this.d;
            if (interfaceC0239f52 != null) {
                String str3 = Y5.a;
                Intrinsics.checkNotNullExpressionValue(str3, "access$getTAG$p(...)");
                ((C0254g5) interfaceC0239f52).b(str3, "Found a null instance of render view!");
                return;
            }
            return;
        }
        try {
            InterfaceC0239f5 interfaceC0239f53 = ya.i;
            if (interfaceC0239f53 != null) {
                String TAG = Ya.P0;
                Intrinsics.checkNotNullExpressionValue(TAG, "TAG");
                ((C0254g5) interfaceC0239f53).a(TAG, "registerBackButtonPressedEventListener " + ya);
            }
            ya.C = str;
        } catch (Exception e) {
            this.a.a(str, "Unexpected error", "registerBackButtonPressedEventListener");
            InterfaceC0239f5 interfaceC0239f54 = this.d;
            if (interfaceC0239f54 != null) {
                String str4 = Y5.a;
                ((C0254g5) interfaceC0239f54).b(str4, Ed.a(e, AbstractC0300j6.a(str4, "access$getTAG$p(...)", "SDK encountered unexpected error in handling registerBackButtonPressedEventListener() request from creative; ")));
            }
        }
    }

    @JavascriptInterface
    public final void registerDeviceMuteEventListener(String jsCallbackNamespace) {
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 != null) {
            String str = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f5).a(str, "registerDeviceMuteEventListener called");
        }
        Ya ya = this.a;
        if (ya == null) {
            InterfaceC0239f5 interfaceC0239f52 = this.d;
            if (interfaceC0239f52 != null) {
                String str2 = Y5.a;
                Intrinsics.checkNotNullExpressionValue(str2, "access$getTAG$p(...)");
                ((C0254g5) interfaceC0239f52).b(str2, "Found a null instance of render view!");
                return;
            }
            return;
        }
        if (jsCallbackNamespace != null) {
            try {
                C0241f7 mediaProcessor = ya.getMediaProcessor();
                if (mediaProcessor != null) {
                    Intrinsics.checkNotNullParameter(jsCallbackNamespace, "jsCallbackNamespace");
                    if (mediaProcessor.d == null) {
                        S6 s6 = new S6(new C0196c7(mediaProcessor, jsCallbackNamespace));
                        mediaProcessor.d = s6;
                        s6.b();
                    }
                }
            } catch (Exception e) {
                this.a.a(jsCallbackNamespace, "Unexpected error", "registerDeviceMuteEventListener");
                InterfaceC0239f5 interfaceC0239f53 = this.d;
                if (interfaceC0239f53 != null) {
                    String str3 = Y5.a;
                    ((C0254g5) interfaceC0239f53).b(str3, Ed.a(e, AbstractC0300j6.a(str3, "access$getTAG$p(...)", "SDK encountered unexpected error in handling registerDeviceMuteEventListener() request from creative; ")));
                }
            }
        }
    }

    @JavascriptInterface
    public final void registerDeviceVolumeChangeEventListener(String jsCallbackNamespace) {
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 != null) {
            String str = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f5).a(str, "registerDeviceVolumeChangeEventListener called");
        }
        Ya ya = this.a;
        if (ya == null) {
            InterfaceC0239f5 interfaceC0239f52 = this.d;
            if (interfaceC0239f52 != null) {
                String str2 = Y5.a;
                Intrinsics.checkNotNullExpressionValue(str2, "access$getTAG$p(...)");
                ((C0254g5) interfaceC0239f52).b(str2, "Found a null instance of render view!");
                return;
            }
            return;
        }
        if (jsCallbackNamespace != null) {
            try {
                C0241f7 mediaProcessor = ya.getMediaProcessor();
                if (mediaProcessor != null) {
                    Intrinsics.checkNotNullParameter(jsCallbackNamespace, "jsCallbackNamespace");
                    Context d = Kb.d();
                    if (d != null && mediaProcessor.e == null) {
                        S6 s6 = new S6(new C0211d7(mediaProcessor, jsCallbackNamespace, d, new Handler(Looper.getMainLooper())));
                        mediaProcessor.e = s6;
                        s6.b();
                    }
                }
            } catch (Exception e) {
                this.a.a(jsCallbackNamespace, "Unexpected error", "registerDeviceVolumeChangeEventListener");
                InterfaceC0239f5 interfaceC0239f53 = this.d;
                if (interfaceC0239f53 != null) {
                    String str3 = Y5.a;
                    ((C0254g5) interfaceC0239f53).b(str3, Ed.a(e, AbstractC0300j6.a(str3, "access$getTAG$p(...)", "SDK encountered unexpected error in handling registerDeviceVolumeChangeEventListener() request from creative; ")));
                }
            }
        }
    }

    @JavascriptInterface
    public final void registerHeadphonePluggedEventListener(String jsCallbackNamespace) {
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 != null) {
            String str = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f5).a(str, "registerHeadphonePluggedEventListener called");
        }
        Ya ya = this.a;
        if (ya == null) {
            InterfaceC0239f5 interfaceC0239f52 = this.d;
            if (interfaceC0239f52 != null) {
                String str2 = Y5.a;
                Intrinsics.checkNotNullExpressionValue(str2, "access$getTAG$p(...)");
                ((C0254g5) interfaceC0239f52).b(str2, "Found a null instance of render view!");
                return;
            }
            return;
        }
        if (jsCallbackNamespace != null) {
            try {
                C0241f7 mediaProcessor = ya.getMediaProcessor();
                if (mediaProcessor != null) {
                    Intrinsics.checkNotNullParameter(jsCallbackNamespace, "jsCallbackNamespace");
                    if (mediaProcessor.f == null) {
                        S6 s6 = new S6(new C0181b7(mediaProcessor, jsCallbackNamespace));
                        mediaProcessor.f = s6;
                        s6.b();
                    }
                }
            } catch (Exception e) {
                this.a.a(jsCallbackNamespace, "Unexpected error", "registerHeadphonePluggedEventListener");
                InterfaceC0239f5 interfaceC0239f53 = this.d;
                if (interfaceC0239f53 != null) {
                    String str3 = Y5.a;
                    ((C0254g5) interfaceC0239f53).b(str3, Ed.a(e, AbstractC0300j6.a(str3, "access$getTAG$p(...)", "SDK encountered unexpected error in handling registerHeadphonePluggedEventListener() request from creative; ")));
                }
            }
        }
    }

    @JavascriptInterface
    public final void saveBlob(String str, String str2) {
        Z1 z1;
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 != null) {
            String str3 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str3, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f5).a(str3, "saveBlob is called");
        }
        Ya ya = this.a;
        if (ya == null) {
            InterfaceC0239f5 interfaceC0239f52 = this.d;
            if (interfaceC0239f52 != null) {
                String str4 = Y5.a;
                Intrinsics.checkNotNullExpressionValue(str4, "access$getTAG$p(...)");
                ((C0254g5) interfaceC0239f52).b(str4, "Found a null instance of render view!");
                return;
            }
            return;
        }
        InterfaceC0239f5 interfaceC0239f53 = ya.i;
        if (interfaceC0239f53 != null) {
            String TAG = Ya.P0;
            Intrinsics.checkNotNullExpressionValue(TAG, "TAG");
            ((C0254g5) interfaceC0239f53).a(TAG, "saveBlob");
        }
        if (str2 == null || (z1 = ya.R) == null) {
            return;
        }
        ((Q0) z1).a(str2, ya.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.b(str, str2, str3);
                return;
            } catch (Exception e) {
                this.a.a(str, "Unexpected error", "saveContent");
                InterfaceC0239f5 interfaceC0239f5 = this.d;
                if (interfaceC0239f5 != null) {
                    String str4 = Y5.a;
                    ((C0254g5) interfaceC0239f5).b(str4, Ed.a(e, AbstractC0300j6.a(str4, "access$getTAG$p(...)", "SDK encountered unexpected error in handling saveContent() request from creative; ")));
                    return;
                }
                return;
            }
        }
        InterfaceC0239f5 interfaceC0239f52 = this.d;
        if (interfaceC0239f52 != null) {
            String str5 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str5, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f52).a(str5, "saveContent called with invalid parameters");
        }
        JSONObject jSONObject = new JSONObject();
        if (str3 == null) {
            str3 = RootConfig.DEFAULT_URL;
        }
        try {
            jSONObject.put("url", str3);
            jSONObject.put("reason", 8);
        } catch (JSONException unused) {
        }
        String jSONObject2 = jSONObject.toString();
        Intrinsics.checkNotNullExpressionValue(jSONObject2, "toString(...)");
        String p = kotlin.text.s.p(jSONObject2, "\"", "\\\"");
        StringBuilder sb = new StringBuilder("sendSaveContentResult(\"saveContent_");
        if (str2 == null) {
            str2 = RootConfig.DEFAULT_URL;
        }
        this.a.a(str, a1.d0.t(sb, str2, "\", 'failed', \"", p, "\");"));
    }

    @JavascriptInterface
    public final void setAdContext(String str, @NotNull String podAdContext) {
        Intrinsics.checkNotNullParameter(podAdContext, "podAdContext");
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 != null) {
            String str2 = Y5.a;
            ((C0254g5) interfaceC0239f5).a(str2, AbstractC0315k6.a(str2, "access$getTAG$p(...)", "setAdContext is called ", podAdContext));
        }
        Z adPodHandler = this.a.getAdPodHandler();
        if (adPodHandler != null) {
            ((Q0) adPodHandler).d(podAdContext);
        }
    }

    @JavascriptInterface
    public final void setCloseEndCardTracker(String str, String str2) {
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 != null) {
            String str3 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str3, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f5).a(str3, "setCloseEndCardTracker is called");
        }
        Ya ya = this.a;
        if (ya == null) {
            InterfaceC0239f5 interfaceC0239f52 = this.d;
            if (interfaceC0239f52 != null) {
                String str4 = Y5.a;
                Intrinsics.checkNotNullExpressionValue(str4, "access$getTAG$p(...)");
                ((C0254g5) interfaceC0239f52).b(str4, "Found a null instance of render view!");
                return;
            }
            return;
        }
        try {
            ya.setCloseEndCardTracker(str2);
        } catch (Exception e) {
            this.a.a(str, "Unexpected error", "getDownloadStatus");
            InterfaceC0239f5 interfaceC0239f53 = this.d;
            if (interfaceC0239f53 != null) {
                String str5 = Y5.a;
                ((C0254g5) interfaceC0239f53).b(str5, Ed.a(e, AbstractC0300j6.a(str5, "access$getTAG$p(...)", "SDK encountered unexpected error in handling getDownloadStatus() request from creative; ")));
            }
        }
    }

    @JavascriptInterface
    public final void setOrientationProperties(String str, @NotNull String orientationPropertiesString) {
        Intrinsics.checkNotNullParameter(orientationPropertiesString, "orientationPropertiesString");
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 != null) {
            String str2 = Y5.a;
            ((C0254g5) interfaceC0239f5).a(str2, AbstractC0315k6.a(str2, "access$getTAG$p(...)", "setOrientationProperties called: ", orientationPropertiesString));
        }
        if (!this.a.z0) {
            new Handler(this.a.getContainerContext().getMainLooper()).post(new gn.d0(this, orientationPropertiesString, 1));
            return;
        }
        InterfaceC0239f5 interfaceC0239f52 = this.d;
        if (interfaceC0239f52 != null) {
            String str3 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str3, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f52).b(str3, "setOrientationProperties called on unloaded ad");
        }
    }

    @JavascriptInterface
    public final void showAd(String str, int i) {
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 != null) {
            String str2 = Y5.a;
            ((C0254g5) interfaceC0239f5).a(str2, AbstractC0504x8.a(str2, "access$getTAG$p(...)", "showAd is called with index ", i));
        }
        Ya ya = this.a;
        InterfaceC0239f5 interfaceC0239f52 = ya.i;
        if (interfaceC0239f52 != null) {
            String TAG = Ya.P0;
            Intrinsics.checkNotNullExpressionValue(TAG, "TAG");
            ((C0254g5) interfaceC0239f52).a(TAG, "showPodAdAtIndex " + ya + ' ' + i);
        }
        if (ya.z == qd.c && ya.V != null && !ya.D.get()) {
            Z z = ya.V;
            if (z != null) {
                z.a(i, ya, ya.getFullScreenActivity());
                return;
            }
            return;
        }
        InterfaceC0239f5 interfaceC0239f53 = ya.i;
        if (interfaceC0239f53 != null) {
            String TAG2 = Ya.P0;
            Intrinsics.checkNotNullExpressionValue(TAG2, "TAG");
            ((C0254g5) interfaceC0239f53).b(TAG2, "Cannot show index pod ad as the current ad is not viewable");
        }
        ya.b(false);
    }

    @JavascriptInterface
    public final void showAlert(String str, @NotNull String alert) {
        Intrinsics.checkNotNullParameter(alert, "alert");
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 != null) {
            String str2 = Y5.a;
            ((C0254g5) interfaceC0239f5).a(str2, AbstractC0315k6.a(str2, "access$getTAG$p(...)", "showAlert: ", alert));
        }
    }

    @JavascriptInterface
    public final void showEndCard(String str) {
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 != null) {
            String str2 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str2, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f5).a(str2, "showEndCard is called");
        }
        Ya ya = this.a;
        if (ya == null) {
            InterfaceC0239f5 interfaceC0239f52 = this.d;
            if (interfaceC0239f52 != null) {
                String str3 = Y5.a;
                Intrinsics.checkNotNullExpressionValue(str3, "access$getTAG$p(...)");
                ((C0254g5) interfaceC0239f52).b(str3, "Found a null instance of render view!");
                return;
            }
            return;
        }
        InterfaceC0239f5 interfaceC0239f53 = ya.i;
        if (interfaceC0239f53 != null) {
            String TAG = Ya.P0;
            Intrinsics.checkNotNullExpressionValue(TAG, "TAG");
            ((C0254g5) interfaceC0239f53).a(TAG, "showEndCardFromInterActive");
        }
        InterfaceC0495x referenceContainer = ya.getReferenceContainer();
        if (referenceContainer instanceof C0447t7) {
            ((C0447t7) referenceContainer).o();
        }
    }

    @JavascriptInterface
    public final void storePicture(String str, String str2) {
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 != null) {
            String str3 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str3, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f5).a(str3, "storePicture is deprecated and no-op. ");
        }
    }

    @JavascriptInterface
    public final void submitAdReport(String str, @NotNull String adQualityUrl, @NotNull String enableUserAdReportScreenshot, @NotNull String templateInfo) {
        Intrinsics.checkNotNullParameter(adQualityUrl, "adQualityUrl");
        Intrinsics.checkNotNullParameter(enableUserAdReportScreenshot, "enableUserAdReportScreenshot");
        Intrinsics.checkNotNullParameter(templateInfo, "templateInfo");
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 != null) {
            String str2 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str2, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f5).a(str2, "submitAdReport called");
        }
        this.a.a(adQualityUrl, templateInfo, Intrinsics.a(enableUserAdReportScreenshot, "1"));
    }

    @JavascriptInterface
    @NotNull
    public final String supports(String str, @NotNull String feature) {
        Intrinsics.checkNotNullParameter(feature, "feature");
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 != null) {
            String str2 = Y5.a;
            ((C0254g5) interfaceC0239f5).a(str2, AbstractC0315k6.a(str2, "access$getTAG$p(...)", "Checking support for: ", feature));
        }
        String valueOf = String.valueOf(this.a.e(feature));
        InterfaceC0239f5 interfaceC0239f52 = this.d;
        if (interfaceC0239f52 != null) {
            String str3 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str3, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f52).c(str3, "Message:" + feature + " support: " + valueOf);
        }
        return valueOf;
    }

    @JavascriptInterface
    public final long timeSinceShow(String str) {
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 != null) {
            String str2 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str2, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f5).a(str2, "timeSinceShow is called");
        }
        Ya ya = this.a;
        InterfaceC0239f5 interfaceC0239f52 = ya.i;
        if (interfaceC0239f52 != null) {
            String str3 = Ya.P0;
            ((C0254g5) interfaceC0239f52).c(str3, Wa.a(ya, str3, "TAG", "timeSincePodShow "));
        }
        Z z = ya.V;
        if (z != null) {
            return ((Q0) z).A0();
        }
        return 0L;
    }

    @JavascriptInterface
    public final void unload(String str) {
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 != null) {
            String str2 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str2, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f5).a(str2, "unload called");
        }
        try {
            this.a.n();
        } catch (Exception e) {
            this.a.a(str, "Unexpected error", "unload");
            I6.a((byte) 1, "InMobi", "Failed to unload ad; SDK encountered an unexpected error");
            InterfaceC0239f5 interfaceC0239f52 = this.d;
            if (interfaceC0239f52 != null) {
                String str3 = Y5.a;
                ((C0254g5) interfaceC0239f52).b(str3, Ed.a(e, AbstractC0300j6.a(str3, "access$getTAG$p(...)", "SDK encountered an expected error in handling the unload() request from creative; ")));
            }
        }
    }

    @JavascriptInterface
    public final void unregisterBackButtonPressedEventListener(String str) {
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 != null) {
            String str2 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str2, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f5).a(str2, "unregisterBackButtonPressedEventListener called");
        }
        Ya ya = this.a;
        if (ya == null) {
            InterfaceC0239f5 interfaceC0239f52 = this.d;
            if (interfaceC0239f52 != null) {
                String str3 = Y5.a;
                Intrinsics.checkNotNullExpressionValue(str3, "access$getTAG$p(...)");
                ((C0254g5) interfaceC0239f52).b(str3, "Found a null instance of render view!");
                return;
            }
            return;
        }
        try {
            InterfaceC0239f5 interfaceC0239f53 = ya.i;
            if (interfaceC0239f53 != null) {
                String TAG = Ya.P0;
                Intrinsics.checkNotNullExpressionValue(TAG, "TAG");
                ((C0254g5) interfaceC0239f53).a(TAG, "unregisterBackButtonPressedEventListener " + ya);
            }
            ya.C = null;
        } catch (Exception e) {
            this.a.a(str, "Unexpected error", "unregisterBackButtonPressedEventListener");
            InterfaceC0239f5 interfaceC0239f54 = this.d;
            if (interfaceC0239f54 != null) {
                String str4 = Y5.a;
                ((C0254g5) interfaceC0239f54).b(str4, Ed.a(e, AbstractC0300j6.a(str4, "access$getTAG$p(...)", "SDK encountered unexpected error in handling unregisterBackButtonPressedEventListener() request from creative; ")));
            }
        }
    }

    @JavascriptInterface
    public final void unregisterDeviceMuteEventListener(String str) {
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 != null) {
            String str2 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str2, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f5).a(str2, "unregisterDeviceMuteEventListener called");
        }
        if (this.a == null) {
            InterfaceC0239f5 interfaceC0239f52 = this.d;
            if (interfaceC0239f52 != null) {
                String str3 = Y5.a;
                Intrinsics.checkNotNullExpressionValue(str3, "access$getTAG$p(...)");
                ((C0254g5) interfaceC0239f52).b(str3, "Found a null instance of render view!");
                return;
            }
            return;
        }
        InterfaceC0239f5 interfaceC0239f53 = this.d;
        if (interfaceC0239f53 != null) {
            String str4 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str4, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f53).a(str4, "Unregister device mute event listener ...");
        }
        try {
            C0241f7 mediaProcessor = this.a.getMediaProcessor();
            if (mediaProcessor != null) {
                S6 s6 = mediaProcessor.d;
                if (s6 != null) {
                    s6.a();
                }
                mediaProcessor.d = null;
            }
        } catch (Exception e) {
            this.a.a(str, "Unexpected error", "unRegisterDeviceMuteEventListener");
            InterfaceC0239f5 interfaceC0239f54 = this.d;
            if (interfaceC0239f54 != null) {
                String str5 = Y5.a;
                ((C0254g5) interfaceC0239f54).b(str5, Ed.a(e, AbstractC0300j6.a(str5, "access$getTAG$p(...)", "SDK encountered unexpected error in handling unregisterDeviceMuteEventListener() request from creative; ")));
            }
        }
    }

    @JavascriptInterface
    public final void unregisterDeviceVolumeChangeEventListener(String str) {
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 != null) {
            String str2 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str2, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f5).a(str2, "unregisterDeviceVolumeChangeEventListener called");
        }
        if (this.a == null) {
            InterfaceC0239f5 interfaceC0239f52 = this.d;
            if (interfaceC0239f52 != null) {
                String str3 = Y5.a;
                Intrinsics.checkNotNullExpressionValue(str3, "access$getTAG$p(...)");
                ((C0254g5) interfaceC0239f52).b(str3, "Found a null instance of render view!");
                return;
            }
            return;
        }
        InterfaceC0239f5 interfaceC0239f53 = this.d;
        if (interfaceC0239f53 != null) {
            String str4 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str4, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f53).a(str4, "Unregister device volume change listener ...");
        }
        try {
            C0241f7 mediaProcessor = this.a.getMediaProcessor();
            if (mediaProcessor != null) {
                S6 s6 = mediaProcessor.e;
                if (s6 != null) {
                    s6.a();
                }
                mediaProcessor.e = null;
            }
        } catch (Exception e) {
            this.a.a(str, "Unexpected error", "unregisterDeviceVolumeChangeEventListener");
            InterfaceC0239f5 interfaceC0239f54 = this.d;
            if (interfaceC0239f54 != null) {
                String str5 = Y5.a;
                ((C0254g5) interfaceC0239f54).b(str5, Ed.a(e, AbstractC0300j6.a(str5, "access$getTAG$p(...)", "SDK encountered unexpected error in handling unregisterDeviceVolumeChangeEventListener() request from creative; ")));
            }
        }
    }

    @JavascriptInterface
    public final void unregisterHeadphonePluggedEventListener(String str) {
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 != null) {
            String str2 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str2, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f5).a(str2, "unregisterHeadphonePluggedEventListener called");
        }
        if (this.a == null) {
            InterfaceC0239f5 interfaceC0239f52 = this.d;
            if (interfaceC0239f52 != null) {
                String str3 = Y5.a;
                Intrinsics.checkNotNullExpressionValue(str3, "access$getTAG$p(...)");
                ((C0254g5) interfaceC0239f52).b(str3, "Found a null instance of render view!");
                return;
            }
            return;
        }
        InterfaceC0239f5 interfaceC0239f53 = this.d;
        if (interfaceC0239f53 != null) {
            String str4 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str4, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f53).a(str4, "Unregister headphone plugged event listener ...");
        }
        try {
            C0241f7 mediaProcessor = this.a.getMediaProcessor();
            if (mediaProcessor != null) {
                S6 s6 = mediaProcessor.f;
                if (s6 != null) {
                    s6.a();
                }
                mediaProcessor.f = null;
            }
        } catch (Exception e) {
            this.a.a(str, "Unexpected error", "unregisterHeadphonePluggedEventListener");
            InterfaceC0239f5 interfaceC0239f54 = this.d;
            if (interfaceC0239f54 != null) {
                String str5 = Y5.a;
                ((C0254g5) interfaceC0239f54).b(str5, Ed.a(e, AbstractC0300j6.a(str5, "access$getTAG$p(...)", "SDK encountered unexpected error in handling unregisterHeadphonePluggedEventListener() request from creative; ")));
            }
        }
    }

    @JavascriptInterface
    public final void useCustomClose(String str, boolean z) {
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 != null) {
            String str2 = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str2, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f5).a(str2, "useCustomClose called:" + z);
        }
        new Handler(this.a.getContainerContext().getMainLooper()).post(new gn.f0(this, z, str, 0));
    }

    @JavascriptInterface
    public final void zoom(@NotNull String jsCallbackNamespace, int i) {
        Intrinsics.checkNotNullParameter(jsCallbackNamespace, "jsCallbackNamespace");
        InterfaceC0239f5 interfaceC0239f5 = this.d;
        if (interfaceC0239f5 != null) {
            String str = Y5.a;
            Intrinsics.checkNotNullExpressionValue(str, "access$getTAG$p(...)");
            ((C0254g5) interfaceC0239f5).a(str, "zoom is called " + jsCallbackNamespace + ' ' + i);
        }
        AbstractC0246fc.a(new ab.b(this, i, 9));
    }

    public static final void c(X5 this$0) {
        Intrinsics.checkNotNullParameter(this$0, "this$0");
        try {
            this$0.a.p();
        } catch (Exception e) {
            InterfaceC0239f5 interfaceC0239f5 = this$0.d;
            if (interfaceC0239f5 != null) {
                String str = Y5.a;
                ((C0254g5) interfaceC0239f5).b(str, Ed.a(e, AbstractC0300j6.a(str, "access$getTAG$p(...)", "SDK encountered unexpected error in getting/setting default position; ")));
            }
        }
    }

    public final void a(final String str, final String str2, final int i, final float f, final boolean z, final C0446t6 c0446t6) {
        if (c0446t6 != null) {
            c0446t6.g = "IN_CUSTOM";
        }
        new Handler(this.a.getContainerContext().getMainLooper()).post(new Runnable() {
            @Override
            public final void run() {
                X5.a(X5.this, c0446t6, str2, i, str, f, z);
            }
        });
    }

    public static final void a(X5 this$0, C0446t6 c0446t6, String expandInput, int i, String str, float f, boolean z) {
        String str2;
        String str3;
        Intrinsics.checkNotNullParameter(this$0, "this$0");
        Intrinsics.checkNotNullParameter(expandInput, "$expandInput");
        try {
            if (this$0.a.getEmbeddedBrowserJSCallbacks() == null) {
                InterfaceC0239f5 interfaceC0239f5 = this$0.d;
                if (interfaceC0239f5 != null) {
                    String str4 = Y5.a;
                    Intrinsics.checkNotNullExpressionValue(str4, "access$getTAG$p(...)");
                    ((C0254g5) interfaceC0239f5).b(str4, "Found a null instance of EmbeddedBrowserJSCallback instance to customExpand");
                }
                C0375o6 landingPageHandler = this$0.a.getLandingPageHandler();
                EnumC0270h6 funnelState = EnumC0270h6.e;
                landingPageHandler.getClass();
                Intrinsics.checkNotNullParameter(funnelState, "funnelState");
                C0330l6.a(funnelState, c0446t6, (Integer) 8002, (Function2) new C0360n6(landingPageHandler));
                return;
            }
            InterfaceC0239f5 interfaceC0239f52 = this$0.d;
            if (interfaceC0239f52 != null) {
                String str5 = Y5.a;
                Intrinsics.checkNotNullExpressionValue(str5, "access$getTAG$p(...)");
                ((C0254g5) interfaceC0239f52).a(str5, "Custom expand called. Url: " + expandInput);
            }
            R3 r3 = R3.values()[i];
            try {
                if (r3 == R3.a) {
                    try {
                        int a = this$0.a.getLandingPageHandler().a("customExpand", str, expandInput, c0446t6, null);
                        InterfaceC0239f5 interfaceC0239f53 = this$0.d;
                        if (interfaceC0239f53 != null) {
                            String str6 = Y5.a;
                            Intrinsics.checkNotNullExpressionValue(str6, "access$getTAG$p(...)");
                            ((C0254g5) interfaceC0239f53).a(str6, "processCustomExpandRequest: " + a);
                        }
                        if (a == 3) {
                            S3 embeddedBrowserJSCallbacks = this$0.a.getEmbeddedBrowserJSCallbacks();
                            if (embeddedBrowserJSCallbacks != null) {
                                str3 = expandInput;
                                ((N4) embeddedBrowserJSCallbacks).a(str3, r3, f, z, this$0.a.getViewTouchTimestamp(), c0446t6);
                            } else {
                                str3 = expandInput;
                            }
                            C0375o6 landingPageHandler2 = this$0.a.getLandingPageHandler();
                            EnumC0270h6 funnelState2 = EnumC0270h6.f;
                            landingPageHandler2.getClass();
                            Intrinsics.checkNotNullParameter(funnelState2, "funnelState");
                            C0330l6.a(funnelState2, c0446t6, (Integer) null, new C0360n6(landingPageHandler2));
                            Ra ra = this$0.a.getLandingPageHandler().d;
                            if (ra != null) {
                                Ya.a(ra.a, "customExpand", str, str3);
                                return;
                            }
                            return;
                        }
                        S3 embeddedBrowserJSCallbacks2 = this$0.a.getEmbeddedBrowserJSCallbacks();
                        if (embeddedBrowserJSCallbacks2 != null) {
                            P4.a(((N4) embeddedBrowserJSCallbacks2).a);
                            return;
                        }
                        return;
                    } catch (Exception e) {
                        e = e;
                        str2 = str;
                        this$0.a.a(str2, "Unexpected error", "customExpand");
                        C0375o6 landingPageHandler3 = this$0.a.getLandingPageHandler();
                        EnumC0270h6 funnelState3 = EnumC0270h6.e;
                        landingPageHandler3.getClass();
                        Intrinsics.checkNotNullParameter(funnelState3, "funnelState");
                        C0330l6.a(funnelState3, c0446t6, (Integer) 9, (Function2) new C0360n6(landingPageHandler3));
                        I6.a((byte) 1, "InMobi", "Failed to custom expand ad; SDK encountered an unexpected error");
                        InterfaceC0239f5 interfaceC0239f54 = this$0.d;
                        if (interfaceC0239f54 != null) {
                            String str7 = Y5.a;
                            ((C0254g5) interfaceC0239f54).b(str7, Ed.a(e, AbstractC0300j6.a(str7, "access$getTAG$p(...)", "SDK encountered unexpected error in handling customExpand() request; ")));
                            return;
                        }
                        return;
                    }
                }
                S3 embeddedBrowserJSCallbacks3 = this$0.a.getEmbeddedBrowserJSCallbacks();
                if (embeddedBrowserJSCallbacks3 != null) {
                    ((N4) embeddedBrowserJSCallbacks3).a(expandInput, r3, f, z, this$0.a.getViewTouchTimestamp(), c0446t6);
                }
                C0375o6 landingPageHandler4 = this$0.a.getLandingPageHandler();
                EnumC0270h6 funnelState4 = EnumC0270h6.f;
                landingPageHandler4.getClass();
                Intrinsics.checkNotNullParameter(funnelState4, "funnelState");
                C0330l6.a(funnelState4, c0446t6, (Integer) null, new C0360n6(landingPageHandler4));
                Ra ra2 = this$0.a.getLandingPageHandler().d;
                if (ra2 != null) {
                    Ya.a(ra2.a, "customExpand", str, expandInput);
                }
            } catch (Exception e2) {
                e = e2;
            }
        } catch (Exception e3) {
            e = e3;
            str2 = str;
        }
    }

    public static final void b(X5 this$0) {
        Intrinsics.checkNotNullParameter(this$0, "this$0");
        try {
            this$0.a.o();
        } catch (Exception e) {
            InterfaceC0239f5 interfaceC0239f5 = this$0.d;
            if (interfaceC0239f5 != null) {
                String str = Y5.a;
                ((C0254g5) interfaceC0239f5).b(str, Ed.a(e, AbstractC0300j6.a(str, "access$getTAG$p(...)", "SDK encountered unexpected error in getting/setting current position; ")));
            }
        }
    }

    public static final void b(X5 this$0, String json) {
        Intrinsics.checkNotNullParameter(this$0, "this$0");
        Intrinsics.checkNotNullParameter(json, "$orientationPropertiesString");
        K9 op = this$0.a.getOrientationProperties();
        if (op != null) {
            Intrinsics.checkNotNullParameter(json, "json");
            Intrinsics.checkNotNullParameter(op, "op");
            K9 k9 = new K9();
            k9.d = json;
            try {
                JSONObject jSONObject = new JSONObject(json);
                String optString = jSONObject.optString("forceOrientation", op.b);
                Intrinsics.checkNotNullExpressionValue(optString, "optString(...)");
                Intrinsics.checkNotNullParameter(optString, "<set-?>");
                k9.b = optString;
                k9.a = jSONObject.optBoolean("allowOrientationChange", op.a);
                String optString2 = jSONObject.optString("direction", op.c);
                Intrinsics.checkNotNullExpressionValue(optString2, "optString(...)");
                Intrinsics.checkNotNullParameter(optString2, "<set-?>");
                k9.c = optString2;
                if (!Intrinsics.a(k9.b, "portrait") && !Intrinsics.a(k9.b, "landscape")) {
                    Intrinsics.checkNotNullParameter("none", "<set-?>");
                    k9.b = "none";
                }
                if (!Intrinsics.a(k9.c, "left") && !Intrinsics.a(k9.c, "right")) {
                    Intrinsics.checkNotNullParameter("right", "<set-?>");
                    k9.c = "right";
                }
            } catch (JSONException unused) {
                k9 = null;
            }
            this$0.c = k9;
        }
        K9 k92 = this$0.c;
        if (k92 != null) {
            this$0.a.setOrientationProperties(k92);
        }
    }

    public static final void b(X5 this$0, boolean z, String str) {
        Intrinsics.checkNotNullParameter(this$0, "this$0");
        try {
            this$0.a.e(z);
        } catch (Exception e) {
            this$0.a.a(str, "Unexpected error", "useCustomClose");
            InterfaceC0239f5 interfaceC0239f5 = this$0.d;
            if (interfaceC0239f5 != null) {
                String str2 = Y5.a;
                ((C0254g5) interfaceC0239f5).b(str2, Ed.a(e, AbstractC0300j6.a(str2, "access$getTAG$p(...)", "SDK encountered internal error in handling useCustomClose() request from creative; ")));
            }
        }
    }

    public static final void a(X5 this$0) {
        Intrinsics.checkNotNullParameter(this$0, "this$0");
        if (this$0.a.getEmbeddedBrowserJSCallbacks() == null) {
            InterfaceC0239f5 interfaceC0239f5 = this$0.d;
            if (interfaceC0239f5 != null) {
                String str = Y5.a;
                Intrinsics.checkNotNullExpressionValue(str, "access$getTAG$p(...)");
                ((C0254g5) interfaceC0239f5).b(str, "Found a null instance of EmbeddedBrowserJSCallback instance to closeCustomExpand");
                return;
            }
            return;
        }
        S3 embeddedBrowserJSCallbacks = this$0.a.getEmbeddedBrowserJSCallbacks();
        if (embeddedBrowserJSCallbacks != null) {
            P4.a(((N4) embeddedBrowserJSCallbacks).a);
        }
    }

    public static final void a(X5 this$0, String str) {
        Intrinsics.checkNotNullParameter(this$0, "this$0");
        try {
            InterfaceC0495x referenceContainer = this$0.a.getReferenceContainer();
            if (referenceContainer != null) {
                referenceContainer.a();
            }
        } catch (Exception e) {
            this$0.a.a(str, "Unexpected error", CampaignEx.JSON_NATIVE_VIDEO_CLOSE);
            I6.a((byte) 1, "InMobi", "Failed to close ad; SDK encountered an unexpected error");
            InterfaceC0239f5 interfaceC0239f5 = this$0.d;
            if (interfaceC0239f5 != null) {
                String str2 = Y5.a;
                ((C0254g5) interfaceC0239f5).b(str2, Ed.a(e, AbstractC0300j6.a(str2, "access$getTAG$p(...)", "SDK encountered an expected error in handling the close() request from creative; ")));
            }
        }
    }

    public static final void a(X5 this$0, boolean z, String str) {
        Intrinsics.checkNotNullParameter(this$0, "this$0");
        try {
            this$0.a.d(z);
        } catch (Exception e) {
            this$0.a.a(str, "Unexpected error", "disableCloseRegion");
            InterfaceC0239f5 interfaceC0239f5 = this$0.d;
            if (interfaceC0239f5 != null) {
                String str2 = Y5.a;
                ((C0254g5) interfaceC0239f5).b(str2, Ed.a(e, AbstractC0300j6.a(str2, "access$getTAG$p(...)", "SDK encountered unexpected error in handling disableCloseRegion() request from creative; ")));
            }
        }
    }

    public static final void a(X5 this$0, int i) {
        Intrinsics.checkNotNullParameter(this$0, "this$0");
        this$0.a.setInitialScale(i);
    }
}