导航菜单

页面标题

页面副标题

OLX India v19.42.007 - C0279p5.java 源代码

正在查看: OLX India v19.42.007 应用的 C0279p5.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.os.SystemClock;
import android.webkit.JavascriptInterface;
import android.webkit.URLUtil;
import android.widget.FrameLayout;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Locale;
import java.util.Map;
import java.util.concurrent.ScheduledExecutorService;
import kotlin.Pair;
import kotlin.TuplesKt;
import kotlin.Unit;
import kotlin.collections.MapsKt;
import kotlin.jvm.internal.Intrinsics;
import kotlin.text.StringsKt;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

public final class C0279p5 {
    public final S9 a;
    public final int b;
    public C0132e9 c;
    public A4 d;

    public C0279p5(int i, S9 s9) {
        this.a = s9;
        this.b = i;
    }

    public static final void a(C0279p5 c0279p5, String str, String str2) {
        try {
            c0279p5.a.e(str);
        } catch (Exception e) {
            c0279p5.a.a(str2, "Unexpected error", "expand");
            Z5.a((byte) 1, "InMobi", "Failed to expand ad; SDK encountered an unexpected error");
            A4 a4 = c0279p5.d;
            if (a4 != null) {
                String str3 = AbstractC0292q5.a;
                ((B4) a4).b(str3, Cc.a(e, A5.a(str3, "access$getTAG$p(...)", "SDK encountered unexpected error in handling expand() request; ")));
            }
        }
    }

    public static final void b(C0279p5 c0279p5, String str, String str2) {
        c0279p5.a.getLandingPageHandler().a("open", str, str2, true);
    }

    public static final void c(C0279p5 c0279p5, String str, String str2) {
        try {
            c0279p5.a.getLandingPageHandler().e("openEmbedded", str, str2);
        } catch (Exception e) {
            c0279p5.a.a(str, "Unexpected error", "openEmbedded");
            Z5.a((byte) 1, "InMobi", "Failed to open URL; SDK encountered unexpected error");
            A4 a4 = c0279p5.d;
            if (a4 != null) {
                String str3 = AbstractC0292q5.a;
                ((B4) a4).b(str3, Cc.a(e, A5.a(str3, "access$getTAG$p(...)", "SDK encountered unexpected error in handling openEmbedded() request from creative; ")));
            }
        }
    }

    public static final void d(C0279p5 c0279p5, String str, String str2) {
        c0279p5.a.getLandingPageHandler().a("openWithoutTracker", str, str2, true);
    }

    public static final void e(C0279p5 c0279p5, String str, String str2) {
        try {
            S9 s9 = c0279p5.a;
            int length = str2.length() - 1;
            int i = 0;
            boolean z = false;
            while (i <= length) {
                boolean z2 = Intrinsics.e(str2.charAt(!z ? i : length), 32) <= 0;
                if (z) {
                    if (!z2) {
                        break;
                    } else {
                        length--;
                    }
                } else if (z2) {
                    i++;
                } else {
                    z = true;
                }
            }
            s9.b(str, str2.subSequence(i, length + 1).toString());
        } catch (Exception e) {
            c0279p5.a.a(str, "Unexpected error", "playVideo");
            Z5.a((byte) 1, "InMobi", "Error playing video; SDK encountered an unexpected error");
            A4 a4 = c0279p5.d;
            if (a4 != null) {
                String str3 = AbstractC0292q5.a;
                ((B4) a4).b(str3, Cc.a(e, A5.a(str3, "access$getTAG$p(...)", "SDK encountered unexpected error in handling playVideo() request from creative; ")));
            }
        }
    }

    @JavascriptInterface
    public final void asyncPing(String str, String str2) {
        A4 a4 = this.d;
        if (a4 != null) {
            String str3 = AbstractC0292q5.a;
            ((B4) a4).a(str3, AbstractC0408z5.a(str3, "access$getTAG$p(...)", "asyncPing called: ", str2));
        }
        if (!URLUtil.isValidUrl(str2)) {
            this.a.a(str, "Invalid url", "asyncPing");
            return;
        }
        try {
            G8 g8 = new G8(str2, this.d);
            g8.x = false;
            g8.t = false;
            g8.u = false;
            g8.a(new Z0(new C0068a1(g8, new C0266o5(this))));
        } catch (Exception e) {
            this.a.a(str, "Unexpected error", "asyncPing");
            A4 a42 = this.d;
            if (a42 != null) {
                String str4 = AbstractC0292q5.a;
                ((B4) a42).b(str4, Cc.a(e, A5.a(str4, "access$getTAG$p(...)", "SDK encountered internal error in handling asyncPing() request from creative; ")));
            }
        }
    }

    @JavascriptInterface
    public final void cancelSaveContent(String str, String str2) {
        A4 a4 = this.d;
        if (a4 != null) {
            String str3 = AbstractC0292q5.a;
            ((B4) a4).a(str3, AbstractC0408z5.a(str3, "access$getTAG$p(...)", "cancelSaveContent called. mediaId:", str2));
        }
    }

    @JavascriptInterface
    public final void close(final String str) {
        A4 a4 = this.d;
        if (a4 != null) {
            ((B4) a4).a(AbstractC0292q5.a, "close called");
        }
        new Handler(this.a.getContainerContext().getMainLooper()).post(new Runnable() {
            @Override
            public final void run() {
                C0279p5.a(C0279p5.this, str);
            }
        });
    }

    @JavascriptInterface
    public final void closeAll(String str) {
        A4 a4 = this.d;
        if (a4 != null) {
            ((B4) a4).a(AbstractC0292q5.a, "closeAll is called");
        }
        S9 s9 = this.a;
        A4 a42 = s9.j;
        if (a42 != null) {
            String str2 = S9.O0;
            ((B4) a42).a(str2, G9.a(s9, str2, "TAG", "closeAll "));
        }
        K k = s9.d0;
        if (k != null) {
            k.b();
        }
        Activity activity = (Activity) s9.m.get();
        if (activity != null) {
            activity.finish();
        }
    }

    @JavascriptInterface
    public final void closeCustomExpand(String str) {
        A4 a4 = this.d;
        if (a4 != null) {
            ((B4) a4).a(AbstractC0292q5.a, "closeCustomExpand called.");
        }
        if (this.b != 1) {
            A4 a42 = this.d;
            if (a42 != null) {
                String str2 = AbstractC0292q5.a;
                StringBuilder a = A5.a(str2, "access$getTAG$p(...)", "closeCustomExpand called in incorrect Ad type: ");
                a.append(this.b);
                ((B4) a42).b(str2, a.toString());
                return;
            }
            return;
        }
        if (this.a != null) {
            new Handler(this.a.getContainerContext().getMainLooper()).post(new Runnable() {
                @Override
                public final void run() {
                    C0279p5.a(C0279p5.this);
                }
            });
            return;
        }
        A4 a43 = this.d;
        if (a43 != null) {
            ((B4) a43).b(AbstractC0292q5.a, "Found a null instance of render view!");
        }
    }

    @JavascriptInterface
    public final void customExpand(final String str, final String str2, final int i, final float f, boolean z, final boolean z2) {
        A4 a4 = this.d;
        if (a4 != null) {
            ((B4) a4).a(AbstractC0292q5.a, "customExpand called");
        }
        if (this.b != 1) {
            A4 a42 = this.d;
            if (a42 != null) {
                String str3 = AbstractC0292q5.a;
                StringBuilder a = A5.a(str3, "access$getTAG$p(...)", "customExpand called in incorrect Ad type: ");
                a.append(this.b);
                ((B4) a42).b(str3, a.toString());
                return;
            }
            return;
        }
        if (str2 != null) {
            int length = str2.length() - 1;
            int i2 = 0;
            boolean z3 = false;
            while (i2 <= length) {
                boolean z4 = Intrinsics.e(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 >= EnumC0251n3.values().length) {
                    this.a.a(str, "Invalid inputType", "customExpand");
                    return;
                } else if (f < 0.0f || f > 1.0f) {
                    this.a.a(str, "Invalid screenPercentage", "customExpand");
                    return;
                } else {
                    this.a.getLandingPageHandler().a("clickStartCalled", MapsKt.m(new Pair[]{TuplesKt.a("trigger", this.a.getLandingPageHandler().a(str2))}));
                    new Handler(this.a.getContainerContext().getMainLooper()).post(new Runnable() {
                        @Override
                        public final void run() {
                            C0279p5.a(C0279p5.this, str2, i, str, f, z2);
                        }
                    });
                    return;
                }
            }
        }
        this.a.a(str, "Invalid " + i, "customExpand");
    }

    @JavascriptInterface
    public final void disableBackButton(String str, boolean z) {
        A4 a4 = this.d;
        if (a4 != null) {
            ((B4) a4).a(AbstractC0292q5.a, "disableBackButton called");
        }
        S9 s9 = this.a;
        if (s9 != null) {
            s9.setDisableBackButton(z);
            return;
        }
        A4 a42 = this.d;
        if (a42 != null) {
            ((B4) a42).b(AbstractC0292q5.a, "Found a null instance of render view!");
        }
    }

