导航菜单

页面标题

页面副标题

RummyCircle v11000.89 - PhonePe.java 源代码

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

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


package com.phonepe.intent.sdk.api;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Parcelable;
import androidx.annotation.NonNull;
import androidx.camera.camera2.internal.X0;
import androidx.camera.camera2.internal.Y0;
import androidx.camera.core.impl.b0;
import chmha.c;
import chmha.f;
import com.phonepe.intent.sdk.api.UserValidityStatus;
import com.phonepe.intent.sdk.api.models.PhonePeEnvironment;
import com.phonepe.intent.sdk.api.models.SDKType;
import com.phonepe.intent.sdk.bridges.BridgeHandler;
import com.phonepe.intent.sdk.contracts.DeviceIdListener;
import com.phonepe.intent.sdk.ui.OpenIntentTransactionActivity;
import com.phonepe.intent.sdk.ui.TransactionActivity;
import com.phonepe.intent.sdk.ui.UpiAppsSelectionDialogActivity;
import com.phonepe.intent.sdk.ui.b2bPg.B2bPgActivity;
import fffzd.a;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicBoolean;
import kotlin.Pair;
import kotlin.collections.H;
import kotlin.collections.I;
import kotlin.jvm.internal.Intrinsics;
import krrvc.d;
import npzhg.q;
import org.json.JSONException;
import org.json.JSONObject;
import uauho.e;
import uauho.h;
import uauho.j;
import uauho.k;
import wlgrx.l;
import wlgrx.n;
import wlgrx.o;
import wlgrx.p;

public class PhonePe {

    public class irjuc implements CheckPhonePeAvailabilityInternalCallback {
        public final CheckPhonePeAvailabilityCallback cqqlq;
        public final AtomicBoolean irjuc;

        public irjuc(AtomicBoolean atomicBoolean, CheckPhonePeAvailabilityCallback checkPhonePeAvailabilityCallback) {
            this.irjuc = atomicBoolean;
            this.cqqlq = checkPhonePeAvailabilityCallback;
        }

        @Override
        public final void onFailure(boolean z, @NonNull String str) {
            Intrinsics.checkNotNullParameter("CHECK_AVAILABILITY_API_CALL_FAILURE", "eventName");
            try {
                c c = f.c().c(c.class);
                c.a(c.e("CHECK_AVAILABILITY_API_CALL_FAILURE"));
            } catch (Exception e) {
                Intrinsics.checkNotNullParameter("EventDebug", "tag");
                Intrinsics.checkNotNullParameter("error in send event", BridgeHandler.MESSAGE);
                jmjou.a.a.c("EventDebug", "error in send event", e);
            }
            PhonePe.irjuc(true, "SUCCESS", this.irjuc, this.cqqlq);
        }

        @Override
        public final void onSuccess(boolean z, @NonNull String str) {
            Intrinsics.checkNotNullParameter("CHECK_AVAILABILITY_API_CALL_SUCCESS", "eventName");
            try {
                c c = f.c().c(c.class);
                c.a(c.e("CHECK_AVAILABILITY_API_CALL_SUCCESS"));
            } catch (Exception e) {
                Intrinsics.checkNotNullParameter("EventDebug", "tag");
                Intrinsics.checkNotNullParameter("error in send event", BridgeHandler.MESSAGE);
                jmjou.a.a.c("EventDebug", "error in send event", e);
            }
            PhonePe.irjuc(z, str, this.irjuc, this.cqqlq);
        }
    }

