导航菜单

页面标题

页面副标题

RummyCircle v11000.89 - BaseWebviewUtility.java 源代码

正在查看: RummyCircle v11000.89 应用的 BaseWebviewUtility.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.games24x7.dynamicrc.unitymodule.webview.base;

import android.app.Activity;
import android.content.Intent;
import android.content.res.Resources;
import android.net.Uri;
import android.util.Log;
import android.webkit.CookieManager;
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.WebviewOperation;
import com.games24x7.coregame.common.deeplink.util.NativeUtil;
import com.games24x7.coregame.common.deeplink.util.PreferenceManager;
import com.games24x7.coregame.common.model.webview.PurchaseInfoModel;
import com.games24x7.coregame.common.utility.analytics.AnalyticsUtil;
import com.games24x7.coregame.common.utility.crashlytics.CrashlyticsUtility;
import com.games24x7.coregame.common.utility.log.Logger;
import com.games24x7.coregame.common.utility.native.UrlUtility;
import com.games24x7.coregame.common.utility.runtimevars.RunTimeVarsUtility;
import com.games24x7.dynamicrc.unitymodule.comm.unitycomm.NativeUnityCommController;
import com.games24x7.dynamicrc.unitymodule.ui.UnityActivity;
import com.games24x7.dynamicrc.unitymodule.util.logger.LoggerConstants;
import com.games24x7.pgeventbus.event.EventInfo;
import com.games24x7.pgeventbus.event.PGEvent;
import com.games24x7.pgwebview.models.CustomWebviewResponse;
import com.games24x7.pgwebview.models.WebViewConfiguration;
import com.google.firebase.perf.metrics.Trace;
import java.util.HashMap;
import java.util.LinkedHashMap;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.collections.I;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlin.text.StringsKt;
import org.jetbrains.annotations.NotNull;
import org.json.JSONObject;

@Metadata
public abstract class BaseWebviewUtility {

    @NotNull
    private static final String TAG = "BaseWebviewUtility";
    private boolean addCashFromRoyalEntry;
    private int count;
    private boolean downtime;
    private ComplexLayerCommInterface eventCommInterface;
    private boolean gotoBaf;
    private boolean isAddCashGT;
    private boolean isMMOnBoardingJourney;
    private boolean isRumbleOnBoardingJourney;
    private boolean isSideWinsJourney;
    private boolean isSpinRummyJourney;
    private boolean isTutorialShown;
    private boolean isTutorialWebview;
    private boolean loadNewOverlayHtmlPLO;
    private Trace mAddCashTrace;
    private Trace mPerformanceLegoTrace;
    private Trace mPerformanceTrace;
    private PurchaseInfoModel mPurchaseInfoModel;

    @NotNull
    private WebViewConfiguration mWebViewConfiguration;
    private boolean offScreenLoad;
    private WebviewOperation webViewOperationHandler;

    @NotNull
    public static final Companion Companion = new Companion(null);

    @NotNull
    private static final HashMap<String, BaseWebviewUtility> utilityWebviewIdMap = new HashMap<>();

    @NotNull
    private String mExtraCallbackObject = "";

    @NotNull
    private String mExtraCallbackFunction = "";

    @NotNull
    private String mExtraCallbackData = "";
    private int mExtraDirection = -1;

    @NotNull
    private String webviewId = "";

    @NotNull
    private String dlSource = "";

    @NotNull
    private String dlScreenType = "";

    @NotNull
    private String dlInferredUrl = "";

    @NotNull
    private String webLoadUrl = "";

    @NotNull
    private String jScript = "";

    @NotNull
    private String postLoginOverlayContent = "";

    @NotNull
    private String hideHtmlScript = "";

    @NotNull
    private HashMap<String, String> hidingScriptMap = new HashMap<>();

    @NotNull
    private HashMap<String, String> ctaMap = new HashMap<>();
    private boolean isFirstPage = true;
    private boolean isFirstDeepLinkPage = true;

    @NotNull
    private String baseUrl = UrlUtility.INSTANCE.getMrcUrl();

    @NotNull
    private CustomWebviewResponse mCustomWebviewResponse = new CustomWebviewResponse(false, "", I.d());

    @Metadata
    public static final class Companion {
        public Companion(DefaultConstructorMarker defaultConstructorMarker) {
            this();
        }

        @NotNull
        public final HashMap<String, BaseWebviewUtility> getUtilityWebviewIdMap() {
            return BaseWebviewUtility.utilityWebviewIdMap;
        }

        public final void sendLegoEventToWebview(int i, Object obj, WebviewOperation webviewOperation) {
            LinkedHashMap linkedHashMap = new LinkedHashMap();
            linkedHashMap.put("type", Integer.valueOf(i));
            linkedHashMap.put("data", obj);
            String s = new com.google.gson.d().s(linkedHashMap);
            Intrinsics.checkNotNullExpressionValue(s, "Gson().toJson(responseMap)");
            Logger.d$default(Logger.INSTANCE, BaseWebviewUtility.TAG, "sendLegoEventToWebview :: Sending response :: " + s, false, 4, (Object) null);
            if (webviewOperation != null) {
                webviewOperation.loadUrlIntoWebview("javascript:window.postMessage(" + s + ", '*');");
            }
        }

