导航菜单

页面标题

页面副标题

Oolka v2.4.42 - CFDropSeamlessActivity.java 源代码

正在查看: Oolka v2.4.42 应用的 CFDropSeamlessActivity.java JAVA 源代码文件

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


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

import android.annotation.SuppressLint;
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.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.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.network.NetworkConnectivityUtil;
import com.cashfree.pg.ui.api.CFDropCheckoutPayment;
import com.cashfree.pg.ui.hidden.activity.base.BaseActivity;
import com.cashfree.pg.ui.hidden.channel.d;
import com.cashfree.pg.ui.hidden.seamless.CFDropSeamlessActivity;
import com.cashfree.pg.ui.hidden.seamless.callbacks.CFSeamlessCallbacks;
import com.cashfree.pg.ui.hidden.seamless.dialog.j;
import com.cashfree.pg.ui.hidden.viewModel.BaseViewModel;
import com.cashfree.pg.ui.hidden.viewModel.a;
import java.util.ArrayList;
import java.util.List;

public class CFDropSeamlessActivity extends BaseActivity implements j.c, a.c, a.d {
    public com.cashfree.pg.ui.hidden.seamless.dialog.j A0;
    public CFTheme A1;
    public CoordinatorLayout C0;
    public List<String> C1;
    public com.cashfree.pg.ui.hidden.viewModel.a H;
    public List<String> V1;
    public ArrayList<CFUPIApp> c0;
    public OrderDetails x1;
    public MerchantInfo y1;
    public boolean I = false;
    public boolean c1 = true;
    public final CFSeamlessCallbacks p1 = new a();

    public class a extends CFSeamlessCallbacks {
        public a() {
        }

        public void c(CFErrorResponse cFErrorResponse) {
            CFDropSeamlessActivity.this.B0();
            CFDropSeamlessActivity.this.A0(cFErrorResponse);
        }

        public void d(String str) {
            CFDropSeamlessActivity.this.B0();
            CFDropSeamlessActivity.this.L0(str);
        }

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

        @Override
        public void onPaymentVerify(final String str) {
            ThreadUtil.runOnUIThread(new Runnable() {
                @Override
                public final void run() {
                    CFDropSeamlessActivity.a.this.d(str);
                }
            });
        }

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

    public void D0() {
        this.C0.setVisibility(8);
    }

    public void E0(CFPayment cFPayment) {
        try {
            M0();
            CFCorePaymentGatewayService.getInstance().doPayment(this, cFPayment);
        } catch (CFException e) {
            e.printStackTrace();
        }
    }

    public static void F0(String str, CFErrorResponse cFErrorResponse) {
        com.cashfree.pg.ui.hidden.channel.d.e().publishEvent(new d.b(com.cashfree.pg.ui.hidden.channel.e.onFailure, str, cFErrorResponse));
    }

    public static void G0(String str) {
        com.cashfree.pg.ui.hidden.channel.d.e().publishEvent(new d.b(com.cashfree.pg.ui.hidden.channel.e.onVerify, str, null));
    }

    public void H0() {
        this.C0.setVisibility(0);
    }

    public void I0(DialogInterface dialogInterface) {
        K0(CFUtil.getResponseFromError(CFUtil.getCancelledResponse()));
    }

    public void J0(ArrayList arrayList) {
        this.c0 = arrayList;
        ThreadUtil.runOnUIThread(new Runnable() {
            @Override
            public final void run() {
                CFDropSeamlessActivity.this.N0();
            }
        });
    }

    public boolean lambda$onCreate$0() {
        return NetworkConnectivityUtil.a(getApplicationContext());
    }

    public final void A0(CFErrorResponse cFErrorResponse) {
        K0(cFErrorResponse);
    }

    public void B0() {
        runOnUiThread(new Runnable() {
            @Override
            public final void run() {
                CFDropSeamlessActivity.this.D0();
            }
        });
    }

    public final void C0() {
        com.google.android.material.bottomsheet.a aVar = this.A0;
        if (aVar == null || !aVar.isShowing()) {
            return;
        }
        this.A0.dismiss();
    }

