导航菜单

页面标题

页面副标题

Crafto v9.3.3 - CFDropSeamlessActivity.java 源代码

正在查看: Crafto v9.3.3 应用的 CFDropSeamlessActivity.java JAVA 源代码文件

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


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

import A8.R0;
import K8.w;
import T6.d;
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.coordinatorlayout.widget.CoordinatorLayout;
import c7.h;
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.utils.CFErrorResponse;
import com.cashfree.pg.core.api.utils.CFUPIApp;
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.StaticConfigResponse;
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.ui.api.CFDropCheckoutPayment;
import com.cashfree.pg.ui.hidden.activity.base.BaseActivity;
import com.cashfree.pg.ui.hidden.viewModel.CFDropSeamlessViewModel;
import com.stripe.android.camera.scanui.CameraView;
import java.util.ArrayList;
import java.util.List;

public class CFDropSeamlessActivity extends BaseActivity implements h.b, CFDropSeamlessViewModel.a, CFDropSeamlessViewModel.DropSeamlessCallbacks {

    public static final int f20859o = 0;

    public CFDropSeamlessViewModel f20860b;
    public ArrayList<CFUPIApp> d;

    public c7.h f20862e;

    public CoordinatorLayout f20863f;

    public List<CFPaymentModes> f20866i;

    public OrderDetails f20867j;

    public MerchantInfo f20868k;

    public CFTheme f20869l;

    public String[] f20870m;

    public String[] f20871n;

    public boolean f20861c = false;

    public boolean f20864g = true;

    public final b7.a f20865h = new AnonymousClass1();

    @Override
    public final Dl.a G() {
        return this.f20860b;
    }

    public final void H(ConfigResponse configResponse, StaticConfigResponse staticConfigResponse, List list) {
        this.f20866i = list;
        this.f20867j = configResponse.getOrderDetails();
        this.f20868k = configResponse.getMerchantInfo();
        if (staticConfigResponse != null) {
            this.f20870m = staticConfigResponse.getOrderedUPIAppList();
            this.f20871n = staticConfigResponse.getBlacklistedUPIAppList();
        }
        if (!list.contains(CFPaymentModes.UPI)) {
            I(CFUtil.getResponseFromError(CFUtil.getFailedResponse("UPI is not enabled for this order.")));
        } else if (this.d == null) {
            CFUPIUtil.getInstalledUPIApps(this, new e(this));
        } else {
            J();
        }
    }

    public final void I(final CFErrorResponse cFErrorResponse) {
        finish();
        if (this.f20861c) {
            return;
        }
        this.f20861c = true;
        final String orderId = this.f20860b.f20889e.getCfSession().getOrderId();
        if (orderId != null) {
            ThreadUtil.runOnUIThread(new Runnable() {
                @Override
                public final void run() {
                    int i7 = CFDropSeamlessActivity.f20859o;
                    T6.d.f7107c.publishEvent(new d.b(T6.e.onFailure, orderId, cFErrorResponse));
                }
            });
        }
    }

    public final void J() {
        if (isDestroyed()) {
            return;
        }
        runOnUiThread(new w(this, 1));
        com.google.android.material.bottomsheet.h hVar = this.f20862e;
        if (hVar != null && hVar.isShowing()) {
            this.f20862e.dismiss();
        }
        ?? hVar2 = new c7.h(this, this.d, this.f20870m, this.f20871n, this.f20867j, this.f20868k, this.f20869l, this);
        this.f20862e = hVar2;
        hVar2.setOnCancelListener(new R0(this, 1));
        this.f20862e.show();
    }