        private Companion() {
        }
    }

    public BaseWebviewUtility() {
        NativeUtil nativeUtil = NativeUtil.INSTANCE;
        String customUserAgent = nativeUtil.getCustomUserAgent();
        boolean booleanRunTimeVar = RunTimeVarsUtility.INSTANCE.getBooleanRunTimeVar("useEvaluateJavaScript", false);
        this.mWebViewConfiguration = new WebViewConfiguration(false, false, false, false, false, false, false, false, false, false, false, false, false, false, customUserAgent, Boolean.valueOf(booleanRunTimeVar), (Boolean) null, nativeUtil.getHW_ACCL_ENABLED_WEBVIEW_IDS(), 77823, (DefaultConstructorMarker) null);
    }

    public static void launchJourney$default(BaseWebviewUtility baseWebviewUtility, String str, int i, int i2, int i3, int i4, String str2, String str3, boolean z, String str4, JSONObject jSONObject, int i5, Object obj) {
        if (obj != null) {
            throw new UnsupportedOperationException("Super calls with default arguments not supported in this target, function: launchJourney");
        }
        baseWebviewUtility.launchJourney(str, (i5 & 2) != 0 ? 0 : i, (i5 & 4) != 0 ? 0 : i2, (i5 & 8) != 0 ? 100 : i3, (i5 & 16) != 0 ? 100 : i4, str2, (i5 & 64) != 0 ? "FULLSCREEN" : str3, (i5 & 128) != 0 ? false : z, (i5 & 256) != 0 ? "portrait" : str4, (i5 & 512) != 0 ? new JSONObject() : jSONObject);
    }

    public static final void loadHidingScript$lambda$17(BaseWebviewUtility baseWebviewUtility) {
        Intrinsics.checkNotNullParameter(baseWebviewUtility, "this$0");
        try {
            WebviewOperation webViewOperationHandler = baseWebviewUtility.getWebViewOperationHandler();
            if (webViewOperationHandler != null) {
                webViewOperationHandler.loadUrlIntoWebview("javascript:" + baseWebviewUtility.getJScript());
            }
            Logger.e$default(Logger.INSTANCE, TAG, "loadHidingScript :: Loading Hiding Script :: Script is " + baseWebviewUtility.getJScript(), false, 4, (Object) null);
        } catch (Exception e) {
            Logger logger = Logger.INSTANCE;
            e.printStackTrace();
            Logger.e$default(logger, TAG, "loadHidingScript :: " + Unit.a, false, 4, (Object) null);
            CrashlyticsUtility.logException$default(CrashlyticsUtility.INSTANCE, e, (String) null, (HashMap) null, 6, (Object) null);
        }
    }

    public static void onDestroy$default(BaseWebviewUtility baseWebviewUtility, String str, JSONObject jSONObject, int i, Object obj) {
        if (obj != null) {
            throw new UnsupportedOperationException("Super calls with default arguments not supported in this target, function: onDestroy");
        }
        if ((i & 2) != 0) {
            jSONObject = null;
        }
        baseWebviewUtility.onDestroy(str, jSONObject);
    }

    public static final void onPageFinished$lambda$2(BaseWebviewUtility baseWebviewUtility) {
        Intrinsics.checkNotNullParameter(baseWebviewUtility, "this$0");
        try {
            WebviewOperation webViewOperationHandler = baseWebviewUtility.getWebViewOperationHandler();
            if (webViewOperationHandler != null) {
                webViewOperationHandler.loadUrlIntoWebview("javascript:" + baseWebviewUtility.getJScript());
            }
            Logger.e$default(Logger.INSTANCE, TAG, "onPageFinished ::Loading PLO script :: Script is " + baseWebviewUtility.getJScript(), false, 4, (Object) null);
        } catch (Exception e) {
            Logger logger = Logger.INSTANCE;
            e.printStackTrace();
            Logger.e$default(logger, TAG, "BaseWebUtilityOnPageFinished :: " + Unit.a, false, 4, (Object) null);
            CrashlyticsUtility.logException$default(CrashlyticsUtility.INSTANCE, e, (String) null, (HashMap) null, 6, (Object) null);
        }
    }