    @MerchantAPI
    public static void checkAvailability(AvailabilityCheckRequest availabilityCheckRequest, CheckPhonePeAvailabilityCallback checkPhonePeAvailabilityCallback) throws PhonePeInitException {
        String str;
        HashMap hashMap = new HashMap();
        hashMap.put("merchantRequest", availabilityCheckRequest.toString());
        uauho.b.c(k.k, hashMap);
        AtomicBoolean atomicBoolean = new AtomicBoolean(false);
        if (!f.a(f.c())) {
            if (!e.g(chmha.a.a, e.b(f.c()))) {
                str = "PHONEPE_APP_NOT_INSTALLED";
            } else if (f.g(f.c(), e.b(f.c()))) {
                l c = f.c().c(l.class);
                boolean z = c.a.b().getBoolean("availability_check_enabled", true);
                long longValue = Long.valueOf(c.a.b().getLong("availability_check_timeout_ms", 5000L)).longValue();
                if (z) {
                    irjuc(atomicBoolean, longValue, availabilityCheckRequest, checkPhonePeAvailabilityCallback);
                    return;
                }
            } else {
                str = "UPI_NOT_REGISTERED";
            }
            irjuc(false, str, atomicBoolean, checkPhonePeAvailabilityCallback);
            return;
        }
        irjuc(true, "SUCCESS", atomicBoolean, checkPhonePeAvailabilityCallback);
    }

    public static void cqqlq(boolean z, ShowPhonePeCallback showPhonePeCallback, boolean z2) {
        Map f = I.f(new Pair[]{new Pair("show", String.valueOf(Boolean.valueOf(z))), new Pair("isRegistered", String.valueOf(Boolean.valueOf(z2)))});
        Intrinsics.checkNotNullParameter("IS_UPI_ACC_REG_SDK_RESULT_SENT", "eventName");
        try {
            c c = f.c().c(c.class);
            n e = c.e("IS_UPI_ACC_REG_SDK_RESULT_SENT");
            for (Map.Entry entry : f.entrySet()) {
                e.b(entry.getValue(), (String) entry.getKey());
            }
            c.a(e);
        } catch (Exception e2) {
            Intrinsics.checkNotNullParameter("EventDebug", "tag");
            Intrinsics.checkNotNullParameter("error in send event", BridgeHandler.MESSAGE);
            jmjou.a.a.c("EventDebug", "error in send event", e2);
        }
        showPhonePeCallback.onResponse(z2 && z);
    }

    @MerchantAPI
    public static void getDeviceId(Context context, DeviceIdListener deviceIdListener) throws PhonePeInitException {
        f.c().c(j.class).b(true, deviceIdListener);
    }

    @MerchantAPI
    public static Intent getImplicitIntent(Context context, @NonNull B2BPGRequest b2BPGRequest, String str) throws PhonePeInitException {
        HashMap hashMap = new HashMap();
        hashMap.put("merchantRequest", b2BPGRequest.toString());
        uauho.b.c(k.e, hashMap);
        o c = f.c().c(o.class);
        Parcelable c2 = f.c();
        Bundle bundle = new Bundle();
        bundle.putParcelable("data_factory", c2);
        bundle.putParcelable("request", b2BPGRequest);
        bundle.putParcelable("sdk_context", c);
        bundle.putString("openIntentWithApp", str);
        bundle.putString("KEY_B2B_PG_FLOW", "V1");
        f.c();
        Intent intent = new Intent(context, (Class<?>) B2bPgActivity.class);
        intent.putExtras(bundle);
        return intent;
    }

    @MerchantAPI
    public static String getPackageSignature() throws PhonePeInitException {
        f.c();
        return chmha.a.f();
    }

    @MerchantAPI
    public static long getPhonePeAppVersionCode() throws PhonePeInitException {
        return e.a(f.c(), e.b(f.c()));
    }

    @MerchantAPI
    public static String getSDKVersion() {
        return "3.0.0";
    }

    @MerchantAPI
    public static Intent getTransactionIntent(@NonNull TransactionRequest transactionRequest) throws PhonePeInitException {
        HashMap hashMap = new HashMap();
        hashMap.put("merchantRequest", transactionRequest.toString());
        uauho.b.c(k.b, hashMap);
        f.c();
        Context context = chmha.a.a;
        Parcelable c = f.c();
        int i = TransactionActivity.k;
        o c2 = c.c(o.class);
        Bundle bundle = new Bundle();
        bundle.putParcelable("data_factory", c);
        bundle.putParcelable("request", transactionRequest);
        bundle.putParcelable("sdk_context", c2);
        Intent intent = new Intent(context, (Class<?>) TransactionActivity.class);
        intent.putExtras(bundle);
        return intent;
    }

