正在查看: bbinstant v6.24.0 应用的 b.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: bbinstant v6.24.0 应用的 b.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.moengage.inapp.internal.html;
import android.app.Activity;
import android.content.Context;
import android.view.View;
import android.webkit.JavascriptInterface;
import com.moengage.core.Properties;
import com.moengage.core.internal.utils.MoEUtils;
import com.snowplowanalytics.snowplow.tracker.constants.Parameters;
import in.juspay.hyper.constants.LogCategory;
import java.util.Locale;
import java.util.Map;
import org.json.JSONObject;
public final class b {
private final com.moengage.inapp.internal.a actionHandler;
private final Activity activity;
private final Context context;
private final View htmlInAppView;
private final String instanceId;
private final com.moengage.inapp.internal.model.h payload;
private final com.moengage.core.internal.model.a0 sdkInstance;
private final String tag;
private final WebPayloadParser webCallbackParser;
static final class a extends kotlin.jvm.internal.w implements kotlin.jvm.functions.a {
final String $mobileNumber;
a(String str) {
super(0);
this.$mobileNumber = str;
}
public final String invoke() {
return b.this.tag + " call() : mobile number: " + ((Object) this.$mobileNumber);
}
}
static final class a0 extends kotlin.jvm.internal.w implements kotlin.jvm.functions.a {
a0() {
super(0);
}
public final String invoke() {
return kotlin.jvm.internal.v.stringPlus(b.this.tag, " setFirstName() : ");
}
}
static final class a1 extends kotlin.jvm.internal.w implements kotlin.jvm.functions.a {
a1() {
super(0);
}
public final String invoke() {
return kotlin.jvm.internal.v.stringPlus(b.this.tag, " trackDismiss() : ");
}
}
static final class C0120b extends kotlin.jvm.internal.w implements kotlin.jvm.functions.a {
C0120b() {
super(0);
}
public final String invoke() {
return kotlin.jvm.internal.v.stringPlus(b.this.tag, " call() : ");
}
}
static final class b0 extends kotlin.jvm.internal.w implements kotlin.jvm.functions.a {
final String $gender;
b0(String str) {
super(0);
this.$gender = str;
}
public final String invoke() {
return b.this.tag + " setGender() : gender: " + ((Object) this.$gender);
}
}
static final class b1 extends kotlin.jvm.internal.w implements kotlin.jvm.functions.a {
b1() {
super(0);
}
public final String invoke() {
return kotlin.jvm.internal.v.stringPlus(b.this.tag, " trackDismiss() : ");
}
}
static final class c extends kotlin.jvm.internal.w implements kotlin.jvm.functions.a {
final String $message;
final String $textToCopy;
c(String str, String str2) {
super(0);
this.$textToCopy = str;
this.$message = str2;
}
public final String invoke() {
return b.this.tag + " copyText() : text to copy: " + ((Object) this.$textToCopy) + ", message: " + ((Object) this.$message);
}
}
static final class c0 extends kotlin.jvm.internal.w implements kotlin.jvm.functions.a {
c0() {
super(0);
}
public final String invoke() {
return kotlin.jvm.internal.v.stringPlus(b.this.tag, " setGender() : ");
}
}
static final class c1 extends kotlin.jvm.internal.w implements kotlin.jvm.functions.a {
final String $dateAttrJson;
final String $eventName;
final String $generalAttrJson;
final boolean $isNonInteractive;
final String $locationAttrJson;
final boolean $shouldAttachCampaignMeta;
c1(String str, String str2, String str3, String str4, boolean z, boolean z2) {
super(0);
this.$eventName = str;
this.$generalAttrJson = str2;
this.$locationAttrJson = str3;
this.$dateAttrJson = str4;
this.$isNonInteractive = z;
this.$shouldAttachCampaignMeta = z2;
}
public final String invoke() {
return b.this.tag + " trackEvent() : eventName: " + ((Object) this.$eventName) + ", generalAttrJson: " + ((Object) this.$generalAttrJson) + ", locationAttrJson: " + ((Object) this.$locationAttrJson) + ", dateAttrJson: " + ((Object) this.$dateAttrJson) + ", isNonInteractive: " + this.$isNonInteractive + ", shouldAttachCampaignMeta: " + this.$shouldAttachCampaignMeta;
}
}
static final class d extends kotlin.jvm.internal.w implements kotlin.jvm.functions.a {
d() {
super(0);
}
public final String invoke() {
return kotlin.jvm.internal.v.stringPlus(b.this.tag, " copyText() : ");
}
}
static final class d0 extends kotlin.jvm.internal.w implements kotlin.jvm.functions.a {
final String $lastName;
d0(String str) {
super(0);
this.$lastName = str;
}
public final String invoke() {
return b.this.tag + " setLastName() : last name: " + ((Object) this.$lastName);
}
}
static final class d1 extends kotlin.jvm.internal.w implements kotlin.jvm.functions.a {
d1() {
super(0);
}
public final String invoke() {
return kotlin.jvm.internal.v.stringPlus(b.this.tag, " trackEvent() : ");
}
}
static final class e extends kotlin.jvm.internal.w implements kotlin.jvm.functions.a {
final String $dataJson;
e(String str) {
super(0);
this.$dataJson = str;
}
public final String invoke() {
return b.this.tag + " customAction() : DataJson: " + ((Object) this.$dataJson);
}
}
static final class e0 extends kotlin.jvm.internal.w implements kotlin.jvm.functions.a {
e0() {
super(0);
}
public final String invoke() {
return kotlin.jvm.internal.v.stringPlus(b.this.tag, " setLastName() : ");
}
}
static final class e1 extends kotlin.jvm.internal.w implements kotlin.jvm.functions.a {
final String $payload;
e1(String str) {
super(0);
this.$payload = str;
}
public final String invoke() {
return b.this.tag + " trackRating() : " + ((Object) this.$payload);
}
}
static final class f extends kotlin.jvm.internal.w implements kotlin.jvm.functions.a {
f() {
super(0);
}
public final String invoke() {
return kotlin.jvm.internal.v.stringPlus(b.this.tag, " customAction() : ");
}
}
static final class f0 extends kotlin.jvm.internal.w implements kotlin.jvm.functions.a {
final String $mobileNumber;
f0(String str) {
super(0);
this.$mobileNumber = str;
}
public final String invoke() {
return b.this.tag + " setMobileNumber() : mobile number: " + ((Object) this.$mobileNumber);
}
}
static final class f1 extends kotlin.jvm.internal.w implements kotlin.jvm.functions.a {
f1() {
super(0);
}
public final String invoke() {
return kotlin.jvm.internal.v.stringPlus(b.this.tag, " trackRating() : ");
}
}
static final class g extends kotlin.jvm.internal.w implements kotlin.jvm.functions.a {
g() {
super(0);
}
public final String invoke() {
return kotlin.jvm.internal.v.stringPlus(b.this.tag, " dismissMessage() : ");
}
}
static final class g0 extends kotlin.jvm.internal.w implements kotlin.jvm.functions.a {
g0() {
super(0);
}
public final String invoke() {
return kotlin.jvm.internal.v.stringPlus(b.this.tag, " setMobileNumber() : ");
}
}
static final class h extends kotlin.jvm.internal.w implements kotlin.jvm.functions.a {
h() {
super(0);
}
public final String invoke() {
return kotlin.jvm.internal.v.stringPlus(b.this.tag, " navigateToNotificationSettings() : ");
}
}
static final class h0 extends kotlin.jvm.internal.w implements kotlin.jvm.functions.a {
final String $uniqueId;
h0(String str) {
super(0);
this.$uniqueId = str;
}
public final String invoke() {
return b.this.tag + " setUniqueId() : uniqueId: " + ((Object) this.$uniqueId);
}
}
static final class i extends kotlin.jvm.internal.w implements kotlin.jvm.functions.a {
i() {
super(0);
}
public final String invoke() {
return kotlin.jvm.internal.v.stringPlus(b.this.tag, " navigateToNotificationSettings() : ");
}
}
static final class i0 extends kotlin.jvm.internal.w implements kotlin.jvm.functions.a {
i0() {
super(0);
}
public final String invoke() {
return kotlin.jvm.internal.v.stringPlus(b.this.tag, " setUniqueId() : ");
}
}
static final class j extends kotlin.jvm.internal.w implements kotlin.jvm.functions.a {
final String $screenName;
j(String str) {
super(0);
this.$screenName = str;
}
public final String invoke() {
return b.this.tag + " navigateToScreen() : screenName: " + ((Object) this.$screenName) + " is invalid. Not processing.";
}
}
static final class j0 extends kotlin.jvm.internal.w implements kotlin.jvm.functions.a {
final String $userAttrJson;
j0(String str) {
super(0);
this.$userAttrJson = str;
}
public final String invoke() {
return b.this.tag + " setUserAttribute() : userAttrJson: " + ((Object) this.$userAttrJson);
}
}
static final class k extends kotlin.jvm.internal.w implements kotlin.jvm.functions.a {
k() {
super(0);
}
public final String invoke() {
return kotlin.jvm.internal.v.stringPlus(b.this.tag, " navigateToScreen() : ");
}
}
static final class k0 extends kotlin.jvm.internal.w implements kotlin.jvm.functions.a {
final String $name;
final Object $value;
k0(String str, Object obj) {
super(0);
this.$name = str;
this.$value = obj;
}
public final String invoke() {
return b.this.tag + " setUserAttribute() : name: " + ((Object) this.$name) + " value: " + this.$value + ", unsupported data type.";
}
}
static final class l extends kotlin.jvm.internal.w implements kotlin.jvm.functions.a {
final String $deepLinkUrl;
l(String str) {
super(0);
this.$deepLinkUrl = str;
}
public final String invoke() {
return b.this.tag + " openDeepLink() : url: " + ((Object) this.$deepLinkUrl) + " is invalid. Not processing.";
}
}
static final class l0 extends kotlin.jvm.internal.w implements kotlin.jvm.functions.a {
l0() {
super(0);
}
public final String invoke() {
return kotlin.jvm.internal.v.stringPlus(b.this.tag, " setUserAttribute() : ");
}
}
static final class m extends kotlin.jvm.internal.w implements kotlin.jvm.functions.a {
m() {
super(0);
}
public final String invoke() {
return kotlin.jvm.internal.v.stringPlus(b.this.tag, " openDeepLink() : ");
}
}
static final class m0 extends kotlin.jvm.internal.w implements kotlin.jvm.functions.a {
final String $isoDate;
final String $name;
m0(String str, String str2) {
super(0);
this.$name = str;
this.$isoDate = str2;
}
public final String invoke() {
return b.this.tag + " setUserAttributeDate() : name: " + ((Object) this.$name) + ", iso date: " + ((Object) this.$isoDate);
}
}
static final class n extends kotlin.jvm.internal.w implements kotlin.jvm.functions.a {
final String $url;
n(String str) {
super(0);
this.$url = str;
}
public final String invoke() {
return b.this.tag + " openRichLanding() : url: " + ((Object) this.$url) + " is invalid. Not processing.";
}
}
static final class n0 extends kotlin.jvm.internal.w implements kotlin.jvm.functions.a {
n0() {
super(0);
}
public final String invoke() {
return kotlin.jvm.internal.v.stringPlus(b.this.tag, " setUserAttributeDate() : ");
}
}
static final class o extends kotlin.jvm.internal.w implements kotlin.jvm.functions.a {
o() {
super(0);
}
public final String invoke() {
return kotlin.jvm.internal.v.stringPlus(b.this.tag, " openRichLanding() : ");
}
}
static final class o0 extends kotlin.jvm.internal.w implements kotlin.jvm.functions.a {
final String $payload;
o0(String str) {
super(0);
this.$payload = str;
}
public final String invoke() {
return b.this.tag + " setUserAttributeLocation() : " + ((Object) this.$payload);
}
}
static final class p extends kotlin.jvm.internal.w implements kotlin.jvm.functions.a {
final String $webUrl;
p(String str) {
super(0);
this.$webUrl = str;
}
public final String invoke() {
return b.this.tag + " openWebURL() : " + ((Object) this.$webUrl) + " is invalid. Not processing.";
}
}
static final class p0 extends kotlin.jvm.internal.w implements kotlin.jvm.functions.a {
p0() {
super(0);
}
public final String invoke() {
return kotlin.jvm.internal.v.stringPlus(b.this.tag, " setUserAttributeLocation() : ");
}
}
static final class q extends kotlin.jvm.internal.w implements kotlin.jvm.functions.a {
q() {
super(0);
}
public final String invoke() {
return kotlin.jvm.internal.v.stringPlus(b.this.tag, " openWebURL() : ");
}
}
static final class q0 extends kotlin.jvm.internal.w implements kotlin.jvm.functions.a {
final String $payload;
q0(String str) {
super(0);
this.$payload = str;
}
public final String invoke() {
return b.this.tag + " setUserLocation() : " + ((Object) this.$payload);
}
}
static final class r extends kotlin.jvm.internal.w implements kotlin.jvm.functions.a {
r() {
super(0);
}
public final String invoke() {
return kotlin.jvm.internal.v.stringPlus(b.this.tag, " requestNotificationPermission() : ");
}
}
static final class r0 extends kotlin.jvm.internal.w implements kotlin.jvm.functions.a {
r0() {
super(0);
}
public final String invoke() {
return kotlin.jvm.internal.v.stringPlus(b.this.tag, " setUserLocation() : ");
}
}
static final class s extends kotlin.jvm.internal.w implements kotlin.jvm.functions.a {
s() {
super(0);
}
public final String invoke() {
return kotlin.jvm.internal.v.stringPlus(b.this.tag, " requestNotificationPermission() : ");
}
}
static final class s0 extends kotlin.jvm.internal.w implements kotlin.jvm.functions.a {
final String $userName;
s0(String str) {
super(0);
this.$userName = str;
}
public final String invoke() {
return b.this.tag + " setUserName() : username: " + ((Object) this.$userName);
}
}
static final class t extends kotlin.jvm.internal.w implements kotlin.jvm.functions.a {
final String $alias;
t(String str) {
super(0);
this.$alias = str;
}
public final String invoke() {
return b.this.tag + " setAlias() : alias " + ((Object) this.$alias);
}
}
static final class t0 extends kotlin.jvm.internal.w implements kotlin.jvm.functions.a {
t0() {
super(0);
}
public final String invoke() {
return kotlin.jvm.internal.v.stringPlus(b.this.tag, " setUserName() : ");
}
}
static final class u extends kotlin.jvm.internal.w implements kotlin.jvm.functions.a {
u() {
super(0);
}
public final String invoke() {
return kotlin.jvm.internal.v.stringPlus(b.this.tag, " setAlias() : ");
}
}
static final class u0 extends kotlin.jvm.internal.w implements kotlin.jvm.functions.a {
final String $content;
u0(String str) {
super(0);
this.$content = str;
}
public final String invoke() {
return b.this.tag + " share() : content: " + ((Object) this.$content);
}
}
static final class v extends kotlin.jvm.internal.w implements kotlin.jvm.functions.a {
final String $birthDate;
v(String str) {
super(0);
this.$birthDate = str;
}
public final String invoke() {
return b.this.tag + " setBirthDate() : birthdate: " + ((Object) this.$birthDate);
}
}
static final class v0 extends kotlin.jvm.internal.w implements kotlin.jvm.functions.a {
v0() {
super(0);
}
public final String invoke() {
return kotlin.jvm.internal.v.stringPlus(b.this.tag, " share() : ");
}
}
static final class w extends kotlin.jvm.internal.w implements kotlin.jvm.functions.a {
w() {
super(0);
}
public final String invoke() {
return kotlin.jvm.internal.v.stringPlus(b.this.tag, " setBirthDate() : ");
}
}
static final class w0 extends kotlin.jvm.internal.w implements kotlin.jvm.functions.a {
final String $message;
final String $mobileNumber;
w0(String str, String str2) {
super(0);
this.$mobileNumber = str;
this.$message = str2;
}
public final String invoke() {
return b.this.tag + " sms() : mobile number: " + ((Object) this.$mobileNumber) + ", message: " + ((Object) this.$message);
}
}
static final class x extends kotlin.jvm.internal.w implements kotlin.jvm.functions.a {
final String $emailId;
x(String str) {
super(0);
this.$emailId = str;
}
public final String invoke() {
return b.this.tag + " setEmailId() : emailId: " + ((Object) this.$emailId);
}
}
static final class x0 extends kotlin.jvm.internal.w implements kotlin.jvm.functions.a {
x0() {
super(0);
}
public final String invoke() {
return kotlin.jvm.internal.v.stringPlus(b.this.tag, " sms() : ");
}
}
static final class y extends kotlin.jvm.internal.w implements kotlin.jvm.functions.a {
y() {
super(0);
}
public final String invoke() {
return kotlin.jvm.internal.v.stringPlus(b.this.tag, " setEmailId() : ");
}
}
static final class y0 extends kotlin.jvm.internal.w implements kotlin.jvm.functions.a {
final String $payload;
y0(String str) {
super(0);
this.$payload = str;
}
public final String invoke() {
return b.this.tag + " trackClick() : payload: " + ((Object) this.$payload);
}
}
static final class z extends kotlin.jvm.internal.w implements kotlin.jvm.functions.a {
final String $firstName;
z(String str) {
super(0);
this.$firstName = str;
}
public final String invoke() {
return b.this.tag + " setFirstName() : first name: " + ((Object) this.$firstName);
}
}
static final class z0 extends kotlin.jvm.internal.w implements kotlin.jvm.functions.a {
z0() {
super(0);
}
public final String invoke() {
return kotlin.jvm.internal.v.stringPlus(b.this.tag, " trackClick() : ");
}
}
public b(Activity activity, com.moengage.inapp.internal.model.h hVar, View view, com.moengage.core.internal.model.a0 a0Var) {
kotlin.jvm.internal.v.checkNotNullParameter(activity, Parameters.SCREEN_ACTIVITY);
kotlin.jvm.internal.v.checkNotNullParameter(hVar, "payload");
kotlin.jvm.internal.v.checkNotNullParameter(a0Var, "sdkInstance");
this.activity = activity;
this.payload = hVar;
this.htmlInAppView = view;
this.sdkInstance = a0Var;
this.tag = "InApp_6.7.2_HtmlJavaScriptInterface";
this.webCallbackParser = new WebPayloadParser();
this.actionHandler = new com.moengage.inapp.internal.a(activity, a0Var);
this.context = activity.getApplicationContext();
this.instanceId = a0Var.getInstanceMeta().getInstanceId();
}
public static final void m806dismissMessage$lambda0(b bVar) {
kotlin.jvm.internal.v.checkNotNullParameter(bVar, "this$0");
bVar.processAction(new com.moengage.inapp.internal.model.actions.e(com.moengage.inapp.model.enums.a.DISMISS));
}
private final void processAction(com.moengage.inapp.model.actions.a aVar) {
View view = this.htmlInAppView;
if (view == null) {
return;
}
this.actionHandler.onActionPerformed(view, aVar, this.payload);
}
private final Map<String, Object> toKeyValuePairs(String str) {
if (!com.moengage.inapp.internal.z.isValidJavaScriptString(str) || str == null || kotlin.text.p.isBlank(str)) {
return null;
}
return MoEUtils.jsonToMap(new JSONObject(str));
}
@JavascriptInterface
public final void call(String str) {
try {
com.moengage.core.internal.logger.f.log$default(this.sdkInstance.logger, 0, null, new a(str), 3, null);
if (str != null && !kotlin.text.p.isBlank(str) && com.moengage.inapp.internal.z.isValidJavaScriptString(str)) {
processAction(new com.moengage.inapp.internal.model.actions.a(com.moengage.inapp.model.enums.a.CALL, str));
}
} catch (Exception e2) {
this.sdkInstance.logger.log(1, e2, new C0120b());
}
}
@JavascriptInterface
public final void copyText(String str, String str2) {
try {
com.moengage.core.internal.logger.f.log$default(this.sdkInstance.logger, 0, null, new c(str, str2), 3, null);
if (str != null && !kotlin.text.p.isBlank(str) && com.moengage.inapp.internal.z.isValidJavaScriptString(str)) {
com.moengage.inapp.model.enums.a aVar = com.moengage.inapp.model.enums.a.COPY_TEXT;
if (!com.moengage.inapp.internal.z.isValidJavaScriptString(str2)) {
str2 = null;
}
processAction(new com.moengage.inapp.internal.model.actions.d(aVar, str2, str));
}
} catch (Exception e2) {
this.sdkInstance.logger.log(1, e2, new d());
}
}
@JavascriptInterface
public final void customAction(String str) {
try {
com.moengage.core.internal.logger.f.log$default(this.sdkInstance.logger, 0, null, new e(str), 3, null);
if (com.moengage.inapp.internal.z.isValidJavaScriptString(str)) {
processAction(new com.moengage.inapp.model.actions.b(com.moengage.inapp.model.enums.a.CUSTOM_ACTION, toKeyValuePairs(str)));
}
} catch (Exception e2) {
this.sdkInstance.logger.log(1, e2, new f());
}
}
@JavascriptInterface
public final void dismissMessage() {
try {
this.activity.runOnUiThread(new Runnable() {
@Override
public final void run() {
b.m806dismissMessage$lambda0(b.this);
}
});
} catch (Exception e2) {
this.sdkInstance.logger.log(1, e2, new g());
}
}
@JavascriptInterface
public final void navigateToNotificationSettings() {
try {
com.moengage.core.internal.logger.f.log$default(this.sdkInstance.logger, 0, null, new h(), 3, null);
processAction(new com.moengage.inapp.internal.model.actions.f(com.moengage.inapp.model.enums.a.NAVIGATE_SETTINGS_NOTIFICATIONS));
} catch (Exception e2) {
this.sdkInstance.logger.log(1, e2, new i());
}
}
@JavascriptInterface
public final void navigateToScreen(String str, String str2) {
if (str != null) {
try {
if (!kotlin.text.p.isBlank(str) && com.moengage.inapp.internal.z.isValidJavaScriptString(str)) {
processAction(new com.moengage.inapp.model.actions.c(com.moengage.inapp.model.enums.a.NAVIGATE, com.moengage.inapp.model.enums.b.SCREEN, str, toKeyValuePairs(str2)));
return;
}
} catch (Exception e2) {
this.sdkInstance.logger.log(1, e2, new k());
return;
}
}
com.moengage.core.internal.logger.f.log$default(this.sdkInstance.logger, 1, null, new j(str), 2, null);
}
@JavascriptInterface
public final void openDeepLink(String str, String str2) {
if (str != null) {
try {
if (!kotlin.text.p.isBlank(str) && com.moengage.inapp.internal.z.isValidJavaScriptString(str)) {
processAction(new com.moengage.inapp.model.actions.c(com.moengage.inapp.model.enums.a.NAVIGATE, com.moengage.inapp.model.enums.b.DEEP_LINKING, str, toKeyValuePairs(str2)));
return;
}
} catch (Exception e2) {
this.sdkInstance.logger.log(1, e2, new m());
return;
}
}
com.moengage.core.internal.logger.f.log$default(this.sdkInstance.logger, 1, null, new l(str), 2, null);
}
@JavascriptInterface
public final void openRichLanding(String str, String str2) {
if (str != null) {
try {
if (!kotlin.text.p.isBlank(str) && com.moengage.inapp.internal.z.isValidJavaScriptString(str)) {
processAction(new com.moengage.inapp.model.actions.c(com.moengage.inapp.model.enums.a.NAVIGATE, com.moengage.inapp.model.enums.b.RICH_LANDING, str, toKeyValuePairs(str2)));
return;
}
} catch (Exception e2) {
this.sdkInstance.logger.log(1, e2, new o());
return;
}
}
com.moengage.core.internal.logger.f.log$default(this.sdkInstance.logger, 1, null, new n(str), 2, null);
}
@JavascriptInterface
public final void openWebURL(String str, String str2) {
if (str != null) {
try {
if (!kotlin.text.p.isBlank(str) && com.moengage.inapp.internal.z.isValidJavaScriptString(str)) {
processAction(new com.moengage.inapp.model.actions.c(com.moengage.inapp.model.enums.a.NAVIGATE, com.moengage.inapp.model.enums.b.DEEP_LINKING, str, toKeyValuePairs(str2)));
return;
}
} catch (Exception e2) {
this.sdkInstance.logger.log(1, e2, new q());
return;
}
}
com.moengage.core.internal.logger.f.log$default(this.sdkInstance.logger, 1, null, new p(str), 2, null);
}
@JavascriptInterface
public final void requestNotificationPermission() {
try {
com.moengage.core.internal.logger.f.log$default(this.sdkInstance.logger, 0, null, new r(), 3, null);
processAction(new com.moengage.inapp.model.actions.d(com.moengage.inapp.model.enums.a.REQUEST_NOTIFICATION_PERMISSION, -1));
} catch (Exception e2) {
this.sdkInstance.logger.log(1, e2, new s());
}
}
@JavascriptInterface
public final void setAlias(String str) {
try {
com.moengage.core.internal.logger.f.log$default(this.sdkInstance.logger, 0, null, new t(str), 3, null);
if (str != null && !kotlin.text.p.isBlank(str) && com.moengage.inapp.internal.z.isValidJavaScriptString(str)) {
com.moengage.core.analytics.a aVar = com.moengage.core.analytics.a.INSTANCE;
Context context = this.context;
kotlin.jvm.internal.v.checkNotNullExpressionValue(context, LogCategory.CONTEXT);
aVar.setAlias(context, str, this.instanceId);
}
} catch (Exception e2) {
this.sdkInstance.logger.log(1, e2, new u());
}
}
@JavascriptInterface
public final void setBirthDate(String str) {
try {
com.moengage.core.internal.logger.f.log$default(this.sdkInstance.logger, 0, null, new v(str), 3, null);
if (str != null && !kotlin.text.p.isBlank(str) && com.moengage.inapp.internal.z.isValidJavaScriptString(str)) {
com.moengage.core.analytics.a aVar = com.moengage.core.analytics.a.INSTANCE;
Context context = this.context;
kotlin.jvm.internal.v.checkNotNullExpressionValue(context, LogCategory.CONTEXT);
aVar.setUserAttributeISODate(context, "USER_ATTRIBUTE_USER_BDAY", str, this.instanceId);
}
} catch (Exception e2) {
this.sdkInstance.logger.log(1, e2, new w());
}
}
@JavascriptInterface
public final void setEmailId(String str) {
try {
com.moengage.core.internal.logger.f.log$default(this.sdkInstance.logger, 0, null, new x(str), 3, null);
if (str != null && !kotlin.text.p.isBlank(str) && com.moengage.inapp.internal.z.isValidJavaScriptString(str)) {
com.moengage.core.analytics.a aVar = com.moengage.core.analytics.a.INSTANCE;
Context context = this.context;
kotlin.jvm.internal.v.checkNotNullExpressionValue(context, LogCategory.CONTEXT);
aVar.setEmailId(context, str, this.instanceId);
}
} catch (Exception e2) {
this.sdkInstance.logger.log(1, e2, new y());
}
}
@JavascriptInterface
public final void setFirstName(String str) {
try {
com.moengage.core.internal.logger.f.log$default(this.sdkInstance.logger, 0, null, new z(str), 3, null);
if (str != null && !kotlin.text.p.isBlank(str) && com.moengage.inapp.internal.z.isValidJavaScriptString(str)) {
com.moengage.core.analytics.a aVar = com.moengage.core.analytics.a.INSTANCE;
Context context = this.context;
kotlin.jvm.internal.v.checkNotNullExpressionValue(context, LogCategory.CONTEXT);
aVar.setFirstName(context, str, this.instanceId);
}
} catch (Exception e2) {
this.sdkInstance.logger.log(1, e2, new a0());
}
}
@JavascriptInterface
public final void setGender(String str) {
try {
com.moengage.core.internal.logger.f.log$default(this.sdkInstance.logger, 0, null, new b0(str), 3, null);
if (str != null && !kotlin.text.p.isBlank(str) && com.moengage.inapp.internal.z.isValidJavaScriptString(str)) {
com.moengage.core.analytics.a aVar = com.moengage.core.analytics.a.INSTANCE;
Context context = this.context;
kotlin.jvm.internal.v.checkNotNullExpressionValue(context, LogCategory.CONTEXT);
String upperCase = str.toUpperCase(Locale.ROOT);
kotlin.jvm.internal.v.checkNotNullExpressionValue(upperCase, "this as java.lang.String).toUpperCase(Locale.ROOT)");
aVar.setGender(context, com.moengage.core.model.i.valueOf(upperCase), this.instanceId);
}
} catch (Exception e2) {
this.sdkInstance.logger.log(1, e2, new c0());
}
}
@JavascriptInterface
public final void setLastName(String str) {
try {
com.moengage.core.internal.logger.f.log$default(this.sdkInstance.logger, 0, null, new d0(str), 3, null);
if (str != null && !kotlin.text.p.isBlank(str) && com.moengage.inapp.internal.z.isValidJavaScriptString(str)) {
com.moengage.core.analytics.a aVar = com.moengage.core.analytics.a.INSTANCE;
Context context = this.context;
kotlin.jvm.internal.v.checkNotNullExpressionValue(context, LogCategory.CONTEXT);
aVar.setLastName(context, str, this.instanceId);
}
} catch (Exception e2) {
this.sdkInstance.logger.log(1, e2, new e0());
}
}
@JavascriptInterface
public final void setMobileNumber(String str) {
try {
com.moengage.core.internal.logger.f.log$default(this.sdkInstance.logger, 0, null, new f0(str), 3, null);
if (str != null && !kotlin.text.p.isBlank(str) && com.moengage.inapp.internal.z.isValidJavaScriptString(str)) {
com.moengage.core.analytics.a aVar = com.moengage.core.analytics.a.INSTANCE;
Context context = this.context;
kotlin.jvm.internal.v.checkNotNullExpressionValue(context, LogCategory.CONTEXT);
aVar.setMobileNumber(context, str, this.instanceId);
}
} catch (Exception e2) {
this.sdkInstance.logger.log(1, e2, new g0());
}
}
@JavascriptInterface
public final void setUniqueId(String str) {
try {
com.moengage.core.internal.logger.f.log$default(this.sdkInstance.logger, 0, null, new h0(str), 3, null);
if (str != null && !kotlin.text.p.isBlank(str) && com.moengage.inapp.internal.z.isValidJavaScriptString(str)) {
com.moengage.core.analytics.a aVar = com.moengage.core.analytics.a.INSTANCE;
Context context = this.context;
kotlin.jvm.internal.v.checkNotNullExpressionValue(context, LogCategory.CONTEXT);
aVar.setUniqueId(context, str, this.instanceId);
}
} catch (Exception e2) {
this.sdkInstance.logger.log(1, e2, new i0());
}
}
@JavascriptInterface
public final void setUserAttribute(String str) {
try {
com.moengage.core.internal.logger.f.log$default(this.sdkInstance.logger, 0, null, new j0(str), 3, null);
if (str != null && !kotlin.text.p.isBlank(str) && com.moengage.inapp.internal.z.isValidJavaScriptString(str) && com.moengage.inapp.internal.z.isValidJavaScriptValue(str)) {
JSONObject jSONObject = new JSONObject(str);
String string = jSONObject.getString("name");
Object obj = jSONObject.get("value");
if (obj instanceof Integer) {
com.moengage.core.analytics.a aVar = com.moengage.core.analytics.a.INSTANCE;
Context context = this.context;
kotlin.jvm.internal.v.checkNotNullExpressionValue(context, LogCategory.CONTEXT);
kotlin.jvm.internal.v.checkNotNullExpressionValue(string, "name");
aVar.setUserAttribute(context, string, obj, this.sdkInstance.getInstanceMeta().getInstanceId());
} else if (obj instanceof Boolean) {
com.moengage.core.analytics.a aVar2 = com.moengage.core.analytics.a.INSTANCE;
Context context2 = this.context;
kotlin.jvm.internal.v.checkNotNullExpressionValue(context2, LogCategory.CONTEXT);
kotlin.jvm.internal.v.checkNotNullExpressionValue(string, "name");
aVar2.setUserAttribute(context2, string, obj, this.instanceId);
} else if (obj instanceof Double) {
com.moengage.core.analytics.a aVar3 = com.moengage.core.analytics.a.INSTANCE;
Context context3 = this.context;
kotlin.jvm.internal.v.checkNotNullExpressionValue(context3, LogCategory.CONTEXT);
kotlin.jvm.internal.v.checkNotNullExpressionValue(string, "name");
aVar3.setUserAttribute(context3, string, obj, this.instanceId);
} else if (obj instanceof Float) {
com.moengage.core.analytics.a aVar4 = com.moengage.core.analytics.a.INSTANCE;
Context context4 = this.context;
kotlin.jvm.internal.v.checkNotNullExpressionValue(context4, LogCategory.CONTEXT);
kotlin.jvm.internal.v.checkNotNullExpressionValue(string, "name");
aVar4.setUserAttribute(context4, string, obj, this.instanceId);
} else if (obj instanceof Long) {
com.moengage.core.analytics.a aVar5 = com.moengage.core.analytics.a.INSTANCE;
Context context5 = this.context;
kotlin.jvm.internal.v.checkNotNullExpressionValue(context5, LogCategory.CONTEXT);
kotlin.jvm.internal.v.checkNotNullExpressionValue(string, "name");
aVar5.setUserAttribute(context5, string, obj, this.instanceId);
} else if (obj instanceof String) {
com.moengage.core.analytics.a aVar6 = com.moengage.core.analytics.a.INSTANCE;
Context context6 = this.context;
kotlin.jvm.internal.v.checkNotNullExpressionValue(context6, LogCategory.CONTEXT);
kotlin.jvm.internal.v.checkNotNullExpressionValue(string, "name");
aVar6.setUserAttribute(context6, string, obj, this.instanceId);
} else {
com.moengage.core.internal.logger.f.log$default(this.sdkInstance.logger, 1, null, new k0(string, obj), 2, null);
}
}
} catch (Exception e2) {
this.sdkInstance.logger.log(1, e2, new l0());
}
}
@JavascriptInterface
public final void setUserAttributeDate(String str, String str2) {
try {
com.moengage.core.internal.logger.f.log$default(this.sdkInstance.logger, 0, null, new m0(str, str2), 3, null);
if (str != null && !kotlin.text.p.isBlank(str) && com.moengage.inapp.internal.z.isValidJavaScriptString(str) && str2 != null && !kotlin.text.p.isBlank(str2) && com.moengage.inapp.internal.z.isValidJavaScriptString(str2)) {
com.moengage.core.analytics.a aVar = com.moengage.core.analytics.a.INSTANCE;
Context context = this.context;
kotlin.jvm.internal.v.checkNotNullExpressionValue(context, LogCategory.CONTEXT);
aVar.setUserAttributeISODate(context, str, str2, this.instanceId);
}
} catch (Exception e2) {
this.sdkInstance.logger.log(1, e2, new n0());
}
}
@JavascriptInterface
public final void setUserAttributeLocation(String str) {
JSONObject jSONObject;
String string;
try {
com.moengage.core.internal.logger.f.log$default(this.sdkInstance.logger, 0, null, new o0(str), 3, null);
if (str != null && !kotlin.text.p.isBlank(str) && com.moengage.inapp.internal.z.isValidJavaScriptString(str) && (string = (jSONObject = new JSONObject(str)).getString("name")) != null && !kotlin.text.p.isBlank(string) && com.moengage.inapp.internal.z.isValidJavaScriptString(string)) {
com.moengage.core.analytics.a aVar = com.moengage.core.analytics.a.INSTANCE;
Context context = this.context;
kotlin.jvm.internal.v.checkNotNullExpressionValue(context, LogCategory.CONTEXT);
kotlin.jvm.internal.v.checkNotNullExpressionValue(string, "name");
aVar.setUserAttribute(context, string, new com.moengage.core.model.e(jSONObject.getDouble(Parameters.LATITUDE), jSONObject.getDouble(Parameters.LONGITUDE)), this.instanceId);
}
} catch (Exception e2) {
this.sdkInstance.logger.log(1, e2, new p0());
}
}
@JavascriptInterface
public final void setUserLocation(String str) {
try {
com.moengage.core.internal.logger.f.log$default(this.sdkInstance.logger, 0, null, new q0(str), 3, null);
if (str != null && !kotlin.text.p.isBlank(str) && com.moengage.inapp.internal.z.isValidJavaScriptString(str) && com.moengage.inapp.internal.z.isValidJavaScriptValue(str)) {
JSONObject jSONObject = new JSONObject(str);
com.moengage.core.analytics.a aVar = com.moengage.core.analytics.a.INSTANCE;
Context context = this.context;
kotlin.jvm.internal.v.checkNotNullExpressionValue(context, LogCategory.CONTEXT);
aVar.setLocation(context, jSONObject.getDouble(Parameters.LATITUDE), jSONObject.getDouble(Parameters.LONGITUDE), this.instanceId);
}
} catch (Exception e2) {
this.sdkInstance.logger.log(1, e2, new r0());
}
}
@JavascriptInterface
public final void setUserName(String str) {
try {
com.moengage.core.internal.logger.f.log$default(this.sdkInstance.logger, 0, null, new s0(str), 3, null);
if (str != null && !kotlin.text.p.isBlank(str) && com.moengage.inapp.internal.z.isValidJavaScriptString(str)) {
com.moengage.core.analytics.a aVar = com.moengage.core.analytics.a.INSTANCE;
Context context = this.context;
kotlin.jvm.internal.v.checkNotNullExpressionValue(context, LogCategory.CONTEXT);
aVar.setUserName(context, str, this.instanceId);
}
} catch (Exception e2) {
this.sdkInstance.logger.log(1, e2, new t0());
}
}
@JavascriptInterface
public final void share(String str) {
try {
com.moengage.core.internal.logger.f.log$default(this.sdkInstance.logger, 0, null, new u0(str), 3, null);
if (str != null && !kotlin.text.p.isBlank(str) && com.moengage.inapp.internal.z.isValidJavaScriptString(str)) {
processAction(new com.moengage.inapp.internal.model.actions.g(com.moengage.inapp.model.enums.a.SHARE, str));
}
} catch (Exception e2) {
this.sdkInstance.logger.log(1, e2, new v0());
}
}
@JavascriptInterface
public final void sms(String str, String str2) {
try {
com.moengage.core.internal.logger.f.log$default(this.sdkInstance.logger, 0, null, new w0(str, str2), 3, null);
if (str != null && !kotlin.text.p.isBlank(str) && com.moengage.inapp.internal.z.isValidJavaScriptString(str) && str2 != null && !kotlin.text.p.isBlank(str2) && com.moengage.inapp.internal.z.isValidJavaScriptString(str2)) {
processAction(new com.moengage.inapp.internal.model.actions.h(com.moengage.inapp.model.enums.a.SMS, str, str2));
}
} catch (Exception e2) {
this.sdkInstance.logger.log(1, e2, new x0());
}
}
@JavascriptInterface
public final void trackClick(String str) {
Object obj;
try {
com.moengage.core.internal.logger.f.log$default(this.sdkInstance.logger, 0, null, new y0(str), 3, null);
if (com.moengage.inapp.internal.z.isValidJavaScriptValue(str)) {
if (str != null && !kotlin.text.p.isBlank(str)) {
obj = new JSONObject(str).opt("widgetId");
Context context = this.context;
kotlin.jvm.internal.v.checkNotNullExpressionValue(context, LogCategory.CONTEXT);
com.moengage.inapp.internal.y.trackInAppClicked(context, this.sdkInstance, new com.moengage.inapp.model.b(this.payload.getCampaignId(), this.payload.getCampaignName(), this.payload.getCampaignContext()), obj);
}
obj = null;
Context context2 = this.context;
kotlin.jvm.internal.v.checkNotNullExpressionValue(context2, LogCategory.CONTEXT);
com.moengage.inapp.internal.y.trackInAppClicked(context2, this.sdkInstance, new com.moengage.inapp.model.b(this.payload.getCampaignId(), this.payload.getCampaignName(), this.payload.getCampaignContext()), obj);
}
} catch (Exception e2) {
this.sdkInstance.logger.log(1, e2, new z0());
}
}
@JavascriptInterface
public final void trackDismiss() {
try {
com.moengage.core.internal.logger.f.log$default(this.sdkInstance.logger, 0, null, new a1(), 3, null);
Context context = this.context;
kotlin.jvm.internal.v.checkNotNullExpressionValue(context, LogCategory.CONTEXT);
com.moengage.inapp.internal.y.trackInAppDismissed(context, this.sdkInstance, new com.moengage.inapp.model.b(this.payload.getCampaignId(), this.payload.getCampaignName(), this.payload.getCampaignContext()));
} catch (Exception e2) {
this.sdkInstance.logger.log(1, e2, new b1());
}
}
@JavascriptInterface
public final void trackEvent(String str, String str2, String str3, String str4, boolean z2, boolean z3) {
try {
com.moengage.core.internal.logger.f.log$default(this.sdkInstance.logger, 0, null, new c1(str, str2, str3, str4, z2, z3), 3, null);
if (str != null && !kotlin.text.p.isBlank(str) && com.moengage.inapp.internal.z.isValidJavaScriptString(str)) {
Properties properties$inapp_release = this.webCallbackParser.toProperties$inapp_release(str2, str3, str4, z2);
if (z3) {
com.moengage.inapp.internal.z.addAttributesToProperties(properties$inapp_release, this.payload.getCampaignId(), this.payload.getCampaignName(), this.payload.getCampaignContext());
}
com.moengage.core.analytics.a aVar = com.moengage.core.analytics.a.INSTANCE;
Context context = this.context;
kotlin.jvm.internal.v.checkNotNullExpressionValue(context, LogCategory.CONTEXT);
aVar.trackEvent(context, str, properties$inapp_release, this.instanceId);
}
} catch (Exception e2) {
this.sdkInstance.logger.log(1, e2, new d1());
}
}
@JavascriptInterface
public final void trackRating(String str) {
try {
com.moengage.core.internal.logger.f.log$default(this.sdkInstance.logger, 0, null, new e1(str), 3, null);
if (str != null && !kotlin.text.p.isBlank(str) && com.moengage.inapp.internal.z.isValidJavaScriptString(str) && com.moengage.inapp.internal.z.isValidJavaScriptValue(str)) {
Properties addAttribute = new Properties().addAttribute("rating", Double.valueOf(new JSONObject(str).getDouble("rating")));
com.moengage.inapp.internal.z.addAttributesToProperties(addAttribute, this.payload.getCampaignId(), this.payload.getCampaignName(), this.payload.getCampaignContext());
com.moengage.core.analytics.a aVar = com.moengage.core.analytics.a.INSTANCE;
Context context = this.context;
kotlin.jvm.internal.v.checkNotNullExpressionValue(context, LogCategory.CONTEXT);
aVar.trackEvent(context, "MOE_APP_RATED", addAttribute, this.instanceId);
}
} catch (Exception e2) {
this.sdkInstance.logger.log(1, e2, new f1());
}
}
}