    public static final void onPageStarted$lambda$0(BaseWebviewUtility baseWebviewUtility) {
        Intrinsics.checkNotNullParameter(baseWebviewUtility, "this$0");
        try {
            if (KrakenApplication.Companion.getWebviewActivity() instanceof UnityActivity) {
                WebviewOperation webViewOperationHandler = baseWebviewUtility.getWebViewOperationHandler();
                if (webViewOperationHandler != null) {
                    webViewOperationHandler.animatedScaleToWebview(0.0f, 1.0f, 1000.0f);
                }
                WebviewOperation webViewOperationHandler2 = baseWebviewUtility.getWebViewOperationHandler();
                if (webViewOperationHandler2 != null) {
                    WebviewOperation.closeWebview$default(webViewOperationHandler2, (String) null, 1, (Object) null);
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
            CrashlyticsUtility.logException$default(CrashlyticsUtility.INSTANCE, e, (String) null, (HashMap) null, 6, (Object) null);
        }
    }

    public static final void onPageStarted$lambda$1(BaseWebviewUtility baseWebviewUtility) {
        Intrinsics.checkNotNullParameter(baseWebviewUtility, "this$0");
        try {
            WebviewOperation webViewOperationHandler = baseWebviewUtility.getWebViewOperationHandler();
            if (webViewOperationHandler != null) {
                webViewOperationHandler.loadUrlIntoWebview("javascript:" + baseWebviewUtility.getJScript());
            }
            Logger.e$default(Logger.INSTANCE, TAG, "onPageStarted :: Loading Hiding Script :: Script is " + baseWebviewUtility.getJScript(), false, 4, (Object) null);
        } catch (Exception e) {
            Logger logger = Logger.INSTANCE;
            e.printStackTrace();
            Logger.e$default(logger, TAG, "BaseWebUtilityOnPageStarted :: " + Unit.a, false, 4, (Object) null);
            CrashlyticsUtility.logException$default(CrashlyticsUtility.INSTANCE, e, (String) null, (HashMap) null, 6, (Object) null);
        }
    }

    private final void startIntent(String str, String str2) {
        Resources resources;
        Resources resources2;
        Intent intent = new Intent();
        intent.setAction("android.intent.action.SEND");
        KrakenApplication.Companion companion = KrakenApplication.Companion;
        Activity webviewActivity = companion.getWebviewActivity();
        String str3 = null;
        String string = (webviewActivity == null || (resources2 = webviewActivity.getResources()) == null) ? null : resources2.getString(R.string.baf_message);
        Activity webviewActivity2 = companion.getWebviewActivity();
        if (webviewActivity2 != null && (resources = webviewActivity2.getResources()) != null) {
            str3 = resources.getString(R.string.baf_url);
        }
        intent.putExtra("android.intent.extra.TEXT", string + str3 + "refId=" + PreferenceManager.Companion.getInstance().getUserId() + "&utm_medium=" + str2 + "&cid=3");
        intent.setType("text/plain");
        intent.setPackage(str);
        try {
            Activity webviewActivity3 = companion.getWebviewActivity();
            if (webviewActivity3 != null) {
                webviewActivity3.startActivity(Intent.createChooser(intent, "Share"));
            }
        } catch (Exception e) {
            CrashlyticsUtility.logException$default(CrashlyticsUtility.INSTANCE, e, (String) null, (HashMap) null, 6, (Object) null);
        }
    }

    public final void closeWebview() {
        int i;
        Log.e(TAG, "closeWebview :: Is RumbleOnBoard :: " + isRumbleOnBoardingJourney());
        if (isRumbleOnBoardingJourney()) {
            Log.e(TAG, "closeWebview :: Is Function :: " + getMExtraCallbackFunction() + " ::  CallbackObj :: " + getMExtraCallbackObject());
            if (getMExtraCallbackFunction().length() > 0 && getMExtraCallbackObject().length() > 0) {
                Log.e(TAG, "closeWebview :: Sedning webview");
                String mExtraCallbackFunction = 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()");
                sendMessageToClient(mExtraCallbackFunction, jSONObject3);
                if (getMExtraDirection() == 0) {
                    i = R.anim.scale_down_closing;
                } else if (getMExtraDirection() == 1) {
                    i = R.anim.scale_down_closing_bottom_top;
                }
            }
            i = 0;
        } else if (isMMOnBoardingJourney()) {
            String mExtraCallbackFunction2 = getMExtraCallbackFunction();
            JSONObject jSONObject4 = new JSONObject();
            jSONObject4.put("isSuccess", true);
            JSONObject jSONObject5 = new JSONObject();
            jSONObject5.put("data", getMExtraCallbackData());
            Unit unit2 = Unit.a;
            jSONObject4.put("result", jSONObject5.toString());
            String jSONObject6 = jSONObject4.toString();
            Intrinsics.checkNotNullExpressionValue(jSONObject6, "JSONObject().apply {\n   …             }.toString()");
            sendMessageToClient(mExtraCallbackFunction2, jSONObject6);
            if (getMExtraDirection() == 2) {
                i = R.anim.scale_down_closing_left_right_center;
            }
            i = 0;
        } else {
            if (isSideWinsJourney()) {
                String mExtraCallbackFunction3 = getMExtraCallbackFunction();
                JSONObject jSONObject7 = new JSONObject();
                jSONObject7.put("isSuccess", true);
                JSONObject jSONObject8 = new JSONObject();
                jSONObject8.put("data", getMExtraCallbackData());
                Unit unit3 = Unit.a;
                jSONObject7.put("result", jSONObject8.toString());
                String jSONObject9 = jSONObject7.toString();
                Intrinsics.checkNotNullExpressionValue(jSONObject9, "JSONObject().apply {\n   …             }.toString()");
                sendMessageToClient(mExtraCallbackFunction3, jSONObject9);
                if (getMExtraDirection() == 2) {
                    i = R.anim.scale_down_closing_left_right_center;
                }
            } else if (isSpinRummyJourney()) {
                String mExtraCallbackFunction4 = getMExtraCallbackFunction();
                JSONObject jSONObject10 = new JSONObject();
                jSONObject10.put("isSuccess", true);
                JSONObject jSONObject11 = new JSONObject();
                jSONObject11.put("data", getMExtraCallbackData());
                Unit unit4 = Unit.a;
                jSONObject10.put("result", jSONObject11.toString());
                String jSONObject12 = jSONObject10.toString();
                Intrinsics.checkNotNullExpressionValue(jSONObject12, "JSONObject().apply {\n   …             }.toString()");
                sendMessageToClient(mExtraCallbackFunction4, jSONObject12);
            }
            i = 0;
        }
        if (NativeUtil.INSTANCE.isAddCashURL(getWebLoadUrl()) || StringsKt.E(getWebLoadUrl(), "kyc", false)) {
            JSONObject jSONObject13 = new JSONObject();
            jSONObject13.put("isSuccess", true);
            jSONObject13.put("result", "");
            Unit unit5 = Unit.a;
            String jSONObject14 = jSONObject13.toString();
            Intrinsics.checkNotNullExpressionValue(jSONObject14, "JSONObject().apply {\n   …             }.toString()");
            sendMessageToClient("onAddCashClosed", jSONObject14);
            KrakenApplication.Companion.updateRuntimeVar("isAddCashInProgress", Boolean.FALSE);
        }
        WebviewOperation webViewOperationHandler = getWebViewOperationHandler();
        if (webViewOperationHandler != null) {
            JSONObject jSONObject15 = new JSONObject();
            jSONObject15.put("isExitAnimationRequired", i != 0);
            jSONObject15.put("exitAnimationResource", i);
            webViewOperationHandler.closeWebview(jSONObject15.toString());
        }
    }

    public boolean getAddCashFromRoyalEntry() {
        return this.addCashFromRoyalEntry;
    }

    @NotNull
    public String getBaseUrl() {
        return this.baseUrl;
    }

    public int getCount() {
        return this.count;
    }

    @NotNull
    public HashMap<String, String> getCtaMap() {
        return this.ctaMap;
    }

    @NotNull
    public String getDlInferredUrl() {
        return this.dlInferredUrl;
    }

    @NotNull
    public String getDlScreenType() {
        return this.dlScreenType;
    }

    @NotNull
    public String getDlSource() {
        return this.dlSource;
    }

    public boolean getDowntime() {
        return this.downtime;
    }

    public ComplexLayerCommInterface getEventCommInterface() {
        return this.eventCommInterface;
    }

    public boolean getGotoBaf() {
        return this.gotoBaf;
    }

    @NotNull
    public String getHideHtmlScript() {
        return this.hideHtmlScript;
    }

    @NotNull
    public HashMap<String, String> getHidingScriptMap() {
        return this.hidingScriptMap;
    }

    @NotNull
    public String getJScript() {
        return this.jScript;
    }

    public boolean getLoadNewOverlayHtmlPLO() {
        return this.loadNewOverlayHtmlPLO;
    }

    public Trace getMAddCashTrace() {
        return this.mAddCashTrace;
    }

    @NotNull
    public CustomWebviewResponse getMCustomWebviewResponse() {
        return this.mCustomWebviewResponse;
    }

    @NotNull
    public String getMExtraCallbackData() {
        return this.mExtraCallbackData;
    }

    @NotNull
    public String getMExtraCallbackFunction() {
        return this.mExtraCallbackFunction;
    }

    @NotNull
    public String getMExtraCallbackObject() {
        return this.mExtraCallbackObject;
    }

    public int getMExtraDirection() {
        return this.mExtraDirection;
    }

    public Trace getMPerformanceLegoTrace() {
        return this.mPerformanceLegoTrace;
    }

    public Trace getMPerformanceTrace() {
        return this.mPerformanceTrace;
    }

    public PurchaseInfoModel getMPurchaseInfoModel() {
        return this.mPurchaseInfoModel;
    }

    @NotNull
    public WebViewConfiguration getMWebViewConfiguration() {
        return this.mWebViewConfiguration;
    }

    public boolean getOffScreenLoad() {
        return this.offScreenLoad;
    }

    @NotNull
    public final String getPLOSuffixUrl() {
        Logger logger = Logger.INSTANCE;
        Logger.d$default(logger, TAG, "OverlayHTML PLO value : " + getLoadNewOverlayHtmlPLO(), false, 4, (Object) null);
        String valueOf = getLoadNewOverlayHtmlPLO() ? String.valueOf(KrakenApplication.Companion.getRuntimeVars().get("redesignPostLoginOverlayPage")) : String.valueOf(KrakenApplication.Companion.getRuntimeVars().get("postLoginOverlayPage"));
        Logger.d$default(logger, TAG, "New PLO suffix : ".concat(valueOf), false, 4, (Object) null);
        return valueOf;
    }

    @NotNull
    public String getPostLoginOverlayContent() {
        return this.postLoginOverlayContent;
    }

    @NotNull
    public final String getUrlEndPoint(@NotNull String str) {
        Intrinsics.checkNotNullParameter(str, "url");
        if (str.length() == 0) {
            return str;
        }
        try {
            String U = StringsKt.U(str, "//");
            Integer valueOf = Integer.valueOf(StringsKt.I(U, '?', 0, false, 6));
            if (valueOf.intValue() == -1) {
                valueOf = null;
            }
            String substring = U.substring(0, valueOf != null ? valueOf.intValue() : U.length());
            Intrinsics.checkNotNullExpressionValue(substring, "substring(...)");
            String T = StringsKt.T(substring, '/');
            return T.length() > 0 ? "/".concat(T) : "/";
        } catch (Exception e) {
            e.printStackTrace();
            CrashlyticsUtility.logException$default(CrashlyticsUtility.INSTANCE, e, (String) null, (HashMap) null, 6, (Object) null);
            return "/";
        }
    }

    @NotNull
    public String getWebLoadUrl() {
        return this.webLoadUrl;
    }

    public WebviewOperation getWebViewOperationHandler() {
        return this.webViewOperationHandler;
    }

    @NotNull
    public String getWebviewId() {
        return this.webviewId;
    }

    public boolean isAddCashGT() {
        return this.isAddCashGT;
    }

    public boolean isFirstDeepLinkPage() {
        return this.isFirstDeepLinkPage;
    }

    public boolean isFirstPage() {
        return this.isFirstPage;
    }

    public boolean isMMOnBoardingJourney() {
        return this.isMMOnBoardingJourney;
    }

    public boolean isRumbleOnBoardingJourney() {
        return this.isRumbleOnBoardingJourney;
    }

    public boolean isSideWinsJourney() {
        return this.isSideWinsJourney;
    }

    public boolean isSpinRummyJourney() {
        return this.isSpinRummyJourney;
    }

    public boolean isTutorialShown() {
        return this.isTutorialShown;
    }

    public boolean isTutorialWebview() {
        return this.isTutorialWebview;
    }

    public abstract void launchJourney(@NotNull String str, int i, int i2, int i3, int i4, @NotNull String str2, @NotNull String str3, boolean z, @NotNull String str4, @NotNull JSONObject jSONObject);

    public final void loadHidingScript() {
        Activity webviewActivity = KrakenApplication.Companion.getWebviewActivity();
        if (webviewActivity != null) {
            webviewActivity.runOnUiThread(new a(this, 0));
        }
    }

    public abstract void onActivityResult(@NotNull String str, @NotNull String str2, int i, int i2, @NotNull String str3);

    public abstract void onBackPress(@NotNull String str);

    public abstract void onCanGoBack(@NotNull String str, boolean z);

    public abstract void onCanGoForward(@NotNull String str, boolean z);

    public void onCreate(@NotNull String str) {
        Intrinsics.checkNotNullParameter(str, "webviewId");
    }

    public abstract void onDestroy(@NotNull String str, JSONObject jSONObject);

    public abstract void onFinish(@NotNull String str);

    public abstract void onMaximized(@NotNull String str);

    public abstract void onMinimized(@NotNull String str);

    public void onPageFinished(@NotNull String str, @NotNull String str2) {
        Activity webviewActivity;
        WebviewOperation webViewOperationHandler;
        String string;
        WebviewOperation webViewOperationHandler2;
        Intrinsics.checkNotNullParameter(str, "webviewId");
        Intrinsics.checkNotNullParameter(str2, "url");
        if (isFirstDeepLinkPage()) {
            trackDeepLinkLandingEvent("deepLinking/landedOnIntendedScreen", "view_displayed", null, null);
            setFirstDeepLinkPage(false);
        }
        if (getOffScreenLoad()) {
            Logger.d$default(Logger.INSTANCE, TAG, "Offscreen loading returning..", false, 4, (Object) null);
            return;
        }
        try {
            if (StringsKt.E(str2, "rummycircle.com", false)) {
                WebviewOperation webViewOperationHandler3 = getWebViewOperationHandler();
                if (webViewOperationHandler3 != null) {
                    webViewOperationHandler3.loadUrlIntoWebview("javascript: var rcLogoDiv = document.getElementsByClassName('rc_logo');if(rcLogoDiv.length > 0){rcLogoDiv[0].onclick = function(){Android.RCLogoClick();};}");
                }
                KrakenApplication.Companion companion = KrakenApplication.Companion;
                if (companion.getWebviewActivity() != null && (string = PreferenceManager.Companion.getInstance().getCuratedSharedPref().getString("data", "")) != null && string.length() > 0 && (webViewOperationHandler2 = getWebViewOperationHandler()) != null) {
                    webViewOperationHandler2.loadUrlIntoWebview("javascript:localStorage.setItem('curatedJourneyData'," + string + ");");
                }
                if (StringsKt.J(str2, "/csp.jsp?", 0, false, 6) > 0) {
                    String cookie = CookieManager.getInstance().getCookie(getBaseUrl());
                    Logger.i$default(Logger.INSTANCE, TAG, "BaseWebUtilityOnPageFinished :: Cookies are :: " + cookie, false, 4, (Object) null);
                    Intrinsics.checkNotNullExpressionValue(cookie, "str");
                    if (StringsKt.J(cookie, "BAF_STATUS=1", 0, false, 6) == -1) {
                        WebviewOperation webViewOperationHandler4 = getWebViewOperationHandler();
                        if (webViewOperationHandler4 != null) {
                            webViewOperationHandler4.reloadWebview();
                        }
                    } else {
                        WebviewOperation webViewOperationHandler5 = getWebViewOperationHandler();
                        if (webViewOperationHandler5 != null) {
                            webViewOperationHandler5.loadUrlIntoWebview(getBaseUrl() + companion.getRuntimeVars().get("bafUrl"));
                        }
                        setGotoBaf(true);
                    }
                }
                if (StringsKt.E(str2, "help.html", false) && (webViewOperationHandler = getWebViewOperationHandler()) != null) {
                    webViewOperationHandler.loadUrlIntoWebview("javascript:try{var elem = document.getElementsByClassName('footer')[0];elem.parentElement.removeChild(elem);}catch(e){console.log(e);}");
                }
                if (StringsKt.E(str2, "logout", false)) {
                    Logger.e$default(Logger.INSTANCE, TAG, "onPageFinished :: Sending logout event to unity...", false, 4, (Object) null);
                    ComplexLayerCommInterface eventCommInterface = getEventCommInterface();
                    if (eventCommInterface != null) {
                        EventInfo eventInfo = new EventInfo("performLogout", NativeUnityCommController.TYPE, (String) null, (String) null, 12, (DefaultConstructorMarker) null);
                        String jSONObject = new JSONObject().toString();
                        Intrinsics.checkNotNullExpressionValue(jSONObject, "JSONObject().toString()");
                        ComplexLayerCommInterface.DefaultImpls.onRouterResponse$default(eventCommInterface, new PGEvent(eventInfo, jSONObject, new EventInfo((String) null, (String) null, (String) null, (String) null, 15, (DefaultConstructorMarker) null)), false, false, 6, (Object) null);
                    }
                    WebviewOperation webViewOperationHandler6 = getWebViewOperationHandler();
                    if (webViewOperationHandler6 != null) {
                        webViewOperationHandler6.stopLoadingWebview();
                    }
                    WebviewOperation webViewOperationHandler7 = getWebViewOperationHandler();
                    if (webViewOperationHandler7 != null) {
                        WebviewOperation.closeWebview$default(webViewOperationHandler7, (String) null, 1, (Object) null);
                    }
                }
                if (StringsKt.E(str2, getPLOSuffixUrl(), false)) {
                    setJScript(getPostLoginOverlayContent());
                    if (getOffScreenLoad() || (webviewActivity = companion.getWebviewActivity()) == null) {
                        return;
                    }
                    webviewActivity.runOnUiThread(new Runnable() {
                        @Override
                        public final void run() {
                            BaseWebviewUtility.onPageFinished$lambda$2(BaseWebviewUtility.this);
                        }
                    });
                }
            }
        } catch (Exception e) {
            CrashlyticsUtility.logException$default(CrashlyticsUtility.INSTANCE, e, (String) null, (HashMap) null, 6, (Object) null);
            Logger logger = Logger.INSTANCE;
            e.printStackTrace();
            Logger.e$default(logger, TAG, "BaseWebUtilityOnPageFinished :: Got crash is the onFinish Journey :: " + Unit.a, false, 4, (Object) null);
        }
    }

    public void onPageStarted(@org.jetbrains.annotations.NotNull java.lang.String r13, @org.jetbrains.annotations.NotNull java.lang.String r14) {
        throw new UnsupportedOperationException("Method not decompiled: com.games24x7.dynamicrc.unitymodule.webview.base.BaseWebviewUtility.onPageStarted(java.lang.String, java.lang.String):void");
    }

    public abstract void onPause(@NotNull String str);

    public void onReceivedError(@NotNull String str, int i, @NotNull String str2, @NotNull String str3) {
        Intrinsics.checkNotNullParameter(str, "webviewId");
        Intrinsics.checkNotNullParameter(str2, "description");
        Intrinsics.checkNotNullParameter(str3, "failingUrl");
        if (isFirstDeepLinkPage()) {
            Logger.e$default(Logger.INSTANCE, TAG, "onReceivedError :: Webview Id is " + str + " :: Error Code is " + i + " ::  Description is :: " + str2 + " and Failing url is " + str3, false, 4, (Object) null);
            trackDeepLinkLandingEvent("deepLinking/deepLinkDiscarded", "action_failed", str2, "WEB_DL_LOAD_FAILURE");
            setFirstDeepLinkPage(false);
        }
        if (i == -2) {
            Logger logger = Logger.INSTANCE;
            Logger.e$default(logger, TAG, "Got Error Code 2, Showing Toast and closing the webview...", false, 4, (Object) null);
            if (getOffScreenLoad()) {
                Logger.d$default(logger, TAG, "Offscreen loading dont show discon view", false, 4, (Object) null);
            } else {
                NativeUtil.INSTANCE.handleDisconnection(str3, getWebViewOperationHandler());
            }
        }
    }

    public abstract void onResponseFromNative(@NotNull PGEvent pGEvent);

    public abstract void onRestart(@NotNull String str);

    public abstract void onResume(@NotNull String str);

    public void onTouch(@NotNull String str, @NotNull String str2) {
        Intrinsics.checkNotNullParameter(str, "webviewId");
        Intrinsics.checkNotNullParameter(str2, "payload");
        Logger.e$default(Logger.INSTANCE, TAG, "WebviewId : " + str + " payload: " + str2 + " onTouch not implemented for base!", false, 4, (Object) null);
    }

    public abstract void onWebviewCrashed(@NotNull String str, @NotNull String str2);

    public void onWebviewCreated(@NotNull String str) {
        Intrinsics.checkNotNullParameter(str, "webviewId");
        JSONObject jSONObject = new JSONObject();
        jSONObject.put("isSuccess", true);
        JSONObject jSONObject2 = new JSONObject();
        jSONObject2.put("webviewId", str);
        Unit unit = Unit.a;
        jSONObject.put("result", jSONObject2);
        String jSONObject3 = jSONObject.toString();
        Intrinsics.checkNotNullExpressionValue(jSONObject3, "JSONObject().apply {\n   …\n            }.toString()");
        sendMessageToClient("onWebviewLoaded", jSONObject3);
    }

    public final void sendMessageToClient(@NotNull String str, @NotNull String str2) {
        Intrinsics.checkNotNullParameter(str, "eventName");
        Intrinsics.checkNotNullParameter(str2, "payload");
        ComplexLayerCommInterface eventCommInterface = getEventCommInterface();
        if (eventCommInterface != null) {
            ComplexLayerCommInterface.DefaultImpls.onRouterResponse$default(eventCommInterface, new PGEvent(new EventInfo(str, NativeUnityCommController.TYPE, (String) null, (String) null, 12, (DefaultConstructorMarker) null), str2, new EventInfo(NativeUnityCommController.TYPE, NativeUnityCommController.TYPE, (String) null, (String) null, 12, (DefaultConstructorMarker) null)), false, true, 2, (Object) null);
        }
    }

    public void setAddCashFromRoyalEntry(boolean z) {
        this.addCashFromRoyalEntry = z;
    }

    public void setAddCashGT(boolean z) {
        this.isAddCashGT = z;
    }

    public void setBaseUrl(@NotNull String str) {
        Intrinsics.checkNotNullParameter(str, "<set-?>");
        this.baseUrl = str;
    }

    public void setCount(int i) {
        this.count = i;
    }

    public void setCtaMap(@NotNull HashMap<String, String> hashMap) {
        Intrinsics.checkNotNullParameter(hashMap, "<set-?>");
        this.ctaMap = hashMap;
    }

    public void setDlInferredUrl(@NotNull String str) {
        Intrinsics.checkNotNullParameter(str, "<set-?>");
        this.dlInferredUrl = str;
    }

    public void setDlScreenType(@NotNull String str) {
        Intrinsics.checkNotNullParameter(str, "<set-?>");
        this.dlScreenType = str;
    }

    public void setDlSource(@NotNull String str) {
        Intrinsics.checkNotNullParameter(str, "<set-?>");
        this.dlSource = str;
    }

    public void setDowntime(boolean z) {
        this.downtime = z;
    }

    public void setEventCommInterface(ComplexLayerCommInterface complexLayerCommInterface) {
        this.eventCommInterface = complexLayerCommInterface;
    }

    public void setFirstDeepLinkPage(boolean z) {
        this.isFirstDeepLinkPage = z;
    }

    public void setFirstPage(boolean z) {
        this.isFirstPage = z;
    }

    public void setGotoBaf(boolean z) {
        this.gotoBaf = z;
    }

    public void setHideHtmlScript(@NotNull String str) {
        Intrinsics.checkNotNullParameter(str, "<set-?>");
        this.hideHtmlScript = str;
    }

    public void setHidingScriptMap(@NotNull HashMap<String, String> hashMap) {
        Intrinsics.checkNotNullParameter(hashMap, "<set-?>");
        this.hidingScriptMap = hashMap;
    }

    public void setJScript(@NotNull String str) {
        Intrinsics.checkNotNullParameter(str, "<set-?>");
        this.jScript = str;
    }

    public void setLoadNewOverlayHtmlPLO(boolean z) {
        this.loadNewOverlayHtmlPLO = z;
    }

    public void setMAddCashTrace(Trace trace) {
        this.mAddCashTrace = trace;
    }

    public void setMCustomWebviewResponse(@NotNull CustomWebviewResponse customWebviewResponse) {
        Intrinsics.checkNotNullParameter(customWebviewResponse, "<set-?>");
        this.mCustomWebviewResponse = customWebviewResponse;
    }

    public void setMExtraCallbackData(@NotNull String str) {
        Intrinsics.checkNotNullParameter(str, "<set-?>");
        this.mExtraCallbackData = str;
    }

    public void setMExtraCallbackFunction(@NotNull String str) {
        Intrinsics.checkNotNullParameter(str, "<set-?>");
        this.mExtraCallbackFunction = str;
    }

    public void setMExtraCallbackObject(@NotNull String str) {
        Intrinsics.checkNotNullParameter(str, "<set-?>");
        this.mExtraCallbackObject = str;
    }

    public void setMExtraDirection(int i) {
        this.mExtraDirection = i;
    }

    public void setMMOnBoardingJourney(boolean z) {
        this.isMMOnBoardingJourney = z;
    }

    public void setMPerformanceLegoTrace(Trace trace) {
        this.mPerformanceLegoTrace = trace;
    }

    public void setMPerformanceTrace(Trace trace) {
        this.mPerformanceTrace = trace;
    }

    public void setMPurchaseInfoModel(PurchaseInfoModel purchaseInfoModel) {
        this.mPurchaseInfoModel = purchaseInfoModel;
    }

    public void setMWebViewConfiguration(@NotNull WebViewConfiguration webViewConfiguration) {
        Intrinsics.checkNotNullParameter(webViewConfiguration, "<set-?>");
        this.mWebViewConfiguration = webViewConfiguration;
    }

    public void setOffScreenLoad(boolean z) {
        this.offScreenLoad = z;
    }

    public void setPostLoginOverlayContent(@NotNull String str) {
        Intrinsics.checkNotNullParameter(str, "<set-?>");
        this.postLoginOverlayContent = str;
    }

    public void setRumbleOnBoardingJourney(boolean z) {
        this.isRumbleOnBoardingJourney = z;
    }

    public void setSideWinsJourney(boolean z) {
        this.isSideWinsJourney = z;
    }

    public void setSpinRummyJourney(boolean z) {
        this.isSpinRummyJourney = z;
    }

    public void setTutorialShown(boolean z) {
        this.isTutorialShown = z;
    }

    public void setTutorialWebview(boolean z) {
        this.isTutorialWebview = z;
    }

    public void setWebLoadUrl(@NotNull String str) {
        Intrinsics.checkNotNullParameter(str, "<set-?>");
        this.webLoadUrl = str;
    }

    public void setWebViewOperationHandler(WebviewOperation webviewOperation) {
        this.webViewOperationHandler = webviewOperation;
    }

    public void setWebviewId(@NotNull String str) {
        Intrinsics.checkNotNullParameter(str, "<set-?>");
        this.webviewId = str;
    }

    public abstract void setupCommInterface(@NotNull String str, @NotNull ComplexLayerCommInterface complexLayerCommInterface);

    public abstract void shouldInterceptRequest(@NotNull String str, @NotNull String str2);

    public abstract void shouldOverrideUrlLoading(@NotNull String str, @NotNull String str2);

    public final void stopAddCashPerformanceEvent() {
        Trace mAddCashTrace = getMAddCashTrace();
        if (mAddCashTrace != null) {
            Logger.i$default(Logger.INSTANCE, TAG, "FireBase Event " + mAddCashTrace.d + " stop " + System.currentTimeMillis(), false, 4, (Object) null);
            mAddCashTrace.stop();
        }
    }

    public final void stopLegoPerformanceEvent() {
        Logger.e$default(Logger.INSTANCE, TAG, "stopLegoPerformanceEvent :: Method called...", false, 4, (Object) null);
        Trace mPerformanceLegoTrace = getMPerformanceLegoTrace();
        if (mPerformanceLegoTrace != null) {
            mPerformanceLegoTrace.stop();
        }
    }

    public final void trackDeepLinkLandingEvent(@NotNull String str, @NotNull String str2, String str3, String str4) {
        Intrinsics.checkNotNullParameter(str, "eventId");
        Intrinsics.checkNotNullParameter(str2, "eventName");
        KrakenApplication.Companion companion = KrakenApplication.Companion;
        if (companion.getWebviewActivity() != null) {
            Activity webviewActivity = companion.getWebviewActivity();
            if ((webviewActivity != null ? webviewActivity.getIntent() : null) == null || getDlInferredUrl() == null) {
                return;
            }
            String queryParameter = Uri.parse(getDlInferredUrl()).getQueryParameter("campaign_info");
            JSONObject jSONObject = new JSONObject();
            jSONObject.put("eventUrl", "");
            jSONObject.put("eventType", "event_type_clickstream");
            JSONObject jSONObject2 = new JSONObject();
            jSONObject2.put("event", str2);
            jSONObject2.put(LoggerConstants.METADATA_LOG_ID, str);
            jSONObject2.put("url", "");
            jSONObject2.put("userId", PreferenceManager.Companion.getInstance().getUserId());
            jSONObject2.put("metadata", NativeUtil.INSTANCE.getDLMetadata(str3, str4, (String) null, getDlSource(), queryParameter, (String) null, (String) null, getDlInferredUrl(), getDlScreenType(), (String) null)).toString();
            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);
        }
    }
}