    public static List<UPIApplicationInfo> getUpiApps() throws PhonePeInitException {
        uauho.b.c(k.m, (Map) null);
        return f.e(f.c());
    }

    @MerchantAPI
    public static boolean init(@NonNull Context context, @NonNull PhonePeEnvironment phonePeEnvironment, @NonNull String str, String str2) {
        return PhonePeKt.init(context, str, phonePeEnvironment, false, str2);
    }

    public static void irjuc(ShouldShowMandateCallback shouldShowMandateCallback, String str) {
        boolean z;
        if (shouldShowMandateCallback != null) {
            if (str == null || str.isEmpty()) {
                jmjou.a.c("PhonePe", "result is null or empty");
                z = true;
            } else {
                try {
                    ShouldShowMandateCallbackResult irjuc2 = irjuc(new JSONObject(str));
                    jmjou.a.c("PhonePe", "sending result " + irjuc2);
                    irjuc(irjuc2.isSingleMandateSupported(), irjuc2.isRecurringMandateSupported(), shouldShowMandateCallback);
                    return;
                } catch (Exception e) {
                    jmjou.a.a("PhonePe", "error while reading app response" + e.getMessage());
                    uauho.b.b(e.getMessage());
                    z = false;
                }
            }
            irjuc(z, z, shouldShowMandateCallback);
        }
    }

    @MerchantAPI
    public static boolean isGooglePayAppInstalled(boolean z) throws PhonePeInitException {
        if (!z) {
            chmha.a c = f.c();
            Context context = chmha.a.a;
            c.c(h.class).getClass();
            return e.g(context, "com.google.android.apps.nbu.paisa.user");
        }
        chmha.a c2 = f.c();
        Context context2 = chmha.a.a;
        c2.c(h.class).getClass();
        if (e.g(context2, "com.google.android.apps.nbu.paisa.user")) {
            chmha.a c3 = f.c();
            f.c().c(h.class).getClass();
            if (f.g(c3, "com.google.android.apps.nbu.paisa.user")) {
                return true;
            }
        }
        return false;
    }

    @MerchantAPI
    public static void isMandateSupported(ShouldShowMandateCallback shouldShowMandateCallback) throws PhonePeInitException {
        Intrinsics.checkNotNullParameter("PhonePe", "tag");
        Intrinsics.checkNotNullParameter("isMandateSupported started", BridgeHandler.MESSAGE);
        jmjou.a.b("PhonePe", "isMandateSupported started");
        uauho.b.c(k.j, (Map) null);
        if (f.a(f.c())) {
            irjuc(true, true, shouldShowMandateCallback);
            return;
        }
        if (e.g(chmha.a.a, e.b(f.c()))) {
            f.f(f.c(), new a.c(f.c()), new X0(shouldShowMandateCallback, 8));
            return;
        }
        Intrinsics.checkNotNullParameter("PhonePe", "tag");
        Intrinsics.checkNotNullParameter("app is not installed", BridgeHandler.MESSAGE);
        jmjou.a.b("PhonePe", "app is not installed");
        uauho.b.a();
        irjuc(false, false, shouldShowMandateCallback);
    }

    @MerchantAPI
    public static boolean isPayTMAppInstalled(boolean z) throws PhonePeInitException {
        if (!z) {
            chmha.a c = f.c();
            Context context = chmha.a.a;
            c.c(h.class).getClass();
            return e.g(context, "net.one97.paytm");
        }
        chmha.a c2 = f.c();
        Context context2 = chmha.a.a;
        c2.c(h.class).getClass();
        if (e.g(context2, "net.one97.paytm")) {
            chmha.a c3 = f.c();
            f.c().c(h.class).getClass();
            if (f.g(c3, "net.one97.paytm")) {
                return true;
            }
        }
        return false;
    }

    @MerchantAPI
    public static boolean isPhonePeAppInstalled(boolean z) throws PhonePeInitException {
        if (z) {
            return e.g(chmha.a.a, e.b(f.c())) && f.g(f.c(), e.b(f.c()));
        }
        return e.g(chmha.a.a, e.b(f.c()));
    }

