导航菜单

页面标题

页面副标题

Housing v14.7.8 - CFDropSeamlessActivity.java 源代码

正在查看: Housing v14.7.8 应用的 CFDropSeamlessActivity.java JAVA 源代码文件

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


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

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 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.ui.PaymentInitiationData;
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.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.hidden.seamless.dialog.g;
import com.cashfree.pg.ui.hidden.viewModel.CFDropSeamlessViewModel;
import com.google.android.material.bottomsheet.j;
import java.util.ArrayList;
import java.util.List;

public class CFDropSeamlessActivity extends com.cashfree.pg.ui.hidden.activity.base.b implements g.a, CFDropSeamlessViewModel.a, CFDropSeamlessViewModel.DropSeamlessCallbacks {
    public static final int i = 0;
    private List<String> blacklistedUPIAppList;
    private CFDropSeamlessViewModel cfDropSeamlessViewModel;
    private CFTheme cfTheme;
    private CoordinatorLayout loader;
    private MerchantInfo merchantInfo;
    private OrderDetails orderDetails;
    private List<String> orderedUPIAppList;
    private ArrayList<CFUPIApp> upiAppList;
    private g upiDialog;
    private boolean isResponseSent = false;
    private boolean isFresh = true;
    private final h5.a cfNativeCoreCallbacks = new AnonymousClass1();

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

        @Override
        public void onPaymentFailure(CFErrorResponse cFErrorResponse, String str) {
            ThreadUtil.runOnUIThread(new e(this, cFErrorResponse, 0));
        }

        @Override
        public void onPaymentVerify(String str) {
            ?? r0 = CFDropSeamlessActivity.this;
            r0.getClass();
            r0.runOnUiThread(new b(r0, 0));
            CFDropSeamlessActivity.r(CFDropSeamlessActivity.this, str);
        }

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

    public static void q(CFDropSeamlessActivity cFDropSeamlessActivity, ArrayList arrayList) {
        cFDropSeamlessActivity.upiAppList = arrayList;
        ThreadUtil.runOnUIThread(new b(cFDropSeamlessActivity, 2));
    }

    public static void r(CFDropSeamlessActivity cFDropSeamlessActivity, String str) {
        cFDropSeamlessActivity.finish();
        if (cFDropSeamlessActivity.isResponseSent) {
            return;
        }
        cFDropSeamlessActivity.isResponseSent = true;
        if (str != null) {
            ThreadUtil.runOnUIThread(new c(str, 0));
        }
    }

    @Override
    public final com.cashfree.pg.ui.hidden.viewModel.a n() {
        return this.cfDropSeamlessViewModel;
    }

    @Override
    public final void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(g5.e.activity_cf_ui_modal);
        CFCorePaymentGatewayService.getInstance().setCheckoutCallback(this.cfNativeCoreCallbacks);
        CFCorePaymentGatewayService.getInstance().setQRCallback(this.cfNativeCoreCallbacks);
        this.loader = findViewById(g5.d.cf_loader);
        this.cfDropSeamlessViewModel = new CFDropSeamlessViewModel(new a(this), this, this);
        if (Build.VERSION.SDK_INT != 26) {
            setRequestedOrientation(1);
        }
        CFTheme k = this.cfDropSeamlessViewModel.k();
        this.cfTheme = k;
        ((ProgressBar) findViewById(g5.d.progress_bar)).getIndeterminateDrawable().setColorFilter(Color.parseColor(k.getNavigationBarBackgroundColor()), PorterDuff.Mode.MULTIPLY);
        runOnUiThread(new b(this, 1));
        this.cfDropSeamlessViewModel.h();
    }

    @Override
    public void onPaymentInitiate(CFPayment cFPayment) {
        ThreadUtil.runOnUIThread(new e(this, cFPayment, 1));
    }

    @Override
    public final void onResume() {
        super.onResume();
        if (this.isFresh) {
            this.isFresh = false;
        } else {
            this.cfDropSeamlessViewModel.j();
        }
    }

    public final void s(ConfigResponse configResponse, ArrayList arrayList) {
        this.orderDetails = configResponse.getOrderDetails();
        this.merchantInfo = configResponse.getMerchantInfo();
        this.orderedUPIAppList = configResponse.getFeatureConfig().getPaymentModeConfig().getUpiPriorityApps();
        this.blacklistedUPIAppList = configResponse.getFeatureConfig().getPaymentModeConfig().getUpiBlacklistedApps();
        if (!arrayList.contains(CFPaymentModes.UPI)) {
            u(CFUtil.getResponseFromError(CFUtil.getFailedResponse("UPI is not enabled for this order.")));
        } else if (this.upiAppList == null) {
            CFUPIUtil.getInstalledUPIApps(this, new a(this));
        } else {
            v();
        }
    }

    public final void t(PaymentInitiationData paymentInitiationData) {
        this.cfDropSeamlessViewModel.g(paymentInitiationData);
    }

    public final void u(CFErrorResponse cFErrorResponse) {
        finish();
        if (this.isResponseSent) {
            return;
        }
        this.isResponseSent = true;
        String i2 = this.cfDropSeamlessViewModel.i();
        if (i2 != null) {
            ThreadUtil.runOnUIThread(new e(i2, cFErrorResponse, 2));
        }
    }

    public final void v() {
        if (isDestroyed()) {
            return;
        }
        runOnUiThread(new b(this, 0));
        j jVar = this.upiDialog;
        if (jVar != null && jVar.isShowing()) {
            this.upiDialog.dismiss();
        }
        ?? gVar = new g(this, this.upiAppList, this.orderedUPIAppList, this.blacklistedUPIAppList, this.orderDetails, this.merchantInfo, this.cfTheme, this);
        this.upiDialog = gVar;
        gVar.setOnCancelListener(new d(this, 0));
        this.upiDialog.show();
    }
}