    public final void K0(final CFErrorResponse cFErrorResponse) {
        finish();
        if (this.I) {
            return;
        }
        this.I = true;
        final String h = this.H.h();
        if (h != null) {
            ThreadUtil.runOnUIThread(new Runnable() {
                @Override
                public final void run() {
                    CFDropSeamlessActivity.F0(h, cFErrorResponse);
                }
            });
        }
    }

    public final void L0(final String str) {
        finish();
        if (this.I) {
            return;
        }
        this.I = true;
        if (str != null) {
            ThreadUtil.runOnUIThread(new Runnable() {
                @Override
                public final void run() {
                    CFDropSeamlessActivity.G0(str);
                }
            });
        }
    }

    public void M0() {
        runOnUiThread(new Runnable() {
            @Override
            public final void run() {
                CFDropSeamlessActivity.this.H0();
            }
        });
    }

    public final void N0() {
        if (isDestroyed()) {
            return;
        }
        B0();
        C0();
        ?? jVar = new com.cashfree.pg.ui.hidden.seamless.dialog.j(this, this.c0, this.C1, this.V1, this.x1, this.y1, this.A1, this);
        this.A0 = jVar;
        jVar.setOnCancelListener(new DialogInterface.OnCancelListener() {
            @Override
            public final void onCancel(DialogInterface dialogInterface) {
                CFDropSeamlessActivity.this.I0(dialogInterface);
            }
        });
        this.A0.show();
    }

    public final void O0() {
        if (this.c0 == null) {
            z0(new CFUPIUtil.UPIAppsCallback() {
                @Override
                public final void onUPIAppsFetched(ArrayList arrayList) {
                    CFDropSeamlessActivity.this.J0(arrayList);
                }
            });
        } else {
            N0();
        }
    }

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

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

    @Override
    public void j(ConfigResponse configResponse, List<CFPaymentModes> list, CFDropCheckoutPayment cFDropCheckoutPayment) {
        this.x1 = configResponse.getOrderDetails();
        this.y1 = configResponse.getMerchantInfo();
        this.C1 = configResponse.getFeatureConfig().getPaymentModeConfig().getUpiPriorityApps();
        this.V1 = configResponse.getFeatureConfig().getPaymentModeConfig().getUpiBlacklistedApps();
        if (list.contains(CFPaymentModes.UPI)) {
            O0();
        } else {
            K0(CFUtil.getResponseFromError(CFUtil.getFailedResponse("UPI is not enabled for this order.")));
        }
    }

    @Override
    public BaseViewModel n0() {
        return this.H;
    }

    @Override
    public void o(CFErrorResponse cFErrorResponse) {
        K0(cFErrorResponse);
    }

    @Override
    @SuppressLint({"SourceLockedOrientationActivity"})
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(com.cashfree.pg.ui.e.b);
        CFCorePaymentGatewayService.getInstance().setCheckoutCallback(this.p1);
        CFCorePaymentGatewayService.getInstance().setQRCallback(this.p1);
        this.C0 = findViewById(com.cashfree.pg.ui.d.z);
        this.H = new com.cashfree.pg.ui.hidden.viewModel.a(new com.cashfree.pg.network.c() {
            @Override
            public final boolean isNetworkConnected() {
                boolean lambda$onCreate$0;
                lambda$onCreate$0 = CFDropSeamlessActivity.this.lambda$onCreate$0();
                return lambda$onCreate$0;
            }
        }, this, this);
        if (Build.VERSION.SDK_INT != 26) {
            setRequestedOrientation(1);
        }
        this.A1 = this.H.j();
        setTheme();
        M0();
        this.H.g();
    }

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

    @Override
    public void onResume() {
        super.onResume();
        if (this.c1) {
            this.c1 = false;
        } else {
            this.H.i();
        }
    }

    public final void setTheme() {
        ((ProgressBar) findViewById(com.cashfree.pg.ui.d.K0)).getIndeterminateDrawable().setColorFilter(Color.parseColor(this.A1.getNavigationBarBackgroundColor()), PorterDuff.Mode.MULTIPLY);
    }

    public final void z0(CFUPIUtil.UPIAppsCallback uPIAppsCallback) {
        CFUPIUtil.getInstalledUPIApps(this, uPIAppsCallback);
    }
}