    @JavascriptInterface
    public final void disableCloseRegion(final String str, final boolean z) {
        A4 a4 = this.d;
        if (a4 != null) {
            ((B4) a4).a(AbstractC0292q5.a, "disableCloseRegion called");
        }
        if (this.a != null) {
            new Handler(this.a.getContainerContext().getMainLooper()).post(new Runnable() {
                @Override
                public final void run() {
                    C0279p5.a(C0279p5.this, z, str);
                }
            });
            return;
        }
        A4 a42 = this.d;
        if (a42 != null) {
            ((B4) a42).b(AbstractC0292q5.a, "Found a null instance of render view!");
        }
    }

    @JavascriptInterface
    public final void expand(final String str, final String str2) {
        A4 a4 = this.d;
        if (a4 != null) {
            ((B4) a4).a(AbstractC0292q5.a, "expand called");
        }
        if (this.b != 1) {
            S9 s9 = this.a;
            if (s9 == null) {
                A4 a42 = this.d;
                if (a42 != null) {
                    ((B4) a42).b(AbstractC0292q5.a, "Found a null instance of render view!");
                    return;
                }
                return;
            }
            if (!s9.k()) {
                this.a.a("expand");
                return;
            }
            A4 a43 = this.d;
            if (a43 != null) {
                String str3 = AbstractC0292q5.a;
                ((B4) a43).a(str3, AbstractC0408z5.a(str3, "access$getTAG$p(...)", "expand called. Url:", str2));
            }
            S9 s92 = this.a;
            if (s92.E != oc.c) {
                s92.a(str, "Creative is not visible. Ignoring request.", "expand");
                return;
            }
            if (str2 != null && str2.length() > 0 && !StringsKt.O(str2, "http", false, 2, (Object) null)) {
                this.a.a(str, "Invalid URL", "expand");
                return;
            }
            if (URLUtil.isValidUrl(str2)) {
                this.a.i();
            }
            new Handler(this.a.getContainerContext().getMainLooper()).post(new Runnable() {
                @Override
                public final void run() {
                    C0279p5.a(C0279p5.this, str2, str);
                }
            });
        }
    }

    @JavascriptInterface
    public final void fireAdFailed(String str) {
        try {
            A4 a4 = this.d;
            if (a4 != null) {
                ((B4) a4).a(AbstractC0292q5.a, "fireAdFailed called.");
            }
            S9 s9 = this.a;
            Z9 z9 = s9.T;
            if (z9 != null) {
                Map a = z9.a();
                long j = z9.b;
                ScheduledExecutorService scheduledExecutorService = Vb.a;
                a.put("latency", Long.valueOf(SystemClock.elapsedRealtime() - j));
                C0134eb c0134eb = C0134eb.a;
                C0134eb.b("FireAdFailed", a, EnumC0204jb.a);
            }
            s9.getListener().g(s9);
        } catch (Exception e) {
            this.a.a(str, "Unexpected error", "fireAdFailed");
            A4 a42 = this.d;
            if (a42 != null) {
                String str2 = AbstractC0292q5.a;
                ((B4) a42).b(str2, Cc.a(e, A5.a(str2, "access$getTAG$p(...)", "SDK encountered unexpected error in handling fireAdFailed() signal from creative; ")));
            }
        }
    }

    @JavascriptInterface
    public final void fireAdReady(String str) {
        try {
            A4 a4 = this.d;
            if (a4 != null) {
                ((B4) a4).a(AbstractC0292q5.a, "fireAdReady called.");
            }
            this.a.h();
        } catch (Exception e) {
            this.a.a(str, "Unexpected error", "fireAdReady");
            A4 a42 = this.d;
            if (a42 != null) {
                String str2 = AbstractC0292q5.a;
                ((B4) a42).b(str2, Cc.a(e, A5.a(str2, "access$getTAG$p(...)", "SDK encountered unexpected error in handling fireAdReady() signal from creative; ")));
            }
        }
    }

    @JavascriptInterface
    public final void fireComplete(String str) {
        A4 a4 = this.d;
        if (a4 != null) {
            ((B4) a4).a(AbstractC0292q5.a, "fireComplete is called");
        }
        S9 s9 = this.a;
        if (s9 == null) {
            A4 a42 = this.d;
            if (a42 != null) {
                ((B4) a42).b(AbstractC0292q5.a, "Found a null instance of render view!");
                return;
            }
            return;
        }
        A4 a43 = s9.j;
        if (a43 != null) {
            String str2 = S9.O0;
            ((B4) a43).c(str2, G9.a(s9, str2, "TAG", "completeFromInterActive "));
        }
        A2 a2 = s9.H0;
        if (a2 != null && !a2.g.get()) {
            a2.d.i = 1;
        }
        A4 a44 = s9.j;
        if (a44 != null) {
            ((B4) a44).a(S9.O0, "completeFromInterActive");
        }
    }

    @JavascriptInterface
    public final void fireSkip(String str) {
        A4 a4;
        A4 a42 = this.d;
        if (a42 != null) {
            ((B4) a42).a(AbstractC0292q5.a, "fireSkip is called");
        }
        if (this.a == null && (a4 = this.d) != null) {
            ((B4) a4).b(AbstractC0292q5.a, "Found a null instance of render view!");
        }
        S9 s9 = this.a;
        A4 a43 = s9.j;
        if (a43 != null) {
            String str2 = S9.O0;
            ((B4) a43).c(str2, G9.a(s9, str2, "TAG", "skipFromInterActive "));
        }
        A2 a2 = s9.H0;
        if (a2 != null && !a2.g.get()) {
            a2.d.h = 1;
        }
        A4 a44 = s9.j;
        if (a44 != null) {
            ((B4) a44).a(S9.O0, "skipFromInterActive");
        }
    }

    @JavascriptInterface
    public final String getAdContext(String str) {
        A4 a4 = this.d;
        if (a4 != null) {
            ((B4) a4).a(AbstractC0292q5.a, "getAdContext is called");
        }
        K adPodHandler = this.a.getAdPodHandler();
        if (adPodHandler != null) {
            return ((AbstractC0364w0) adPodHandler).K();
        }
        return null;
    }

    @JavascriptInterface
    public final void getBlob(String str, String str2) {
        F1 f1;
        A4 a4 = this.d;
        if (a4 != null) {
            ((B4) a4).a(AbstractC0292q5.a, "getBlob is called");
        }
        S9 s9 = this.a;
        if (s9 == null) {
            A4 a42 = this.d;
            if (a42 != null) {
                ((B4) a42).b(AbstractC0292q5.a, "Found a null instance of render view!");
                return;
            }
            return;
        }
        A4 a43 = s9.j;
        if (a43 != null) {
            ((B4) a43).a(S9.O0, "getBlob");
        }
        if (str == null || str2 == null || (f1 = s9.W) == null) {
            return;
        }
        ((AbstractC0364w0) f1).a(str, str2, s9, s9.getImpressionId());
    }

    @JavascriptInterface
    public final String getCurrentPosition(String str) {
        S9 s9;
        A4 a4 = this.d;
        if (a4 != null) {
            ((B4) a4).a(AbstractC0292q5.a, "getCurrentPosition called");
        }
        S9 s92 = this.a;
        if (s92 == null) {
            A4 a42 = this.d;
            if (a42 == null) {
                return "";
            }
            ((B4) a42).b(AbstractC0292q5.a, "Found a null instance of render view!");
            return "";
        }
        synchronized (s92.getCurrentPositionMonitor()) {
            this.a.B = true;
            new Handler(this.a.getContainerContext().getMainLooper()).post(new Runnable() {
                @Override
                public final void run() {
                    C0279p5.b(C0279p5.this);
                }
            });
            while (true) {
                s9 = this.a;
                if (s9.B) {
                    try {
                        s9.getCurrentPositionMonitor().wait();
                    } catch (InterruptedException unused) {
                    }
                } else {
                    Unit unit = Unit.a;
                }
            }
        }
        return s9.getCurrentPosition();
    }

    @JavascriptInterface
    public final int getCurrentRenderingIndex(String str) {
        A4 a4 = this.d;
        if (a4 != null) {
            ((B4) a4).a(AbstractC0292q5.a, "getCurrentRenderingIndex is called");
        }
        return this.a.getCurrentRenderingPodAdIndex();
    }

    @JavascriptInterface
    public final String getDefaultPosition(String str) {
        S9 s9;
        A4 a4 = this.d;
        if (a4 != null) {
            ((B4) a4).a(AbstractC0292q5.a, "getDefaultPosition called");
        }
        S9 s92 = this.a;
        if (s92 == null) {
            A4 a42 = this.d;
            if (a42 != null) {
                ((B4) a42).b(AbstractC0292q5.a, "Found a null instance of render view!");
            }
            return new JSONObject().toString();
        }
        synchronized (s92.getDefaultPositionMonitor()) {
            this.a.A = true;
            new Handler(this.a.getContainerContext().getMainLooper()).post(new Runnable() {
                @Override
                public final void run() {
                    C0279p5.c(C0279p5.this);
                }
            });
            while (true) {
                s9 = this.a;
                if (s9.A) {
                    try {
                        s9.getDefaultPositionMonitor().wait();
                    } catch (InterruptedException unused) {
                    }
                } else {
                    Unit unit = Unit.a;
                }
            }
        }
        return s9.getDefaultPosition();
    }