    @MerchantAPI
    public static void isUPIAccountRegistered(final ShowPhonePeCallback showPhonePeCallback) throws PhonePeInitException {
        uauho.b.c(k.i, new HashMap());
        if (f.a(f.c())) {
            cqqlq(true, showPhonePeCallback, true);
            return;
        }
        if (!e.g(chmha.a.a, e.b(f.c()))) {
            uauho.b.a();
            cqqlq(false, showPhonePeCallback, false);
            return;
        }
        final boolean g = f.g(f.c(), e.b(f.c()));
        if (f.c().c(l.class).a.b().getBoolean("sdk_config_is_should_show_enabled", true)) {
            irjuc(new ShowPhonePeCallback() {
                @Override
                public final void onResponse(boolean z) {
                    PhonePe.irjuc(g, showPhonePeCallback, z);
                }
            });
        } else {
            cqqlq(true, showPhonePeCallback, g);
        }
    }

    @MerchantAPI
    public static void setAdditionalInfo(SDKType sDKType) {
        f fVar = f.a;
        Intrinsics.checkNotNullParameter(sDKType, "<set-?>");
        f.c = sDKType;
    }

    @MerchantAPI
    public static void setFlowId(String str) throws PhonePeInitException {
        if (str != null) {
            String concat = " setting new flow ID : ".concat(str);
            Intrinsics.checkNotNullParameter("PhonePe", "tag");
            Intrinsics.checkNotNullParameter(concat, BridgeHandler.MESSAGE);
            jmjou.a.b("PhonePe", concat);
            f.b(f.c(), str);
        }
    }

    @MerchantAPI
    public static void validateUser(String str, UserValidityCallback userValidityCallback) throws PhonePeInitException {
        uauho.b.c(k.l, androidx.camera.core.impl.utils.f.h("mobileNumber", str));
        if (f.a(f.c())) {
            irjuc(UserValidityStatus.Companion.getValidityStatus(true), userValidityCallback);
            return;
        }
        try {
            chmha.a c = f.c();
            chmha.a c2 = f.c();
            byte[] digest = MessageDigest.getInstance("SHA-256").digest(str.getBytes(StandardCharsets.UTF_8));
            StringBuilder sb = new StringBuilder();
            for (byte b : digest) {
                String hexString = Integer.toHexString(b & 255);
                if (hexString.length() == 1) {
                    sb.append('0');
                }
                sb.append(hexString);
            }
            f.f(c, new a.a(c2, sb.toString()), new b0(userValidityCallback, 6));
        } catch (Exception e) {
            uauho.b.b(e.getMessage());
            irjuc(UserValidityStatus.Companion.getValidityStatus(false), userValidityCallback);
        }
    }

    @MerchantAPI
    public boolean isInUATMode() {
        try {
            f.c();
            return e.h((Boolean) chmha.a.e("com.phonepe.android.sdk.isUAT"));
        } catch (PhonePeInitException e) {
            String str = "error in isInUATMode : " + e.getMessage();
            Intrinsics.checkNotNullParameter("PhonePe", "tag");
            Intrinsics.checkNotNullParameter(str, BridgeHandler.MESSAGE);
            jmjou.a.a.c("PhonePe", str, e);
            return false;
        }
    }

    public static void irjuc(ShowPhonePeCallback showPhonePeCallback, String str) {
        if (showPhonePeCallback != null) {
            if (str != null && !str.isEmpty()) {
                try {
                    showPhonePeCallback.onResponse(new JSONObject(str).optBoolean("result", true));
                    return;
                } catch (Exception e) {
                    uauho.b.b(e.getMessage());
                }
            }
            showPhonePeCallback.onResponse(true);
        }
    }

    public static void irjuc(UserValidityCallback userValidityCallback, String str) {
        UserValidityStatus.Companion companion;
        boolean z;
        if (str == null || str.isEmpty()) {
            companion = UserValidityStatus.Companion;
            z = true;
        } else {
            try {
                irjuc(UserValidityStatus.Companion.getValidityStatus(new JSONObject(str).optBoolean("isPhoneNumberValid")), userValidityCallback);
                return;
            } catch (JSONException unused) {
                companion = UserValidityStatus.Companion;
                z = false;
            }
        }
        irjuc(companion.getValidityStatus(z), userValidityCallback);
    }

