导航菜单

页面标题

页面副标题

Aisle v12.32 - CFDropSeamlessActivity.java 源代码

正在查看: Aisle v12.32 应用的 CFDropSeamlessActivity.java JAVA 源代码文件

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


package com.cashfree.pg.ui.hidden.seamless;

import F5.k;
import H5.b;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Color;
import android.graphics.PorterDuff;
import android.os.Build;
import android.os.Bundle;
import android.widget.ProgressBar;
import androidx.appcompat.app.q;
import androidx.coordinatorlayout.widget.CoordinatorLayout;
import com.cashfree.pg.core.api.CFCorePaymentGatewayService;
import com.cashfree.pg.core.api.CFTheme;
import com.cashfree.pg.core.api.base.CFPayment;
import com.cashfree.pg.core.api.exception.CFException;
import com.cashfree.pg.core.api.ui.PaymentInitiationData;
import com.cashfree.pg.core.api.utils.CFErrorResponse;
import com.cashfree.pg.core.api.utils.CFUPIUtil;
import com.cashfree.pg.core.api.utils.CFUtil;
import com.cashfree.pg.core.api.utils.ThreadUtil;
import com.cashfree.pg.core.hidden.network.response.models.ConfigResponse;
import com.cashfree.pg.core.hidden.network.response.models.config.MerchantInfo;
import com.cashfree.pg.core.hidden.network.response.models.config.OrderDetails;
import com.cashfree.pg.core.hidden.utils.CFPaymentModes;
import com.cashfree.pg.network.h;
import com.cashfree.pg.network.j;
import com.cashfree.pg.ui.api.CFDropCheckoutPayment;
import com.cashfree.pg.ui.hidden.seamless.CFDropSeamlessActivity;
import java.util.ArrayList;
import java.util.List;
import p5.d;
import p5.e;
import r5.b;
import s5.C1057d;
import s5.EnumC1058e;

public class CFDropSeamlessActivity extends b implements k.b, b.c, b.d {
    private H5.b b;
    private ArrayList d;
    private k e;
    private CoordinatorLayout f;
    private OrderDetails p;
    private MerchantInfo q;
    private CFTheme r;
    private List s;
    private List t;
    private boolean c = false;
    private boolean i = true;
    private final E5.a o = new a();

    class a extends E5.a {
        a() {
        }

        public static void a(a aVar, CFErrorResponse cFErrorResponse) {
            CFDropSeamlessActivity.this.e0();
            CFDropSeamlessActivity.this.d0(cFErrorResponse);
        }

        @Override
        public void onPaymentFailure(final CFErrorResponse cFErrorResponse, String str) {
            ThreadUtil.runOnUIThread(new Runnable() {
                @Override
                public final void run() {
                    CFDropSeamlessActivity.a.a(CFDropSeamlessActivity.a.this, cFErrorResponse);
                }
            });
        }

        @Override
        public void onPaymentVerify(String str) {
            CFDropSeamlessActivity.this.h0(str);
        }

        @Override
        public void onQRFetched(String str) {
        }
    }

    public static void V(CFDropSeamlessActivity cFDropSeamlessActivity, CFPayment cFPayment) {
        cFDropSeamlessActivity.getClass();
        try {
            cFDropSeamlessActivity.j0();
            CFCorePaymentGatewayService.getInstance().doPayment(cFDropSeamlessActivity, cFPayment);
        } catch (CFException e) {
            e.printStackTrace();
        }
    }

    public static void Y(final CFDropSeamlessActivity cFDropSeamlessActivity, ArrayList arrayList) {
        cFDropSeamlessActivity.d = arrayList;
        ThreadUtil.runOnUIThread(new Runnable() {
            @Override
            public final void run() {
                CFDropSeamlessActivity.this.k0();
            }
        });
    }

    public static void Z(CFDropSeamlessActivity cFDropSeamlessActivity, DialogInterface dialogInterface) {
        cFDropSeamlessActivity.getClass();
        cFDropSeamlessActivity.g0(CFUtil.getResponseFromError(CFUtil.getCancelledResponse()));
    }

    private void c0(CFUPIUtil.UPIAppsCallback uPIAppsCallback) {
        CFUPIUtil.getInstalledUPIApps(this, uPIAppsCallback);
    }

    public void d0(CFErrorResponse cFErrorResponse) {
        g0(cFErrorResponse);
    }

    private void f0() {
        q qVar = this.e;
        if (qVar == null || !qVar.isShowing()) {
            return;
        }
        this.e.dismiss();
    }