    @JavascriptInterface
    public final int getDeviceVolume(String str) {
        A4 a4 = this.d;
        if (a4 != null) {
            ((B4) a4).a(AbstractC0292q5.a, "getDeviceVolume called");
        }
        S9 s9 = this.a;
        if (s9 == null) {
            A4 a42 = this.d;
            if (a42 != null) {
                ((B4) a42).b(AbstractC0292q5.a, "Found a null instance of render view!");
            }
            return -1;
        }
        try {
            C0396y6 mediaProcessor = s9.getMediaProcessor();
            if (mediaProcessor != null) {
                return mediaProcessor.a();
            }
        } catch (Exception e) {
            this.a.a(str, "Unexpected error", "getDeviceVolume");
            A4 a43 = this.d;
            if (a43 != null) {
                String str2 = AbstractC0292q5.a;
                ((B4) a43).b(str2, Cc.a(e, A5.a(str2, "access$getTAG$p(...)", "SDK encountered unexpected error in handling getDeviceVolume() request from creative; ")));
            }
        }
        return -1;
    }

    @JavascriptInterface
    public final String getExpandProperties(String str) {
        A4 a4 = this.d;
        if (a4 != null) {
            ((B4) a4).a(AbstractC0292q5.a, "getExpandedProperties called");
        }
        S9 s9 = this.a;
        if (s9 != null) {
            return s9.getExpandProperties().b;
        }
        A4 a42 = this.d;
        if (a42 == null) {
            return "";
        }
        ((B4) a42).b(AbstractC0292q5.a, "Found a null instance of render view!");
        return "";
    }

    @JavascriptInterface
    public final int getMaxDeviceVolume(String str) {
        A4 a4 = this.d;
        if (a4 != null) {
            ((B4) a4).a(AbstractC0292q5.a, "getMaxDeviceVolume called");
        }
        try {
            return C0084b3.a.m();
        } catch (Exception e) {
            this.a.a(str, "Unexpected error", "getMaxDeviceVolume");
            A4 a42 = this.d;
            if (a42 == null) {
                return 0;
            }
            String str2 = AbstractC0292q5.a;
            ((B4) a42).b(str2, Cc.a(e, A5.a(str2, "access$getTAG$p(...)", "SDK encountered unexpected error in handling getMaxDeviceVolume() request from creative; ")));
            return 0;
        }
    }

    @JavascriptInterface
    public final String getMaxSize(String str) {
        int i;
        int i2;
        A4 a4 = this.d;
        if (a4 != null) {
            ((B4) a4).a(AbstractC0292q5.a, "getMaxSize called");
        }
        JSONObject jSONObject = new JSONObject();
        try {
            Activity fullScreenActivity = this.a.getFullScreenActivity();
            if (fullScreenActivity == null) {
                Context containerContext = this.a.getContainerContext();
                if ((containerContext instanceof Activity ? (Activity) containerContext : null) == null) {
                    return getScreenSize(str);
                }
                fullScreenActivity = (Activity) this.a.getContainerContext();
            }
            FrameLayout frameLayout = (FrameLayout) fullScreenActivity.findViewById(R.id.content);
            int a = AbstractC0210k3.a(frameLayout.getWidth());
            int a2 = AbstractC0210k3.a(frameLayout.getHeight());
            if (this.a.getFullScreenActivity() != null && (a == 0 || a2 == 0)) {
                ViewTreeObserverOnGlobalLayoutListenerC0253n5 viewTreeObserverOnGlobalLayoutListenerC0253n5 = new ViewTreeObserverOnGlobalLayoutListenerC0253n5(frameLayout, this.d);
                frameLayout.getViewTreeObserver().addOnGlobalLayoutListener(viewTreeObserverOnGlobalLayoutListenerC0253n5);
                Boolean bool = Boolean.FALSE;
                synchronized (bool) {
                    try {
                        bool.wait();
                    } catch (InterruptedException unused) {
                    }
                    i = viewTreeObserverOnGlobalLayoutListenerC0253n5.c;
                    i2 = viewTreeObserverOnGlobalLayoutListenerC0253n5.d;
                    Unit unit = Unit.a;
                }
                a2 = i2;
                a = i;
            }
            try {
                jSONObject.put("width", a);
                jSONObject.put("height", a2);
            } catch (JSONException e) {
                A4 a42 = this.d;
                if (a42 != null) {
                    ((B4) a42).a(AbstractC0292q5.a, "Error while creating max size Json.", e);
                }
            }
            A4 a43 = this.d;
            if (a43 != null) {
                ((B4) a43).a(AbstractC0292q5.a, "getMaxSize called:" + jSONObject);
            }
        } catch (Exception e2) {
            this.a.a(str, "Unexpected error", "getMaxSize");
            A4 a44 = this.d;
            if (a44 != null) {
                String str2 = AbstractC0292q5.a;
                ((B4) a44).b(str2, Cc.a(e2, A5.a(str2, "access$getTAG$p(...)", "SDK encountered unexpected error in handling getMaxSize() request from creative; ")));
            }
        }
        return jSONObject.toString();
    }

    @JavascriptInterface
    public final String getOrientation(String str) {
        A4 a4 = this.d;
        if (a4 != null) {
            ((B4) a4).a(AbstractC0292q5.a, "getOrientation called");
        }
        byte g = AbstractC0210k3.g();
        return g == 1 ? "0" : g == 3 ? "90" : g == 2 ? "180" : g == 4 ? "270" : "-1";
    }

    @JavascriptInterface
    public final String getOrientationProperties(String str) {
        C0132e9 c0132e9 = this.c;
        String str2 = c0132e9 != null ? c0132e9.d : null;
        A4 a4 = this.d;
        if (a4 != null) {
            String str3 = AbstractC0292q5.a;
            ((B4) a4).a(str3, AbstractC0408z5.a(str3, "access$getTAG$p(...)", "getOrientationProperties called: ", str2));
        }
        return str2;
    }

    @JavascriptInterface
    public final String getPlacementType(String str) {
        A4 a4 = this.d;
        if (a4 != null) {
            ((B4) a4).a(AbstractC0292q5.a, "getPlacementType called");
        }
        return 1 == this.b ? "interstitial" : "inline";
    }

    @JavascriptInterface
    public final String getPlatform(String str) {
        A4 a4 = this.d;
        if (a4 == null) {
            return "android";
        }
        ((B4) a4).a(AbstractC0292q5.a, "getPlatform. Platform:android");
        return "android";
    }

    @JavascriptInterface
    public final String getPlatformVersion(String str) {
        String valueOf = String.valueOf(Build.VERSION.SDK_INT);
        A4 a4 = this.d;
        if (a4 != null) {
            String str2 = AbstractC0292q5.a;
            ((B4) a4).a(str2, AbstractC0408z5.a(str2, "access$getTAG$p(...)", "getPlatformVersion. Version:", valueOf));
        }
        return valueOf;
    }

    @JavascriptInterface
    public final String getRenderableAdIndexes(String str) {
        A4 a4 = this.d;
        if (a4 != null) {
            ((B4) a4).a(AbstractC0292q5.a, "getRenderableAdIndexes is called");
        }
        JSONArray renderableAdIndexes = this.a.getRenderableAdIndexes();
        A4 a42 = this.d;
        if (a42 != null) {
            ((B4) a42).a(AbstractC0292q5.a, "renderableAdIndexes called:" + renderableAdIndexes);
        }
        return renderableAdIndexes.toString();
    }

    @JavascriptInterface
    public final String getResizeProperties(String str) {
        A4 a4 = this.d;
        if (a4 != null) {
            ((B4) a4).a(AbstractC0292q5.a, "getResizeProperties called");
        }
        S9 s9 = this.a;
        if (s9 == null) {
            A4 a42 = this.d;
            if (a42 != null) {
                ((B4) a42).b(AbstractC0292q5.a, "Found a null instance of render view!");
            }
            return "";
        }
        C0231la resizeProperties = s9.getResizeProperties();
        if (resizeProperties == null) {
            return "";
        }
        JSONObject a = new C0240m5().a(resizeProperties);
        String jSONObject = a != null ? a.toString() : null;
        return jSONObject == null ? "" : jSONObject;
    }

    @JavascriptInterface
    public final String getSafeArea(String str) {
        S9 s9 = this.a;
        if (!s9.D0) {
            return null;
        }
        Integer navBarTypeViaSettings = s9.getNavBarTypeViaSettings();
        if (navBarTypeViaSettings == null) {
            navBarTypeViaSettings = this.a.getNavBarTypeViaInsets();
        }
        JSONObject jSONObject = this.a.getSafeArea().get(navBarTypeViaSettings);
        A4 a4 = this.d;
        if (a4 != null) {
            ((B4) a4).a(AbstractC0292q5.a, "getSafeArea called:" + jSONObject);
        }
        if (jSONObject != null) {
            return jSONObject.toString();
        }
        return null;
    }