    public static void irjuc(boolean z, ShowPhonePeCallback showPhonePeCallback, boolean z2) {
        try {
            cqqlq(z2, showPhonePeCallback, z);
        } catch (Exception e) {
            uauho.b.b(e.getMessage());
            cqqlq(false, showPhonePeCallback, false);
        }
    }

    public static void irjuc(boolean z, AtomicBoolean atomicBoolean, long j, Long l, CheckPhonePeAvailabilityCallback checkPhonePeAvailabilityCallback) {
        Long valueOf = Long.valueOf(System.currentTimeMillis());
        if (z && Looper.myLooper() != null && Looper.myLooper() != Looper.getMainLooper()) {
            Looper.myLooper().quit();
        }
        if (atomicBoolean.get()) {
            return;
        }
        Map f = I.f(new Pair[]{new Pair("checkAvailabilityTimeoutMs", Long.valueOf(j)), new Pair("timeTakenMs", Long.valueOf(valueOf.longValue() - l.longValue()))});
        Intrinsics.checkNotNullParameter("CHECK_AVAILABILITY_API_CALL_TIMED_OUT", "eventName");
        try {
            c c = f.c().c(c.class);
            n e = c.e("CHECK_AVAILABILITY_API_CALL_TIMED_OUT");
            for (Map.Entry entry : f.entrySet()) {
                e.b(entry.getValue(), (String) entry.getKey());
            }
            c.a(e);
        } catch (Exception e2) {
            Intrinsics.checkNotNullParameter("EventDebug", "tag");
            Intrinsics.checkNotNullParameter("error in send event", BridgeHandler.MESSAGE);
            jmjou.a.a.c("EventDebug", "error in send event", e2);
        }
        irjuc(true, "SUCCESS", atomicBoolean, checkPhonePeAvailabilityCallback);
    }

    @MerchantAPI
    public static Intent getImplicitIntent(Context context, @NonNull TransactionRequest transactionRequest) throws PhonePeInitException {
        HashMap hashMap = new HashMap();
        hashMap.put("merchantRequest", transactionRequest.toString());
        uauho.b.c(k.c, hashMap);
        Parcelable c = f.c();
        int i = TransactionActivity.k;
        o c2 = c.c(o.class);
        Bundle bundle = new Bundle();
        bundle.putParcelable("data_factory", c);
        bundle.putParcelable("request", transactionRequest);
        bundle.putParcelable("sdk_context", c2);
        Intent intent = new Intent(context, (Class<?>) UpiAppsSelectionDialogActivity.class);
        intent.putExtras(bundle);
        return intent;
    }

    public static void irjuc(boolean z, String str, AtomicBoolean atomicBoolean, CheckPhonePeAvailabilityCallback checkPhonePeAvailabilityCallback) {
        if (atomicBoolean.get()) {
            return;
        }
        atomicBoolean.set(true);
        Intrinsics.checkNotNullParameter(str, "responseCode");
        Map f = I.f(new Pair[]{new Pair("checkAvailabilityFinalResponse", Boolean.valueOf(z)), new Pair("checkAvailabilityFinalResponseCode", str)});
        Intrinsics.checkNotNullParameter("CHECK_AVAILABILITY_SDK_FINAL_RESPONSE_SENT", "eventName");
        try {
            c c = f.c().c(c.class);
            n e = c.e("CHECK_AVAILABILITY_SDK_FINAL_RESPONSE_SENT");
            for (Map.Entry entry : f.entrySet()) {
                e.b(entry.getValue(), (String) entry.getKey());
            }
            c.a(e);
        } catch (Exception e2) {
            Intrinsics.checkNotNullParameter("EventDebug", "tag");
            Intrinsics.checkNotNullParameter("error in send event", BridgeHandler.MESSAGE);
            jmjou.a.a.c("EventDebug", "error in send event", e2);
        }
        checkPhonePeAvailabilityCallback.onResponse(z, str);
    }

