正在查看: Antivirus Cleaner v1.2.0.0 应用的 X5.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Antivirus Cleaner v1.2.0.0 应用的 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.facebook.appevents.internal.ViewHierarchyConstants;
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 kotlin.text.StringsKt;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.json.b9;
import org.json.fe;
public final class X5 {
public final Ya a;
public final int b;
public K9 c;
public InterfaceC0239f5 d;
public X5(int i, Ya ya) {
Intrinsics.checkNotNullParameter(ya, "mRenderView");
this.a = ya;
this.b = i;
}
public static final void a(X5 x5, String str, String str2) {
Intrinsics.checkNotNullParameter(x5, "this$0");
C0375o6.a(x5.a.getLandingPageHandler(), "open", str, str2, null, false, 24);
}
public static final void b(X5 x5, String str, String str2) {
Intrinsics.checkNotNullParameter(x5, "this$0");
try {
x5.a.getLandingPageHandler().d("openEmbedded", str, str2, null);
} catch (Exception e) {
x5.a.a(str, "Unexpected error", "openEmbedded");
I6.a((byte) 1, "InMobi", "Failed to open URL; SDK encountered unexpected error");
InterfaceC0239f5 interfaceC0239f5 = x5.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 x5, String str, String str2) {
Intrinsics.checkNotNullParameter(x5, "this$0");
C0375o6.a(x5.a.getLandingPageHandler(), "openWithoutTracker", str, str2, null, true, 8);
}
public static final void d(X5 x5, String str, String str2) {
Intrinsics.checkNotNullParameter(x5, "this$0");
try {
Ya ya = x5.a;
int length = str2.length() - 1;
int i = 0;
boolean z = false;
while (i <= length) {
boolean z2 = Intrinsics.compare(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) {
x5.a.a(str, "Unexpected error", "playVideo");
I6.a((byte) 1, "InMobi", "Error playing video; SDK encountered an unexpected error");
InterfaceC0239f5 interfaceC0239f5 = x5.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, String str2) {
Intrinsics.checkNotNullParameter(str2, "url");
InterfaceC0239f5 interfaceC0239f5 = this.d;
if (interfaceC0239f5 != null) {
String str3 = Y5.a;
((C0254g5) interfaceC0239f5).a(str3, AbstractC0315k6.a(str3, "access$getTAG$p(...)", "asyncPing called: ", str2));
}
if (!URLUtil.isValidUrl(str2)) {
this.a.a(str, "Invalid url", "asyncPing");
return;
}
try {
C0333l9 c0333l9 = new C0333l9(str2, 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 str4 = Y5.a;
((C0254g5) interfaceC0239f52).b(str4, Ed.a(e, AbstractC0300j6.a(str4, "access$getTAG$p(...)", "SDK encountered internal error in handling asyncPing() request from creative; ")));
}
}
}
@JavascriptInterface
public final void cancelSaveContent(String str, String str2) {
Intrinsics.checkNotNullParameter(str2, "mediaId");
InterfaceC0239f5 interfaceC0239f5 = this.d;
if (interfaceC0239f5 != null) {
String str3 = Y5.a;
((C0254g5) interfaceC0239f5).a(str3, AbstractC0315k6.a(str3, "access$getTAG$p(...)", "cancelSaveContent called. mediaId:", str2));
}
}
@JavascriptInterface
public final void close(final 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 Runnable() {
@Override
public final void run() {
X5.a(X5.this, str);
}
});
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 Runnable() {
@Override
public final void run() {
X5.a(X5.this);
}
});
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 z5 = false;
while (i2 <= length) {
boolean z6 = Intrinsics.compare(str2.charAt(!z5 ? i2 : length), 32) <= 0;
if (z5) {
if (!z6) {
break;
} else {
length--;
}
} else if (z6) {
i2++;
} else {
z5 = 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 enumC0270h6 = EnumC0270h6.d;
landingPageHandler2.getClass();
Intrinsics.checkNotNullParameter(enumC0270h6, "funnelState");
C0330l6.a(enumC0270h6, 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, String str2, float f, boolean z) {
C0446t6 c0446t6;
Intrinsics.checkNotNullParameter(str2, "url");
InterfaceC0239f5 interfaceC0239f5 = this.d;
if (interfaceC0239f5 != null) {
String str3 = Y5.a;
Intrinsics.checkNotNullExpressionValue(str3, "access$getTAG$p(...)");
((C0254g5) interfaceC0239f5).a(str3, "customExpandInNative called");
}
Ya ya = this.a;
if (ya.z0) {
InterfaceC0239f5 interfaceC0239f52 = this.d;
if (interfaceC0239f52 != null) {
String str4 = Y5.a;
Intrinsics.checkNotNullExpressionValue(str4, "access$getTAG$p(...)");
((C0254g5) interfaceC0239f52).b(str4, "customExpandInNative 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(...)", "customExpandInNative called in incorrect Ad type: ");
a.append(this.b);
((C0254g5) interfaceC0239f53).b(str5, 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(str2);
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 enumC0270h6 = EnumC0270h6.d;
landingPageHandler2.getClass();
Intrinsics.checkNotNullParameter(enumC0270h6, "funnelState");
C0330l6.a(enumC0270h6, c0446t62, (Integer) 8010, (Function2) new C0360n6(landingPageHandler2));
int a3 = this.a.getLandingPageHandler().a("customExpandInNative", str, str2, c0446t62, new C0251g2(f, z));
InterfaceC0239f5 interfaceC0239f54 = this.d;
if (interfaceC0239f54 != null) {
String str6 = Y5.a;
((C0254g5) interfaceC0239f54).a(str6, AbstractC0504x8.a(str6, "access$getTAG$p(...)", "customExpandInNativeRequest: ", a3));
}
if (a3 == 3) {
R3 r3 = R3.a;
a(str, str2, 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(final String str, final 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 Runnable() {
@Override
public final void run() {
X5.a(X5.this, z, str);
}
});
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.checkNotNull(z2.c);
}
InterfaceC0239f5 interfaceC0239f54 = ya.i;
if (interfaceC0239f54 != null) {
String str5 = Ya.P0;
Intrinsics.checkNotNullExpressionValue(str5, "TAG");
((C0254g5) interfaceC0239f54).a(str5, "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.checkNotNull(z2.c);
}
InterfaceC0239f5 interfaceC0239f54 = ya.i;
if (interfaceC0239f54 != null) {
String str5 = Ya.P0;
Intrinsics.checkNotNullExpressionValue(str5, "TAG");
((C0254g5) interfaceC0239f54).a(str5, "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 str5 = Ya.P0;
Intrinsics.checkNotNullExpressionValue(str5, "TAG");
((C0254g5) interfaceC0239f53).a(str5, "getBlob");
}
if (str == null || str2 == null || (z1 = ya.R) == null) {
return;
}
((Q0) z1).a(str, str2, ya, ya.getImpressionId());
}
@JavascriptInterface
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 "";
}
String str3 = Y5.a;
Intrinsics.checkNotNullExpressionValue(str3, "access$getTAG$p(...)");
((C0254g5) interfaceC0239f52).b(str3, "Found a null instance of render view!");
return "";
}
synchronized (ya2.getCurrentPositionMonitor()) {
this.a.w = true;
new Handler(this.a.getContainerContext().getMainLooper()).post(new Runnable() {
@Override
public final void run() {
X5.b(X5.this);
}
});
while (true) {
ya = this.a;
if (ya.w) {
try {
ya.getCurrentPositionMonitor().wait();
} catch (InterruptedException unused) {
}
} else {
Unit unit = Unit.INSTANCE;
}
}
}
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
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 Runnable() {
@Override
public final void run() {
X5.c(X5.this);
}
});
while (true) {
ya = this.a;
if (ya.v) {
try {
ya.getDefaultPositionMonitor().wait();
} catch (InterruptedException unused) {
}
} else {
Unit unit = Unit.INSTANCE;
}
}
}
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
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.checkNotNull(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)) {
Intrinsics.checkNotNull(frameLayout);
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.INSTANCE;
}
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
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
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.checkNotNull(str2);
return str2;
}
@JavascriptInterface
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
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
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
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
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
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
public final String getState(String str) {
String viewState = this.a.getViewState();
Locale locale = Locale.ENGLISH;
Intrinsics.checkNotNullExpressionValue(locale, ViewHierarchyConstants.ENGLISH);
String lowerCase = viewState.toLowerCase(locale);
Intrinsics.checkNotNullExpressionValue(lowerCase, "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:", lowerCase));
}
return lowerCase;
}
@JavascriptInterface
public final String getVersion(String str) {
InterfaceC0239f5 interfaceC0239f5 = this.d;
if (interfaceC0239f5 == null) {
return fe.f0;
}
String str2 = Y5.a;
Intrinsics.checkNotNullExpressionValue(str2, "access$getTAG$p(...)");
((C0254g5) interfaceC0239f5).a(str2, "getVersion called. Version:2.0");
return fe.f0;
}
@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.checkNotNull(next, "null cannot be cast to non-null type kotlin.String");
String str5 = next;
Object obj = jSONObject.get(str5);
Intrinsics.checkNotNull(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
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.checkNotNull(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
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 {
C0241f7 mediaProcessor = this.a.getMediaProcessor();
Intrinsics.checkNotNull(mediaProcessor);
mediaProcessor.getClass();
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) {
InterfaceC0239f5 interfaceC0239f5 = this.d;
if (interfaceC0239f5 != null) {
String str2 = Y5.a;
((C0254g5) interfaceC0239f5).a(str2, AbstractC0504x8.a(str2, "access$getTAG$p(...)", "loadAd is called with index - ", i));
}
Ya ya = this.a;
InterfaceC0239f5 interfaceC0239f52 = ya.i;
if (interfaceC0239f52 != null) {
String str3 = Ya.P0;
((C0254g5) interfaceC0239f52).a(str3, Wa.a(ya, str3, "TAG", "loadPodAd "));
}
if (ya.z == qd.c && ya.V != null && !ya.D.get()) {
Z z = ya.V;
if (z != null) {
z.a(i, ya);
return;
}
return;
}
InterfaceC0239f5 interfaceC0239f53 = ya.i;
if (interfaceC0239f53 != null) {
String str4 = Ya.P0;
Intrinsics.checkNotNullExpressionValue(str4, "TAG");
((C0254g5) interfaceC0239f53).b(str4, "Cannot load index pod ad as the current ad is not viewable");
}
ya.a(false);
}
@JavascriptInterface
public final void log(String str, String str2) {
Intrinsics.checkNotNullParameter(str2, "message");
InterfaceC0239f5 interfaceC0239f5 = this.d;
if (interfaceC0239f5 != null) {
String str3 = Y5.a;
((C0254g5) interfaceC0239f5).c(str3, AbstractC0315k6.a(str3, "access$getTAG$p(...)", "Log called. Message:", str2));
}
Ya ya = this.a;
ya.getClass();
Ia ia = Ya.N0;
ia.getClass();
if (!((Boolean) Ya.Q0.getValue(ia, Ia.a[0])).booleanValue() || str2 == null) {
return;
}
ya.getListener().a(str2);
}
@android.webkit.JavascriptInterface
public final void logTelemetryEvent(java.lang.String r5, java.lang.String r6, java.lang.String r7) {
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.checkNotNull(next, "null cannot be cast to non-null type kotlin.String");
String str6 = next;
Object obj = jSONObject.get(str6);
Intrinsics.checkNotNull(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(final String str, final 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 Runnable() {
@Override
public final void run() {
X5.a(X5.this, str, str2);
}
});
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(final String str, final 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 Runnable() {
@Override
public final void run() {
X5.b(X5.this, str, str2);
}
});
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, String str2, String str3) {
C0446t6 c0446t6;
Intrinsics.checkNotNullParameter(str2, "url");
InterfaceC0239f5 interfaceC0239f5 = this.d;
if (interfaceC0239f5 != null) {
String str4 = Y5.a;
Intrinsics.checkNotNullExpressionValue(str4, "access$getTAG$p(...)");
((C0254g5) interfaceC0239f5).a(str4, "open External");
}
Ya ya = this.a;
if (ya == null) {
InterfaceC0239f5 interfaceC0239f52 = this.d;
if (interfaceC0239f52 != null) {
String str5 = Y5.a;
Intrinsics.checkNotNullExpressionValue(str5, "access$getTAG$p(...)");
((C0254g5) interfaceC0239f52).b(str5, "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 str6 = Y5.a;
((C0254g5) interfaceC0239f53).a(str6, AbstractC0315k6.a(str6, "access$getTAG$p(...)", "openExternal called with url: ", str2));
}
C0460u6 c0460u6 = this.a.getLandingPageHandler().f;
if (c0460u6 != null) {
String a = C0330l6.a(str2);
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 enumC0270h6 = EnumC0270h6.d;
landingPageHandler2.getClass();
Intrinsics.checkNotNullParameter(enumC0270h6, "funnelState");
C0330l6.a(enumC0270h6, c0446t6, (Integer) null, new C0360n6(landingPageHandler2));
C0375o6 landingPageHandler3 = this.a.getLandingPageHandler();
landingPageHandler3.getClass();
Intrinsics.checkNotNullParameter("openExternal", "api");
if (str2 != null) {
landingPageHandler3.e(str, str2, str3, c0446t6);
return;
}
if (str3 != null) {
landingPageHandler3.e(str, str3, null, c0446t6);
return;
}
EnumC0270h6 enumC0270h62 = EnumC0270h6.e;
Intrinsics.checkNotNullParameter(enumC0270h62, "funnelState");
C0330l6.a(enumC0270h62, 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(final String str, final 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 Runnable() {
@Override
public final void run() {
X5.c(X5.this, str, str2);
}
});
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 z5 = Intrinsics.compare(str2.charAt(!z2 ? i : length), 32) <= 0;
if (z2) {
if (!z5) {
break;
} else {
length--;
}
} else if (z5) {
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 z5 = Intrinsics.compare(str2.charAt(!z2 ? i : length), 32) <= 0;
if (z2) {
if (!z5) {
break;
} else {
length--;
}
} else if (z5) {
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(final String str, final 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.compare(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.startsWith$default(str2, "http", false, 2, (Object) null) && (StringsKt.endsWith$default(str2, "mp4", false, 2, (Object) null) || StringsKt.endsWith$default(str2, "avi", false, 2, (Object) null) || StringsKt.endsWith$default(str2, "m4v", false, 2, (Object) null))) {
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 Runnable() {
@Override
public final void run() {
X5.d(X5.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) {
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 str4 = Ya.P0;
Intrinsics.checkNotNullExpressionValue(str4, "TAG");
((C0254g5) interfaceC0239f53).a(str4, "registerBackButtonPressedEventListener " + ya);
}
ya.C = str;
} catch (Exception e) {
this.a.a(str, "Unexpected error", "registerBackButtonPressedEventListener");
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 registerBackButtonPressedEventListener() request from creative; ")));
}
}
}
@JavascriptInterface
public final void registerDeviceMuteEventListener(String str) {
InterfaceC0239f5 interfaceC0239f5 = this.d;
if (interfaceC0239f5 != null) {
String str2 = Y5.a;
Intrinsics.checkNotNullExpressionValue(str2, "access$getTAG$p(...)");
((C0254g5) interfaceC0239f5).a(str2, "registerDeviceMuteEventListener 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;
}
if (str != null) {
try {
C0241f7 mediaProcessor = ya.getMediaProcessor();
if (mediaProcessor != null) {
Intrinsics.checkNotNullParameter(str, "jsCallbackNamespace");
if (mediaProcessor.d == null) {
S6 s6 = new S6(new C0196c7(mediaProcessor, str));
mediaProcessor.d = s6;
s6.b();
}
}
} catch (Exception e) {
this.a.a(str, "Unexpected error", "registerDeviceMuteEventListener");
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 registerDeviceMuteEventListener() request from creative; ")));
}
}
}
}
@JavascriptInterface
public final void registerDeviceVolumeChangeEventListener(String str) {
InterfaceC0239f5 interfaceC0239f5 = this.d;
if (interfaceC0239f5 != null) {
String str2 = Y5.a;
Intrinsics.checkNotNullExpressionValue(str2, "access$getTAG$p(...)");
((C0254g5) interfaceC0239f5).a(str2, "registerDeviceVolumeChangeEventListener 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;
}
if (str != null) {
try {
C0241f7 mediaProcessor = ya.getMediaProcessor();
if (mediaProcessor != null) {
Intrinsics.checkNotNullParameter(str, "jsCallbackNamespace");
Context d = Kb.d();
if (d != null && mediaProcessor.e == null) {
S6 s6 = new S6(new C0211d7(mediaProcessor, str, d, new Handler(Looper.getMainLooper())));
mediaProcessor.e = s6;
s6.b();
}
}
} catch (Exception e) {
this.a.a(str, "Unexpected error", "registerDeviceVolumeChangeEventListener");
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 registerDeviceVolumeChangeEventListener() request from creative; ")));
}
}
}
}
@JavascriptInterface
public final void registerHeadphonePluggedEventListener(String str) {
InterfaceC0239f5 interfaceC0239f5 = this.d;
if (interfaceC0239f5 != null) {
String str2 = Y5.a;
Intrinsics.checkNotNullExpressionValue(str2, "access$getTAG$p(...)");
((C0254g5) interfaceC0239f5).a(str2, "registerHeadphonePluggedEventListener 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;
}
if (str != null) {
try {
C0241f7 mediaProcessor = ya.getMediaProcessor();
if (mediaProcessor != null) {
Intrinsics.checkNotNullParameter(str, "jsCallbackNamespace");
if (mediaProcessor.f == null) {
S6 s6 = new S6(new C0181b7(mediaProcessor, str));
mediaProcessor.f = s6;
s6.b();
}
}
} catch (Exception e) {
this.a.a(str, "Unexpected error", "registerHeadphonePluggedEventListener");
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 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 str5 = Ya.P0;
Intrinsics.checkNotNullExpressionValue(str5, "TAG");
((C0254g5) interfaceC0239f53).a(str5, "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 = "";
}
try {
jSONObject.put("url", str3);
jSONObject.put("reason", 8);
} catch (JSONException unused) {
}
String jSONObject2 = jSONObject.toString();
Intrinsics.checkNotNullExpressionValue(jSONObject2, "toString(...)");
String replace$default = StringsKt.replace$default(jSONObject2, "\"", "\\\"", false, 4, (Object) null);
StringBuilder sb = new StringBuilder("sendSaveContentResult(\"saveContent_");
if (str2 == null) {
str2 = "";
}
sb.append(str2);
sb.append("\", 'failed', \"");
sb.append(replace$default);
sb.append("\");");
this.a.a(str, sb.toString());
}
@JavascriptInterface
public final void setAdContext(String str, String str2) {
Intrinsics.checkNotNullParameter(str2, "podAdContext");
InterfaceC0239f5 interfaceC0239f5 = this.d;
if (interfaceC0239f5 != null) {
String str3 = Y5.a;
((C0254g5) interfaceC0239f5).a(str3, AbstractC0315k6.a(str3, "access$getTAG$p(...)", "setAdContext is called ", str2));
}
Z adPodHandler = this.a.getAdPodHandler();
if (adPodHandler != null) {
((Q0) adPodHandler).d(str2);
}
}
@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, final String str2) {
Intrinsics.checkNotNullParameter(str2, "orientationPropertiesString");
InterfaceC0239f5 interfaceC0239f5 = this.d;
if (interfaceC0239f5 != null) {
String str3 = Y5.a;
((C0254g5) interfaceC0239f5).a(str3, AbstractC0315k6.a(str3, "access$getTAG$p(...)", "setOrientationProperties called: ", str2));
}
if (!this.a.z0) {
new Handler(this.a.getContainerContext().getMainLooper()).post(new Runnable() {
@Override
public final void run() {
X5.b(X5.this, str2);
}
});
return;
}
InterfaceC0239f5 interfaceC0239f52 = this.d;
if (interfaceC0239f52 != null) {
String str4 = Y5.a;
Intrinsics.checkNotNullExpressionValue(str4, "access$getTAG$p(...)");
((C0254g5) interfaceC0239f52).b(str4, "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 str3 = Ya.P0;
Intrinsics.checkNotNullExpressionValue(str3, "TAG");
((C0254g5) interfaceC0239f52).a(str3, "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 str4 = Ya.P0;
Intrinsics.checkNotNullExpressionValue(str4, "TAG");
((C0254g5) interfaceC0239f53).b(str4, "Cannot show index pod ad as the current ad is not viewable");
}
ya.b(false);
}
@JavascriptInterface
public final void showAlert(String str, String str2) {
Intrinsics.checkNotNullParameter(str2, "alert");
InterfaceC0239f5 interfaceC0239f5 = this.d;
if (interfaceC0239f5 != null) {
String str3 = Y5.a;
((C0254g5) interfaceC0239f5).a(str3, AbstractC0315k6.a(str3, "access$getTAG$p(...)", "showAlert: ", str2));
}
}
@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 str4 = Ya.P0;
Intrinsics.checkNotNullExpressionValue(str4, "TAG");
((C0254g5) interfaceC0239f53).a(str4, "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, String str2, String str3, String str4) {
Intrinsics.checkNotNullParameter(str2, "adQualityUrl");
Intrinsics.checkNotNullParameter(str3, "enableUserAdReportScreenshot");
Intrinsics.checkNotNullParameter(str4, "templateInfo");
InterfaceC0239f5 interfaceC0239f5 = this.d;
if (interfaceC0239f5 != null) {
String str5 = Y5.a;
Intrinsics.checkNotNullExpressionValue(str5, "access$getTAG$p(...)");
((C0254g5) interfaceC0239f5).a(str5, "submitAdReport called");
}
this.a.a(str2, str4, Intrinsics.areEqual(str3, "1"));
}
@JavascriptInterface
public final String supports(String str, String str2) {
Intrinsics.checkNotNullParameter(str2, "feature");
InterfaceC0239f5 interfaceC0239f5 = this.d;
if (interfaceC0239f5 != null) {
String str3 = Y5.a;
((C0254g5) interfaceC0239f5).a(str3, AbstractC0315k6.a(str3, "access$getTAG$p(...)", "Checking support for: ", str2));
}
String valueOf = String.valueOf(this.a.e(str2));
InterfaceC0239f5 interfaceC0239f52 = this.d;
if (interfaceC0239f52 != null) {
String str4 = Y5.a;
Intrinsics.checkNotNullExpressionValue(str4, "access$getTAG$p(...)");
((C0254g5) interfaceC0239f52).c(str4, "Message:" + str2 + " 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 str4 = Ya.P0;
Intrinsics.checkNotNullExpressionValue(str4, "TAG");
((C0254g5) interfaceC0239f53).a(str4, "unregisterBackButtonPressedEventListener " + ya);
}
ya.C = null;
} catch (Exception e) {
this.a.a(str, "Unexpected error", "unregisterBackButtonPressedEventListener");
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 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(final String str, final 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 Runnable() {
@Override
public final void run() {
X5.b(X5.this, z, str);
}
});
}
@JavascriptInterface
public final void zoom(String str, final int i) {
Intrinsics.checkNotNullParameter(str, "jsCallbackNamespace");
InterfaceC0239f5 interfaceC0239f5 = this.d;
if (interfaceC0239f5 != null) {
String str2 = Y5.a;
Intrinsics.checkNotNullExpressionValue(str2, "access$getTAG$p(...)");
((C0254g5) interfaceC0239f5).a(str2, "zoom is called " + str + ' ' + i);
}
AbstractC0246fc.a(new Runnable() {
@Override
public final void run() {
X5.a(X5.this, i);
}
});
}
public static final void c(X5 x5) {
Intrinsics.checkNotNullParameter(x5, "this$0");
try {
x5.a.p();
} catch (Exception e) {
InterfaceC0239f5 interfaceC0239f5 = x5.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 x5, C0446t6 c0446t6, String str, int i, String str2, float f, boolean z) {
Intrinsics.checkNotNullParameter(x5, "this$0");
Intrinsics.checkNotNullParameter(str, "$expandInput");
try {
if (x5.a.getEmbeddedBrowserJSCallbacks() == null) {
InterfaceC0239f5 interfaceC0239f5 = x5.d;
if (interfaceC0239f5 != null) {
String str3 = Y5.a;
Intrinsics.checkNotNullExpressionValue(str3, "access$getTAG$p(...)");
((C0254g5) interfaceC0239f5).b(str3, "Found a null instance of EmbeddedBrowserJSCallback instance to customExpand");
}
C0375o6 landingPageHandler = x5.a.getLandingPageHandler();
EnumC0270h6 enumC0270h6 = EnumC0270h6.e;
landingPageHandler.getClass();
Intrinsics.checkNotNullParameter(enumC0270h6, "funnelState");
C0330l6.a(enumC0270h6, c0446t6, (Integer) 8002, (Function2) new C0360n6(landingPageHandler));
return;
}
InterfaceC0239f5 interfaceC0239f52 = x5.d;
if (interfaceC0239f52 != null) {
String str4 = Y5.a;
Intrinsics.checkNotNullExpressionValue(str4, "access$getTAG$p(...)");
((C0254g5) interfaceC0239f52).a(str4, "Custom expand called. Url: " + str);
}
R3 r3 = R3.values()[i];
if (r3 == R3.a) {
int a = x5.a.getLandingPageHandler().a("customExpand", str2, str, c0446t6, null);
InterfaceC0239f5 interfaceC0239f53 = x5.d;
if (interfaceC0239f53 != null) {
String str5 = Y5.a;
Intrinsics.checkNotNullExpressionValue(str5, "access$getTAG$p(...)");
((C0254g5) interfaceC0239f53).a(str5, "processCustomExpandRequest: " + a);
}
if (a == 3) {
S3 embeddedBrowserJSCallbacks = x5.a.getEmbeddedBrowserJSCallbacks();
if (embeddedBrowserJSCallbacks != null) {
((N4) embeddedBrowserJSCallbacks).a(str, r3, f, z, x5.a.getViewTouchTimestamp(), c0446t6);
}
C0375o6 landingPageHandler2 = x5.a.getLandingPageHandler();
EnumC0270h6 enumC0270h62 = EnumC0270h6.f;
landingPageHandler2.getClass();
Intrinsics.checkNotNullParameter(enumC0270h62, "funnelState");
C0330l6.a(enumC0270h62, c0446t6, (Integer) null, new C0360n6(landingPageHandler2));
Ra ra = x5.a.getLandingPageHandler().d;
if (ra != null) {
Ya.a(ra.a, "customExpand", str2, str);
return;
}
return;
}
S3 embeddedBrowserJSCallbacks2 = x5.a.getEmbeddedBrowserJSCallbacks();
if (embeddedBrowserJSCallbacks2 != null) {
P4.a(((N4) embeddedBrowserJSCallbacks2).a);
return;
}
return;
}
S3 embeddedBrowserJSCallbacks3 = x5.a.getEmbeddedBrowserJSCallbacks();
if (embeddedBrowserJSCallbacks3 != null) {
((N4) embeddedBrowserJSCallbacks3).a(str, r3, f, z, x5.a.getViewTouchTimestamp(), c0446t6);
}
C0375o6 landingPageHandler3 = x5.a.getLandingPageHandler();
EnumC0270h6 enumC0270h63 = EnumC0270h6.f;
landingPageHandler3.getClass();
Intrinsics.checkNotNullParameter(enumC0270h63, "funnelState");
C0330l6.a(enumC0270h63, c0446t6, (Integer) null, new C0360n6(landingPageHandler3));
Ra ra2 = x5.a.getLandingPageHandler().d;
if (ra2 != null) {
Ya.a(ra2.a, "customExpand", str2, str);
}
} catch (Exception e) {
x5.a.a(str2, "Unexpected error", "customExpand");
C0375o6 landingPageHandler4 = x5.a.getLandingPageHandler();
EnumC0270h6 enumC0270h64 = EnumC0270h6.e;
landingPageHandler4.getClass();
Intrinsics.checkNotNullParameter(enumC0270h64, "funnelState");
C0330l6.a(enumC0270h64, c0446t6, (Integer) 9, (Function2) new C0360n6(landingPageHandler4));
I6.a((byte) 1, "InMobi", "Failed to custom expand ad; SDK encountered an unexpected error");
InterfaceC0239f5 interfaceC0239f54 = x5.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 customExpand() request; ")));
}
}
}
public static final void b(X5 x5) {
Intrinsics.checkNotNullParameter(x5, "this$0");
try {
x5.a.o();
} catch (Exception e) {
InterfaceC0239f5 interfaceC0239f5 = x5.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 x5, String str) {
Intrinsics.checkNotNullParameter(x5, "this$0");
Intrinsics.checkNotNullParameter(str, "$orientationPropertiesString");
K9 orientationProperties = x5.a.getOrientationProperties();
if (orientationProperties != null) {
Intrinsics.checkNotNullParameter(str, "json");
Intrinsics.checkNotNullParameter(orientationProperties, "op");
K9 k9 = new K9();
k9.d = str;
try {
JSONObject jSONObject = new JSONObject(str);
String optString = jSONObject.optString("forceOrientation", orientationProperties.b);
Intrinsics.checkNotNullExpressionValue(optString, "optString(...)");
Intrinsics.checkNotNullParameter(optString, "<set-?>");
k9.b = optString;
k9.a = jSONObject.optBoolean("allowOrientationChange", orientationProperties.a);
String optString2 = jSONObject.optString("direction", orientationProperties.c);
Intrinsics.checkNotNullExpressionValue(optString2, "optString(...)");
Intrinsics.checkNotNullParameter(optString2, "<set-?>");
k9.c = optString2;
if (!Intrinsics.areEqual(k9.b, b9.h.D) && !Intrinsics.areEqual(k9.b, b9.h.C)) {
Intrinsics.checkNotNullParameter("none", "<set-?>");
k9.b = "none";
}
if (!Intrinsics.areEqual(k9.c, ViewHierarchyConstants.DIMENSION_LEFT_KEY) && !Intrinsics.areEqual(k9.c, "right")) {
Intrinsics.checkNotNullParameter("right", "<set-?>");
k9.c = "right";
}
} catch (JSONException unused) {
k9 = null;
}
x5.c = k9;
}
K9 k92 = x5.c;
if (k92 != null) {
Ya ya = x5.a;
Intrinsics.checkNotNull(k92);
ya.setOrientationProperties(k92);
}
}
public static final void b(X5 x5, boolean z, String str) {
Intrinsics.checkNotNullParameter(x5, "this$0");
try {
x5.a.e(z);
} catch (Exception e) {
x5.a.a(str, "Unexpected error", "useCustomClose");
InterfaceC0239f5 interfaceC0239f5 = x5.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 x5) {
Intrinsics.checkNotNullParameter(x5, "this$0");
if (x5.a.getEmbeddedBrowserJSCallbacks() == null) {
InterfaceC0239f5 interfaceC0239f5 = x5.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 = x5.a.getEmbeddedBrowserJSCallbacks();
if (embeddedBrowserJSCallbacks != null) {
P4.a(((N4) embeddedBrowserJSCallbacks).a);
}
}
public static final void a(X5 x5, String str) {
Intrinsics.checkNotNullParameter(x5, "this$0");
try {
InterfaceC0495x referenceContainer = x5.a.getReferenceContainer();
if (referenceContainer != null) {
referenceContainer.a();
}
} catch (Exception e) {
x5.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 = x5.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 x5, boolean z, String str) {
Intrinsics.checkNotNullParameter(x5, "this$0");
try {
x5.a.d(z);
} catch (Exception e) {
x5.a.a(str, "Unexpected error", "disableCloseRegion");
InterfaceC0239f5 interfaceC0239f5 = x5.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 x5, int i) {
Intrinsics.checkNotNullParameter(x5, "this$0");
x5.a.setInitialScale(i);
}
}