正在查看: Dostt v1.0.89 应用的 CFDropSeamlessActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Dostt v1.0.89 应用的 CFDropSeamlessActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.cashfree.pg.ui.hidden.seamless;
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.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.api.CFDropCheckoutPayment;
import com.cashfree.pg.ui.hidden.seamless.CFDropSeamlessActivity;
import com.cashfree.pg.ui.hidden.viewModel.CFDropSeamlessViewModel;
import h3.AbstractC1218d;
import h3.AbstractC1219e;
import j3.C1243d;
import j3.EnumC1244e;
import java.util.ArrayList;
import java.util.List;
import s3.AbstractC1512a;
import t3.C1610j;
import v3.AbstractC1663a;
public class CFDropSeamlessActivity extends i3.b implements C1610j.c, CFDropSeamlessViewModel.c, CFDropSeamlessViewModel.DropSeamlessCallbacks {
private CFDropSeamlessViewModel f13415b;
private ArrayList f13417d;
private C1610j f13418e;
private CoordinatorLayout f13419f;
private OrderDetails f13422q;
private MerchantInfo f13423r;
private CFTheme f13424s;
private List f13425t;
private List f13426u;
private boolean f13416c = false;
private boolean f13420o = true;
private final AbstractC1512a f13421p = new AnonymousClass1();
class AnonymousClass1 extends AbstractC1512a {
AnonymousClass1() {
}
public void c(CFErrorResponse cFErrorResponse) {
CFDropSeamlessActivity.this.n0();
CFDropSeamlessActivity.this.m0(cFErrorResponse);
}
public void d(String str) {
CFDropSeamlessActivity.this.n0();
CFDropSeamlessActivity.this.x0(str);
}
@Override
public void onPaymentFailure(final CFErrorResponse cFErrorResponse, String str) {
ThreadUtil.runOnUIThread(new Runnable() {
@Override
public final void run() {
CFDropSeamlessActivity.AnonymousClass1.this.c(cFErrorResponse);
}
});
}
@Override
public void onPaymentVerify(final String str) {
ThreadUtil.runOnUIThread(new Runnable() {
@Override
public final void run() {
CFDropSeamlessActivity.AnonymousClass1.this.d(str);
}
});
}
@Override
public void onQRFetched(String str) {
}
}
private void A0() {
if (this.f13417d == null) {
l0(new CFUPIUtil.UPIAppsCallback() {
@Override
public final void onUPIAppsFetched(ArrayList arrayList) {
CFDropSeamlessActivity.this.v0(arrayList);
}
});
} else {
z0();
}
}
private void l0(CFUPIUtil.UPIAppsCallback uPIAppsCallback) {
CFUPIUtil.getInstalledUPIApps(this, uPIAppsCallback);
}
public boolean lambda$onCreate$0() {
return com.cashfree.pg.network.j.a(getApplicationContext());
}
public void m0(CFErrorResponse cFErrorResponse) {
w0(cFErrorResponse);
}
private void o0() {
com.google.android.material.bottomsheet.a aVar = this.f13418e;
if (aVar == null || !aVar.isShowing()) {
return;
}
this.f13418e.dismiss();
}
public void p0() {
this.f13419f.setVisibility(8);
}
public void q0(CFPayment cFPayment) {
try {
y0();
CFCorePaymentGatewayService.getInstance().doPayment(this, cFPayment);
} catch (CFException e7) {
e7.printStackTrace();
}
}
public static void r0(String str, CFErrorResponse cFErrorResponse) {
C1243d.f().publishEvent(new C1243d.b(EnumC1244e.onFailure, str, cFErrorResponse));
}
public static void s0(String str) {
C1243d.f().publishEvent(new C1243d.b(EnumC1244e.onVerify, str, null));
}
private void setTheme() {
((ProgressBar) findViewById(AbstractC1218d.f17612K0)).getIndeterminateDrawable().setColorFilter(Color.parseColor(this.f13424s.getNavigationBarBackgroundColor()), PorterDuff.Mode.MULTIPLY);
}
public void t0() {
this.f13419f.setVisibility(0);
}
public void u0(DialogInterface dialogInterface) {
w0(CFUtil.getResponseFromError(CFUtil.getCancelledResponse()));
}
public void v0(ArrayList arrayList) {
this.f13417d = arrayList;
ThreadUtil.runOnUIThread(new Runnable() {
@Override
public final void run() {
CFDropSeamlessActivity.this.z0();
}
});
}
private void w0(final CFErrorResponse cFErrorResponse) {
finish();
if (this.f13416c) {
return;
}
this.f13416c = true;
final String h7 = this.f13415b.h();
if (h7 != null) {
ThreadUtil.runOnUIThread(new Runnable() {
@Override
public final void run() {
CFDropSeamlessActivity.r0(h7, cFErrorResponse);
}
});
}
}
public void x0(final String str) {
finish();
if (this.f13416c) {
return;
}
this.f13416c = true;
if (str != null) {
ThreadUtil.runOnUIThread(new Runnable() {
@Override
public final void run() {
CFDropSeamlessActivity.s0(str);
}
});
}
}
public void z0() {
if (isDestroyed()) {
return;
}
n0();
o0();
?? c1610j = new C1610j(this, this.f13417d, this.f13425t, this.f13426u, this.f13422q, this.f13423r, this.f13424s, this);
this.f13418e = c1610j;
c1610j.setOnCancelListener(new DialogInterface.OnCancelListener() {
@Override
public final void onCancel(DialogInterface dialogInterface) {
CFDropSeamlessActivity.this.u0(dialogInterface);
}
});
this.f13418e.show();
}
@Override
protected AbstractC1663a Z() {
return this.f13415b;
}
@Override
public void c(PaymentInitiationData paymentInitiationData) {
this.f13415b.f(paymentInitiationData);
}
@Override
public void g(ConfigResponse configResponse, List list, CFDropCheckoutPayment cFDropCheckoutPayment) {
this.f13422q = configResponse.getOrderDetails();
this.f13423r = configResponse.getMerchantInfo();
this.f13425t = configResponse.getFeatureConfig().getPaymentModeConfig().getUpiPriorityApps();
this.f13426u = configResponse.getFeatureConfig().getPaymentModeConfig().getUpiBlacklistedApps();
if (list.contains(CFPaymentModes.UPI)) {
A0();
} else {
w0(CFUtil.getResponseFromError(CFUtil.getFailedResponse("UPI is not enabled for this order.")));
}
}
public void n0() {
runOnUiThread(new Runnable() {
@Override
public final void run() {
CFDropSeamlessActivity.this.p0();
}
});
}
@Override
public void o(CFErrorResponse cFErrorResponse) {
w0(cFErrorResponse);
}
@Override
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
setContentView(AbstractC1219e.f17748b);
CFCorePaymentGatewayService.getInstance().setCheckoutCallback(this.f13421p);
CFCorePaymentGatewayService.getInstance().setQRCallback(this.f13421p);
this.f13419f = (CoordinatorLayout) findViewById(AbstractC1218d.f17738z);
this.f13415b = new CFDropSeamlessViewModel(new com.cashfree.pg.network.h() {
@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.f13424s = this.f13415b.j();
setTheme();
y0();
this.f13415b.g();
}
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
}
@Override
public void onPaymentInitiate(final CFPayment cFPayment) {
ThreadUtil.runOnUIThread(new Runnable() {
@Override
public final void run() {
CFDropSeamlessActivity.this.q0(cFPayment);
}
});
}
@Override
protected void onResume() {
super.onResume();
if (this.f13420o) {
this.f13420o = false;
} else {
this.f13415b.i();
}
}
public void y0() {
runOnUiThread(new Runnable() {
@Override
public final void run() {
CFDropSeamlessActivity.this.t0();
}
});
}
}