    private void g0(final CFErrorResponse cFErrorResponse) {
        finish();
        if (this.c) {
            return;
        }
        this.c = true;
        final String i = this.b.i();
        if (i != null) {
            ThreadUtil.runOnUIThread(new Runnable() {
                @Override
                public final void run() {
                    C1057d.e().publishEvent(new C1057d.b(EnumC1058e.onFailure, i, cFErrorResponse));
                }
            });
        }
    }

    public void h0(final String str) {
        finish();
        if (this.c) {
            return;
        }
        this.c = true;
        if (str != null) {
            ThreadUtil.runOnUIThread(new Runnable() {
                @Override
                public final void run() {
                    C1057d.e().publishEvent(new C1057d.b(EnumC1058e.onVerify, str, null));
                }
            });
        }
    }

    private void i0() {
        ((ProgressBar) findViewById(d.K0)).getIndeterminateDrawable().setColorFilter(Color.parseColor(this.r.getNavigationBarBackgroundColor()), PorterDuff.Mode.MULTIPLY);
    }

    public void k0() {
        if (isDestroyed()) {
            return;
        }
        e0();
        f0();
        ?? kVar = new k(this, this.d, this.s, this.t, this.p, this.q, this.r, this);
        this.e = kVar;
        kVar.setOnCancelListener(new DialogInterface.OnCancelListener() {
            @Override
            public final void onCancel(DialogInterface dialogInterface) {
                CFDropSeamlessActivity.Z(CFDropSeamlessActivity.this, dialogInterface);
            }
        });
        this.e.show();
    }

    private void l0() {
        if (this.d == null) {
            c0(new CFUPIUtil.UPIAppsCallback() {
                @Override
                public final void onUPIAppsFetched(ArrayList arrayList) {
                    CFDropSeamlessActivity.Y(CFDropSeamlessActivity.this, arrayList);
                }
            });
        } else {
            k0();
        }
    }

    @Override
    protected H5.a Q() {
        return this.b;
    }

    @Override
    public void b(PaymentInitiationData paymentInitiationData) {
        this.b.f(paymentInitiationData);
    }

    @Override
    public void e(CFErrorResponse cFErrorResponse) {
        g0(cFErrorResponse);
    }

    public void e0() {
        runOnUiThread(new Runnable() {
            @Override
            public final void run() {
                CFDropSeamlessActivity.this.f.setVisibility(8);
            }
        });
    }

    public void j0() {
        runOnUiThread(new Runnable() {
            @Override
            public final void run() {
                CFDropSeamlessActivity.this.f.setVisibility(0);
            }
        });
    }

    @Override
    public void k(final CFPayment cFPayment) {
        ThreadUtil.runOnUIThread(new Runnable() {
            @Override
            public final void run() {
                CFDropSeamlessActivity.V(CFDropSeamlessActivity.this, cFPayment);
            }
        });
    }

    @Override
    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(e.b);
        CFCorePaymentGatewayService.getInstance().setCheckoutCallback(this.o);
        CFCorePaymentGatewayService.getInstance().setQRCallback(this.o);
        this.f = findViewById(d.z);
        this.b = new H5.b(new h() {
            @Override
            public final boolean isNetworkConnected() {
                boolean a2;
                a2 = j.a(CFDropSeamlessActivity.this.getApplicationContext());
                return a2;
            }
        }, this, this);
        if (Build.VERSION.SDK_INT != 26) {
            setRequestedOrientation(1);
        }
        this.r = this.b.k();
        i0();
        j0();
        this.b.g();
    }

    protected void onNewIntent(Intent intent) {
        super/*androidx.activity.ComponentActivity*/.onNewIntent(intent);
    }

    @Override
    protected void onResume() {
        super.onResume();
        if (this.i) {
            this.i = false;
        } else {
            this.b.j();
        }
    }

    @Override
    public void t(ConfigResponse configResponse, List list, CFDropCheckoutPayment cFDropCheckoutPayment) {
        this.p = configResponse.getOrderDetails();
        this.q = configResponse.getMerchantInfo();
        this.s = configResponse.getFeatureConfig().getPaymentModeConfig().getUpiPriorityApps();
        this.t = configResponse.getFeatureConfig().getPaymentModeConfig().getUpiBlacklistedApps();
        if (list.contains(CFPaymentModes.UPI)) {
            l0();
        } else {
            g0(CFUtil.getResponseFromError(CFUtil.getFailedResponse("UPI is not enabled for this order.")));
        }
    }
}