    @MerchantAPI
    public static Intent getImplicitIntent(Context context, @NonNull TransactionRequest transactionRequest, String str) throws PhonePeInitException {
        HashMap hashMap = new HashMap();
        hashMap.put("merchantRequest", transactionRequest.toString());
        hashMap.put("openIntentWithApp", str);
        uauho.b.c(k.d, hashMap);
        if (e.g(context, str)) {
            Parcelable c = f.c();
            String str2 = OpenIntentTransactionActivity.i;
            o c2 = c.c(o.class);
            Bundle bundle = new Bundle();
            bundle.putParcelable("data_factory", c);
            bundle.putParcelable("request", transactionRequest);
            bundle.putParcelable("sdk_context", c2);
            bundle.putString("openIntentWithApp", str);
            Intent intent = new Intent(context, (Class<?>) OpenIntentTransactionActivity.class);
            intent.putExtras(bundle);
            return intent;
        }
        uauho.b.a();
        throw new PhonePeInitException("App is not installed on user's device");
    }

    public static void irjuc(boolean z, boolean z2, ShouldShowMandateCallback shouldShowMandateCallback) {
        Map f = I.f(new Pair[]{new Pair("isSingleMandateSupported", String.valueOf(z)), new Pair("isRecurringMandateSupported", String.valueOf(z2))});
        Intrinsics.checkNotNullParameter("IS_MANDATE_SUPPORTED_SDK_RESULT_SENT", "eventName");
        try {
            c c = f.c().c(c.class);
            n e = c.e("IS_MANDATE_SUPPORTED_SDK_RESULT_SENT");
            for (Map.Entry entry : f.entrySet()) {
                e.b(entry.getValue(), (String) entry.getKey());
            }
            c.a(e);
        } catch (Exception e2) {
            Intrinsics.checkNotNullParameter("EventDebug", "tag");
            Intrinsics.checkNotNullParameter("error in send event", BridgeHandler.MESSAGE);
            jmjou.a.a.c("EventDebug", "error in send event", e2);
        }
        shouldShowMandateCallback.onResponse(new ShouldShowMandateCallbackResult(z, z2));
    }

    @MerchantAPI
    public static Intent getImplicitIntent(Context context, @NonNull String str, String str2) throws PhonePeInitException {
        HashMap hashMap = new HashMap();
        hashMap.put("merchantRequest", str);
        hashMap.put("packageName", str2);
        uauho.b.c(k.f, hashMap);
        o c = f.c().c(o.class);
        Parcelable c2 = f.c();
        Bundle bundle = new Bundle();
        bundle.putParcelable("data_factory", c2);
        bundle.putParcelable("request", null);
        bundle.putParcelable("sdk_context", c);
        bundle.putString("openIntentWithApp", str2);
        bundle.putString("KEY_B2B_PG_FLOW", "V1");
        f.c();
        Intent intent = new Intent(context, (Class<?>) B2bPgActivity.class);
        intent.putExtras(bundle);
        intent.putExtra("B2B_PG_Response", str);
        return intent;
    }

    public static void irjuc(String str, UserValidityCallback userValidityCallback) {
        Intrinsics.checkNotNullParameter(str, "userStatus");
        Map b = H.b(new Pair("result", str));
        Intrinsics.checkNotNullParameter("VALIDATE_USER_SDK_RESULT_SENT", "eventName");
        try {
            c c = f.c().c(c.class);
            n e = c.e("VALIDATE_USER_SDK_RESULT_SENT");
            if (b != null) {
                for (Map.Entry entry : b.entrySet()) {
                    e.b(entry.getValue(), (String) entry.getKey());
                }
            }
            c.a(e);
        } catch (Exception e2) {
            Intrinsics.checkNotNullParameter("EventDebug", "tag");
            Intrinsics.checkNotNullParameter("error in send event", BridgeHandler.MESSAGE);
            jmjou.a.a.c("EventDebug", "error in send event", e2);
        }
        userValidityCallback.onResponse(str);
    }