    @Override
    public final void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(R6.e.activity_cf_ui_modal);
        CFCorePaymentGatewayService cFCorePaymentGatewayService = CFCorePaymentGatewayService.getInstance();
        b7.a aVar = this.f20865h;
        cFCorePaymentGatewayService.setCheckoutCallback(aVar);
        CFCorePaymentGatewayService.getInstance().setQRCallback(aVar);
        this.f20863f = (CoordinatorLayout) findViewById(R6.d.cf_loader);
        this.f20860b = new CFDropSeamlessViewModel(new com.cashfree.pg.network.f() {
            @Override
            public final boolean isNetworkConnected() {
                int i7 = CFDropSeamlessActivity.f20859o;
                return com.cashfree.pg.network.h.b(CFDropSeamlessActivity.this.getApplicationContext());
            }
        }, this, this);
        if (Build.VERSION.SDK_INT != 26) {
            setRequestedOrientation(1);
        }
        CFTheme theme = this.f20860b.f20889e.getTheme();
        this.f20869l = theme;
        ((ProgressBar) findViewById(R6.d.progress_bar)).getIndeterminateDrawable().setColorFilter(Color.parseColor(theme.getNavigationBarBackgroundColor()), PorterDuff.Mode.MULTIPLY);
        runOnUiThread(new d(this, 0));
        CFDropSeamlessViewModel cFDropSeamlessViewModel = this.f20860b;
        cFDropSeamlessViewModel.getClass();
        com.cashfree.pg.ui.hidden.viewModel.a aVar2 = new com.cashfree.pg.ui.hidden.viewModel.a(cFDropSeamlessViewModel);
        com.cashfree.pg.ui.hidden.viewModel.b bVar = new com.cashfree.pg.ui.hidden.viewModel.b(cFDropSeamlessViewModel);
        Y6.d dVar = cFDropSeamlessViewModel.f20887b;
        dVar.getClass();
        Y6.b bVar2 = new Y6.b(dVar, aVar2);
        Y6.c cVar = new Y6.c(bVar);
        CFDropCheckoutPayment cFDropCheckoutPayment = cFDropSeamlessViewModel.f20889e;
        dVar.f10122c.getStaticConfigData(cFDropCheckoutPayment.getCfSession(), cVar);
        dVar.f10120a.getConfigData(cFDropCheckoutPayment.getCfSession(), bVar2);
    }

    @Override
    public final void onNewIntent(Intent intent) {
        super.onNewIntent(intent);
    }

    @Override
    public void onPaymentInitiate(final CFPayment cFPayment) {
        ThreadUtil.runOnUIThread(new Runnable() {
            @Override
            public final void run() {
                CFPayment cFPayment2 = cFPayment;
                int i7 = CFDropSeamlessActivity.f20859o;
                CFDropSeamlessActivity cFDropSeamlessActivity = CFDropSeamlessActivity.this;
                cFDropSeamlessActivity.getClass();
                try {
                    cFDropSeamlessActivity.runOnUiThread(new d(cFDropSeamlessActivity, 0));
                    CFCorePaymentGatewayService.getInstance().doPayment(cFDropSeamlessActivity, cFPayment2);
                } catch (CFException e8) {
                    e8.printStackTrace();
                }
            }
        });
    }

    @Override
    public final void onResume() {
        super.onResume();
        if (this.f20864g) {
            this.f20864g = false;
            return;
        }
        CFDropSeamlessViewModel cFDropSeamlessViewModel = this.f20860b;
        cFDropSeamlessViewModel.f20886a.getOrderStatus(cFDropSeamlessViewModel.f20889e.getCfSession(), new e7.a());
    }

    public class AnonymousClass1 extends b7.a {
        public AnonymousClass1() {
        }

        @Override
        public void onPaymentFailure(final CFErrorResponse cFErrorResponse, String str) {
            ThreadUtil.runOnUIThread(new Runnable() {
                @Override
                public final void run() {
                    CFDropSeamlessActivity cFDropSeamlessActivity = CFDropSeamlessActivity.this;
                    cFDropSeamlessActivity.getClass();
                    cFDropSeamlessActivity.runOnUiThread(new w(cFDropSeamlessActivity, 1));
                    cFDropSeamlessActivity.I(cFErrorResponse);
                }
            });
        }

        @Override
        public void onPaymentVerify(final String str) {
            int i7 = CFDropSeamlessActivity.f20859o;
            CFDropSeamlessActivity cFDropSeamlessActivity = CFDropSeamlessActivity.this;
            cFDropSeamlessActivity.finish();
            if (cFDropSeamlessActivity.f20861c) {
                return;
            }
            cFDropSeamlessActivity.f20861c = true;
            if (str != null) {
                final int i8 = 0;
                ThreadUtil.runOnUIThread(new Runnable() {
                    @Override
                    public final void run() {
                        Object obj = str;
                        switch (i8) {
                            case 0:
                                int i9 = CFDropSeamlessActivity.f20859o;
                                T6.d.f7107c.publishEvent(new d.b(T6.e.onVerify, (String) obj, null));
                                break;
                            default:
                                CameraView.p((CameraView) obj);
                                break;
                        }
                    }
                });
            }
        }

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