正在查看: RummyCircle v11000.89 应用的 JsInterfaceHandler.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: RummyCircle v11000.89 应用的 JsInterfaceHandler.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.games24x7.dynamicrc.unitymodule.webview.handler;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri;
import android.os.Handler;
import android.os.Looper;
import android.webkit.JavascriptInterface;
import android.widget.Toast;
import com.games24x7.coregame.KrakenApplication;
import com.games24x7.coregame.R;
import com.games24x7.coregame.common.communication.nativecomm.ComplexLayerCommInterface;
import com.games24x7.coregame.common.communication.nativecomm.unity.webview.WebViewHelper;
import com.games24x7.coregame.common.communication.nativecomm.unity.webview.WebviewOperation;
import com.games24x7.coregame.common.deeplink.DeepLinkActivity;
import com.games24x7.coregame.common.deeplink.util.NativeUtil;
import com.games24x7.coregame.common.deeplink.util.PreferenceManager;
import com.games24x7.coregame.common.model.webview.AddCashBranchEventData;
import com.games24x7.coregame.common.model.webview.PurchaseInfoModel;
import com.games24x7.coregame.common.utility.analytics.AnalyticsUtil;
import com.games24x7.coregame.common.utility.analytics.firebase.FirebaseAnalyticsUtility;
import com.games24x7.coregame.common.utility.crashlytics.CrashlyticsUtility;
import com.games24x7.coregame.common.utility.log.Logger;
import com.games24x7.coregame.common.utility.runtimevars.RunTimeVarsUtility;
import com.games24x7.dynamicrc.unitymodule.comm.unitycomm.NativeUnityCommController;
import com.games24x7.dynamicrc.unitymodule.util.logger.LoggerConstants;
import com.games24x7.dynamicrc.unitymodule.webview.base.BaseWebviewUtility;
import com.games24x7.dynamicrc.unitymodule.webview.handler.factory.WebviewHandlerFactory;
import com.games24x7.pgeventbus.event.EventInfo;
import com.games24x7.pgeventbus.event.PGEvent;
import com.games24x7.pgwebview.custom.PGWebView;
import com.games24x7.pgwebview.custom.WebJsCommInterface;
import com.games24x7.pgwebview.ui.FullscreenWebviewActivity;
import java.util.HashMap;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlin.text.StringsKt;
import kotlin.text.o;
import org.jetbrains.annotations.NotNull;
import org.json.JSONObject;
@Metadata
public final class JsInterfaceHandler implements WebJsCommInterface {
@NotNull
private final String TAG;
@NotNull
private final BaseWebviewUtility webviewUtility;
public JsInterfaceHandler(@NotNull BaseWebviewUtility baseWebviewUtility) {
Intrinsics.checkNotNullParameter(baseWebviewUtility, "webviewUtility");
this.webviewUtility = baseWebviewUtility;
this.TAG = "JsInterfaceHandler";
}
public static final void closeDemo$lambda$26(JsInterfaceHandler jsInterfaceHandler) {
Intrinsics.checkNotNullParameter(jsInterfaceHandler, "this$0");
jsInterfaceHandler.closeWebview();
}
public static final void closeKYCJourneyOnNative$lambda$3(String str, JsInterfaceHandler jsInterfaceHandler) {
Intrinsics.checkNotNullParameter(str, "$response");
Intrinsics.checkNotNullParameter(jsInterfaceHandler, "this$0");
if (new JSONObject(str).optBoolean("reload")) {
jsInterfaceHandler.closeWebview();
return;
}
WebviewOperation webViewOperationHandler = jsInterfaceHandler.webviewUtility.getWebViewOperationHandler();
if (webViewOperationHandler != null) {
webViewOperationHandler.reloadWebview();
}
}
private final void closeMinMaxOverlay() {
KrakenApplication.Companion.updateRuntimeVar("isAddCashInProgress", Boolean.FALSE);
WebviewOperation webViewOperationHandler = this.webviewUtility.getWebViewOperationHandler();
if (webViewOperationHandler != null) {
WebviewOperation.closeWebview$default(webViewOperationHandler, (String) null, 1, (Object) null);
}
AnalyticsUtil analyticsUtil = AnalyticsUtil.INSTANCE;
AnalyticsUtil.sendAnalyticsEvent$default(analyticsUtil, "clickStreamData", analyticsUtil.createAnalyticsPayload(NativeUtil.getStringifyJson$default(NativeUtil.INSTANCE, "gtm.click", (String) null, (String) null, (String) null, (String) null, "acgtw-close", (String) null, (String) null, (String) null, "/player/gametable", 478, (Object) null)), (String) null, (String) null, 12, (Object) null);
}
public static final void closeOverlayWithAnimation$lambda$23(JsInterfaceHandler jsInterfaceHandler, String str, String str2) {
int i;
Intrinsics.checkNotNullParameter(jsInterfaceHandler, "this$0");
Intrinsics.checkNotNullParameter(str, "$jsonData");
Intrinsics.checkNotNullParameter(str2, "$direction");
jsInterfaceHandler.webviewUtility.setMExtraCallbackData(str);
if (o.f(str2, "RightCenter", true)) {
i = R.anim.scale_down_closing_left_right_center;
jsInterfaceHandler.webviewUtility.setMExtraDirection(2);
} else {
if (Intrinsics.a(str2, "MiddleCenter")) {
jsInterfaceHandler.webviewUtility.setMExtraDirection(1);
} else if (Intrinsics.a(str2, "LeftCenter")) {
jsInterfaceHandler.webviewUtility.setMExtraDirection(0);
} else if (Intrinsics.a(str2, "close")) {
jsInterfaceHandler.webviewUtility.setMExtraDirection(-1);
Logger.e$default(Logger.INSTANCE, jsInterfaceHandler.TAG, "closeOverlayWithAnimation :: Sending Required Callback to the Unity....", false, 4, (Object) null);
BaseWebviewUtility baseWebviewUtility = jsInterfaceHandler.webviewUtility;
String mExtraCallbackFunction = baseWebviewUtility.getMExtraCallbackFunction();
JSONObject jSONObject = new JSONObject();
jSONObject.put("isSuccess", true);
JSONObject jSONObject2 = new JSONObject();
jSONObject2.put("data", jsInterfaceHandler.webviewUtility.getMExtraCallbackData());
Unit unit = Unit.a;
jSONObject.put("result", jSONObject2.toString());
String jSONObject3 = jSONObject.toString();
Intrinsics.checkNotNullExpressionValue(jSONObject3, "JSONObject().apply {\n … }.toString()");
baseWebviewUtility.sendMessageToClient(mExtraCallbackFunction, jSONObject3);
}
i = -1;
}
WebviewOperation webViewOperationHandler = jsInterfaceHandler.webviewUtility.getWebViewOperationHandler();
if (webViewOperationHandler != null) {
JSONObject jSONObject4 = new JSONObject();
jSONObject4.put("isExitAnimationRequired", i != -1);
jSONObject4.put("exitAnimationResource", i);
webViewOperationHandler.closeWebview(jSONObject4.toString());
}
}
public static final void closeSWOverlayWithAnimation$lambda$62(String str, JsInterfaceHandler jsInterfaceHandler, String str2) {
Intrinsics.checkNotNullParameter(str, "$direction");
Intrinsics.checkNotNullParameter(jsInterfaceHandler, "this$0");
Intrinsics.checkNotNullParameter(str2, "$jsonData");
if (o.f(str, "RightCenter", true)) {
jsInterfaceHandler.webviewUtility.setMExtraDirection(2);
}
jsInterfaceHandler.webviewUtility.setMExtraCallbackData(str2);
WebviewOperation webViewOperationHandler = jsInterfaceHandler.webviewUtility.getWebViewOperationHandler();
if (webViewOperationHandler != null) {
JSONObject jSONObject = new JSONObject();
jSONObject.put("isExitAnimationRequired", true);
jSONObject.put("exitAnimationResource", R.anim.scale_down_closing_left_right_center);
webViewOperationHandler.closeWebview(jSONObject.toString());
}
}
private final void closeWebview() {
int i;
KrakenApplication.Companion.updateRuntimeVar("webviewFlag", Boolean.FALSE);
if (this.webviewUtility.isRumbleOnBoardingJourney()) {
if (this.webviewUtility.getMExtraCallbackFunction().length() > 0 && this.webviewUtility.getMExtraCallbackObject().length() > 0) {
BaseWebviewUtility baseWebviewUtility = this.webviewUtility;
String mExtraCallbackFunction = baseWebviewUtility.getMExtraCallbackFunction();
JSONObject jSONObject = new JSONObject();
jSONObject.put("isSuccess", true);
JSONObject jSONObject2 = new JSONObject();
jSONObject2.put("data", "");
Unit unit = Unit.a;
jSONObject.put("result", jSONObject2.toString());
String jSONObject3 = jSONObject.toString();
Intrinsics.checkNotNullExpressionValue(jSONObject3, "JSONObject().apply {\n … }.toString()");
baseWebviewUtility.sendMessageToClient(mExtraCallbackFunction, jSONObject3);
if (this.webviewUtility.getMExtraDirection() == 0) {
i = R.anim.scale_down_closing;
} else if (this.webviewUtility.getMExtraDirection() == 1) {
i = R.anim.scale_down_closing_bottom_top;
}
}
i = 0;
} else {
if (this.webviewUtility.isMMOnBoardingJourney()) {
BaseWebviewUtility baseWebviewUtility2 = this.webviewUtility;
String mExtraCallbackFunction2 = baseWebviewUtility2.getMExtraCallbackFunction();
JSONObject jSONObject4 = new JSONObject();
jSONObject4.put("isSuccess", true);
JSONObject jSONObject5 = new JSONObject();
jSONObject5.put("data", this.webviewUtility.getMExtraCallbackData());
Unit unit2 = Unit.a;
jSONObject4.put("result", jSONObject5.toString());
String jSONObject6 = jSONObject4.toString();
Intrinsics.checkNotNullExpressionValue(jSONObject6, "JSONObject().apply {\n … }.toString()");
baseWebviewUtility2.sendMessageToClient(mExtraCallbackFunction2, jSONObject6);
if (this.webviewUtility.getMExtraDirection() == 2) {
i = R.anim.scale_down_closing_left_right_center;
}
}
i = 0;
}
WebviewOperation webViewOperationHandler = this.webviewUtility.getWebViewOperationHandler();
if (webViewOperationHandler != null) {
JSONObject jSONObject7 = new JSONObject();
jSONObject7.put("isExitAnimationRequired", i != 0);
jSONObject7.put("exitAnimationResource", i);
webViewOperationHandler.closeWebview(jSONObject7.toString());
}
}
public static final void documentLoaded$lambda$15(JsInterfaceHandler jsInterfaceHandler) {
WebviewOperation webViewOperationHandler;
Intrinsics.checkNotNullParameter(jsInterfaceHandler, "this$0");
if (jsInterfaceHandler.webviewUtility.isFirstPage()) {
Logger.i$default(Logger.INSTANCE, jsInterfaceHandler.TAG, "documentLoaded :: document is loaded " + jsInterfaceHandler.webviewUtility.getWebLoadUrl(), false, 4, (Object) null);
try {
if (!StringsKt.E(jsInterfaceHandler.webviewUtility.getWebLoadUrl(), "spin-and-go", false) && !StringsKt.E(jsInterfaceHandler.webviewUtility.getWebLoadUrl(), "turbo-rummy", false) && !StringsKt.E(jsInterfaceHandler.webviewUtility.getWebLoadUrl(), RunTimeVarsUtility.getStringRunTimeVar$default(RunTimeVarsUtility.INSTANCE, "redesignPostLoginOverlayPage", (String) null, 2, (Object) null), false) && !StringsKt.E(jsInterfaceHandler.webviewUtility.getWebLoadUrl(), "power-charge-tournament", false) && (webViewOperationHandler = jsInterfaceHandler.webviewUtility.getWebViewOperationHandler()) != null) {
webViewOperationHandler.setBackgroundResource(R.drawable.in_app_dialog_bg);
}
} catch (NullPointerException e) {
e.printStackTrace();
}
try {
if (!StringsKt.E(jsInterfaceHandler.webviewUtility.getWebLoadUrl(), "spin-and-go", false) && !StringsKt.E(jsInterfaceHandler.webviewUtility.getWebLoadUrl(), "turbo-rummy", false) && !StringsKt.E(jsInterfaceHandler.webviewUtility.getWebLoadUrl(), RunTimeVarsUtility.getStringRunTimeVar$default(RunTimeVarsUtility.INSTANCE, "redesignPostLoginOverlayPage", (String) null, 2, (Object) null), false) && !StringsKt.E(jsInterfaceHandler.webviewUtility.getWebLoadUrl(), "power-charge-tournament", false)) {
WebviewOperation webViewOperationHandler2 = jsInterfaceHandler.webviewUtility.getWebViewOperationHandler();
if (webViewOperationHandler2 != null) {
webViewOperationHandler2.setBackgroundResource(R.drawable.in_app_dialog_bg);
}
WebviewOperation webViewOperationHandler3 = jsInterfaceHandler.webviewUtility.getWebViewOperationHandler();
if (webViewOperationHandler3 != null) {
webViewOperationHandler3.setBackgroundColor(-1);
}
}
} catch (NullPointerException e2) {
e2.printStackTrace();
}
jsInterfaceHandler.webviewUtility.setFirstPage(false);
}
}
public static final void loadOverlayPage$lambda$2(String str, JsInterfaceHandler jsInterfaceHandler) {
Intrinsics.checkNotNullParameter(str, "$url");
Intrinsics.checkNotNullParameter(jsInterfaceHandler, "this$0");
NativeUtil nativeUtil = NativeUtil.INSTANCE;
if (nativeUtil.isAddCashURL(str)) {
KrakenApplication.Companion.updateRuntimeVar("isAddCashInProgress", Boolean.TRUE);
WebviewHandlerFactory.INSTANCE.getManager(jsInterfaceHandler.webviewUtility.getWebviewId()).performAction("START_ADD_CASH_JOURNEY", str);
return;
}
ComplexLayerCommInterface eventCommInterface = jsInterfaceHandler.webviewUtility.getEventCommInterface();
if (eventCommInterface != null) {
EventInfo eventInfo = new EventInfo("UNITY_CREATE_WEBVIEW", NativeUnityCommController.TYPE, (String) null, (String) null, 12, (DefaultConstructorMarker) null);
EventInfo eventInfo2 = new EventInfo(NativeUnityCommController.TYPE, NativeUnityCommController.TYPE, (String) null, (String) null, 12, (DefaultConstructorMarker) null);
JSONObject jSONObject = new JSONObject();
jSONObject.put("url", str);
jSONObject.put("webviewId", nativeUtil.generateRandomUUID());
jSONObject.put("webviewType", "OVERLAY");
jSONObject.put("orientation", "landscape");
JSONObject jSONObject2 = new JSONObject();
jSONObject2.put("data", "{}");
jSONObject2.put("overlaySizeData", "{}");
Unit unit = Unit.a;
jSONObject.put("metaData", jSONObject2.toString());
String jSONObject3 = jSONObject.toString();
Intrinsics.checkNotNullExpressionValue(jSONObject3, "toString()");
ComplexLayerCommInterface.DefaultImpls.onRouterResponse$default(eventCommInterface, new PGEvent(eventInfo, jSONObject3, eventInfo2), false, false, 6, (Object) null);
}
}
public static final void resumeCuratedJourney$lambda$4(JsInterfaceHandler jsInterfaceHandler) {
Intrinsics.checkNotNullParameter(jsInterfaceHandler, "this$0");
if (KrakenApplication.Companion.getWebviewActivity() instanceof FullscreenWebviewActivity) {
jsInterfaceHandler.closeWebview();
}
}
@JavascriptInterface
public final void EdsCTABtnClick(int i, @NotNull String str, @NotNull String str2) {
Intrinsics.checkNotNullParameter(str, "actionType");
Intrinsics.checkNotNullParameter(str2, "url");
Logger.i$default(Logger.INSTANCE, this.TAG, "EdsCTABtnClick :: JavascriptInterface Method called :: ZoneId is " + i + " :: Action Type is " + str + " :: Url is " + str2, false, 4, (Object) null);
BaseWebviewUtility baseWebviewUtility = this.webviewUtility;
JSONObject jSONObject = new JSONObject();
jSONObject.put("isSuccess", true);
JSONObject jSONObject2 = new JSONObject();
jSONObject2.put("actionType", str);
jSONObject2.put("zoneId", i);
jSONObject2.put("url", str2);
Unit unit = Unit.a;
jSONObject.put("result", jSONObject2.toString());
String jSONObject3 = jSONObject.toString();
Intrinsics.checkNotNullExpressionValue(jSONObject3, "JSONObject().apply {\n …\n }.toString()");
baseWebviewUtility.sendMessageToClient("EdsCTABtnClick", jSONObject3);
}
@JavascriptInterface
public final void EdsSidezoneBtnClick() {
Logger.i$default(Logger.INSTANCE, this.TAG, "EdsSidezoneBtnClick :: JavascriptInterface Method called", false, 4, (Object) null);
BaseWebviewUtility baseWebviewUtility = this.webviewUtility;
JSONObject jSONObject = new JSONObject();
jSONObject.put("isSuccess", true);
jSONObject.put("result", "");
Unit unit = Unit.a;
String jSONObject2 = jSONObject.toString();
Intrinsics.checkNotNullExpressionValue(jSONObject2, "JSONObject().apply {\n …\n }.toString()");
baseWebviewUtility.sendMessageToClient("EdsSidezoneBtnClick", jSONObject2);
}
@JavascriptInterface
public final void EdsTopzoneBtnClick(boolean z) {
Logger.i$default(Logger.INSTANCE, this.TAG, "EdsTopzoneBtnClick :: JavascriptInterface Method called :: AutoClose is " + z, false, 4, (Object) null);
BaseWebviewUtility baseWebviewUtility = this.webviewUtility;
JSONObject jSONObject = new JSONObject();
jSONObject.put("isSuccess", true);
JSONObject jSONObject2 = new JSONObject();
jSONObject2.put("autoclose", z);
Unit unit = Unit.a;
jSONObject.put("result", jSONObject2.toString());
String jSONObject3 = jSONObject.toString();
Intrinsics.checkNotNullExpressionValue(jSONObject3, "JSONObject().apply {\n …\n }.toString()");
baseWebviewUtility.sendMessageToClient("EdsTopzoneBtnClick", jSONObject3);
}
@JavascriptInterface
public final void NativeActionHandler(int i, @NotNull String str) {
Intrinsics.checkNotNullParameter(str, "data");
Logger.i$default(Logger.INSTANCE, this.TAG, "NativeActionHandler :: JavascriptInterface Method called :: type is " + i + " :: Data is " + str, false, 4, (Object) null);
WebviewHandlerFactory.INSTANCE.getManager(this.webviewUtility.getWebviewId()).handleMidProcessing(i, str);
}
@JavascriptInterface
public final void NotificationDialogClick(@NotNull String str) {
Intrinsics.checkNotNullParameter(str, LoggerConstants.METADATA_LOG_ID);
Logger.i$default(Logger.INSTANCE, this.TAG, "NotificationDialogClick :: JavascriptInterface Method called :: Id is " + str, false, 4, (Object) null);
BaseWebviewUtility baseWebviewUtility = this.webviewUtility;
JSONObject jSONObject = new JSONObject();
jSONObject.put("isSuccess", true);
JSONObject jSONObject2 = new JSONObject();
jSONObject2.put(LoggerConstants.METADATA_LOG_ID, str);
Unit unit = Unit.a;
jSONObject.put("result", jSONObject2.toString());
String jSONObject3 = jSONObject.toString();
Intrinsics.checkNotNullExpressionValue(jSONObject3, "JSONObject().apply {\n …\n }.toString()");
baseWebviewUtility.sendMessageToClient("notificationDialogClick", jSONObject3);
}
@JavascriptInterface
public final void NotificationListCLick(@NotNull String str) {
Intrinsics.checkNotNullParameter(str, LoggerConstants.METADATA_LOG_ID);
Logger.i$default(Logger.INSTANCE, this.TAG, "NotificationListCLick :: JavascriptInterface Method called :: Id is " + str, false, 4, (Object) null);
BaseWebviewUtility baseWebviewUtility = this.webviewUtility;
JSONObject jSONObject = new JSONObject();
jSONObject.put("isSuccess", true);
JSONObject jSONObject2 = new JSONObject();
jSONObject2.put(LoggerConstants.METADATA_LOG_ID, str);
Unit unit = Unit.a;
jSONObject.put("result", jSONObject2.toString());
String jSONObject3 = jSONObject.toString();
Intrinsics.checkNotNullExpressionValue(jSONObject3, "JSONObject().apply {\n …\n }.toString()");
baseWebviewUtility.sendMessageToClient("notificationListClick", jSONObject3);
}
@JavascriptInterface
public final void RCLogoClick() {
Logger.i$default(Logger.INSTANCE, this.TAG, "RCLogoClick :: JavascriptInterface Method called", false, 4, (Object) null);
if (!this.webviewUtility.isAddCashGT()) {
closeWebview();
return;
}
closeMinMaxOverlay();
ComplexLayerCommInterface eventCommInterface = this.webviewUtility.getEventCommInterface();
if (eventCommInterface != null) {
EventInfo eventInfo = new EventInfo("onOverlayClosed", NativeUnityCommController.TYPE, (String) null, (String) null, 12, (DefaultConstructorMarker) null);
EventInfo eventInfo2 = new EventInfo(NativeUnityCommController.TYPE, NativeUnityCommController.TYPE, (String) null, (String) null, 12, (DefaultConstructorMarker) null);
JSONObject jSONObject = new JSONObject();
jSONObject.put("isSuccess", true);
jSONObject.put("result", "");
String jSONObject2 = jSONObject.toString();
Intrinsics.checkNotNullExpressionValue(jSONObject2, "toString()");
ComplexLayerCommInterface.DefaultImpls.onRouterResponse$default(eventCommInterface, new PGEvent(eventInfo, jSONObject2, eventInfo2), false, true, 2, (Object) null);
}
}
@JavascriptInterface
public final void UploadNowClick(@NotNull String str) {
Intrinsics.checkNotNullParameter(str, "trackingIdentifier");
Logger.i$default(Logger.INSTANCE, this.TAG, "UploadNowClick :: JavascriptInterface Method called :: Tracking Identifier is " + str, false, 4, (Object) null);
AnalyticsUtil analyticsUtil = AnalyticsUtil.INSTANCE;
NativeUtil nativeUtil = NativeUtil.INSTANCE;
AnalyticsUtil.sendAnalyticsEvent$default(analyticsUtil, "clickStreamData", analyticsUtil.createAnalyticsPayload(nativeUtil.getStringifyJson("gtm.click", (String) null, (String) null, (String) null, (String) null, str, (String) null, (String) null, (String) null, "/player/nativelobby.html")), (String) null, (String) null, 12, (Object) null);
ComplexLayerCommInterface eventCommInterface = this.webviewUtility.getEventCommInterface();
if (eventCommInterface != null) {
EventInfo eventInfo = new EventInfo("UNITY_CREATE_WEBVIEW", NativeUnityCommController.TYPE, (String) null, (String) null, 12, (DefaultConstructorMarker) null);
EventInfo eventInfo2 = new EventInfo(NativeUnityCommController.TYPE, NativeUnityCommController.TYPE, (String) null, (String) null, 12, (DefaultConstructorMarker) null);
JSONObject jSONObject = new JSONObject();
jSONObject.put("webviewId", nativeUtil.generateRandomUUID());
jSONObject.put("url", RunTimeVarsUtility.getStringRunTimeVar$default(RunTimeVarsUtility.INSTANCE, "kycUrl", (String) null, 2, (Object) null));
jSONObject.put("webviewType", "FULLSCREEN");
jSONObject.put("orientation", "portrait");
String jSONObject2 = jSONObject.toString();
Intrinsics.checkNotNullExpressionValue(jSONObject2, "toString()");
ComplexLayerCommInterface.DefaultImpls.onRouterResponse$default(eventCommInterface, new PGEvent(eventInfo, jSONObject2, eventInfo2), false, false, 6, (Object) null);
}
}
@JavascriptInterface
public final void WidgetActionHandler(@NotNull String str, int i, @NotNull String str2) {
Intrinsics.checkNotNullParameter(str, "widget");
Intrinsics.checkNotNullParameter(str2, "jsonData");
Logger.i$default(Logger.INSTANCE, this.TAG, "WidgetActionHandler :: JavascriptInterface Method called :: Widget is " + str + " :: Action Type is " + i + " :: Json data is " + str2, false, 4, (Object) null);
BaseWebviewUtility baseWebviewUtility = this.webviewUtility;
JSONObject jSONObject = new JSONObject();
jSONObject.put("isSuccess", true);
JSONObject jSONObject2 = new JSONObject();
jSONObject2.put("actionType", i);
jSONObject2.put("widget", str);
jSONObject2.put("jsondata", str2);
Unit unit = Unit.a;
jSONObject.put("result", jSONObject2.toString());
String jSONObject3 = jSONObject.toString();
Intrinsics.checkNotNullExpressionValue(jSONObject3, "JSONObject().apply {\n …\n }.toString()");
baseWebviewUtility.sendMessageToClient("WidgetActionHandler", jSONObject3);
}
@JavascriptInterface
public final void checkRuntimePermission(int i, int i2, @NotNull String str) {
Intrinsics.checkNotNullParameter(str, "callbackId");
Logger.i$default(Logger.INSTANCE, this.TAG, "checkRuntimePermission :: JavascriptInterface Method called :: PermissionType is " + i + " :: OriginId is " + i2 + " :: CallbackId is " + str, false, 4, (Object) null);
WebviewHandlerManager manager = WebviewHandlerFactory.INSTANCE.getManager(this.webviewUtility.getWebviewId());
JSONObject jSONObject = new JSONObject();
JSONObject jSONObject2 = new JSONObject();
jSONObject2.put("permission", i);
jSONObject2.put("originId", i2);
Unit unit = Unit.a;
jSONObject.put("data", jSONObject2.toString());
jSONObject.put("source", str);
String jSONObject3 = jSONObject.toString();
Intrinsics.checkNotNullExpressionValue(jSONObject3, "JSONObject().apply {\n …\n }.toString()");
manager.performAction("START_REQUEST_PERMISSION_FLOW", jSONObject3);
}
@JavascriptInterface
public final void closeChatbotWebview() {
String stringRunTimeVar = RunTimeVarsUtility.INSTANCE.getStringRunTimeVar("kycInitiationPoint", "");
if (stringRunTimeVar.length() <= 0) {
closeWebview();
return;
}
String str = "rcspa/kyc?isBgTransparent=true&orientation=portrait&initiationPoint=" + stringRunTimeVar;
WebviewOperation webViewOperationHandler = this.webviewUtility.getWebViewOperationHandler();
if (webViewOperationHandler != null) {
WebviewOperation.closeWebview$default(webViewOperationHandler, (String) null, 1, (Object) null);
}
ComplexLayerCommInterface eventCommInterface = this.webviewUtility.getEventCommInterface();
if (eventCommInterface != null) {
EventInfo eventInfo = new EventInfo("UNITY_CREATE_WEBVIEW", NativeUnityCommController.TYPE, (String) null, (String) null, 12, (DefaultConstructorMarker) null);
EventInfo eventInfo2 = new EventInfo(NativeUnityCommController.TYPE, NativeUnityCommController.TYPE, (String) null, (String) null, 12, (DefaultConstructorMarker) null);
JSONObject jSONObject = new JSONObject();
jSONObject.put("webviewType", "FULLSCREEN");
jSONObject.put("webviewId", NativeUtil.INSTANCE.generateRandomUUID());
jSONObject.put("isBackGroundTransparent", true);
jSONObject.put("orientation", "portrait");
jSONObject.put("url", str);
String jSONObject2 = jSONObject.toString();
Intrinsics.checkNotNullExpressionValue(jSONObject2, "toString()");
ComplexLayerCommInterface.DefaultImpls.onRouterResponse$default(eventCommInterface, new PGEvent(eventInfo, jSONObject2, eventInfo2), true, false, 4, (Object) null);
}
KrakenApplication.Companion.updateRuntimeVar("webviewFlag", Boolean.TRUE);
}
@JavascriptInterface
public final void closeDemo() {
Logger.i$default(Logger.INSTANCE, this.TAG, "closeDemo :: JavascriptInterface Method called ::", false, 4, (Object) null);
KrakenApplication.Companion companion = KrakenApplication.Companion;
if (companion.getCurrentActivity() == null) {
return;
}
JSONObject jSONObject = new JSONObject();
jSONObject.put("eventUrl", "");
jSONObject.put("eventType", "event_type_clickstream");
JSONObject jSONObject2 = new JSONObject();
jSONObject2.put("event", "gtm.click");
jSONObject2.put(LoggerConstants.METADATA_LOG_ID, "close_demo");
jSONObject2.put("url", "/interactivedemo");
jSONObject2.put("time", String.valueOf(System.currentTimeMillis()));
jSONObject2.put("userId", PreferenceManager.Companion.getInstance().getUserId());
Unit unit = Unit.a;
jSONObject.put("eventData", jSONObject2);
AnalyticsUtil analyticsUtil = AnalyticsUtil.INSTANCE;
String jSONObject3 = jSONObject.toString();
Intrinsics.checkNotNullExpressionValue(jSONObject3, "analyticsJson.toString()");
AnalyticsUtil.sendAnalyticsEvent$default(analyticsUtil, "clickStreamData", analyticsUtil.createAnalyticsPayload(jSONObject3), (String) null, (String) null, 12, (Object) null);
Activity webviewActivity = companion.getWebviewActivity();
if (webviewActivity != null) {
webviewActivity.runOnUiThread(new Runnable() {
@Override
public final void run() {
JsInterfaceHandler.closeDemo$lambda$26(JsInterfaceHandler.this);
}
});
}
}
@JavascriptInterface
public final void closeKYCJourneyOnNative(@NotNull final String str) {
Activity webviewActivity;
Intrinsics.checkNotNullParameter(str, "response");
Logger.i$default(Logger.INSTANCE, this.TAG, "closeKYCJourneyOnNative :: JavascriptInterface Method called :: Response is :: " + str, false, 4, (Object) null);
try {
if (!new JSONObject(str).has("reload") || (webviewActivity = KrakenApplication.Companion.getWebviewActivity()) == null) {
return;
}
webviewActivity.runOnUiThread(new Runnable() {
@Override
public final void run() {
JsInterfaceHandler.closeKYCJourneyOnNative$lambda$3(str, this);
}
});
} catch (Exception e) {
CrashlyticsUtility.logException$default(CrashlyticsUtility.INSTANCE, e, (String) null, (HashMap) null, 6, (Object) null);
Logger logger = Logger.INSTANCE;
String str2 = this.TAG;
e.printStackTrace();
Logger.e$default(logger, str2, "closeKYCJourneyOnNative :: Got Exception in closeKYCJourneyOnNative :: " + Unit.a, false, 4, (Object) null);
}
}
@JavascriptInterface
public final void closeNotifierPopUp() {
Logger.i$default(Logger.INSTANCE, this.TAG, "closeNotifierPopUp :: JavascriptInterface Method called", false, 4, (Object) null);
}
@JavascriptInterface
public final void closeOverlay() {
Logger.i$default(Logger.INSTANCE, this.TAG, "closeOverlay :: JavascriptInterface Method called", false, 4, (Object) null);
closeMinMaxOverlay();
ComplexLayerCommInterface eventCommInterface = this.webviewUtility.getEventCommInterface();
if (eventCommInterface != null) {
EventInfo eventInfo = new EventInfo("onOverlayClosed", NativeUnityCommController.TYPE, (String) null, (String) null, 12, (DefaultConstructorMarker) null);
EventInfo eventInfo2 = new EventInfo(NativeUnityCommController.TYPE, NativeUnityCommController.TYPE, (String) null, (String) null, 12, (DefaultConstructorMarker) null);
JSONObject jSONObject = new JSONObject();
jSONObject.put("isSuccess", true);
jSONObject.put("result", "");
String jSONObject2 = jSONObject.toString();
Intrinsics.checkNotNullExpressionValue(jSONObject2, "toString()");
ComplexLayerCommInterface.DefaultImpls.onRouterResponse$default(eventCommInterface, new PGEvent(eventInfo, jSONObject2, eventInfo2), false, true, 2, (Object) null);
}
}
@JavascriptInterface
public final void closeOverlayAndRedirectUser(@NotNull String str) {
Intrinsics.checkNotNullParameter(str, "url");
Logger.i$default(Logger.INSTANCE, this.TAG, "closeOverlayAndRedirectUser :: JavascriptInterface Method called :: url is " + str, false, 4, (Object) null);
closeWebview();
}
@JavascriptInterface
public final void closeOverlayWithAnimation(@NotNull final String str, @NotNull final String str2) {
Intrinsics.checkNotNullParameter(str, "direction");
Intrinsics.checkNotNullParameter(str2, "jsonData");
Logger.i$default(Logger.INSTANCE, this.TAG, "closeOverlayWithAnimation :: JavascriptInterface Method called :: Direction is " + str + " :: Json Data is " + str2, false, 4, (Object) null);
Activity webviewActivity = KrakenApplication.Companion.getWebviewActivity();
if (webviewActivity != null) {
webviewActivity.runOnUiThread(new Runnable() {
@Override
public final void run() {
JsInterfaceHandler.closeOverlayWithAnimation$lambda$23(JsInterfaceHandler.this, str2, str);
}
});
}
}
@JavascriptInterface
public final void closeRumbleOnboardingWithAnimation() {
Logger.i$default(Logger.INSTANCE, this.TAG, "closeRumbleOnboardingWithAnimation :: JavascriptInterface Method called", false, 4, (Object) null);
closeWebview();
}
@JavascriptInterface
public final void closeSWOverlayWithAnimation(@NotNull final String str, @NotNull final String str2) {
Intrinsics.checkNotNullParameter(str, "direction");
Intrinsics.checkNotNullParameter(str2, "jsonData");
Logger.e$default(Logger.INSTANCE, this.TAG, "closeSWOverlayWithAnimation :: JavaScript Method called :: direction :: " + str + " :: JsonData :: " + str2, false, 4, (Object) null);
Activity webviewActivity = KrakenApplication.Companion.getWebviewActivity();
if (webviewActivity != null) {
webviewActivity.runOnUiThread(new Runnable(this) {
public final JsInterfaceHandler b;
{
this.b = this;
}
@Override
public final void run() {
JsInterfaceHandler.closeSWOverlayWithAnimation$lambda$62(str, this.b, str2);
}
});
}
}
@JavascriptInterface
public final void copyToClipBoard(@NotNull String str) {
Intrinsics.checkNotNullParameter(str, "txt");
Logger.d$default(Logger.INSTANCE, this.TAG, "copyToClipBoard :: JavascriptInterface Method called :: Text is " + str, false, 4, (Object) null);
try {
KrakenApplication.Companion companion = KrakenApplication.Companion;
Object systemService = companion.getApplicationContext().getSystemService("clipboard");
Intrinsics.d(systemService, "null cannot be cast to non-null type android.content.ClipboardManager");
((ClipboardManager) systemService).setPrimaryClip(ClipData.newPlainText("Text Copied", str));
Toast.makeText((Context) companion.getApplicationContext(), (CharSequence) "Copied To Clipboard", 0).show();
} catch (Exception e) {
Logger logger = Logger.INSTANCE;
String str2 = this.TAG;
e.printStackTrace();
Logger.e$default(logger, str2, "copyToClipBoard :: Got Exception while Copying Data to Clipboard :: Exception is :: " + Unit.a, false, 4, (Object) null);
CrashlyticsUtility.logException$default(CrashlyticsUtility.INSTANCE, e, (String) null, (HashMap) null, 6, (Object) null);
}
}
@JavascriptInterface
@SuppressLint({"ResourceType"})
public final void documentLoaded() {
Activity webviewActivity = KrakenApplication.Companion.getWebviewActivity();
if (webviewActivity != null) {
webviewActivity.runOnUiThread(new Runnable() {
@Override
public final void run() {
JsInterfaceHandler.documentLoaded$lambda$15(JsInterfaceHandler.this);
}
});
}
}
@JavascriptInterface
public final void fetchContacts(int i) {
Logger.d$default(Logger.INSTANCE, this.TAG, "fetchContacts :: JavascriptInterface Method called :: CallbackId is " + i, false, 4, (Object) null);
WebviewHandlerFactory.INSTANCE.getManager(this.webviewUtility.getWebviewId()).performAction("FETCH_CONTACTS", String.valueOf(i));
}
@JavascriptInterface
public final boolean getAddressBookConsentStatus() {
Logger.i$default(Logger.INSTANCE, this.TAG, "getAddressBookConsentStatus :: JavascriptInterface Method called", false, 4, (Object) null);
return PreferenceManager.Companion.getInstance().getConsentStatus();
}
@JavascriptInterface
@NotNull
public final String getAnalyticsMetadata() {
return NativeUtil.INSTANCE.getAnalyticsMetadata(KrakenApplication.Companion.getApplicationContext(), "");
}
@JavascriptInterface
@NotNull
public final String getContacts() {
Logger.i$default(Logger.INSTANCE, this.TAG, "getContacts :: JavascriptInterface Method called", false, 4, (Object) null);
return RunTimeVarsUtility.INSTANCE.getStringRunTimeVar("contacts", "-1");
}
@JavascriptInterface
@NotNull
public final String getCricketWidgetUrl() {
Logger.i$default(Logger.INSTANCE, this.TAG, "getCricketWidgetUrl :: JavascriptInterface Method called", false, 4, (Object) null);
String stringRunTimeVar$default = RunTimeVarsUtility.getStringRunTimeVar$default(RunTimeVarsUtility.INSTANCE, "cricketWidgetUrl", (String) null, 2, (Object) null);
o.l(stringRunTimeVar$default, "http://", "");
o.l(stringRunTimeVar$default, "https://", "");
Intrinsics.checkNotNullExpressionValue(stringRunTimeVar$default.substring(0, StringsKt.I(stringRunTimeVar$default, '/', 0, false, 6)), "substring(...)");
return stringRunTimeVar$default;
}
@JavascriptInterface
public final String getCuratedJourneyInfo() {
Logger.i$default(Logger.INSTANCE, this.TAG, "getCuratedJourneyInfo :: ", false, 4, (Object) null);
return KrakenApplication.Companion.getWebviewActivity() == null ? "" : PreferenceManager.Companion.getInstance().getCuratedSharedPref().getString("data", "");
}
@JavascriptInterface
public final String getCuratedJourneyState() {
Logger.i$default(Logger.INSTANCE, this.TAG, "getCuratedJourneyState :: JavascriptInterface Method called", false, 4, (Object) null);
return KrakenApplication.Companion.getWebviewActivity() == null ? "" : PreferenceManager.Companion.getInstance().getCuratedStateDataSharedPref().getString("data", "");
}
@JavascriptInterface
public final int getPajPath() {
Logger.d$default(Logger.INSTANCE, this.TAG, "getPajPath :: JavascriptInterface Method called ", false, 4, (Object) null);
return NativeUtil.INSTANCE.getPaj2AbPath();
}
@JavascriptInterface
public final void getTournamentResponse(boolean z, @NotNull String str) {
Intrinsics.checkNotNullParameter(str, "data");
Logger.i$default(Logger.INSTANCE, this.TAG, "getTournamentResponse :: JavascriptInterface Method called :: Success is " + z + " :: Data is " + str, false, 4, (Object) null);
PurchaseInfoModel mPurchaseInfoModel = this.webviewUtility.getMPurchaseInfoModel();
if (mPurchaseInfoModel != null) {
WebViewHelper.INSTANCE.sendPurchaseResulAnalyticsEvent(z, mPurchaseInfoModel, str);
}
BaseWebviewUtility baseWebviewUtility = this.webviewUtility;
JSONObject jSONObject = new JSONObject();
jSONObject.put("isSuccess", z);
JSONObject jSONObject2 = new JSONObject();
jSONObject2.put("tournamentSuccessData", str);
jSONObject2.put("purchase_info", new com.google.gson.d().s(this.webviewUtility.getMPurchaseInfoModel()).toString());
Unit unit = Unit.a;
jSONObject.put("result", jSONObject2.toString());
String jSONObject3 = jSONObject.toString();
Intrinsics.checkNotNullExpressionValue(jSONObject3, "JSONObject().apply {\n …\n }.toString()");
baseWebviewUtility.sendMessageToClient("UNITY_WEBVIEW_ROYAL_ENTRY_RESPONSE", jSONObject3);
}
@JavascriptInterface
public final void handleDeepLink(@NotNull String str, @NotNull String str2) {
Activity webviewActivity;
Intrinsics.checkNotNullParameter(str, "url");
Intrinsics.checkNotNullParameter(str2, "sourceOfInvocation");
Logger logger = Logger.INSTANCE;
Logger.i$default(logger, this.TAG, "handleDeepLink :: JavascriptInterface Method called :: Url is " + str + " :: Source is " + str2, false, 4, (Object) null);
KrakenApplication.Companion companion = KrakenApplication.Companion;
if (companion.getWebviewActivity() == null) {
Logger.d$default(logger, this.TAG, "Webview activity is null using current activity " + companion.getCurrentActivity(), false, 4, (Object) null);
webviewActivity = companion.getCurrentActivity();
} else {
Logger.d$default(logger, this.TAG, "Using webview activity " + companion.getWebviewActivity(), false, 4, (Object) null);
webviewActivity = companion.getWebviewActivity();
}
Intent intent = new Intent(webviewActivity, (Class<?>) DeepLinkActivity.class);
intent.setData(Uri.parse(str));
intent.setAction("android.intent.action.VIEW");
intent.putExtra("dl_source_of_invocation", str2);
intent.putExtra("dl_ignore_game_state", true);
if (webviewActivity != null) {
webviewActivity.startActivity(intent);
}
}
@JavascriptInterface
public final boolean isKYCFromNativeBanner() {
return RunTimeVarsUtility.getBooleanRunTimeVar$default(RunTimeVarsUtility.INSTANCE, "isKycForNativeInitiated", false, 2, (Object) null);
}
@JavascriptInterface
public final boolean isMultiWebViewSupported() {
return true;
}
@JavascriptInterface
public final void launchAddCashFromRewardStore(@NotNull String str, @NotNull String str2) {
Intrinsics.checkNotNullParameter(str, "itemId");
Intrinsics.checkNotNullParameter(str2, "promoCode");
Logger.d$default(Logger.INSTANCE, this.TAG, "launchAddCashFromRewardStore :: JavascriptInterface Method called :: Item Id is " + str + " :: Promo Code is " + str2, false, 4, (Object) null);
closeWebview();
PreferenceManager.Companion companion = PreferenceManager.Companion;
companion.getInstance().setAddCashItemId(str);
companion.getInstance().setAddCashPromoCode(str2);
String str3 = RunTimeVarsUtility.getStringRunTimeVar$default(RunTimeVarsUtility.INSTANCE, "acrMicroAppUrl", (String) null, 2, (Object) null) + "?rewardStoreItemId=" + str + "&promoCode=" + str2 + "&acwTrackingSource=rewardStore";
KrakenApplication.Companion.updateRuntimeVar("isAddCashInProgress", Boolean.TRUE);
WebviewHandlerFactory.INSTANCE.getManager(this.webviewUtility.getWebviewId()).performAction("START_ADD_CASH_JOURNEY", str3);
}
@JavascriptInterface
public final void launchGameDemo(@NotNull String str) {
Intrinsics.checkNotNullParameter(str, "sourceOfInvocation");
Logger.d$default(Logger.INSTANCE, this.TAG, "launchGameDemo :: JavascriptInterface Method called :: Source of Invocation " + str, false, 4, (Object) null);
KrakenApplication.Companion companion = KrakenApplication.Companion;
if (companion.getCurrentActivity() == null) {
return;
}
closeWebview();
AnalyticsUtil analyticsUtil = AnalyticsUtil.INSTANCE;
AnalyticsUtil.sendAnalyticsEvent$default(analyticsUtil, "clickStreamData", AnalyticsUtil.createNewTaxonomyAnalyticsPayload$default(analyticsUtil, "click_on_cash_game", "tutorial", "", (String) null, false, false, 56, (Object) null), (String) null, (String) null, 12, (Object) null);
Activity webviewActivity = companion.getWebviewActivity();
if (webviewActivity == null || webviewActivity.isFinishing()) {
return;
}
companion.updateRuntimeVar("isDemoLaunchedFromTutorial", Boolean.TRUE);
}
@JavascriptInterface
public final void launchMaps(@NotNull String str) {
Intrinsics.checkNotNullParameter(str, "location");
Logger.i$default(Logger.INSTANCE, this.TAG, "launchMaps :: JavascriptInterface Method called :: Location is " + str, false, 4, (Object) null);
try {
Intent intent = new Intent("android.intent.action.VIEW", Uri.parse(str));
intent.setPackage("com.google.android.apps.maps");
Activity webviewActivity = KrakenApplication.Companion.getWebviewActivity();
if (webviewActivity != null) {
webviewActivity.startActivity(intent);
}
} catch (Exception e) {
e.printStackTrace();
CrashlyticsUtility.logException$default(CrashlyticsUtility.INSTANCE, e, (String) null, (HashMap) null, 6, (Object) null);
Intent intent2 = new Intent("android.intent.action.VIEW", Uri.parse(str));
Activity webviewActivity2 = KrakenApplication.Companion.getWebviewActivity();
if (webviewActivity2 != null) {
webviewActivity2.startActivity(intent2);
}
}
}
@JavascriptInterface
public final void launchNewGeoTutorial() {
Logger.d$default(Logger.INSTANCE, this.TAG, "launchNewGeoTutorial :: JavascriptInterface Method called ", false, 4, (Object) null);
if (KrakenApplication.Companion.getCurrentActivity() == null) {
return;
}
closeWebview();
ComplexLayerCommInterface eventCommInterface = this.webviewUtility.getEventCommInterface();
if (eventCommInterface != null) {
EventInfo eventInfo = new EventInfo("UNITY_CREATE_WEBVIEW", NativeUnityCommController.TYPE, (String) null, (String) null, 12, (DefaultConstructorMarker) null);
EventInfo eventInfo2 = new EventInfo(NativeUnityCommController.TYPE, NativeUnityCommController.TYPE, (String) null, (String) null, 12, (DefaultConstructorMarker) null);
JSONObject jSONObject = new JSONObject();
jSONObject.put("webviewId", NativeUtil.INSTANCE.generateRandomUUID());
jSONObject.put("webviewType", "FULLSCREEN");
jSONObject.put("tutorialStart", "START");
jSONObject.put("tutorialEnd", "ADDCASH");
jSONObject.put("tutorial_source", "eds-overlay");
jSONObject.put("isTutorialWebview", true);
jSONObject.put("orientation", "landscape");
String jSONObject2 = jSONObject.toString();
Intrinsics.checkNotNullExpressionValue(jSONObject2, "toString()");
ComplexLayerCommInterface.DefaultImpls.onRouterResponse$default(eventCommInterface, new PGEvent(eventInfo, jSONObject2, eventInfo2), false, false, 6, (Object) null);
}
}
@JavascriptInterface
public final void launchRoyalEntry(@NotNull String str) {
Intrinsics.checkNotNullParameter(str, "sourceOfInvocation");
Logger.d$default(Logger.INSTANCE, this.TAG, "launchRoyalEntry :: JavascriptInterface Method called :: Source Of Invocation is " + str + " ", false, 4, (Object) null);
BaseWebviewUtility baseWebviewUtility = this.webviewUtility;
JSONObject jSONObject = new JSONObject();
jSONObject.put("isSuccess", true);
JSONObject jSONObject2 = new JSONObject();
jSONObject2.put("sourceOfInvocation", str);
Unit unit = Unit.a;
jSONObject.put("result", jSONObject2.toString());
String jSONObject3 = jSONObject.toString();
Intrinsics.checkNotNullExpressionValue(jSONObject3, "JSONObject().apply {\n …\n }.toString()");
baseWebviewUtility.sendMessageToClient("UNITY_WEBVIEW_ROYAL_ENTRY_LAUNCH_RESPONSE", jSONObject3);
}
@JavascriptInterface
public final void launchTournamentDetails(@NotNull String str, boolean z) {
Intrinsics.checkNotNullParameter(str, "tournamentId");
Logger.d$default(Logger.INSTANCE, this.TAG, "launchTournamentDetails :: JavascriptInterface Method called ::Tournament Id is " + str + " :: Show Royal Entry Window Dismiss is :: " + z, false, 4, (Object) null);
BaseWebviewUtility baseWebviewUtility = this.webviewUtility;
JSONObject jSONObject = new JSONObject();
jSONObject.put("isSuccess", true);
JSONObject jSONObject2 = new JSONObject();
jSONObject2.put("data", str + "," + z);
Unit unit = Unit.a;
jSONObject.put("result", jSONObject2.toString());
String jSONObject3 = jSONObject.toString();
Intrinsics.checkNotNullExpressionValue(jSONObject3, "JSONObject().apply {\n …\n }.toString()");
baseWebviewUtility.sendMessageToClient("createTournamentInfoPanel", jSONObject3);
}
@JavascriptInterface
public final void loadFullscreenPage(@NotNull String str) {
Intrinsics.checkNotNullParameter(str, "url");
Logger.d$default(Logger.INSTANCE, this.TAG, "loadFullscreenPage :: JavascriptInterface Method called :: Url is " + str, false, 4, (Object) null);
WebviewOperation webViewOperationHandler = this.webviewUtility.getWebViewOperationHandler();
if (webViewOperationHandler != null) {
WebviewOperation.closeWebview$default(webViewOperationHandler, (String) null, 1, (Object) null);
}
ComplexLayerCommInterface eventCommInterface = this.webviewUtility.getEventCommInterface();
if (eventCommInterface != null) {
EventInfo eventInfo = new EventInfo("UNITY_CREATE_WEBVIEW", NativeUnityCommController.TYPE, (String) null, (String) null, 12, (DefaultConstructorMarker) null);
EventInfo eventInfo2 = new EventInfo(NativeUnityCommController.TYPE, NativeUnityCommController.TYPE, (String) null, (String) null, 12, (DefaultConstructorMarker) null);
JSONObject jSONObject = new JSONObject();
jSONObject.put("webviewId", NativeUtil.INSTANCE.generateRandomUUID());
jSONObject.put("url", str);
jSONObject.put("orientation", "landscape");
jSONObject.put("webviewType", "FULLSCREEN");
String jSONObject2 = jSONObject.toString();
Intrinsics.checkNotNullExpressionValue(jSONObject2, "toString()");
ComplexLayerCommInterface.DefaultImpls.onRouterResponse$default(eventCommInterface, new PGEvent(eventInfo, jSONObject2, eventInfo2), false, false, 6, (Object) null);
}
}
@JavascriptInterface
public final void loadOverlayPage(@NotNull final String str) {
Intrinsics.checkNotNullParameter(str, "url");
Logger.i$default(Logger.INSTANCE, this.TAG, "loadOverlayPage :: JavascriptInterface Method called :: Url is " + str, false, 4, (Object) null);
closeWebview();
new Handler(Looper.getMainLooper()).postDelayed(new Runnable() {
@Override
public final void run() {
JsInterfaceHandler.loadOverlayPage$lambda$2(str, this);
}
}, 300L);
}
@JavascriptInterface
public final void onCashBalanceUpdated() {
Logger.i$default(Logger.INSTANCE, this.TAG, "onCashBalanceUpdated :: JavascriptInterface Method called", false, 4, (Object) null);
ComplexLayerCommInterface eventCommInterface = this.webviewUtility.getEventCommInterface();
if (eventCommInterface != null) {
EventInfo eventInfo = new EventInfo("onAddCashSuccess", NativeUnityCommController.TYPE, (String) null, (String) null, 12, (DefaultConstructorMarker) null);
EventInfo eventInfo2 = new EventInfo(NativeUnityCommController.TYPE, NativeUnityCommController.TYPE, (String) null, (String) null, 12, (DefaultConstructorMarker) null);
JSONObject jSONObject = new JSONObject();
jSONObject.put("isSuccess", true);
jSONObject.put("result", "");
String jSONObject2 = jSONObject.toString();
Intrinsics.checkNotNullExpressionValue(jSONObject2, "toString()");
ComplexLayerCommInterface.DefaultImpls.onRouterResponse$default(eventCommInterface, new PGEvent(eventInfo, jSONObject2, eventInfo2), false, true, 2, (Object) null);
}
}
@JavascriptInterface
public final void onUserDetailsSaved() {
Logger.i$default(Logger.INSTANCE, this.TAG, "onUserDetailsSaved :: JavascriptInterface Method called", false, 4, (Object) null);
ComplexLayerCommInterface eventCommInterface = this.webviewUtility.getEventCommInterface();
if (eventCommInterface != null) {
EventInfo eventInfo = new EventInfo("AddCashHooksShowFMG", NativeUnityCommController.TYPE, (String) null, (String) null, 12, (DefaultConstructorMarker) null);
EventInfo eventInfo2 = new EventInfo(NativeUnityCommController.TYPE, NativeUnityCommController.TYPE, (String) null, (String) null, 12, (DefaultConstructorMarker) null);
JSONObject jSONObject = new JSONObject();
jSONObject.put("isSuccess", true);
jSONObject.put("result", "");
String jSONObject2 = jSONObject.toString();
Intrinsics.checkNotNullExpressionValue(jSONObject2, "toString()");
ComplexLayerCommInterface.DefaultImpls.onRouterResponse$default(eventCommInterface, new PGEvent(eventInfo, jSONObject2, eventInfo2), false, true, 2, (Object) null);
}
}
@JavascriptInterface
public final void openApp(@NotNull String str, @NotNull String str2) {
Intrinsics.checkNotNullParameter(str, "packageName");
Intrinsics.checkNotNullParameter(str2, "data");
Logger.e$default(Logger.INSTANCE, this.TAG, "openApp :: JavaScript Method Called :: PackageName is " + str, false, 4, (Object) null);
NativeUtil.INSTANCE.launchApp(str, str2);
}
@JavascriptInterface
public final void openBrowser(@NotNull String str) {
Intrinsics.checkNotNullParameter(str, "url");
Logger.i$default(Logger.INSTANCE, this.TAG, "openBrowser :: JavascriptInterface Method called :: Url is " + str, false, 4, (Object) null);
try {
Intent intent = new Intent("android.intent.action.VIEW", Uri.parse(str));
Activity webviewActivity = KrakenApplication.Companion.getWebviewActivity();
if (webviewActivity != null) {
webviewActivity.startActivity(intent);
}
} catch (Exception e) {
e.printStackTrace();
CrashlyticsUtility.logException$default(CrashlyticsUtility.INSTANCE, e, (String) null, (HashMap) null, 6, (Object) null);
}
}
@JavascriptInterface
public final void openFacebookGroup(@NotNull String str) {
Intrinsics.checkNotNullParameter(str, "url");
Logger.i$default(Logger.INSTANCE, this.TAG, "openFacebookGroup :: JavascriptInterface Method called :: Url is " + str, false, 4, (Object) null);
try {
KrakenApplication.Companion companion = KrakenApplication.Companion;
if (companion.getApplicationContext().getPackageManager().getPackageInfo("com.facebook.katana", 0).versionCode >= 3002850) {
str = "fb://facewebmodal/f?href=" + str;
}
Intent intent = new Intent("android.intent.action.VIEW", Uri.parse(str));
Activity webviewActivity = companion.getWebviewActivity();
if (webviewActivity != null) {
webviewActivity.startActivity(intent);
}
} catch (Exception e) {
e.printStackTrace();
CrashlyticsUtility.logException$default(CrashlyticsUtility.INSTANCE, e, (String) null, (HashMap) null, 6, (Object) null);
Intent intent2 = new Intent("android.intent.action.VIEW", Uri.parse(str));
Activity webviewActivity2 = KrakenApplication.Companion.getWebviewActivity();
if (webviewActivity2 != null) {
webviewActivity2.startActivity(intent2);
}
}
}
@JavascriptInterface
public final void openGameLayer(int i) {
Logger.i$default(Logger.INSTANCE, this.TAG, "closeDemo :: JavascriptInterface Method called :: PlayerId is :: " + i, false, 4, (Object) null);
closeWebview();
}
@JavascriptInterface
public final void openYoutube(@NotNull String str) {
Intrinsics.checkNotNullParameter(str, "url");
Logger.i$default(Logger.INSTANCE, this.TAG, "openYoutube :: JavascriptInterface Method called :: Url is " + str, false, 4, (Object) null);
try {
Intent intent = new Intent("android.intent.action.VIEW", Uri.parse(str));
intent.addFlags(268435456);
intent.setPackage("com.google.android.youtube");
Activity webviewActivity = KrakenApplication.Companion.getWebviewActivity();
if (webviewActivity != null) {
webviewActivity.startActivity(intent);
}
} catch (Exception e) {
e.printStackTrace();
CrashlyticsUtility.logException$default(CrashlyticsUtility.INSTANCE, e, (String) null, (HashMap) null, 6, (Object) null);
Intent intent2 = new Intent("android.intent.action.VIEW", Uri.parse(str));
Activity webviewActivity2 = KrakenApplication.Companion.getWebviewActivity();
if (webviewActivity2 != null) {
webviewActivity2.startActivity(intent2);
}
}
}
@JavascriptInterface
public final void overlayClick() {
Logger.d$default(Logger.INSTANCE, this.TAG, "overlayClick :: JavascriptInterface Method called", false, 4, (Object) null);
WebviewOperation webViewOperationHandler = this.webviewUtility.getWebViewOperationHandler();
if (webViewOperationHandler != null) {
WebviewOperation.closeWebview$default(webViewOperationHandler, (String) null, 1, (Object) null);
}
BaseWebviewUtility baseWebviewUtility = this.webviewUtility;
JSONObject jSONObject = new JSONObject();
jSONObject.put("isSuccess", true);
jSONObject.put("result", "");
Unit unit = Unit.a;
String jSONObject2 = jSONObject.toString();
Intrinsics.checkNotNullExpressionValue(jSONObject2, "JSONObject().apply {\n …\n }.toString()");
baseWebviewUtility.sendMessageToClient("overlayClick", jSONObject2);
}
@JavascriptInterface
public final void resumeCuratedJourney() {
Logger.i$default(Logger.INSTANCE, this.TAG, "resumeCuratedJourney :: JavascriptInterface Method called", false, 4, (Object) null);
KrakenApplication.Companion companion = KrakenApplication.Companion;
Activity webviewActivity = companion.getWebviewActivity();
if (webviewActivity != null) {
webviewActivity.runOnUiThread(new Runnable() {
@Override
public final void run() {
JsInterfaceHandler.resumeCuratedJourney$lambda$4(JsInterfaceHandler.this);
}
});
}
if (companion.getWebviewActivity() != null) {
RunTimeVarsUtility runTimeVarsUtility = RunTimeVarsUtility.INSTANCE;
if (runTimeVarsUtility.getBooleanRunTimeVar("webviewFlag", false)) {
return;
}
PreferenceManager.Companion companion2 = PreferenceManager.Companion;
String valueOf = String.valueOf(companion2.getInstance().getCuratedSharedPref().getString("data", ""));
try {
if (valueOf.length() > 0) {
SharedPreferences.Editor curatedSharedPrefEditor = companion2.getInstance().getCuratedSharedPrefEditor();
JSONObject jSONObject = new JSONObject(valueOf);
jSONObject.put("showCongratsOverlay", true);
Unit unit = Unit.a;
curatedSharedPrefEditor.putString("data", jSONObject.toString());
curatedSharedPrefEditor.apply();
ComplexLayerCommInterface eventCommInterface = this.webviewUtility.getEventCommInterface();
if (eventCommInterface != null) {
EventInfo eventInfo = new EventInfo("UNITY_CREATE_WEBVIEW", NativeUnityCommController.TYPE, (String) null, (String) null, 12, (DefaultConstructorMarker) null);
JSONObject jSONObject2 = new JSONObject();
jSONObject2.put("webviewId", NativeUtil.INSTANCE.generateRandomUUID());
jSONObject2.put("url", RunTimeVarsUtility.getStringRunTimeVar$default(runTimeVarsUtility, "curatedJourneyPage", (String) null, 2, (Object) null));
jSONObject2.put("orientation", "landscape");
jSONObject2.put("isBackgroundTransparent", true);
jSONObject2.put("webviewType", "FULLSCREEN");
String jSONObject3 = jSONObject2.toString();
Intrinsics.checkNotNullExpressionValue(jSONObject3, "JSONObject().apply {\n … }.toString()");
ComplexLayerCommInterface.DefaultImpls.onRouterResponse$default(eventCommInterface, new PGEvent(eventInfo, jSONObject3, new EventInfo(NativeUnityCommController.TYPE, NativeUnityCommController.TYPE, (String) null, (String) null, 12, (DefaultConstructorMarker) null)), false, false, 6, (Object) null);
}
}
} catch (Exception e) {
e.printStackTrace();
CrashlyticsUtility.logException$default(CrashlyticsUtility.INSTANCE, e, (String) null, (HashMap) null, 6, (Object) null);
}
}
}
@JavascriptInterface
public final void savePasswordFromAddressform(@NotNull String str) {
Intrinsics.checkNotNullParameter(str, "password");
Logger.i$default(Logger.INSTANCE, this.TAG, "savePasswordFromAddressform :: JavascriptInterface Method called :: Password is " + str, false, 4, (Object) null);
int length = str.length() - 1;
int i = 0;
boolean z = false;
while (i <= length) {
boolean z2 = Intrinsics.f(str.charAt(!z ? i : length), 32) <= 0;
if (z) {
if (!z2) {
break;
} else {
length--;
}
} else if (z2) {
i++;
} else {
z = true;
}
}
if (str.subSequence(i, length + 1).toString().length() > 0) {
PreferenceManager.Companion.getInstance().setPassword(str);
}
}
@JavascriptInterface
public final void sendAddCashEventToBranch(@NotNull String str) {
Intrinsics.checkNotNullParameter(str, "addCachBranchEvent");
Logger.d$default(Logger.INSTANCE, this.TAG, "sendAddCashEventToBranch :: JavascriptInterface Method called :: Add Cash Branch event is is " + str, false, 4, (Object) null);
AddCashBranchEventData addCashBranchEventData = (AddCashBranchEventData) new com.google.gson.d().k(str, new com.google.gson.reflect.a<AddCashBranchEventData>() {
}.getType());
FirebaseAnalyticsUtility.INSTANCE.logEventAddCash(addCashBranchEventData.isFirstDeposit(), "INR", Double.parseDouble(addCashBranchEventData.getDepositAmount()), (Double) null, (Double) null, (Double) null);
}
@JavascriptInterface
public final void sendAnalytics(@NotNull String str) {
Intrinsics.checkNotNullParameter(str, "data");
Logger.i$default(Logger.INSTANCE, this.TAG, "sendAnalytics :: JavascriptInterface Method called :: Data is " + str, false, 4, (Object) null);
AnalyticsUtil analyticsUtil = AnalyticsUtil.INSTANCE;
AnalyticsUtil.sendAnalyticsEvent$default(analyticsUtil, "clickStreamData", analyticsUtil.createAnalyticsPayload(str), (String) null, (String) null, 12, (Object) null);
}
@JavascriptInterface
public void sendBackButtonEvent(@NotNull PGWebView pGWebView) {
Intrinsics.checkNotNullParameter(pGWebView, "webview");
Logger.e$default(Logger.INSTANCE, this.TAG, "sendBackButtonEvent :: JavaScript Method called", false, 4, (Object) null);
}
@JavascriptInterface
public final void sendEvent(@NotNull String str) {
JSONObject jSONObject;
Intrinsics.checkNotNullParameter(str, "analyticsJson");
Logger.d$default(Logger.INSTANCE, this.TAG, "sendEvent :: JavascriptInterface Method called :: Analytics Json is " + str, false, 4, (Object) null);
try {
jSONObject = new JSONObject(str);
PreferenceManager.Companion companion = PreferenceManager.Companion;
jSONObject.put("userId", companion.getInstance().getUserId());
if (jSONObject.has("metadata_extra")) {
JSONObject jSONObject2 = jSONObject.getJSONObject("metadata_extra");
jSONObject2.put("userId", companion.getInstance().getUserId());
jSONObject.put("metadata_extra", jSONObject2);
}
} catch (Exception e) {
JSONObject jSONObject3 = new JSONObject();
CrashlyticsUtility.logException$default(CrashlyticsUtility.INSTANCE, e, (String) null, (HashMap) null, 6, (Object) null);
Logger logger = Logger.INSTANCE;
String str2 = this.TAG;
e.printStackTrace();
Logger.e$default(logger, str2, "sendEvent :: Exception while parsing Analytics Data :: Error is " + Unit.a, false, 4, (Object) null);
jSONObject = jSONObject3;
}
AnalyticsUtil analyticsUtil = AnalyticsUtil.INSTANCE;
String jSONObject4 = jSONObject.toString();
Intrinsics.checkNotNullExpressionValue(jSONObject4, "analyticsJSONObj.toString()");
AnalyticsUtil.sendAnalyticsEvent$default(analyticsUtil, "clickStreamData", analyticsUtil.createAnalyticsPayload(jSONObject4), (String) null, (String) null, 12, (Object) null);
}
@JavascriptInterface
public final void setAddCashJourneyID(@NotNull String str) {
Intrinsics.checkNotNullParameter(str, "journeyID");
Logger.d$default(Logger.INSTANCE, this.TAG, "setAddCashJourneyID :: JavascriptInterface Method called :: JourneyId is " + str + " ", false, 4, (Object) null);
KrakenApplication.Companion.updateRuntimeVar("addCashJourneyId", str);
}
@JavascriptInterface
public final void setAddressBookConsentStatus(boolean z) {
Logger.d$default(Logger.INSTANCE, this.TAG, "setAddressBookConsentStatus :: JavascriptInterface Method called :: Flag is " + z, false, 4, (Object) null);
PreferenceManager.Companion.getInstance().setConsentStatus(z);
}
@JavascriptInterface
public final void setCuratedJourneyState(@NotNull String str) {
Intrinsics.checkNotNullParameter(str, "data");
Logger.i$default(Logger.INSTANCE, this.TAG, "setCuratedJourneyState :: JavascriptInterface Method called :: Data is :: " + str, false, 4, (Object) null);
if (KrakenApplication.Companion.getWebviewActivity() == null) {
return;
}
SharedPreferences.Editor curatedStateDataSharedPrefEditor = PreferenceManager.Companion.getInstance().getCuratedStateDataSharedPrefEditor();
curatedStateDataSharedPrefEditor.putString("data", str);
curatedStateDataSharedPrefEditor.apply();
}
@JavascriptInterface
public final void shareToAll(@NotNull String str) {
Intrinsics.checkNotNullParameter(str, "link");
Logger.i$default(Logger.INSTANCE, this.TAG, "shareToAll :: JavascriptInterface Method called :: link is " + str, false, 4, (Object) null);
try {
Intent intent = new Intent();
intent.setAction("android.intent.action.SEND");
intent.putExtra("android.intent.extra.TEXT", str);
intent.setType("text/plain");
Activity webviewActivity = KrakenApplication.Companion.getWebviewActivity();
if (webviewActivity != null) {
webviewActivity.startActivity(Intent.createChooser(intent, "Share to..."));
}
} catch (Exception e) {
e.printStackTrace();
CrashlyticsUtility.logException$default(CrashlyticsUtility.INSTANCE, e, (String) null, (HashMap) null, 6, (Object) null);
}
}
@JavascriptInterface
public final void shareToApp(@NotNull String str, @NotNull String str2, @NotNull String str3) {
Intrinsics.checkNotNullParameter(str, "appPackage");
Intrinsics.checkNotNullParameter(str2, "UnityActivity");
Intrinsics.checkNotNullParameter(str3, "data");
Logger.i$default(Logger.INSTANCE, this.TAG, "shareToApp :: JavascriptInterface Method called :: AppPackage is " + str + " :: UnityActivty is " + str2 + " and data is " + str3, false, 4, (Object) null);
try {
Intent intent = new Intent("android.intent.action.SEND");
intent.putExtra("android.intent.extra.TEXT", "Play Games share content");
intent.addCategory("android.intent.category.LAUNCHER");
intent.setType("text/plain");
intent.setFlags(270532608);
intent.setComponent(new ComponentName(str, str2));
Activity webviewActivity = KrakenApplication.Companion.getWebviewActivity();
if (webviewActivity != null) {
webviewActivity.startActivity(intent);
}
} catch (Exception e) {
e.printStackTrace();
CrashlyticsUtility.logException$default(CrashlyticsUtility.INSTANCE, e, (String) null, (HashMap) null, 6, (Object) null);
}
}
@JavascriptInterface
public final void showToast(@NotNull String str) {
Intrinsics.checkNotNullParameter(str, "toast");
Logger.i$default(Logger.INSTANCE, this.TAG, "showToast :: JavascriptInterface Method called :: Toast is :: " + str, false, 4, (Object) null);
Toast.makeText(KrakenApplication.Companion.getWebviewActivity(), str, 0).show();
}
@JavascriptInterface
public final void switchToReverieApp(@NotNull String str) {
Intrinsics.checkNotNullParameter(str, "initiationSource");
Logger.d$default(Logger.INSTANCE, this.TAG, "switchToReverieApp :: JavascriptInterface Method called :: Initiation Source is " + str, false, 4, (Object) null);
ComplexLayerCommInterface eventCommInterface = this.webviewUtility.getEventCommInterface();
if (eventCommInterface != null) {
EventInfo eventInfo = new EventInfo("switchToReverieApp", NativeUnityCommController.TYPE, (String) null, (String) null, 12, (DefaultConstructorMarker) null);
EventInfo eventInfo2 = new EventInfo(NativeUnityCommController.TYPE, NativeUnityCommController.TYPE, (String) null, (String) null, 12, (DefaultConstructorMarker) null);
JSONObject jSONObject = new JSONObject();
jSONObject.put("initiationPoint", str);
String jSONObject2 = jSONObject.toString();
Intrinsics.checkNotNullExpressionValue(jSONObject2, "toString()");
ComplexLayerCommInterface.DefaultImpls.onRouterResponse$default(eventCommInterface, new PGEvent(eventInfo, jSONObject2, eventInfo2), false, false, 6, (Object) null);
}
}
@JavascriptInterface
public final void updateRoyalEntryAvailability() {
Logger.d$default(Logger.INSTANCE, this.TAG, "updateRoyalEntryAvailability :: JavascriptInterface Method called ", false, 4, (Object) null);
BaseWebviewUtility baseWebviewUtility = this.webviewUtility;
JSONObject jSONObject = new JSONObject();
jSONObject.put("isSuccess", true);
jSONObject.put("result", new JSONObject().toString());
Unit unit = Unit.a;
String jSONObject2 = jSONObject.toString();
Intrinsics.checkNotNullExpressionValue(jSONObject2, "JSONObject().apply {\n …\n }.toString()");
baseWebviewUtility.sendMessageToClient("UNITY_WEBVIEW_UPDATE_RE_AVAILABILITY_RESPONSE", jSONObject2);
}
@JavascriptInterface
public final void uploadNowClicked() {
Logger.d$default(Logger.INSTANCE, this.TAG, "uploadNowClicked :: JavascriptInterface Method called", false, 4, (Object) null);
try {
WebviewOperation webViewOperationHandler = this.webviewUtility.getWebViewOperationHandler();
if (webViewOperationHandler != null) {
WebviewOperation.closeWebview$default(webViewOperationHandler, (String) null, 1, (Object) null);
}
ComplexLayerCommInterface eventCommInterface = this.webviewUtility.getEventCommInterface();
if (eventCommInterface != null) {
EventInfo eventInfo = new EventInfo("UNITY_CREATE_WEBVIEW", NativeUnityCommController.TYPE, (String) null, (String) null, 12, (DefaultConstructorMarker) null);
EventInfo eventInfo2 = new EventInfo(NativeUnityCommController.TYPE, NativeUnityCommController.TYPE, (String) null, (String) null, 12, (DefaultConstructorMarker) null);
JSONObject jSONObject = new JSONObject();
jSONObject.put("webviewType", "FULLSCREEN");
jSONObject.put("webviewId", NativeUtil.INSTANCE.generateRandomUUID());
jSONObject.put("isBackGroundTransparent", true);
jSONObject.put("orientation", "portrait");
jSONObject.put("url", RunTimeVarsUtility.getStringRunTimeVar$default(RunTimeVarsUtility.INSTANCE, "kycUrl", (String) null, 2, (Object) null) + "?src=EventDrivenOverlay");
String jSONObject2 = jSONObject.toString();
Intrinsics.checkNotNullExpressionValue(jSONObject2, "toString()");
ComplexLayerCommInterface.DefaultImpls.onRouterResponse$default(eventCommInterface, new PGEvent(eventInfo, jSONObject2, eventInfo2), true, false, 4, (Object) null);
}
KrakenApplication.Companion.updateRuntimeVar("webviewFlag", Boolean.TRUE);
} catch (Exception e) {
Logger logger = Logger.INSTANCE;
String str = this.TAG;
e.printStackTrace();
Logger.e$default(logger, str, "uploadNowClicked :: Exception in uploadNowClicked :: Message is " + Unit.a, false, 4, (Object) null);
CrashlyticsUtility.logException$default(CrashlyticsUtility.INSTANCE, e, (String) null, (HashMap) null, 6, (Object) null);
}
}
}