Live Football Updates v1.0版本的 MD5 值为:95609b5a5bec0a5f5a0b6e8e4d8f1cba
以下内容为反编译后的 i.java 源代码,内容仅作参考
package com.onesignal.inAppMessages.internal.display.impl;
import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.app.Activity;
import android.os.Build;
import android.webkit.JavascriptInterface;
import android.webkit.ValueCallback;
import android.webkit.WebView;
import cj.e0;
import cj.s0;
import com.google.android.gms.common.api.internal.m1;
import com.ironsource.q2;
import com.onesignal.common.o;
import com.onesignal.inAppMessages.internal.display.impl.c;
import hj.n;
import java.util.Arrays;
import java.util.Locale;
import org.json.JSONException;
import org.json.JSONObject;
import si.p;
@TargetApi(19)
public final class i implements ff.d {
public static final String EVENT_TYPE_ACTION_TAKEN = "action_taken";
public static final String EVENT_TYPE_KEY = "type";
public static final String EVENT_TYPE_PAGE_CHANGE = "page_change";
public static final String EVENT_TYPE_RENDERING_COMPLETE = "rendering_complete";
public static final String EVENT_TYPE_RESIZE = "resize";
public static final String GET_PAGE_META_DATA_JS_FUNCTION = "getPageMetaData()";
public static final String IAM_DISPLAY_LOCATION_KEY = "displayLocation";
public static final String IAM_DRAG_TO_DISMISS_DISABLED_KEY = "dragToDismissDisabled";
public static final String IAM_PAGE_META_DATA_KEY = "pageMetaData";
public static final String JS_OBJ_NAME = "OSAndroid";
public static final String SAFE_AREA_JS_OBJECT = "{\n top: %d,\n bottom: %d,\n right: %d,\n left: %d,\n}";
public static final String SET_SAFE_AREA_INSETS_JS_FUNCTION = "setSafeAreaInsets(%s)";
public static final String SET_SAFE_AREA_INSETS_SCRIPT = "\n\n<script>\n setSafeAreaInsets(%s);\n</script>";
private final ff.f _applicationService;
private final dg.b _lifecycle;
private final gg.a _promptFactory;
private Activity activity;
private boolean closing;
private String currentActivityName;
private boolean dismissFired;
private Integer lastPageHeight;
private final com.onesignal.inAppMessages.internal.a message;
private final com.onesignal.inAppMessages.internal.d messageContent;
private com.onesignal.inAppMessages.internal.display.impl.c messageView;
private final kj.a messageViewMutex;
private com.onesignal.inAppMessages.internal.display.impl.d webView;
public static final a Companion = new a(null);
private static final int MARGIN_PX_SIZE = o.INSTANCE.dpToPx(24);
public static final class a {
private a() {
}
public a(ti.e eVar) {
this();
}
}
public final class b {
public b() {
}
private final c getDisplayLocation(JSONObject jSONObject) {
c cVar = c.FULL_SCREEN;
try {
if (jSONObject.has(i.IAM_DISPLAY_LOCATION_KEY) && !ti.j.a(jSONObject.get(i.IAM_DISPLAY_LOCATION_KEY), "")) {
String optString = jSONObject.optString(i.IAM_DISPLAY_LOCATION_KEY, "FULL_SCREEN");
ti.j.e(optString, "jsonObject.optString(\n … )");
Locale locale = Locale.getDefault();
ti.j.e(locale, "getDefault()");
String upperCase = optString.toUpperCase(locale);
ti.j.e(upperCase, "this as java.lang.String).toUpperCase(locale)");
return c.valueOf(upperCase);
}
return cVar;
} catch (JSONException e10) {
e10.printStackTrace();
return cVar;
}
}
private final boolean getDragToDismissDisabled(JSONObject jSONObject) {
try {
return jSONObject.getBoolean(i.IAM_DRAG_TO_DISMISS_DISABLED_KEY);
} catch (JSONException unused) {
return false;
}
}
private final int getPageHeightData(JSONObject jSONObject) {
try {
i iVar = i.this;
Activity activity = iVar.activity;
JSONObject jSONObject2 = jSONObject.getJSONObject(i.IAM_PAGE_META_DATA_KEY);
ti.j.e(jSONObject2, "jsonObject.getJSONObject(IAM_PAGE_META_DATA_KEY)");
return iVar.pageRectToViewHeight(activity, jSONObject2);
} catch (JSONException unused) {
return -1;
}
}
private final void handleActionTaken(JSONObject jSONObject) throws JSONException {
JSONObject jSONObject2 = jSONObject.getJSONObject(q2.h.E0);
ti.j.e(jSONObject2, q2.h.E0);
String safeString = com.onesignal.common.h.safeString(jSONObject2, "id");
i.this.closing = jSONObject2.getBoolean("close");
if (i.this.message.isPreview()) {
i.this._lifecycle.messageActionOccurredOnPreview(i.this.message, new com.onesignal.inAppMessages.internal.c(jSONObject2, i.this._promptFactory));
} else if (safeString != null) {
i.this._lifecycle.messageActionOccurredOnMessage(i.this.message, new com.onesignal.inAppMessages.internal.c(jSONObject2, i.this._promptFactory));
}
if (i.this.closing) {
i.this.backgroundDismissAndAwaitNextMessage();
}
}
private final void handlePageChange(JSONObject jSONObject) throws JSONException {
i.this._lifecycle.messagePageChanged(i.this.message, new com.onesignal.inAppMessages.internal.g(jSONObject));
}
private final void handleRenderComplete(JSONObject jSONObject) {
int pageHeightData;
c displayLocation = getDisplayLocation(jSONObject);
if (displayLocation == c.FULL_SCREEN) {
pageHeightData = -1;
} else {
pageHeightData = getPageHeightData(jSONObject);
}
boolean dragToDismissDisabled = getDragToDismissDisabled(jSONObject);
i.this.messageContent.setDisplayLocation(displayLocation);
i.this.messageContent.setPageHeight(pageHeightData);
i.this.createNewInAppMessageView(dragToDismissDisabled);
}
@JavascriptInterface
public final void postMessage(String str) {
ti.j.f(str, "message");
try {
com.onesignal.debug.internal.logging.a.debug$default("OSJavaScriptInterface:postMessage: ".concat(str), null, 2, null);
JSONObject jSONObject = new JSONObject(str);
String string = jSONObject.getString(i.EVENT_TYPE_KEY);
if (string != null) {
switch (string.hashCode()) {
case -1484226720:
if (string.equals(i.EVENT_TYPE_PAGE_CHANGE)) {
handlePageChange(jSONObject);
return;
}
return;
case -934437708:
string.equals(i.EVENT_TYPE_RESIZE);
return;
case 42998156:
if (string.equals(i.EVENT_TYPE_RENDERING_COMPLETE)) {
handleRenderComplete(jSONObject);
return;
}
return;
case 1851145598:
if (string.equals(i.EVENT_TYPE_ACTION_TAKEN)) {
com.onesignal.inAppMessages.internal.display.impl.c cVar = i.this.messageView;
boolean z10 = false;
if (cVar != null && !cVar.isDragging()) {
z10 = true;
}
if (z10) {
handleActionTaken(jSONObject);
return;
}
return;
}
return;
default:
return;
}
}
} catch (JSONException e10) {
e10.printStackTrace();
}
}
}
public enum c {
TOP_BANNER,
BOTTOM_BANNER,
CENTER_MODAL,
FULL_SCREEN;
public class a {
public static final int[] $EnumSwitchMapping$0;
static {
int[] iArr = new int[c.values().length];
iArr[c.TOP_BANNER.ordinal()] = 1;
iArr[c.BOTTOM_BANNER.ordinal()] = 2;
$EnumSwitchMapping$0 = iArr;
}
}
public final boolean isBanner() {
int i = a.$EnumSwitchMapping$0[ordinal()];
return i == 1 || i == 2;
}
}
@mi.e(c = "com.onesignal.inAppMessages.internal.display.impl.WebViewManager$backgroundDismissAndAwaitNextMessage$1", f = "WebViewManager.kt", l = {401}, m = "invokeSuspend")
public static final class d extends mi.i implements si.l<ki.d<? super fi.j>, Object> {
int label;
public d(ki.d<? super d> dVar) {
super(1, dVar);
}
@Override
public final ki.d<fi.j> create(ki.d<?> dVar) {
return new d(dVar);
}
@Override
public final Object invoke(ki.d<? super fi.j> dVar) {
return ((d) create(dVar)).invokeSuspend(fi.j.f22793a);
}
@Override
public final Object invokeSuspend(Object obj) {
li.a aVar = li.a.COROUTINE_SUSPENDED;
int i = this.label;
if (i != 0) {
if (i == 1) {
b1.a.o(obj);
} else {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
} else {
b1.a.o(obj);
i iVar = i.this;
this.label = 1;
if (iVar.dismissAndAwaitNextMessage(this) == aVar) {
return aVar;
}
}
return fi.j.f22793a;
}
}
@mi.e(c = "com.onesignal.inAppMessages.internal.display.impl.WebViewManager", f = "WebViewManager.kt", l = {220, 225, 231}, m = "calculateHeightAndShowWebViewAfterNewActivity")
public static final class e extends mi.c {
Object L$0;
int label;
Object result;
public e(ki.d<? super e> dVar) {
super(dVar);
}
@Override
public final Object invokeSuspend(Object obj) {
this.result = obj;
this.label |= Integer.MIN_VALUE;
return i.this.calculateHeightAndShowWebViewAfterNewActivity(this);
}
}
@mi.e(c = "com.onesignal.inAppMessages.internal.display.impl.WebViewManager$calculateHeightAndShowWebViewAfterNewActivity$2$1", f = "WebViewManager.kt", l = {239}, m = "invokeSuspend")
public static final class f extends mi.i implements si.l<ki.d<? super fi.j>, Object> {
final int $pagePxHeight;
int label;
public f(int i, ki.d<? super f> dVar) {
super(1, dVar);
this.$pagePxHeight = i;
}
@Override
public final ki.d<fi.j> create(ki.d<?> dVar) {
return new f(this.$pagePxHeight, dVar);
}
@Override
public final Object invoke(ki.d<? super fi.j> dVar) {
return ((f) create(dVar)).invokeSuspend(fi.j.f22793a);
}
@Override
public final Object invokeSuspend(Object obj) {
li.a aVar = li.a.COROUTINE_SUSPENDED;
int i = this.label;
if (i != 0) {
if (i == 1) {
b1.a.o(obj);
} else {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
} else {
b1.a.o(obj);
i iVar = i.this;
Integer num = new Integer(this.$pagePxHeight);
this.label = 1;
if (iVar.showMessageView(num, this) == aVar) {
return aVar;
}
}
return fi.j.f22793a;
}
}
public static final class g implements c.b {
final i $self;
public g(i iVar) {
this.$self = iVar;
}
@Override
public void onMessageWasDismissed() {
i.this._lifecycle.messageWasDismissed(i.this.message);
i.this._applicationService.removeActivityLifecycleHandler(this.$self);
}
@Override
public void onMessageWasDisplayed() {
i.this._lifecycle.messageWasDisplayed(i.this.message);
}
@Override
public void onMessageWillDismiss() {
i.this._lifecycle.messageWillDismiss(i.this.message);
}
}
@mi.e(c = "com.onesignal.inAppMessages.internal.display.impl.WebViewManager", f = "WebViewManager.kt", l = {417}, m = "dismissAndAwaitNextMessage")
public static final class h extends mi.c {
Object L$0;
int label;
Object result;
public h(ki.d<? super h> dVar) {
super(dVar);
}
@Override
public final Object invokeSuspend(Object obj) {
this.result = obj;
this.label |= Integer.MIN_VALUE;
return i.this.dismissAndAwaitNextMessage(this);
}
}
@mi.e(c = "com.onesignal.inAppMessages.internal.display.impl.WebViewManager$onActivityAvailable$1", f = "WebViewManager.kt", l = {255, 262, 266}, m = "invokeSuspend")
public static final class C0169i extends mi.i implements si.l<ki.d<? super fi.j>, Object> {
final String $lastActivityName;
int label;
final i this$0;
public C0169i(String str, i iVar, ki.d<? super C0169i> dVar) {
super(1, dVar);
this.$lastActivityName = str;
this.this$0 = iVar;
}
@Override
public final ki.d<fi.j> create(ki.d<?> dVar) {
return new C0169i(this.$lastActivityName, this.this$0, dVar);
}
@Override
public final Object invoke(ki.d<? super fi.j> dVar) {
return ((C0169i) create(dVar)).invokeSuspend(fi.j.f22793a);
}
@Override
public final Object invokeSuspend(Object obj) {
li.a aVar = li.a.COROUTINE_SUSPENDED;
int i = this.label;
if (i != 0) {
if (i != 1 && i != 2 && i != 3) {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
b1.a.o(obj);
} else {
b1.a.o(obj);
String str = this.$lastActivityName;
if (str == null) {
i iVar = this.this$0;
this.label = 1;
if (iVar.showMessageView(null, this) == aVar) {
return aVar;
}
} else if (!ti.j.a(str, this.this$0.currentActivityName)) {
if (!this.this$0.closing) {
if (this.this$0.messageView != null) {
com.onesignal.inAppMessages.internal.display.impl.c cVar = this.this$0.messageView;
ti.j.c(cVar);
cVar.removeAllViews();
}
i iVar2 = this.this$0;
Integer num = iVar2.lastPageHeight;
this.label = 2;
if (iVar2.showMessageView(num, this) == aVar) {
return aVar;
}
}
} else {
i iVar3 = this.this$0;
this.label = 3;
if (iVar3.calculateHeightAndShowWebViewAfterNewActivity(this) == aVar) {
return aVar;
}
}
}
return fi.j.f22793a;
}
}
@mi.e(c = "com.onesignal.inAppMessages.internal.display.impl.WebViewManager", f = "WebViewManager.kt", l = {329}, m = "setupWebView")
public static final class j extends mi.c {
Object L$0;
Object L$1;
Object L$2;
int label;
Object result;
public j(ki.d<? super j> dVar) {
super(dVar);
}
@Override
public final Object invokeSuspend(Object obj) {
this.result = obj;
this.label |= Integer.MIN_VALUE;
return i.this.setupWebView(null, null, false, this);
}
}
@mi.e(c = "com.onesignal.inAppMessages.internal.display.impl.WebViewManager", f = "WebViewManager.kt", l = {484, 295, 298, 299}, m = "showMessageView")
public static final class k extends mi.c {
Object L$0;
Object L$1;
Object L$2;
int label;
Object result;
public k(ki.d<? super k> dVar) {
super(dVar);
}
@Override
public final Object invokeSuspend(Object obj) {
this.result = obj;
this.label |= Integer.MIN_VALUE;
return i.this.showMessageView(null, this);
}
}
@mi.e(c = "com.onesignal.inAppMessages.internal.display.impl.WebViewManager$updateSafeAreaInsets$2", f = "WebViewManager.kt", l = {}, m = "invokeSuspend")
public static final class l extends mi.i implements p<e0, ki.d<? super fi.j>, Object> {
int label;
public l(ki.d<? super l> dVar) {
super(2, dVar);
}
@Override
public final ki.d<fi.j> create(Object obj, ki.d<?> dVar) {
return new l(dVar);
}
@Override
public final Object invoke(e0 e0Var, ki.d<? super fi.j> dVar) {
return ((l) create(e0Var, dVar)).invokeSuspend(fi.j.f22793a);
}
@Override
public final Object invokeSuspend(Object obj) {
if (this.label == 0) {
b1.a.o(obj);
int[] cutoutAndStatusBarInsets = o.INSTANCE.getCutoutAndStatusBarInsets(i.this.activity);
String format = String.format(i.SAFE_AREA_JS_OBJECT, Arrays.copyOf(new Object[]{new Integer(cutoutAndStatusBarInsets[0]), new Integer(cutoutAndStatusBarInsets[1]), new Integer(cutoutAndStatusBarInsets[2]), new Integer(cutoutAndStatusBarInsets[3])}, 4));
ti.j.e(format, "format(format, *args)");
String format2 = String.format(i.SET_SAFE_AREA_INSETS_JS_FUNCTION, Arrays.copyOf(new Object[]{format}, 1));
ti.j.e(format2, "format(format, *args)");
com.onesignal.inAppMessages.internal.display.impl.d dVar = i.this.webView;
ti.j.c(dVar);
dVar.evaluateJavascript(format2, null);
return fi.j.f22793a;
}
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
}
public i(com.onesignal.inAppMessages.internal.a aVar, Activity activity, com.onesignal.inAppMessages.internal.d dVar, dg.b bVar, ff.f fVar, gg.a aVar2) {
ti.j.f(aVar, "message");
ti.j.f(activity, "activity");
ti.j.f(dVar, "messageContent");
ti.j.f(bVar, "_lifecycle");
ti.j.f(fVar, "_applicationService");
ti.j.f(aVar2, "_promptFactory");
this.message = aVar;
this.activity = activity;
this.messageContent = dVar;
this._lifecycle = bVar;
this._applicationService = fVar;
this._promptFactory = aVar2;
this.messageViewMutex = m1.a();
}
private final void blurryRenderingWebViewForKitKatWorkAround(WebView webView) {
}
public final Object calculateHeightAndShowWebViewAfterNewActivity(ki.d<? super fi.j> dVar) {
e eVar;
int i;
final i iVar;
i iVar2;
if (dVar instanceof e) {
eVar = (e) dVar;
int i10 = eVar.label;
if ((i10 & Integer.MIN_VALUE) != 0) {
eVar.label = i10 - Integer.MIN_VALUE;
Object obj = eVar.result;
li.a aVar = li.a.COROUTINE_SUSPENDED;
i = eVar.label;
if (i == 0) {
if (i != 1) {
if (i != 2) {
if (i == 3) {
iVar2 = (i) eVar.L$0;
b1.a.o(obj);
iVar = iVar2;
com.onesignal.inAppMessages.internal.display.impl.d dVar2 = iVar.webView;
ti.j.c(dVar2);
dVar2.evaluateJavascript(GET_PAGE_META_DATA_JS_FUNCTION, new ValueCallback() {
@Override
public final void onReceiveValue(Object obj2) {
i.m17calculateHeightAndShowWebViewAfterNewActivity$lambda0(i.this, (String) obj2);
}
});
return fi.j.f22793a;
}
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
iVar = (i) eVar.L$0;
b1.a.o(obj);
iVar.setWebViewToMaxSize(iVar.activity);
if (iVar.messageContent.isFullBleed()) {
eVar.L$0 = iVar;
eVar.label = 3;
if (iVar.updateSafeAreaInsets(eVar) == aVar) {
return aVar;
}
iVar2 = iVar;
iVar = iVar2;
}
com.onesignal.inAppMessages.internal.display.impl.d dVar22 = iVar.webView;
ti.j.c(dVar22);
dVar22.evaluateJavascript(GET_PAGE_META_DATA_JS_FUNCTION, new ValueCallback() {
@Override
public final void onReceiveValue(Object obj2) {
i.m17calculateHeightAndShowWebViewAfterNewActivity$lambda0(i.this, (String) obj2);
}
});
return fi.j.f22793a;
}
b1.a.o(obj);
return fi.j.f22793a;
}
b1.a.o(obj);
com.onesignal.inAppMessages.internal.display.impl.c cVar = this.messageView;
if (cVar == null) {
return fi.j.f22793a;
}
ti.j.c(cVar);
if (cVar.getDisplayPosition() == c.FULL_SCREEN && !this.messageContent.isFullBleed()) {
eVar.label = 1;
if (showMessageView(null, eVar) == aVar) {
return aVar;
}
return fi.j.f22793a;
}
com.onesignal.debug.internal.logging.a.debug$default("In app message new activity, calculate height and show ", null, 2, null);
ff.f fVar = this._applicationService;
eVar.L$0 = this;
eVar.label = 2;
if (fVar.waitUntilActivityReady(eVar) == aVar) {
return aVar;
}
iVar = this;
iVar.setWebViewToMaxSize(iVar.activity);
if (iVar.messageContent.isFullBleed()) {
}
com.onesignal.inAppMessages.internal.display.impl.d dVar222 = iVar.webView;
ti.j.c(dVar222);
dVar222.evaluateJavascript(GET_PAGE_META_DATA_JS_FUNCTION, new ValueCallback() {
@Override
public final void onReceiveValue(Object obj2) {
i.m17calculateHeightAndShowWebViewAfterNewActivity$lambda0(i.this, (String) obj2);
}
});
return fi.j.f22793a;
}
}
eVar = new e(dVar);
Object obj2 = eVar.result;
li.a aVar2 = li.a.COROUTINE_SUSPENDED;
i = eVar.label;
if (i == 0) {
}
}
public static final void m17calculateHeightAndShowWebViewAfterNewActivity$lambda0(i iVar, String str) {
ti.j.f(iVar, "this$0");
try {
com.onesignal.common.threading.a.suspendifyOnThread$default(0, new f(iVar.pageRectToViewHeight(iVar.activity, new JSONObject(str)), null), 1, null);
} catch (JSONException e10) {
e10.printStackTrace();
}
}
private final void enableWebViewRemoteDebugging() {
if (com.onesignal.debug.internal.logging.a.atLogLevel(wf.b.DEBUG)) {
WebView.setWebContentsDebuggingEnabled(true);
}
}
private final int getWebViewMaxSizeX(Activity activity) {
if (this.messageContent.isFullBleed()) {
return o.INSTANCE.getFullbleedWindowWidth(activity);
}
return o.INSTANCE.getWindowWidth(activity) - (MARGIN_PX_SIZE * 2);
}
private final int getWebViewMaxSizeY(Activity activity) {
int i;
if (this.messageContent.isFullBleed()) {
i = 0;
} else {
i = MARGIN_PX_SIZE * 2;
}
return o.INSTANCE.getWindowHeight(activity) - i;
}
public final int pageRectToViewHeight(Activity activity, JSONObject jSONObject) {
try {
int dpToPx = o.INSTANCE.dpToPx(jSONObject.getJSONObject("rect").getInt("height"));
com.onesignal.debug.internal.logging.a.debug$default("getPageHeightData:pxHeight: " + dpToPx, null, 2, null);
int webViewMaxSizeY = getWebViewMaxSizeY(activity);
if (dpToPx > webViewMaxSizeY) {
com.onesignal.debug.internal.logging.a.debug$default("getPageHeightData:pxHeight is over screen max: " + webViewMaxSizeY, null, 2, null);
return webViewMaxSizeY;
}
return dpToPx;
} catch (JSONException e10) {
com.onesignal.debug.internal.logging.a.error("pageRectToViewHeight could not get page height", e10);
return -1;
}
}
private final void setMessageView(com.onesignal.inAppMessages.internal.display.impl.c cVar) {
this.messageView = cVar;
}
private final void setWebViewToMaxSize(Activity activity) {
com.onesignal.inAppMessages.internal.display.impl.d dVar = this.webView;
ti.j.c(dVar);
dVar.layout(0, 0, getWebViewMaxSizeX(activity), getWebViewMaxSizeY(activity));
}
public final Object showMessageView(Integer num, ki.d<? super fi.j> dVar) {
k kVar;
int i;
kj.a aVar;
i iVar;
kj.a aVar2;
i iVar2;
com.onesignal.inAppMessages.internal.display.impl.c cVar;
com.onesignal.inAppMessages.internal.display.impl.c cVar2;
fi.j jVar;
kj.a aVar3;
try {
if (dVar instanceof k) {
kVar = (k) dVar;
int i10 = kVar.label;
if ((i10 & Integer.MIN_VALUE) != 0) {
kVar.label = i10 - Integer.MIN_VALUE;
Object obj = kVar.result;
li.a aVar4 = li.a.COROUTINE_SUSPENDED;
i = kVar.label;
if (i == 0) {
if (i != 1) {
if (i != 2) {
if (i != 3) {
if (i == 4) {
kj.a aVar5 = (kj.a) kVar.L$0;
b1.a.o(obj);
num = aVar5;
jVar = fi.j.f22793a;
aVar3 = num;
aVar3.b(null);
return jVar;
}
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
aVar2 = (kj.a) kVar.L$1;
iVar2 = (i) kVar.L$0;
b1.a.o(obj);
cVar2 = iVar2.messageView;
if (cVar2 != null) {
kVar.L$0 = aVar2;
kVar.L$1 = null;
kVar.L$2 = null;
kVar.label = 4;
num = aVar2;
if (cVar2.checkIfShouldDismiss(kVar) == aVar4) {
return aVar4;
}
jVar = fi.j.f22793a;
aVar3 = num;
aVar3.b(null);
return jVar;
}
jVar = null;
aVar3 = aVar2;
aVar3.b(null);
return jVar;
}
aVar2 = (kj.a) kVar.L$1;
iVar2 = (i) kVar.L$0;
b1.a.o(obj);
cVar = iVar2.messageView;
if (cVar != null) {
Activity activity = iVar2.activity;
kVar.L$0 = iVar2;
kVar.L$1 = aVar2;
kVar.L$2 = null;
kVar.label = 3;
if (cVar.showView(activity, kVar) == aVar4) {
return aVar4;
}
}
cVar2 = iVar2.messageView;
if (cVar2 != null) {
}
} else {
iVar = (i) kVar.L$0;
b1.a.o(obj);
aVar = (kj.a) kVar.L$2;
num = (Integer) kVar.L$1;
}
} else {
b1.a.o(obj);
aVar = this.messageViewMutex;
kVar.L$0 = this;
kVar.L$1 = num;
kVar.L$2 = aVar;
kVar.label = 1;
if (aVar.a(kVar) == aVar4) {
return aVar4;
}
iVar = this;
}
if (iVar.messageView != null) {
com.onesignal.debug.internal.logging.a.warn$default("No messageView found to update a with a new height.", null, 2, null);
fi.j jVar2 = fi.j.f22793a;
aVar.b(null);
return jVar2;
}
com.onesignal.debug.internal.logging.a.debug$default("In app message, showing first one with height: " + num, null, 2, null);
com.onesignal.inAppMessages.internal.display.impl.c cVar3 = iVar.messageView;
if (cVar3 != null) {
com.onesignal.inAppMessages.internal.display.impl.d dVar2 = iVar.webView;
ti.j.c(dVar2);
cVar3.setWebView(dVar2);
}
if (num != null) {
iVar.lastPageHeight = num;
com.onesignal.inAppMessages.internal.display.impl.c cVar4 = iVar.messageView;
if (cVar4 != null) {
int intValue = num.intValue();
kVar.L$0 = iVar;
kVar.L$1 = aVar;
kVar.L$2 = null;
kVar.label = 2;
if (cVar4.updateHeight(intValue, kVar) == aVar4) {
return aVar4;
}
}
}
aVar2 = aVar;
iVar2 = iVar;
cVar = iVar2.messageView;
if (cVar != null) {
}
cVar2 = iVar2.messageView;
if (cVar2 != null) {
}
}
}
if (iVar.messageView != null) {
}
} catch (Throwable th2) {
kj.a aVar6 = aVar;
th = th2;
num = aVar6;
num.b(null);
throw th;
}
kVar = new k(dVar);
Object obj2 = kVar.result;
li.a aVar42 = li.a.COROUTINE_SUSPENDED;
i = kVar.label;
if (i == 0) {
}
}
public final Object updateSafeAreaInsets(ki.d<? super fi.j> dVar) {
ij.c cVar = s0.f4219a;
Object e10 = cj.e.e(n.f23918a, new l(null), dVar);
if (e10 == li.a.COROUTINE_SUSPENDED) {
return e10;
}
return fi.j.f22793a;
}
public final void backgroundDismissAndAwaitNextMessage() {
com.onesignal.common.threading.a.suspendifyOnThread$default(0, new d(null), 1, null);
}
public final void createNewInAppMessageView(boolean z10) {
this.lastPageHeight = Integer.valueOf(this.messageContent.getPageHeight());
com.onesignal.inAppMessages.internal.display.impl.d dVar = this.webView;
ti.j.c(dVar);
setMessageView(new com.onesignal.inAppMessages.internal.display.impl.c(dVar, this.messageContent, z10));
com.onesignal.inAppMessages.internal.display.impl.c cVar = this.messageView;
ti.j.c(cVar);
cVar.setMessageController(new g(this));
this._applicationService.addActivityLifecycleHandler(this);
}
public final Object dismissAndAwaitNextMessage(ki.d<? super fi.j> dVar) {
h hVar;
int i;
i iVar;
if (dVar instanceof h) {
hVar = (h) dVar;
int i10 = hVar.label;
if ((i10 & Integer.MIN_VALUE) != 0) {
hVar.label = i10 - Integer.MIN_VALUE;
Object obj = hVar.result;
li.a aVar = li.a.COROUTINE_SUSPENDED;
i = hVar.label;
if (i == 0) {
if (i == 1) {
iVar = (i) hVar.L$0;
b1.a.o(obj);
} else {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
} else {
b1.a.o(obj);
com.onesignal.inAppMessages.internal.display.impl.c cVar = this.messageView;
if (cVar != null && !this.dismissFired) {
this.dismissFired = true;
this._lifecycle.messageWillDismiss(this.message);
hVar.L$0 = this;
hVar.label = 1;
if (cVar.dismissAndAwaitNextMessage(hVar) == aVar) {
return aVar;
}
iVar = this;
} else {
return fi.j.f22793a;
}
}
iVar.dismissFired = false;
iVar.setMessageView(null);
return fi.j.f22793a;
}
}
hVar = new h(dVar);
Object obj2 = hVar.result;
li.a aVar2 = li.a.COROUTINE_SUSPENDED;
i = hVar.label;
if (i == 0) {
}
iVar.dismissFired = false;
iVar.setMessageView(null);
return fi.j.f22793a;
}
@Override
public void onActivityAvailable(Activity activity) {
ti.j.f(activity, "activity");
String str = this.currentActivityName;
this.activity = activity;
this.currentActivityName = activity.getLocalClassName();
com.onesignal.debug.internal.logging.a.debug$default("In app message activity available currentActivityName: " + this.currentActivityName + " lastActivityName: " + str, null, 2, null);
com.onesignal.common.threading.a.suspendifyOnMain(new C0169i(str, this, null));
}
@Override
public void onActivityStopped(Activity activity) {
ti.j.f(activity, "activity");
com.onesignal.debug.internal.logging.a.debug$default(aj.e.F("\n In app message activity stopped, cleaning views, currentActivityName: " + this.currentActivityName + "\n activity: " + this.activity + "\n messageView: " + this.messageView + "\n "), null, 2, null);
if (this.messageView != null && ti.j.a(activity.getLocalClassName(), this.currentActivityName)) {
com.onesignal.inAppMessages.internal.display.impl.c cVar = this.messageView;
ti.j.c(cVar);
cVar.removeAllViews();
}
}
public final void setContentSafeAreaInsets(com.onesignal.inAppMessages.internal.d dVar, Activity activity) {
ti.j.f(dVar, "content");
ti.j.f(activity, "activity");
String contentHtml = dVar.getContentHtml();
int[] cutoutAndStatusBarInsets = o.INSTANCE.getCutoutAndStatusBarInsets(activity);
String format = String.format(SAFE_AREA_JS_OBJECT, Arrays.copyOf(new Object[]{Integer.valueOf(cutoutAndStatusBarInsets[0]), Integer.valueOf(cutoutAndStatusBarInsets[1]), Integer.valueOf(cutoutAndStatusBarInsets[2]), Integer.valueOf(cutoutAndStatusBarInsets[3])}, 4));
ti.j.e(format, "format(format, *args)");
String format2 = String.format(SET_SAFE_AREA_INSETS_SCRIPT, Arrays.copyOf(new Object[]{format}, 1));
ti.j.e(format2, "format(format, *args)");
dVar.setContentHtml(contentHtml + format2);
}
@SuppressLint({"SetJavaScriptEnabled", "AddJavascriptInterface"})
public final Object setupWebView(Activity activity, String str, boolean z10, ki.d<? super fi.j> dVar) {
j jVar;
int i;
i iVar;
if (dVar instanceof j) {
jVar = (j) dVar;
int i10 = jVar.label;
if ((i10 & Integer.MIN_VALUE) != 0) {
jVar.label = i10 - Integer.MIN_VALUE;
Object obj = jVar.result;
li.a aVar = li.a.COROUTINE_SUSPENDED;
i = jVar.label;
if (i == 0) {
if (i == 1) {
str = (String) jVar.L$2;
activity = (Activity) jVar.L$1;
iVar = (i) jVar.L$0;
b1.a.o(obj);
} else {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
} else {
b1.a.o(obj);
enableWebViewRemoteDebugging();
com.onesignal.inAppMessages.internal.display.impl.d dVar2 = new com.onesignal.inAppMessages.internal.display.impl.d(activity);
this.webView = dVar2;
dVar2.setOverScrollMode(2);
com.onesignal.inAppMessages.internal.display.impl.d dVar3 = this.webView;
ti.j.c(dVar3);
dVar3.setVerticalScrollBarEnabled(false);
com.onesignal.inAppMessages.internal.display.impl.d dVar4 = this.webView;
ti.j.c(dVar4);
dVar4.setHorizontalScrollBarEnabled(false);
com.onesignal.inAppMessages.internal.display.impl.d dVar5 = this.webView;
ti.j.c(dVar5);
dVar5.getSettings().setJavaScriptEnabled(true);
com.onesignal.inAppMessages.internal.display.impl.d dVar6 = this.webView;
ti.j.c(dVar6);
dVar6.addJavascriptInterface(new b(), JS_OBJ_NAME);
if (z10) {
com.onesignal.inAppMessages.internal.display.impl.d dVar7 = this.webView;
ti.j.c(dVar7);
dVar7.setSystemUiVisibility(3074);
if (Build.VERSION.SDK_INT >= 30) {
com.onesignal.inAppMessages.internal.display.impl.d dVar8 = this.webView;
ti.j.c(dVar8);
dVar8.setFitsSystemWindows(false);
}
}
com.onesignal.inAppMessages.internal.display.impl.d dVar9 = this.webView;
ti.j.c(dVar9);
blurryRenderingWebViewForKitKatWorkAround(dVar9);
this._lifecycle.messageWillDisplay(this.message);
ff.f fVar = this._applicationService;
jVar.L$0 = this;
jVar.L$1 = activity;
jVar.L$2 = str;
jVar.label = 1;
if (fVar.waitUntilActivityReady(jVar) == aVar) {
return aVar;
}
iVar = this;
}
iVar.setWebViewToMaxSize(activity);
com.onesignal.inAppMessages.internal.display.impl.d dVar10 = iVar.webView;
ti.j.c(dVar10);
dVar10.loadData(str, "text/html; charset=utf-8", "base64");
return fi.j.f22793a;
}
}
jVar = new j(dVar);
Object obj2 = jVar.result;
li.a aVar2 = li.a.COROUTINE_SUSPENDED;
i = jVar.label;
if (i == 0) {
}
iVar.setWebViewToMaxSize(activity);
com.onesignal.inAppMessages.internal.display.impl.d dVar102 = iVar.webView;
ti.j.c(dVar102);
dVar102.loadData(str, "text/html; charset=utf-8", "base64");
return fi.j.f22793a;
}
}