    @JavascriptInterface
    public final String getScreenSize(String str) {
        JSONObject jSONObject = new JSONObject();
        try {
            jSONObject.put("width", AbstractC0210k3.h().a);
            jSONObject.put("height", AbstractC0210k3.h().b);
        } catch (JSONException unused) {
        } catch (Exception e) {
            this.a.a(str, "Unexpected error", "getScreenSize");
            A4 a4 = this.d;
            if (a4 != null) {
                String str2 = AbstractC0292q5.a;
                ((B4) a4).b(str2, Cc.a(e, A5.a(str2, "access$getTAG$p(...)", "SDK encountered unexpected error while getting screen dimensions; ")));
            }
        }
        String jSONObject2 = jSONObject.toString();
        A4 a42 = this.d;
        if (a42 != null) {
            String str3 = AbstractC0292q5.a;
            ((B4) a42).a(str3, AbstractC0408z5.a(str3, "access$getTAG$p(...)", "getScreenSize called:", jSONObject2));
        }
        return jSONObject2;
    }

    @JavascriptInterface
    public final String getSdkVersion(String str) {
        A4 a4 = this.d;
        if (a4 == null) {
            return "10.7.8";
        }
        ((B4) a4).a(AbstractC0292q5.a, "getSdkVersion called. Version:10.7.8");
        return "10.7.8";
    }

    @JavascriptInterface
    public final long getShowTimeStamp(String str) {
        A4 a4 = this.d;
        if (a4 != null) {
            ((B4) a4).a(AbstractC0292q5.a, "getShowTimeStamp is called");
        }
        long showTimeStamp = this.a.getShowTimeStamp();
        A4 a42 = this.d;
        if (a42 != null) {
            ((B4) a42).a(AbstractC0292q5.a, "getShowTimeStamp is " + showTimeStamp);
        }
        return showTimeStamp;
    }

    @JavascriptInterface
    public final String getState(String str) {
        String lowerCase = this.a.getViewState().toLowerCase(Locale.ENGLISH);
        A4 a4 = this.d;
        if (a4 != null) {
            String str2 = AbstractC0292q5.a;
            ((B4) a4).c(str2, AbstractC0408z5.a(str2, "access$getTAG$p(...)", "getState called:", lowerCase));
        }
        return lowerCase;
    }

    @JavascriptInterface
    public final String getVersion(String str) {
        A4 a4 = this.d;
        if (a4 == null) {
            return "2.0";
        }
        ((B4) a4).a(AbstractC0292q5.a, "getVersion called. Version:2.0");
        return "2.0";
    }

    @JavascriptInterface
    public final void impressionFired(String str) {
        A4 a4 = this.d;
        if (a4 != null) {
            ((B4) a4).a(AbstractC0292q5.a, "impressionFired is called");
        }
        S9 s9 = this.a;
        A4 a42 = s9.j;
        if (a42 != null) {
            String str2 = S9.O0;
            ((B4) a42).a(str2, G9.a(s9, str2, "TAG", "onImpressionFired "));
        }
        A4 a43 = s9.j;
        if (a43 != null) {
            String str3 = S9.O0;
            ((B4) a43).a(str3, G9.a(s9, str3, "TAG", "recordContextualData "));
        }
        A2 a2 = s9.H0;
        if (a2 != null) {
            a2.a();
        }
        s9.getListener().a(s9.getTelemetryOnAdImpression());
    }