    public static void irjuc(ShowPhonePeCallback showPhonePeCallback) throws PhonePeInitException {
        if (e.g(chmha.a.a, e.b(f.c()))) {
            f.f(f.c(), new a.b(f.c()), new Y0(showPhonePeCallback, 8));
        } else {
            uauho.b.a();
            showPhonePeCallback.onResponse(false);
        }
    }

    public static ShouldShowMandateCallbackResult irjuc(JSONObject jSONObject) {
        String str = "json result from app for should show mandate : " + jSONObject.toString();
        Intrinsics.checkNotNullParameter("PhonePe", "tag");
        Intrinsics.checkNotNullParameter(str, BridgeHandler.MESSAGE);
        jmjou.a.b("PhonePe", str);
        return (jSONObject.optBoolean("loggedIn", false) && jSONObject.optBoolean("linkedUpiBankAccount", false)) ? new ShouldShowMandateCallbackResult(jSONObject.optBoolean("singleMandateSupportedAccountAvailable", false), jSONObject.optBoolean("recurringMandateSupportedAccountAvailable", false)) : new ShouldShowMandateCallbackResult(false, false);
    }

    public static void irjuc(final AtomicBoolean atomicBoolean, final long j, AvailabilityCheckRequest availabilityCheckRequest, final CheckPhonePeAvailabilityCallback checkPhonePeAvailabilityCallback) {
        boolean z;
        o oVar;
        final Long valueOf = Long.valueOf(System.currentTimeMillis());
        if (Looper.myLooper() == null) {
            Looper.prepare();
            z = true;
        } else {
            z = false;
        }
        final boolean z2 = z;
        new Handler(Looper.myLooper()).postDelayed(new Runnable() {
            @Override
            public final void run() {
                PhonePe.irjuc(z2, atomicBoolean, j, valueOf, checkPhonePeAvailabilityCallback);
            }
        }, j);
        Intrinsics.checkNotNullParameter("CHECK_AVAILABILITY_API_CALL_STARTED", "eventName");
        try {
            c c = f.c().c(c.class);
            c.a(c.e("CHECK_AVAILABILITY_API_CALL_STARTED"));
        } catch (Exception e) {
            Intrinsics.checkNotNullParameter("EventDebug", "tag");
            Intrinsics.checkNotNullParameter("error in send event", BridgeHandler.MESSAGE);
            jmjou.a.a.c("EventDebug", "error in send event", e);
        }
        irjuc irjucVar = new irjuc(atomicBoolean, checkPhonePeAvailabilityCallback);
        Intrinsics.checkNotNullParameter(availabilityCheckRequest, "availabilityCheckRequest");
        Intrinsics.checkNotNullParameter(irjucVar, "callback");
        d c2 = f.c().c(d.class);
        p pVar = null;
        try {
            oVar = f.c().c(o.class);
        } catch (PhonePeInitException unused) {
            oVar = null;
        }
        try {
            pVar = (gvumm.d) f.c().c(gvumm.d.class);
        } catch (PhonePeInitException unused2) {
        }
        npzhg.a aVar = new npzhg.a(irjucVar);
        c2.a.getClass();
        boolean h = e.h((Boolean) chmha.a.e("com.phonepe.android.sdk.isUAT"));
        StringBuilder sb = new StringBuilder();
        HashSet hashSet = q.a;
        String j2 = android.support.v4.media.a.j(sb, (h ? q.a.b : q.a.c).a, "/v3/availabilitycheck");
        gvumm.b c3 = c2.a.c(gvumm.b.class);
        String data = availabilityCheckRequest.getData();
        if (data == null) {
            c3.getClass();
        } else {
            c3.put("request", data);
        }
        if (oVar != null) {
            c3.put("sdkContext", oVar.toJsonObject());
        }
        if (pVar != null) {
            c3.put("phonePeContext", pVar.toJsonObject());
        }
        npzhg.d.a(c2.a, availabilityCheckRequest.getHeaderMap(), new krrvc.c(c2, j2, c3.toJsonString(), aVar));
        if (z) {
            Looper.loop();
        }
    }
}