    @JavascriptInterface
    public final void incentCompleted(String str, String str2) {
        A4 a4 = this.d;
        if (a4 != null) {
            String str3 = AbstractC0292q5.a;
            ((B4) a4).a(str3, AbstractC0408z5.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");
                A4 a42 = this.d;
                if (a42 != null) {
                    String str4 = AbstractC0292q5.a;
                    ((B4) a42).b(str4, Cc.a(e, A5.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();
            while (keys.hasNext()) {
                String next = keys.next();
                hashMap.put(next, jSONObject.get(next));
            }
            try {
                try {
                    this.a.getListener().b(hashMap);
                } catch (Exception e2) {
                    this.a.a(str, "Unexpected error", "incentCompleted");
                    A4 a43 = this.d;
                    if (a43 != null) {
                        ((B4) a43).b(AbstractC0292q5.a, "SDK encountered unexpected error in handling onUserInteraction() signal from creative; " + e2.getMessage());
                    }
                }
            } catch (Exception e3) {
                this.a.a(str, "Unexpected error", "incentCompleted");
                A4 a44 = this.d;
                if (a44 != null) {
                    String str5 = AbstractC0292q5.a;
                    ((B4) a44).b(str5, Cc.a(e3, A5.a(str5, "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) {
        A4 a4 = this.d;
        if (a4 != null) {
            ((B4) a4).a(AbstractC0292q5.a, "isBackButtonDisabled called");
        }
        S9 s9 = this.a;
        if (s9 != null) {
            return s9.G;
        }
        A4 a42 = this.d;
        if (a42 == null) {
            return false;
        }
        ((B4) a42).b(AbstractC0292q5.a, "Found a null instance of render view!");
        return false;
    }

    @JavascriptInterface
    public final String isDeviceMuted(String str) {
        A4 a4 = this.d;
        if (a4 != null) {
            ((B4) a4).a(AbstractC0292q5.a, "isDeviceMuted called");
        }
        if (this.a == null) {
            A4 a42 = this.d;
            if (a42 == null) {
                return "false";
            }
            ((B4) a42).b(AbstractC0292q5.a, "Found a null instance of render view!");
            return "false";
        }
        A4 a43 = this.d;
        if (a43 != null) {
            ((B4) a43).a(AbstractC0292q5.a, "JavaScript called: isDeviceMuted()");
        }
        boolean z = false;
        try {
            A4 a44 = this.a.getMediaProcessor().b;
            if (a44 != null) {
                ((B4) a44).c("MraidMediaProcessor", "isVolumeMuted");
            }
            Context d = Ha.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) {
            A4 a45 = this.d;
            if (a45 != null) {
                String str2 = AbstractC0292q5.a;
                ((B4) a45).b(str2, Cc.a(e, A5.a(str2, "access$getTAG$p(...)", "SDK encountered unexpected error in checking if device is muted; ")));
            }
        }
        return String.valueOf(z);
    }

    @JavascriptInterface
    public final String isHeadphonePlugged(String str) {
        boolean z;
        A4 a4 = this.d;
        if (a4 != null) {
            ((B4) a4).a(AbstractC0292q5.a, "isHeadphonePlugged called");
        }
        if (this.a == null) {
            A4 a42 = this.d;
            if (a42 == null) {
                return "false";
            }
            ((B4) a42).b(AbstractC0292q5.a, "Found a null instance of render view!");
            return "false";
        }
        A4 a43 = this.d;
        if (a43 != null) {
            ((B4) a43).a(AbstractC0292q5.a, "JavaScript called: isHeadphonePlugged()");
        }
        try {
            this.a.getMediaProcessor().getClass();
            z = C0396y6.b();
        } catch (Exception e) {
            A4 a44 = this.d;
            if (a44 != null) {
                String str2 = AbstractC0292q5.a;
                ((B4) a44).b(str2, Cc.a(e, A5.a(str2, "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 = AbstractC0292q5.a;
        S9 s9 = this.a;
        if (s9 != null) {
            return s9.E == oc.c;
        }
        A4 a4 = this.d;
        if (a4 != null) {
            ((B4) a4).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, String str2) {
        A4 a4 = this.d;
        if (a4 != null) {
            String str3 = AbstractC0292q5.a;
            ((B4) a4).c(str3, AbstractC0408z5.a(str3, "access$getTAG$p(...)", "Log called. Message:", str2));
        }
        S9 s9 = this.a;
        s9.getClass();
        K9 k9 = S9.M0;
        k9.getClass();
        if (!((Boolean) S9.P0.getValue(k9, K9.a[0])).booleanValue() || str2 == null) {
            return;
        }
        s9.getListener().a(str2);
    }

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

    @JavascriptInterface
    public final void onAudioStateChanged(String str, int i) {
        A4 a4 = this.d;
        if (a4 != null) {
            ((B4) a4).a(AbstractC0292q5.a, "onAudioStateChanged is called: " + i);
        }
        EnumC0166h1.b.getClass();
        EnumC0166h1 enumC0166h1 = (EnumC0166h1) EnumC0166h1.c.get(i);
        if (enumC0166h1 == null) {
            enumC0166h1 = EnumC0166h1.d;
        }
        if (enumC0166h1 != EnumC0166h1.d) {
            this.a.getListener().a(enumC0166h1);
        }
    }

    @JavascriptInterface
    public final void onOrientationChange(String str) {
        A4 a4 = this.d;
        if (a4 != null) {
            ((B4) a4).a(AbstractC0292q5.a, ">>> onOrientationChange() >>> This API is deprecated!");
        }
    }

    @JavascriptInterface
    public final void onUserAudioMuteInteraction(String str, boolean z) {
        A4 a4 = this.d;
        if (a4 != null) {
            ((B4) a4).a(AbstractC0292q5.a, "onAudioMuteInteraction is called: " + z);
        }
        this.a.getListener().a(z);
    }

    @JavascriptInterface
    public final void onUserInteraction(String str, String str2) {
        A4 a4 = this.d;
        if (a4 != null) {
            ((B4) a4).a(AbstractC0292q5.a, "onUserInteraction called");
        }
        S9 s9 = this.a;
        if (s9 != null && !s9.k()) {
            this.a.a("onUserInteraction");
            return;
        }
        A4 a42 = this.d;
        if (a42 != null) {
            String str3 = AbstractC0292q5.a;
            ((B4) a42).a(str3, AbstractC0408z5.a(str3, "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");
                A4 a43 = this.d;
                if (a43 != null) {
                    String str4 = AbstractC0292q5.a;
                    ((B4) a43).b(str4, Cc.a(e, A5.a(str4, "access$getTAG$p(...)", "SDK encountered unexpected error in handling onUserInteraction() signal from creative; ")));
                    return;
                }
                return;
            }
        }
        try {
            try {
                JSONObject jSONObject = new JSONObject(str2);
                HashMap hashMap = new HashMap();
                Iterator<String> keys = jSONObject.keys();
                while (keys.hasNext()) {
                    String next = keys.next();
                    hashMap.put(next, jSONObject.get(next));
                }
                try {
                    this.a.getListener().a(hashMap);
                } catch (Exception e2) {
                    this.a.a(str, "Unexpected error", "onUserInteraction");
                    A4 a44 = this.d;
                    if (a44 != null) {
                        ((B4) a44).b(AbstractC0292q5.a, "SDK encountered unexpected error in handling onUserInteraction() signal from creative; " + e2.getMessage());
                    }
                }
            } catch (JSONException unused) {
                this.a.getListener().a(new HashMap());
            }
        } catch (Exception e3) {
            this.a.a(str, "Unexpected error", "onUserInteraction");
            A4 a45 = this.d;
            if (a45 != null) {
                String str5 = AbstractC0292q5.a;
                ((B4) a45).b(str5, Cc.a(e3, A5.a(str5, "access$getTAG$p(...)", "SDK encountered unexpected error in handling onUserInteraction() signal from creative; ")));
            }
        }
    }

    @JavascriptInterface
    public final void open(final String str, final String str2) {
        A4 a4 = this.d;
        if (a4 != null) {
            ((B4) a4).a(AbstractC0292q5.a, "open called");
        }
        String a = this.a.getLandingPageHandler().a(str2);
        this.a.getLandingPageHandler().a("clickStartCalled", MapsKt.m(new Pair[]{TuplesKt.a("trigger", a)}));
        if (this.a.k()) {
            this.a.i();
            AbstractC0092bb.a(new Runnable() {
                @Override
                public final void run() {
                    C0279p5.b(C0279p5.this, str, str2);
                }
            });
        } else {
            this.a.a("open");
            this.a.getLandingPageHandler().a("landingsStartFailed", MapsKt.m(new Pair[]{TuplesKt.a("errorCode", 8), TuplesKt.a("trigger", a)}));
        }
    }

    @JavascriptInterface
    public final void openEmbedded(final String str, final String str2) {
        A4 a4 = this.d;
        if (a4 != null) {
            ((B4) a4).a(AbstractC0292q5.a, "openEmbedded called");
        }
        if (!this.a.k()) {
            this.a.a("openEmbedded");
        } else {
            this.a.i();
            AbstractC0092bb.a(new Runnable() {
                @Override
                public final void run() {
                    C0279p5.c(C0279p5.this, str, str2);
                }
            });
        }
    }

    @JavascriptInterface
    public final void openExternal(String str, String str2, String str3) {
        A4 a4 = this.d;
        if (a4 != null) {
            ((B4) a4).a(AbstractC0292q5.a, "open External");
        }
        S9 s9 = this.a;
        if (s9 == null) {
            A4 a42 = this.d;
            if (a42 != null) {
                ((B4) a42).b(AbstractC0292q5.a, "Found a null instance of render view!");
                return;
            }
            return;
        }
        if (!s9.k()) {
            this.a.a("openExternal");
            return;
        }
        this.a.i();
        A4 a43 = this.d;
        if (a43 != null) {
            String str4 = AbstractC0292q5.a;
            ((B4) a43).a(str4, AbstractC0408z5.a(str4, "access$getTAG$p(...)", "openExternal called with url: ", str2));
        }
        D5 landingPageHandler = this.a.getLandingPageHandler();
        landingPageHandler.getClass();
        if (str2 != null) {
            landingPageHandler.f(str, str2, str3);
            return;
        }
        if (str3 != null) {
            landingPageHandler.f(str, str3, null);
            return;
        }
        O9 o9 = landingPageHandler.d;
        if (o9 != null) {
            o9.a.a(str, "Empty url and fallback url", "openExternal");
        }
        A4 a44 = landingPageHandler.g;
        if (a44 != null) {
            ((B4) a44).b("D5", "Empty deeplink and fallback urls");
        }
    }

    @JavascriptInterface
    public final void openWithoutTracker(final String str, final String str2) {
        A4 a4 = this.d;
        if (a4 != null) {
            ((B4) a4).a(AbstractC0292q5.a, "openWithoutTracker called");
        }
        String a = this.a.getLandingPageHandler().a(str2);
        this.a.getLandingPageHandler().a("clickStartCalled", new HashMap());
        S9 s9 = this.a;
        if (s9 == null) {
            A4 a42 = this.d;
            if (a42 != null) {
                ((B4) a42).b(AbstractC0292q5.a, "Found a null instance of render view!");
            }
            this.a.getLandingPageHandler().a("landingsStartFailed", MapsKt.m(new Pair[]{TuplesKt.a("errorCode", 11), TuplesKt.a("trigger", a)}));
            return;
        }
        if (s9.k()) {
            AbstractC0092bb.a(new Runnable() {
                @Override
                public final void run() {
                    C0279p5.d(C0279p5.this, str, str2);
                }
            });
        } else {
            this.a.a("openWithoutTracker");
            this.a.getLandingPageHandler().a("landingsStartFailed", MapsKt.m(new Pair[]{TuplesKt.a("errorCode", 8), TuplesKt.a("trigger", a)}));
        }
    }

    @JavascriptInterface
    public final void ping(String str, String str2, boolean z) {
        A4 a4 = this.d;
        if (a4 != null) {
            ((B4) a4).a(AbstractC0292q5.a, "ping called");
        }
        if (this.a == null) {
            A4 a42 = this.d;
            if (a42 != null) {
                ((B4) a42).b(AbstractC0292q5.a, "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.e(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)) {
                A4 a43 = this.d;
                if (a43 != null) {
                    ((B4) a43).a(AbstractC0292q5.a, "JavaScript called ping() URL: >>> " + str2 + " <<<");
                }
                try {
                    Y1.a.a(str2, z, this.d);
                    return;
                } catch (Exception e) {
                    this.a.a(str, "Unexpected error", "ping");
                    Z5.a((byte) 1, "InMobi", "Failed to fire ping; SDK encountered unexpected error");
                    A4 a44 = this.d;
                    if (a44 != null) {
                        String str3 = AbstractC0292q5.a;
                        ((B4) a44).b(str3, Cc.a(e, A5.a(str3, "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) {
        A4 a4 = this.d;
        if (a4 != null) {
            ((B4) a4).a(AbstractC0292q5.a, "openInWebView called");
        }
        if (this.a == null) {
            A4 a42 = this.d;
            if (a42 != null) {
                ((B4) a42).b(AbstractC0292q5.a, "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.e(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)) {
                A4 a43 = this.d;
                if (a43 != null) {
                    ((B4) a43).a(AbstractC0292q5.a, "JavaScript called pingInWebView() URL: >>> " + str2 + " <<<");
                }
                try {
                    Y1.a.b(str2, z, this.d);
                    return;
                } catch (Exception e) {
                    this.a.a(str, "Unexpected error", "pingInWebView");
                    Z5.a((byte) 1, "InMobi", "Failed to fire ping; SDK encountered unexpected error");
                    A4 a44 = this.d;
                    if (a44 != null) {
                        String str3 = AbstractC0292q5.a;
                        ((B4) a44).b(str3, Cc.a(e, A5.a(str3, "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(final String str, final String str2) {
        if (this.a == null) {
            A4 a4 = this.d;
            if (a4 != null) {
                ((B4) a4).b(AbstractC0292q5.a, "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.e(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 && StringsKt.O(str2, "http", false, 2, (Object) null) && (StringsKt.A(str2, "mp4", false, 2, (Object) null) || StringsKt.A(str2, "avi", false, 2, (Object) null) || StringsKt.A(str2, "m4v", false, 2, (Object) null))) {
                A4 a42 = this.d;
                if (a42 != null) {
                    ((B4) a42).a(AbstractC0292q5.a, "JavaScript called: playVideo (" + str2 + ')');
                }
                new Handler(this.a.getContainerContext().getMainLooper()).post(new Runnable() {
                    @Override
                    public final void run() {
                        C0279p5.e(C0279p5.this, str, str2);
                    }
                });
                return;
            }
        }
        this.a.a(str, "Null or empty or invalid media playback URL supplied", "playVideo");
    }

    @JavascriptInterface
    public final void registerBackButtonPressedEventListener(String str) {
        A4 a4 = this.d;
        if (a4 != null) {
            ((B4) a4).a(AbstractC0292q5.a, "registerBackButtonPressedEventListener called");
        }
        S9 s9 = this.a;
        if (s9 == null) {
            A4 a42 = this.d;
            if (a42 != null) {
                ((B4) a42).b(AbstractC0292q5.a, "Found a null instance of render view!");
                return;
            }
            return;
        }
        try {
            A4 a43 = s9.j;
            if (a43 != null) {
                ((B4) a43).a(S9.O0, "registerBackButtonPressedEventListener " + s9);
            }
            s9.H = str;
        } catch (Exception e) {
            this.a.a(str, "Unexpected error", "registerBackButtonPressedEventListener");
            A4 a44 = this.d;
            if (a44 != null) {
                String str2 = AbstractC0292q5.a;
                ((B4) a44).b(str2, Cc.a(e, A5.a(str2, "access$getTAG$p(...)", "SDK encountered unexpected error in handling registerBackButtonPressedEventListener() request from creative; ")));
            }
        }
    }

    @JavascriptInterface
    public final void registerDeviceMuteEventListener(String str) {
        A4 a4 = this.d;
        if (a4 != null) {
            ((B4) a4).a(AbstractC0292q5.a, "registerDeviceMuteEventListener called");
        }
        S9 s9 = this.a;
        if (s9 == null) {
            A4 a42 = this.d;
            if (a42 != null) {
                ((B4) a42).b(AbstractC0292q5.a, "Found a null instance of render view!");
                return;
            }
            return;
        }
        if (str != null) {
            try {
                C0396y6 mediaProcessor = s9.getMediaProcessor();
                if (mediaProcessor == null || mediaProcessor.d != null) {
                    return;
                }
                C0199j6 c0199j6 = new C0199j6(new C0357v6(mediaProcessor, str));
                mediaProcessor.d = c0199j6;
                c0199j6.b();
            } catch (Exception e) {
                this.a.a(str, "Unexpected error", "registerDeviceMuteEventListener");
                A4 a43 = this.d;
                if (a43 != null) {
                    String str2 = AbstractC0292q5.a;
                    ((B4) a43).b(str2, Cc.a(e, A5.a(str2, "access$getTAG$p(...)", "SDK encountered unexpected error in handling registerDeviceMuteEventListener() request from creative; ")));
                }
            }
        }
    }

    @JavascriptInterface
    public final void registerDeviceVolumeChangeEventListener(String str) {
        Context d;
        A4 a4 = this.d;
        if (a4 != null) {
            ((B4) a4).a(AbstractC0292q5.a, "registerDeviceVolumeChangeEventListener called");
        }
        S9 s9 = this.a;
        if (s9 == null) {
            A4 a42 = this.d;
            if (a42 != null) {
                ((B4) a42).b(AbstractC0292q5.a, "Found a null instance of render view!");
                return;
            }
            return;
        }
        if (str != null) {
            try {
                C0396y6 mediaProcessor = s9.getMediaProcessor();
                if (mediaProcessor == null || (d = Ha.d()) == null || mediaProcessor.e != null) {
                    return;
                }
                C0199j6 c0199j6 = new C0199j6(new C0370w6(mediaProcessor, str, d, new Handler(Looper.getMainLooper())));
                mediaProcessor.e = c0199j6;
                c0199j6.b();
            } catch (Exception e) {
                this.a.a(str, "Unexpected error", "registerDeviceVolumeChangeEventListener");
                A4 a43 = this.d;
                if (a43 != null) {
                    String str2 = AbstractC0292q5.a;
                    ((B4) a43).b(str2, Cc.a(e, A5.a(str2, "access$getTAG$p(...)", "SDK encountered unexpected error in handling registerDeviceVolumeChangeEventListener() request from creative; ")));
                }
            }
        }
    }

    @JavascriptInterface
    public final void registerHeadphonePluggedEventListener(String str) {
        A4 a4 = this.d;
        if (a4 != null) {
            ((B4) a4).a(AbstractC0292q5.a, "registerHeadphonePluggedEventListener called");
        }
        S9 s9 = this.a;
        if (s9 == null) {
            A4 a42 = this.d;
            if (a42 != null) {
                ((B4) a42).b(AbstractC0292q5.a, "Found a null instance of render view!");
                return;
            }
            return;
        }
        if (str != null) {
            try {
                C0396y6 mediaProcessor = s9.getMediaProcessor();
                if (mediaProcessor == null || mediaProcessor.f != null) {
                    return;
                }
                C0199j6 c0199j6 = new C0199j6(new C0344u6(mediaProcessor, str));
                mediaProcessor.f = c0199j6;
                c0199j6.b();
            } catch (Exception e) {
                this.a.a(str, "Unexpected error", "registerHeadphonePluggedEventListener");
                A4 a43 = this.d;
                if (a43 != null) {
                    String str2 = AbstractC0292q5.a;
                    ((B4) a43).b(str2, Cc.a(e, A5.a(str2, "access$getTAG$p(...)", "SDK encountered unexpected error in handling registerHeadphonePluggedEventListener() request from creative; ")));
                }
            }
        }
    }

    @JavascriptInterface
    public final void resize(final String str) {
        A4 a4 = this.d;
        if (a4 != null) {
            ((B4) a4).a(AbstractC0292q5.a, "resize called");
        }
        if (this.b != 1) {
            if (this.a != null) {
                new Handler(Looper.getMainLooper()).post(new Runnable() {
                    @Override
                    public final void run() {
                        C0279p5.b(C0279p5.this, str);
                    }
                });
                return;
            }
            A4 a42 = this.d;
            if (a42 != null) {
                ((B4) a42).b(AbstractC0292q5.a, "Found a null instance of render view!");
            }
        }
    }

    @JavascriptInterface
    public final void saveBlob(String str, String str2) {
        F1 f1;
        A4 a4 = this.d;
        if (a4 != null) {
            ((B4) a4).a(AbstractC0292q5.a, "saveBlob is called");
        }
        S9 s9 = this.a;
        if (s9 == null) {
            A4 a42 = this.d;
            if (a42 != null) {
                ((B4) a42).b(AbstractC0292q5.a, "Found a null instance of render view!");
                return;
            }
            return;
        }
        A4 a43 = s9.j;
        if (a43 != null) {
            ((B4) a43).a(S9.O0, "saveBlob");
        }
        if (str2 == null || (f1 = s9.W) == null) {
            return;
        }
        ((AbstractC0364w0) f1).a(str2, s9.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");
                A4 a4 = this.d;
                if (a4 != null) {
                    String str4 = AbstractC0292q5.a;
                    ((B4) a4).b(str4, Cc.a(e, A5.a(str4, "access$getTAG$p(...)", "SDK encountered unexpected error in handling saveContent() request from creative; ")));
                    return;
                }
                return;
            }
        }
        A4 a42 = this.d;
        if (a42 != null) {
            ((B4) a42).a(AbstractC0292q5.a, "saveContent called with invalid parameters");
        }
        JSONObject jSONObject = new JSONObject();
        if (str3 == null) {
            str3 = "";
        }
        try {
            jSONObject.put("url", str3);
            jSONObject.put("reason", 8);
        } catch (JSONException unused) {
        }
        String K = StringsKt.K(jSONObject.toString(), "\"", "\\\"", false, 4, (Object) null);
        StringBuilder sb = new StringBuilder("sendSaveContentResult(\"saveContent_");
        if (str2 == null) {
            str2 = "";
        }
        sb.append(str2);
        sb.append("\", 'failed', \"");
        sb.append(K);
        sb.append("\");");
        this.a.a(str, sb.toString());
    }

    @JavascriptInterface
    public final void setAdContext(String str, String str2) {
        A4 a4 = this.d;
        if (a4 != null) {
            String str3 = AbstractC0292q5.a;
            ((B4) a4).a(str3, AbstractC0408z5.a(str3, "access$getTAG$p(...)", "setAdContext is called ", str2));
        }
        K adPodHandler = this.a.getAdPodHandler();
        if (adPodHandler != null) {
            ((AbstractC0364w0) adPodHandler).d(str2);
        }
    }

    @JavascriptInterface
    public final void setCloseEndCardTracker(String str, String str2) {
        A4 a4 = this.d;
        if (a4 != null) {
            ((B4) a4).a(AbstractC0292q5.a, "setCloseEndCardTracker is called");
        }
        S9 s9 = this.a;
        if (s9 == null) {
            A4 a42 = this.d;
            if (a42 != null) {
                ((B4) a42).b(AbstractC0292q5.a, "Found a null instance of render view!");
                return;
            }
            return;
        }
        try {
            s9.setCloseEndCardTracker(str2);
        } catch (Exception e) {
            this.a.a(str, "Unexpected error", "getDownloadStatus");
            A4 a43 = this.d;
            if (a43 != null) {
                String str3 = AbstractC0292q5.a;
                ((B4) a43).b(str3, Cc.a(e, A5.a(str3, "access$getTAG$p(...)", "SDK encountered unexpected error in handling getDownloadStatus() request from creative; ")));
            }
        }
    }

    @JavascriptInterface
    public final void setExpandProperties(String str, String str2) {
        A4 a4 = this.d;
        if (a4 != null) {
            String str3 = AbstractC0292q5.a;
            ((B4) a4).a(str3, AbstractC0408z5.a(str3, "access$getTAG$p(...)", "setExpandProperties called. Params:", str2));
        }
        S9 s9 = this.a;
        if (s9 == null) {
            A4 a42 = this.d;
            if (a42 != null) {
                ((B4) a42).b(AbstractC0292q5.a, "Found a null instance of render view!");
                return;
            }
            return;
        }
        if (Intrinsics.d("Expanded", s9.getViewState())) {
            A4 a43 = this.d;
            if (a43 != null) {
                ((B4) a43).b(AbstractC0292q5.a, "setExpandProperties can't be called on an already expanded ad.");
                return;
            }
            return;
        }
        try {
            this.a.setExpandProperties(H3.a(str2));
        } catch (Exception e) {
            this.a.a(str, "Unexpected error", "setExpandProperties");
            A4 a44 = this.d;
            if (a44 != null) {
                String str4 = AbstractC0292q5.a;
                ((B4) a44).b(str4, Cc.a(e, A5.a(str4, "access$getTAG$p(...)", "SDK encountered unexpected error in setExpandProperties(); ")));
            }
        }
    }

    @JavascriptInterface
    public final void setOrientationProperties(String str, final String str2) {
        A4 a4 = this.d;
        if (a4 != null) {
            String str3 = AbstractC0292q5.a;
            ((B4) a4).a(str3, AbstractC0408z5.a(str3, "access$getTAG$p(...)", "setOrientationProperties called: ", str2));
        }
        new Handler(this.a.getContainerContext().getMainLooper()).post(new Runnable() {
            @Override
            public final void run() {
                C0279p5.c(C0279p5.this, str2);
            }
        });
    }

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

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

    @JavascriptInterface
    public final void showAlert(String str, String str2) {
        A4 a4 = this.d;
        if (a4 != null) {
            String str3 = AbstractC0292q5.a;
            ((B4) a4).a(str3, AbstractC0408z5.a(str3, "access$getTAG$p(...)", "showAlert: ", str2));
        }
    }

    @JavascriptInterface
    public final void showEndCard(String str) {
        A4 a4 = this.d;
        if (a4 != null) {
            ((B4) a4).a(AbstractC0292q5.a, "showEndCard is called");
        }
        S9 s9 = this.a;
        if (s9 == null) {
            A4 a42 = this.d;
            if (a42 != null) {
                ((B4) a42).b(AbstractC0292q5.a, "Found a null instance of render view!");
                return;
            }
            return;
        }
        A4 a43 = s9.j;
        if (a43 != null) {
            ((B4) a43).a(S9.O0, "showEndCardFromInterActive");
        }
        r referenceContainer = s9.getReferenceContainer();
        if (referenceContainer instanceof M6) {
            ((M6) referenceContainer).p();
        }
    }

    @JavascriptInterface
    public final void storePicture(String str, String str2) {
        A4 a4 = this.d;
        if (a4 != null) {
            ((B4) a4).a(AbstractC0292q5.a, "storePicture is deprecated and no-op. ");
        }
    }

    @JavascriptInterface
    public final void submitAdReport(String str, String str2, String str3, String str4) {
        A4 a4 = this.d;
        if (a4 != null) {
            ((B4) a4).a(AbstractC0292q5.a, "submitAdReport called");
        }
        this.a.a(str2, str4, Intrinsics.d(str3, "1"));
    }

    @JavascriptInterface
    public final String supports(String str, String str2) {
        A4 a4 = this.d;
        if (a4 != null) {
            String str3 = AbstractC0292q5.a;
            ((B4) a4).a(str3, AbstractC0408z5.a(str3, "access$getTAG$p(...)", "Checking support for: ", str2));
        }
        return String.valueOf(this.a.f(str2));
    }

    @JavascriptInterface
    public final long timeSinceShow(String str) {
        A4 a4 = this.d;
        if (a4 != null) {
            ((B4) a4).a(AbstractC0292q5.a, "timeSinceShow is called");
        }
        S9 s9 = this.a;
        A4 a42 = s9.j;
        if (a42 != null) {
            String str2 = S9.O0;
            ((B4) a42).c(str2, G9.a(s9, str2, "TAG", "timeSincePodShow "));
        }
        K k = s9.d0;
        if (k != null) {
            return ((AbstractC0364w0) k).A0();
        }
        return 0L;
    }

    @JavascriptInterface
    public final void unregisterBackButtonPressedEventListener(String str) {
        A4 a4 = this.d;
        if (a4 != null) {
            ((B4) a4).a(AbstractC0292q5.a, "unregisterBackButtonPressedEventListener called");
        }
        S9 s9 = this.a;
        if (s9 == null) {
            A4 a42 = this.d;
            if (a42 != null) {
                ((B4) a42).b(AbstractC0292q5.a, "Found a null instance of render view!");
                return;
            }
            return;
        }
        try {
            A4 a43 = s9.j;
            if (a43 != null) {
                ((B4) a43).a(S9.O0, "unregisterBackButtonPressedEventListener " + s9);
            }
            s9.H = null;
        } catch (Exception e) {
            this.a.a(str, "Unexpected error", "unregisterBackButtonPressedEventListener");
            A4 a44 = this.d;
            if (a44 != null) {
                String str2 = AbstractC0292q5.a;
                ((B4) a44).b(str2, Cc.a(e, A5.a(str2, "access$getTAG$p(...)", "SDK encountered unexpected error in handling unregisterBackButtonPressedEventListener() request from creative; ")));
            }
        }
    }

    @JavascriptInterface
    public final void unregisterDeviceMuteEventListener(String str) {
        A4 a4 = this.d;
        if (a4 != null) {
            ((B4) a4).a(AbstractC0292q5.a, "unregisterDeviceMuteEventListener called");
        }
        if (this.a == null) {
            A4 a42 = this.d;
            if (a42 != null) {
                ((B4) a42).b(AbstractC0292q5.a, "Found a null instance of render view!");
                return;
            }
            return;
        }
        A4 a43 = this.d;
        if (a43 != null) {
            ((B4) a43).a(AbstractC0292q5.a, "Unregister device mute event listener ...");
        }
        try {
            C0396y6 mediaProcessor = this.a.getMediaProcessor();
            if (mediaProcessor != null) {
                C0199j6 c0199j6 = mediaProcessor.d;
                if (c0199j6 != null) {
                    c0199j6.a();
                }
                mediaProcessor.d = null;
            }
        } catch (Exception e) {
            this.a.a(str, "Unexpected error", "unRegisterDeviceMuteEventListener");
            A4 a44 = this.d;
            if (a44 != null) {
                String str2 = AbstractC0292q5.a;
                ((B4) a44).b(str2, Cc.a(e, A5.a(str2, "access$getTAG$p(...)", "SDK encountered unexpected error in handling unregisterDeviceMuteEventListener() request from creative; ")));
            }
        }
    }

    @JavascriptInterface
    public final void unregisterDeviceVolumeChangeEventListener(String str) {
        A4 a4 = this.d;
        if (a4 != null) {
            ((B4) a4).a(AbstractC0292q5.a, "unregisterDeviceVolumeChangeEventListener called");
        }
        if (this.a == null) {
            A4 a42 = this.d;
            if (a42 != null) {
                ((B4) a42).b(AbstractC0292q5.a, "Found a null instance of render view!");
                return;
            }
            return;
        }
        A4 a43 = this.d;
        if (a43 != null) {
            ((B4) a43).a(AbstractC0292q5.a, "Unregister device volume change listener ...");
        }
        try {
            C0396y6 mediaProcessor = this.a.getMediaProcessor();
            if (mediaProcessor != null) {
                C0199j6 c0199j6 = mediaProcessor.e;
                if (c0199j6 != null) {
                    c0199j6.a();
                }
                mediaProcessor.e = null;
            }
        } catch (Exception e) {
            this.a.a(str, "Unexpected error", "unregisterDeviceVolumeChangeEventListener");
            A4 a44 = this.d;
            if (a44 != null) {
                String str2 = AbstractC0292q5.a;
                ((B4) a44).b(str2, Cc.a(e, A5.a(str2, "access$getTAG$p(...)", "SDK encountered unexpected error in handling unregisterDeviceVolumeChangeEventListener() request from creative; ")));
            }
        }
    }

    @JavascriptInterface
    public final void unregisterHeadphonePluggedEventListener(String str) {
        A4 a4 = this.d;
        if (a4 != null) {
            ((B4) a4).a(AbstractC0292q5.a, "unregisterHeadphonePluggedEventListener called");
        }
        if (this.a == null) {
            A4 a42 = this.d;
            if (a42 != null) {
                ((B4) a42).b(AbstractC0292q5.a, "Found a null instance of render view!");
                return;
            }
            return;
        }
        A4 a43 = this.d;
        if (a43 != null) {
            ((B4) a43).a(AbstractC0292q5.a, "Unregister headphone plugged event listener ...");
        }
        try {
            C0396y6 mediaProcessor = this.a.getMediaProcessor();
            if (mediaProcessor != null) {
                C0199j6 c0199j6 = mediaProcessor.f;
                if (c0199j6 != null) {
                    c0199j6.a();
                }
                mediaProcessor.f = null;
            }
        } catch (Exception e) {
            this.a.a(str, "Unexpected error", "unregisterHeadphonePluggedEventListener");
            A4 a44 = this.d;
            if (a44 != null) {
                String str2 = AbstractC0292q5.a;
                ((B4) a44).b(str2, Cc.a(e, A5.a(str2, "access$getTAG$p(...)", "SDK encountered unexpected error in handling unregisterHeadphonePluggedEventListener() request from creative; ")));
            }
        }
    }

    @JavascriptInterface
    public final void useCustomClose(final String str, final boolean z) {
        A4 a4 = this.d;
        if (a4 != null) {
            ((B4) a4).a(AbstractC0292q5.a, "useCustomClose called:" + z);
        }
        new Handler(this.a.getContainerContext().getMainLooper()).post(new Runnable() {
            @Override
            public final void run() {
                C0279p5.b(C0279p5.this, z, str);
            }
        });
    }

    @JavascriptInterface
    public final void zoom(String str, final int i) {
        A4 a4 = this.d;
        if (a4 != null) {
            ((B4) a4).a(AbstractC0292q5.a, "zoom is called " + str + ' ' + i);
        }
        AbstractC0092bb.a(new Runnable() {
            @Override
            public final void run() {
                C0279p5.a(C0279p5.this, i);
            }
        });
    }

    public static final void b(C0279p5 c0279p5) {
        try {
            c0279p5.a.n();
        } catch (Exception e) {
            A4 a4 = c0279p5.d;
            if (a4 != null) {
                String str = AbstractC0292q5.a;
                ((B4) a4).b(str, Cc.a(e, A5.a(str, "access$getTAG$p(...)", "SDK encountered unexpected error in getting/setting current position; ")));
            }
        }
    }

    public static final void a(C0279p5 c0279p5, String str, int i, String str2, float f, boolean z) {
        try {
            if (c0279p5.a.getEmbeddedBrowserJSCallbacks() == null) {
                A4 a4 = c0279p5.d;
                if (a4 != null) {
                    ((B4) a4).b(AbstractC0292q5.a, "Found a null instance of EmbeddedBrowserJSCallback instance to customExpand");
                    return;
                }
                return;
            }
            A4 a42 = c0279p5.d;
            if (a42 != null) {
                ((B4) a42).a(AbstractC0292q5.a, "Custom expand called. Url: " + str);
            }
            EnumC0251n3 enumC0251n3 = EnumC0251n3.values()[i];
            if (enumC0251n3 == EnumC0251n3.a) {
                if (c0279p5.a.getLandingPageHandler().a(str2, str) == 3) {
                    InterfaceC0264o3 embeddedBrowserJSCallbacks = c0279p5.a.getEmbeddedBrowserJSCallbacks();
                    if (embeddedBrowserJSCallbacks != null) {
                        ((C0197j4) embeddedBrowserJSCallbacks).a(str, enumC0251n3, f, z, c0279p5.a.getViewTouchTimestamp(), c0279p5.a.m());
                        return;
                    }
                    return;
                }
                InterfaceC0264o3 embeddedBrowserJSCallbacks2 = c0279p5.a.getEmbeddedBrowserJSCallbacks();
                if (embeddedBrowserJSCallbacks2 != null) {
                    C0225l4.a(((C0197j4) embeddedBrowserJSCallbacks2).a);
                    return;
                }
                return;
            }
            InterfaceC0264o3 embeddedBrowserJSCallbacks3 = c0279p5.a.getEmbeddedBrowserJSCallbacks();
            if (embeddedBrowserJSCallbacks3 != null) {
                ((C0197j4) embeddedBrowserJSCallbacks3).a(str, enumC0251n3, f, z, c0279p5.a.getViewTouchTimestamp(), c0279p5.a.m());
            }
        } catch (Exception e) {
            c0279p5.a.a(str2, "Unexpected error", "customExpand");
            Z5.a((byte) 1, "InMobi", "Failed to custom expand ad; SDK encountered an unexpected error");
            A4 a43 = c0279p5.d;
            if (a43 != null) {
                String str3 = AbstractC0292q5.a;
                ((B4) a43).b(str3, Cc.a(e, A5.a(str3, "access$getTAG$p(...)", "SDK encountered unexpected error in handling customExpand() request; ")));
            }
        }
    }

    public static final void b(C0279p5 c0279p5, String str) {
        try {
            c0279p5.a.l();
        } catch (Exception e) {
            c0279p5.a.a(str, "Unexpected error", "resize");
            String str2 = AbstractC0292q5.a;
            Z5.a((byte) 1, str2, "Could not resize ad; SDK encountered an unexpected error");
            A4 a4 = c0279p5.d;
            if (a4 != null) {
                ((B4) a4).b(str2, Cc.a(e, A5.a(str2, "access$getTAG$p(...)", "SDK encountered an unexpected error in handling resize() request; ")));
            }
        }
    }

    public static final void c(C0279p5 c0279p5) {
        try {
            c0279p5.a.o();
        } catch (Exception e) {
            A4 a4 = c0279p5.d;
            if (a4 != null) {
                String str = AbstractC0292q5.a;
                ((B4) a4).b(str, Cc.a(e, A5.a(str, "access$getTAG$p(...)", "SDK encountered unexpected error in getting/setting default position; ")));
            }
        }
    }

    public static final void c(C0279p5 c0279p5, String str) {
        C0132e9 orientationProperties = c0279p5.a.getOrientationProperties();
        if (orientationProperties != null) {
            C0132e9 c0132e9 = new C0132e9();
            c0132e9.d = str;
            try {
                JSONObject jSONObject = new JSONObject(str);
                c0132e9.b = jSONObject.optString("forceOrientation", orientationProperties.b);
                c0132e9.a = jSONObject.optBoolean("allowOrientationChange", orientationProperties.a);
                c0132e9.c = jSONObject.optString("direction", orientationProperties.c);
                if (!Intrinsics.d(c0132e9.b, "portrait") && !Intrinsics.d(c0132e9.b, "landscape")) {
                    c0132e9.b = "none";
                }
                if (!Intrinsics.d(c0132e9.c, "left") && !Intrinsics.d(c0132e9.c, "right")) {
                    c0132e9.c = "right";
                }
            } catch (JSONException unused) {
                c0132e9 = null;
            }
            c0279p5.c = c0132e9;
        }
        C0132e9 c0132e92 = c0279p5.c;
        if (c0132e92 != null) {
            c0279p5.a.setOrientationProperties(c0132e92);
        }
    }

    public static final void b(C0279p5 c0279p5, boolean z, String str) {
        try {
            c0279p5.a.e(z);
        } catch (Exception e) {
            c0279p5.a.a(str, "Unexpected error", "useCustomClose");
            A4 a4 = c0279p5.d;
            if (a4 != null) {
                String str2 = AbstractC0292q5.a;
                ((B4) a4).b(str2, Cc.a(e, A5.a(str2, "access$getTAG$p(...)", "SDK encountered internal error in handling useCustomClose() request from creative; ")));
            }
        }
    }

    public static final void a(C0279p5 c0279p5) {
        if (c0279p5.a.getEmbeddedBrowserJSCallbacks() == null) {
            A4 a4 = c0279p5.d;
            if (a4 != null) {
                ((B4) a4).b(AbstractC0292q5.a, "Found a null instance of EmbeddedBrowserJSCallback instance to closeCustomExpand");
                return;
            }
            return;
        }
        InterfaceC0264o3 embeddedBrowserJSCallbacks = c0279p5.a.getEmbeddedBrowserJSCallbacks();
        if (embeddedBrowserJSCallbacks != null) {
            C0225l4.a(((C0197j4) embeddedBrowserJSCallbacks).a);
        }
    }

    public static final void a(C0279p5 c0279p5, String str) {
        try {
            r referenceContainer = c0279p5.a.getReferenceContainer();
            if (referenceContainer != null) {
                referenceContainer.a();
            }
        } catch (Exception e) {
            c0279p5.a.a(str, "Unexpected error", "close");
            Z5.a((byte) 1, "InMobi", "Failed to close ad; SDK encountered an unexpected error");
            A4 a4 = c0279p5.d;
            if (a4 != null) {
                String str2 = AbstractC0292q5.a;
                ((B4) a4).b(str2, Cc.a(e, A5.a(str2, "access$getTAG$p(...)", "SDK encountered an expected error in handling the close() request from creative; ")));
            }
        }
    }

    public static final void a(C0279p5 c0279p5, boolean z, String str) {
        try {
            c0279p5.a.d(z);
        } catch (Exception e) {
            c0279p5.a.a(str, "Unexpected error", "disableCloseRegion");
            A4 a4 = c0279p5.d;
            if (a4 != null) {
                String str2 = AbstractC0292q5.a;
                ((B4) a4).b(str2, Cc.a(e, A5.a(str2, "access$getTAG$p(...)", "SDK encountered unexpected error in handling disableCloseRegion() request from creative; ")));
            }
        }
    }

    public static final void a(C0279p5 c0279p5, int i) {
        c0279p5.a.setInitialScale(i);
    }
}