正在查看: OLX India v19.42.007 应用的 d.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: OLX India v19.42.007 应用的 d.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.payu.custombrowser;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.os.Handler;
import android.text.TextUtils;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.appcompat.app.c;
import com.google.firebase.perf.network.FirebasePerfUrlConnection;
import com.olxgroup.panamera.domain.seller.posting.entity.PostingDraft;
import com.payu.custombrowser.bean.CustomBrowserConfig;
import com.payu.custombrowser.c;
import com.payu.custombrowser.cbinterface.CbBottomSheetEventListener;
import com.payu.custombrowser.util.CBConstant;
import com.payu.custombrowser.util.SnoozeConfigMap;
import com.payu.custombrowser.widgets.SnoozeLoaderView;
import com.payu.otpassist.utils.Constants;
import com.payu.otpparser.FragCallback;
import com.payu.otpparser.OtpCallback;
import com.payu.otpparser.OtpParser;
import com.payu.payuanalytics.analytics.model.PayUDeviceAnalytics;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLDecoder;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Timer;
import java.util.concurrent.TimeUnit;
import javax.net.ssl.HttpsURLConnection;
import org.json.JSONException;
import org.json.JSONObject;
public abstract class d extends com.payu.custombrowser.c implements CbBottomSheetEventListener, View.OnClickListener {
private static boolean f2 = false;
public static boolean hasToStart = false;
public static int snoozeImageDownloadTimeout;
View E1;
boolean F1;
Intent G1;
boolean H1;
int I1;
String K1;
Timer L1;
boolean N1;
String O1;
boolean R1;
int[] U1;
SnoozeConfigMap V1;
private RelativeLayout Y1;
private RelativeLayout Z1;
private TextView a2;
private TextView b2;
private TextView c2;
private LinearLayout d2;
private CountDownTimer e2;
protected HashMap<String, String> mAnalyticsMap;
protected CountDownTimer slowUserCountDownTimer;
protected AlertDialog slowUserWarningDialog;
protected BroadcastReceiver snoozeBroadCastReceiver;
protected int snoozeUrlLoadingPercentage;
protected int snoozeUrlLoadingTimeout;
protected int snoozeVisibleCountBackwdJourney;
protected int snoozeVisibleCountFwdJourney;
protected String SNOOZE_GET_WEBVIEW_STATUS_INTENT_ACTION = "webview_status_action";
protected boolean isSnoozeBroadCastReceiverRegistered = false;
protected boolean isSnoozeServiceBounded = false;
protected int snoozeCount = 0;
protected int snoozeCountBackwardJourney = 0;
protected boolean isSnoozeEnabled = true;
protected boolean isRetryNowPressed = false;
protected boolean isListenerAttached = false;
boolean J1 = true;
Boolean M1 = Boolean.FALSE;
boolean P1 = true;
boolean Q1 = false;
boolean S1 = false;
boolean T1 = false;
int W1 = 0;
int X1 = 0;
public boolean isS2SHtmlSupport = false;
class a implements Runnable {
a() {
}
@Override
public void run() {
androidx.appcompat.app.c cVar = d.this.O0;
if (cVar == null || !cVar.isShowing()) {
return;
}
d.this.O0.cancel();
d.this.O0.dismiss();
d.this.G0.finish();
}
}
class b implements Runnable {
final String a;
final String b;
b(d dVar, String str, String str2) {
this.a = str;
this.b = str2;
}
@Override
public void run() {
try {
HttpsURLConnection httpsURLConnection = (HttpsURLConnection) ((URLConnection) FirebasePerfUrlConnection.instrument(new URL(URLDecoder.decode(this.a, "UTF-8")).openConnection()));
httpsURLConnection.setRequestMethod("POST");
httpsURLConnection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
httpsURLConnection.setRequestProperty("Content-Length", String.valueOf(this.b.length()));
httpsURLConnection.setDoOutput(true);
httpsURLConnection.getOutputStream().write(this.b.getBytes());
} catch (Exception unused) {
}
}
}
class c implements View.OnTouchListener {
c() {
}
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
com.payu.custombrowser.b bVar = d.this.M0;
if (bVar != null) {
if (!bVar.isAdded()) {
d dVar = d.this;
dVar.M0.showNow(dVar.getActivity().getSupportFragmentManager(), "CbBottomSheet");
}
d dVar2 = d.this;
dVar2.M0.enterManually(dVar2.I0);
}
d.this.w5();
return false;
}
}
class CountDownTimerC0072d extends CountDownTimer {
CountDownTimerC0072d(long j, long j2) {
super(j, j2);
}
@Override
public void onFinish() {
d.this.D5();
if (d.this.isAdded()) {
try {
JSONObject jSONObject = new JSONObject(d.this.B1);
boolean z = jSONObject.has(d.this.getString(i0.cb_regenerate)) && jSONObject.getBoolean(d.this.getString(i0.cb_regenerate));
if (jSONObject.has(d.this.getString(i0.cb_pin))) {
jSONObject.getBoolean(d.this.getString(i0.cb_pin));
}
if (z) {
d.this.c2.setVisibility(0);
}
} catch (JSONException e) {
com.payu.custombrowser.util.d.a(e.getMessage());
}
}
}
@Override
public void onTick(long j) {
if (d.this.isAdded()) {
d.this.b2.setText(d.this.getString(i0.cb_payu_waiting_for_otp) + " " + (j / 1000) + " SEC");
}
}
}
class e implements View.OnTouchListener {
e() {
}
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
if (com.payu.custombrowser.util.b.o0(d.this.G0)) {
d.this.y5();
View view2 = d.this.p1;
if (view2 != null) {
view2.setVisibility(8);
}
d dVar = d.this;
if (dVar.b1 == 2) {
dVar.m5();
}
} else {
d.this.internetErrorHandler(0, CBConstant.MSG_NO_INTERNET);
}
return false;
}
}
class f implements View.OnKeyListener {
class a implements DialogInterface.OnClickListener {
a() {
}
@Override
public void onClick(DialogInterface dialogInterface, int i) {
d.this.postToPaytxn();
d.this.addEventAnalytics("user_input", "back_button_ok_Ok");
dialogInterface.dismiss();
d.this.onBackApproved();
HashMap g0 = new com.payu.custombrowser.util.b().g0(d.this.customBrowserConfig.getPayuPostData());
Bank.G2 = (String) g0.get("amount");
Bank.transactionID = (String) g0.get("txnid");
com.payu.custombrowser.util.b.z(d.this.getContext(), "CB Back Button", d.this.customBrowserConfig.getPaymentType(), true, Bank.G2);
if (d.this.customBrowserConfig.isActionBarPresent()) {
d.this.G0.finish();
}
}
}
class b implements DialogInterface.OnClickListener {
b() {
}
@Override
public void onClick(DialogInterface dialogInterface, int i) {
d.this.addEventAnalytics("user_input", "back_button_cancel_Cancel");
d.this.onBackCancelled();
dialogInterface.dismiss();
new com.payu.custombrowser.util.b().g0(d.this.customBrowserConfig.getPayuPostData());
com.payu.custombrowser.util.b.z(d.this.getContext(), "CB Back Button", d.this.customBrowserConfig.getPaymentType(), false, Bank.G2);
}
}
f() {
}
@Override
public boolean onKey(View view, int i, KeyEvent keyEvent) {
if (keyEvent.getAction() == 1 && i == 4) {
if (d.this.getArguments().getBoolean(CBConstant.BACK_BUTTON, true)) {
AlertDialog.Builder builder = new AlertDialog.Builder(d.this.G0, j0.cb_dialog);
builder.setCancelable(false);
builder.setMessage("Do you really want to cancel the transaction ?");
builder.setPositiveButton(Constants.PAYU_OK, new a());
builder.setNegativeButton("Cancel", new b());
d.this.addEventAnalytics("user_input", "payu_back_button");
d.this.onBackPressed(builder);
builder.show();
return true;
}
d.this.addEventAnalytics("user_input", "m_back_button");
d.this.onBackPressed(null);
d.this.G0.onBackPressed();
}
return false;
}
}
class g implements OtpCallback {
g() {
}
@Override
public void onOtpReceived(String str) {
com.payu.custombrowser.b bVar;
if (str.isEmpty()) {
return;
}
d.this.K1 = str;
com.payu.custombrowser.util.d.c("onOtpReceived " + d.this.K1);
d.this.fillOTPOnBankPage();
d dVar = d.this;
String str2 = dVar.K1;
dVar.backupOfOTP = str2;
dVar.otpTriggered = true;
dVar.I0 = str2;
try {
dVar.isOTPFilled = false;
bVar = dVar.M0;
} catch (JSONException e) {
com.payu.custombrowser.util.d.a(e.getMessage());
}
if (bVar != null && bVar.isAdded()) {
d dVar2 = d.this;
if (dVar2.isCbBottomSheetExpanded) {
dVar2.M0.otpFetched(str2);
if (d.this.catchAllJSEnabled && !TextUtils.isEmpty(str2)) {
JSONObject jSONObject = new JSONObject();
jSONObject.put("otp", str2);
jSONObject.put("isAutoFillOTP", true);
WebView webView = d.this.V0;
StringBuilder sb = new StringBuilder();
sb.append("javascript:");
d dVar3 = d.this;
sb.append(dVar3.J0.getString(dVar3.getString(i0.cb_fill_otp)));
sb.append("(");
sb.append(jSONObject);
sb.append(")");
webView.loadUrl(sb.toString());
}
d.this.addEventAnalytics("user_input", CBConstant.CB_OTP_RECEIVED);
}
}
d dVar4 = d.this;
dVar4.H0 = 1;
dVar4.E5();
if (d.this.catchAllJSEnabled) {
JSONObject jSONObject2 = new JSONObject();
jSONObject2.put("otp", str2);
jSONObject2.put("isAutoFillOTP", true);
WebView webView2 = d.this.V0;
StringBuilder sb2 = new StringBuilder();
sb2.append("javascript:");
d dVar32 = d.this;
sb2.append(dVar32.J0.getString(dVar32.getString(i0.cb_fill_otp)));
sb2.append("(");
sb2.append(jSONObject2);
sb2.append(")");
webView2.loadUrl(sb2.toString());
}
d.this.addEventAnalytics("user_input", CBConstant.CB_OTP_RECEIVED);
}
@Override
public void onUserDenied() {
com.payu.custombrowser.util.d.c("onUserDenied permissionGranted " + d.this.P1);
d.this.addEventAnalytics("user_input", CBConstant.CB_OTP_USERDENIED);
d dVar = d.this;
dVar.P1 = false;
com.payu.custombrowser.b bVar = dVar.M0;
if (bVar != null && bVar.isAdded()) {
d dVar2 = d.this;
if (dVar2.isCbBottomSheetExpanded) {
dVar2.M0.enterManually("");
return;
}
}
d dVar3 = d.this;
dVar3.I0 = "";
dVar3.H0 = 1;
dVar3.E5();
}
}
class h implements Runnable {
class a implements Runnable {
final String a;
a(String str) {
this.a = str;
}
@Override
public void run() {
d.this.V0.loadUrl("javascript:" + this.a);
}
}
class b implements Runnable {
final String a;
b(String str) {
this.a = str;
}
@Override
public void run() {
d.this.V0.loadUrl("javascript:" + this.a);
}
}
class c implements Runnable {
c() {
}
@Override
public void run() {
d.this.onPageStarted();
}
}
h() {
}
@Override
public void run() {
throw new UnsupportedOperationException("Method not decompiled: com.payu.custombrowser.d.h.run():void");
}
}
class i implements Runnable {
final Intent a;
i(Intent intent) {
this.a = intent;
}
@Override
public void run() {
androidx.appcompat.app.c cVar = d.this.O0;
if (cVar != null) {
cVar.dismiss();
}
d dVar = d.this;
if (dVar.backwardJourneyStarted) {
dVar.showTransactionStatusDialog(this.a.getStringExtra("value"), false);
return;
}
if (dVar.isRetryNowPressed) {
dVar.isRetryNowPressed = false;
} else {
dVar.snoozeCount++;
}
dVar.resumeTransaction(this.a);
}
}
class j implements DialogInterface.OnDismissListener {
final String a;
j(String str) {
this.a = str;
}
@Override
public void onDismiss(DialogInterface dialogInterface) {
try {
com.payu.custombrowser.bean.b bVar = com.payu.custombrowser.bean.b.SINGLETON;
if (bVar.getPayuCustomBrowserCallback() != null) {
com.payu.custombrowser.b bVar2 = d.this.M0;
if (bVar2 != null && bVar2.isAdded()) {
d.this.M0.finish();
}
bVar.getPayuCustomBrowserCallback().onPaymentSuccess(this.a, "");
}
} catch (Exception unused) {
}
d.this.O0.dismiss();
d.this.O0.cancel();
d.this.G0.finish();
}
}
class k implements Runnable {
k() {
}
@Override
public void run() {
androidx.appcompat.app.c cVar = d.this.O0;
if (cVar == null || !cVar.isShowing()) {
return;
}
d.this.O0.cancel();
d.this.O0.dismiss();
d.this.G0.finish();
}
}
class l implements View.OnClickListener {
l() {
}
@Override
public void onClick(View view) {
d.this.addEventAnalytics("snooze_interaction_time", PostingDraft.NO_AD_ID);
d.this.addEventAnalytics("snooze_window_action", "snooze_cancel_transaction_click");
d.this.O0.dismiss();
d.this.O0.cancel();
d.this.G0.finish();
}
}
class m implements DialogInterface.OnDismissListener {
m() {
}
@Override
public void onDismiss(DialogInterface dialogInterface) {
d.this.O0.dismiss();
d.this.O0.cancel();
}
}
public class n extends c.h {
public n() {
super();
}
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
com.payu.custombrowser.util.d.c("Class Name: " + n.class.getCanonicalName() + "onTouch of PayUCBLifeCycleCalled");
d.this.y5();
return super.onTouch(view, motionEvent);
}
}
private void A5() {
String str = this.B1;
if (str == null || str.isEmpty()) {
return;
}
boolean a0 = com.payu.custombrowser.util.b.a0(this.B1, getString(i0.cb_regenerate));
if (getActivity() != null) {
if (a0) {
this.c2.setVisibility(0);
} else {
this.c2.setVisibility(8);
}
}
}
private void C5() {
this.V0.getSettings().setJavaScriptEnabled(true);
this.V0.addJavascriptInterface(this, "PayU");
this.V0.getSettings().setSupportMultipleWindows(true);
this.V0.setOnTouchListener(new e());
this.V0.getSettings().setDomStorageEnabled(true);
this.V0.getSettings().setRenderPriority(WebSettings.RenderPriority.HIGH);
this.V0.getSettings().setCacheMode(2);
}
public void D5() {
addEventAnalytics("user_input", "manual_otp_collpased");
this.Z1.setVisibility(0);
this.Y1.setVisibility(8);
this.d2.setVisibility(8);
}
private void G5() {
CountDownTimerC0072d countDownTimerC0072d = new CountDownTimerC0072d(this.C1.longValue(), 1000L);
this.e2 = countDownTimerC0072d;
countDownTimerC0072d.start();
}
private void q5(Intent intent) {
CustomBrowserConfig customBrowserConfig = this.customBrowserConfig;
int internetRestoredWindowTTL = customBrowserConfig != null ? customBrowserConfig.getInternetRestoredWindowTTL() : 5000;
int i2 = this.W1;
if (i2 != 0) {
internetRestoredWindowTTL = i2;
}
if (this.backwardJourneyStarted) {
try {
if (this.q1.O(intent.getStringExtra("value"), getString(i0.cb_snooze_verify_api_status)).contentEquals(CBConstant.TRANSACTION_STATUS_SUCCESS)) {
Activity activity = this.G0;
if (activity != null && !activity.isFinishing()) {
updateSnoozeDialogWithMessage(this.G0.getResources().getString(i0.cb_transaction_verified), this.G0.getResources().getString(i0.redirect_back_to_merchant));
}
} else {
Activity activity2 = this.G0;
if (activity2 != null && !activity2.isFinishing()) {
updateSnoozeDialogWithMessage(this.G0.getResources().getString(i0.cb_transaction_state_unknown), this.G0.getResources().getString(i0.status_unknown_redirect_to_merchant));
}
}
} catch (Exception unused) {
Activity activity3 = this.G0;
if (activity3 != null && !activity3.isFinishing()) {
updateSnoozeDialogWithMessage(this.G0.getResources().getString(i0.cb_transaction_state_unknown), this.G0.getResources().getString(i0.status_unknown_redirect_to_merchant));
}
}
} else {
Activity activity4 = this.G0;
if (activity4 != null && !activity4.isFinishing()) {
updateSnoozeDialogWithMessage(this.G0.getResources().getString(i0.internet_restored), this.G0.getResources().getString(i0.resuming_your_transaction));
}
}
new Handler().postDelayed(new i(intent), internetRestoredWindowTTL);
}
public void r5(Intent intent, int i2) {
startActivityForResult(intent, i2);
}
public void y5() {
if (this.forwardJourneyForChromeLoaderIsComplete) {
this.firstTouch = true;
dismissSlowUserWarningTimer();
}
}
private void z5() {
this.Q0 = CBConstant.errorMessages.PAYMENT_INITIATED;
addEventAnalytics("user_input", CBConstant.errorMessages.PAYMENT_INITIATED);
if (this.customBrowserConfig.getPayuPostData() != null) {
HashMap g0 = new com.payu.custombrowser.util.b().g0(this.customBrowserConfig.getPayuPostData());
Bank.G2 = (String) g0.get("amount");
Bank.transactionID = (String) g0.get("txnid");
Bank.E2 = com.payu.custombrowser.util.b.X(g0);
Bank.F2 = com.payu.custombrowser.util.b.P(g0);
String str = Bank.E2;
if (str == null || !str.equalsIgnoreCase(CBConstant.NETBANKING)) {
Bank.H2 = "";
} else {
Bank.H2 = "L2";
}
Bank.I2 = System.currentTimeMillis();
com.payu.custombrowser.util.b.x(getActivity().getApplicationContext(), "Custom browser Initiated", com.payu.custombrowser.util.b.X(g0), "CB Initiated", Bank.G2, Bank.F2, Bank.E2, "", String.valueOf(0));
}
this.y1.execute(new h());
}
abstract void B5();
void E5() {
w5();
FrameLayout frameLayout = this.m1;
if (frameLayout != null) {
frameLayout.removeAllViews();
}
View inflate = this.G0.getLayoutInflater().inflate(h0.cb_bottom_sheet_collapsed, (ViewGroup) null);
this.Y1 = (RelativeLayout) inflate.findViewById(g0.rlWaitingForOtpCollapsed);
this.Z1 = (RelativeLayout) inflate.findViewById(g0.rlManualOtpCollapsed);
View findViewById = inflate.findViewById(g0.viewOpenBottomSheet);
this.a2 = (TextView) inflate.findViewById(g0.tvCollapsedOtp);
this.b2 = (TextView) inflate.findViewById(g0.tvWaitingForOtp);
this.c2 = (TextView) inflate.findViewById(g0.resentOtp);
TextView textView = (TextView) inflate.findViewById(g0.btnSubmitOtpCollapsed);
this.d2 = (LinearLayout) inflate.findViewById(g0.llOtpFetched);
int i2 = this.H0;
if (i2 == 1 || i2 == 2 || i2 == 5) {
this.m1.setVisibility(0);
this.m1.addView(inflate);
textView.setOnClickListener(this);
this.c2.setOnClickListener(this);
findViewById.setOnTouchListener(new c());
int i3 = this.H0;
if (i3 != 1 && i3 != 5) {
if (i3 == 2) {
addEventAnalytics("user_input", "waiting_otp_collpased");
this.Y1.setVisibility(0);
this.d2.setVisibility(8);
this.Z1.setVisibility(8);
w5();
G5();
return;
}
return;
}
if (this.I0.isEmpty() || this.I0.length() < 6 || this.I0.length() > 8) {
A5();
D5();
return;
}
addEventAnalytics("user_input", "ready_to_submit_otp_collpased");
this.a2.setText(this.I0);
this.d2.setVisibility(0);
this.Z1.setVisibility(8);
this.Y1.setVisibility(8);
}
}
void F5() {
if (this.isListenerAttached) {
return;
}
this.isListenerAttached = true;
Bundle bundle = new Bundle();
bundle.putString("merchant_key", this.customBrowserConfig.getMerchantKey());
bundle.putString("txnid", this.customBrowserConfig.getTransactionID());
this.L0.startListening(new g(), bundle);
}
void H5() {
if (this.isListenerAttached) {
this.L0.stopListening();
this.isListenerAttached = false;
}
}
public void approveOtp(String str) {
this.K1 = null;
this.Q0 = "approved_otp";
addEventAnalytics("user_input", "approved_otp");
addEventAnalytics("Approve_btn_clicked_time", PostingDraft.NO_AD_ID);
F5();
this.N1 = false;
this.M1 = Boolean.TRUE;
onHelpUnavailable();
l5();
this.b1 = 1;
if (str != null && !str.isEmpty()) {
this.V0.loadUrl("javascript:" + this.K0.optString(getString(i0.cb_process_otp)) + "(\"" + str + "\")");
}
k5();
}
public void cbOldFlowOnCreateView() {
this.V0 = (WebView) this.G0.findViewById(getArguments().getInt(CBConstant.WEBVIEW));
String str = Bank.D2;
if (str == null || !str.equalsIgnoreCase("nb")) {
CustomBrowserConfig customBrowserConfig = this.customBrowserConfig;
if (customBrowserConfig != null && customBrowserConfig.getViewPortWideEnable() == 1) {
this.V0.getSettings().setUseWideViewPort(true);
}
} else {
this.V0.getSettings().setUseWideViewPort(true);
}
this.V0.setFocusable(true);
this.V0.setOnKeyListener(new f());
String str2 = Bank.D2;
if ((str2 == null || !str2.equalsIgnoreCase("nb")) && !this.j1.getBoolean(CBConstant.VIEWPORTWIDE, false)) {
return;
}
this.V0.getSettings().setUseWideViewPort(true);
}
public void cbOldOnCreate() {
Bundle arguments = getArguments();
this.j1 = arguments;
this.autoApprove = arguments.getBoolean(CBConstant.AUTO_APPROVE, false);
this.autoSelectOtp = this.j1.getBoolean(CBConstant.AUTO_SELECT_OTP, false);
this.e1 = this.j1.getBoolean(CBConstant.MERCHANT_SMS_PERMISSION, false);
String str = Bank.J2;
if (str == null || str.equalsIgnoreCase("")) {
Bank.J2 = getArguments().getString(CBConstant.SDK_DETAILS);
}
String str2 = Bank.transactionID;
if (str2 == null || str2.equalsIgnoreCase("")) {
Bank.transactionID = getArguments().getString("txnid");
}
String str3 = Bank.keyAnalytics;
if (str3 == null || str3.equalsIgnoreCase("")) {
Bank.keyAnalytics = getArguments().getString("merchantid");
}
}
public void cbOnCreate() {
if (getArguments() == null || !getArguments().containsKey("cb_config")) {
return;
}
CustomBrowserConfig customBrowserConfig = (CustomBrowserConfig) getArguments().getParcelable("cb_config");
this.customBrowserConfig = customBrowserConfig;
boolean z = false;
this.e1 = customBrowserConfig != null && customBrowserConfig.getMerchantSMSPermission() == 1;
CustomBrowserConfig customBrowserConfig2 = this.customBrowserConfig;
this.autoApprove = customBrowserConfig2 != null && customBrowserConfig2.getAutoApprove() == 1;
CustomBrowserConfig customBrowserConfig3 = this.customBrowserConfig;
if (customBrowserConfig3 != null && customBrowserConfig3.getAutoSelectOTP() == 1) {
z = true;
}
this.autoSelectOtp = z;
if (this.customBrowserConfig != null) {
String str = Bank.keyAnalytics;
if (str == null || str.trim().equals("")) {
if (this.customBrowserConfig.getMerchantKey() != null) {
Bank.keyAnalytics = this.customBrowserConfig.getMerchantKey().trim();
} else {
Bank.keyAnalytics = "";
}
}
String str2 = Bank.transactionID;
if (str2 == null || str2.trim().equals("")) {
if (this.customBrowserConfig.getTransactionID() == null || this.customBrowserConfig.getTransactionID().trim().equals("")) {
Bank.transactionID = "123";
} else {
Bank.transactionID = this.customBrowserConfig.getTransactionID();
}
}
String str3 = Bank.J2;
if (str3 == null || str3.trim().equals("")) {
if (this.customBrowserConfig.getSdkVersionName() != null) {
Bank.J2 = this.customBrowserConfig.getSdkVersionName().trim();
} else {
Bank.J2 = "";
}
}
if (TextUtils.isEmpty(this.customBrowserConfig.getSurepayS2Surl()) && TextUtils.isEmpty(this.customBrowserConfig.getHtmlData())) {
return;
}
this.isS2SHtmlSupport = true;
}
}
public void cbOnCreateView() {
String str = Bank.D2;
if (str == null || !str.equalsIgnoreCase("nb")) {
CustomBrowserConfig customBrowserConfig = this.customBrowserConfig;
if (customBrowserConfig != null && customBrowserConfig.getViewPortWideEnable() == 1) {
this.V0.getSettings().setUseWideViewPort(true);
this.V0.getSettings().setLoadWithOverviewMode(true);
}
} else {
this.V0.getSettings().setUseWideViewPort(true);
this.V0.getSettings().setLoadWithOverviewMode(true);
}
Bank bank = (Bank) this;
this.V0.setWebChromeClient(new PayUWebChromeClient(bank));
if (this.customBrowserConfig.getEnableSurePay() > 0) {
this.V0.setWebViewClient(new PayUSurePayWebViewClient(bank, Bank.keyAnalytics));
} else {
this.V0.setWebViewClient(new PayUWebViewClient(bank, Bank.keyAnalytics));
}
if (!TextUtils.isEmpty(this.customBrowserConfig.getHtmlData())) {
addEventAnalytics("cb_status", "load_html");
this.V0.loadDataWithBaseURL("https://secure.payu.in/_payment", this.customBrowserConfig.getHtmlData(), "text/html", "UTF-8", null);
} else if (TextUtils.isEmpty(this.customBrowserConfig.getSurepayS2Surl())) {
CustomBrowserConfig customBrowserConfig2 = this.customBrowserConfig;
if (customBrowserConfig2 != null && customBrowserConfig2.getPostURL() != null && this.customBrowserConfig.getPayuPostData() != null) {
this.V0.postUrl(this.customBrowserConfig.getPostURL(), this.customBrowserConfig.getPayuPostData().getBytes());
}
} else {
this.V0.loadUrl(this.customBrowserConfig.getSurepayS2Surl());
}
com.payu.custombrowser.bean.b bVar = com.payu.custombrowser.bean.b.SINGLETON;
if (bVar.getPayuCustomBrowserCallback() != null) {
bVar.getPayuCustomBrowserCallback().setCBProperties(this.V0, bank);
}
this.mAnalyticsMap = new HashMap<>();
String j0 = com.payu.custombrowser.util.b.j0(getContext());
if (j0.length() <= 0 || j0.contentEquals(com.payu.custombrowser.util.b.m(new WebView(getContext())))) {
return;
}
addEventAnalytics("web_view_updated_successfully", com.payu.custombrowser.util.b.m(new WebView(getContext())));
com.payu.custombrowser.util.b.n0(getContext(), "");
}
protected void dismissSlowUserWarning() {
AlertDialog alertDialog = this.slowUserWarningDialog;
if (alertDialog != null) {
alertDialog.dismiss();
}
}
abstract void dismissSlowUserWarningTimer();
public void fillOTPOnBankPage() {
try {
if (this.K0 == null || TextUtils.isEmpty(this.K1) || !this.K0.has(getString(i0.cb_fill_otp))) {
return;
}
this.V0.loadUrl("javascript:" + this.K0.getString(getString(i0.cb_fill_otp)) + "(\"" + this.K1 + "\",\"url\")");
this.K1 = null;
} catch (JSONException e2) {
com.payu.custombrowser.util.d.a(e2.getMessage());
}
}
abstract void internetErrorHandler(int i2, String str);
public void logOnTerminate() {
try {
addEventAnalytics("last_url", com.payu.custombrowser.util.b.u0(this.q1.V(this.G0.getApplicationContext(), "last_url")));
} catch (Exception unused) {
} finally {
this.q1.v(this.G0.getApplicationContext(), "last_url");
}
ArrayList arrayList = this.S0;
if (arrayList != null && !arrayList.contains("CUSTOM_BROWSER")) {
if (this.S0.contains("review_order_custom_browser")) {
this.Q0 = "review_order_custom_browser";
} else {
this.Q0 = "NON_CUSTOM_BROWSER";
}
addEventAnalytics("cb_status", this.Q0);
}
this.Q0 = "terminate_transaction";
addEventAnalytics("user_input", "terminate_transaction");
com.payu.custombrowser.widgets.a aVar = this.Z0;
if (aVar != null && !aVar.isShowing()) {
this.Z0.dismiss();
}
String str = this.listOfTxtFld;
if (str != null && str.length() > 1 && !this.isOTPFilled) {
addEventAnalytics("bank_page_otp_fields", this.listOfTxtFld);
addEventAnalytics("bank_page_host_name", this.hostName);
}
this.q1.t(this.G0);
}
public void markPreviousTxnAsUserCanceled(String str) {
new com.payu.custombrowser.widgets.b(str, l0.a(this.G0.getApplicationContext()).getUrl()).a();
}
public void onActivityResult(int i2, int i3, Intent intent) {
if (i2 != 101 || i3 != 0) {
this.L0.onActivityResult(i2, i3, intent);
} else if (this.M0.isVisible()) {
this.M0.B5();
}
}
public void onAttach(Context context) {
super.onAttach(context);
this.G0 = (Activity) context;
if (OtpParser.getInstance(getActivity()) != null) {
OtpParser.getInstance(getActivity()).lifeCycleOnDestroy();
}
OtpParser otpParser = OtpParser.getInstance(getActivity());
this.L0 = otpParser;
otpParser.setFragCallback(new FragCallback() {
@Override
public final void onFragCallback(Intent intent, int i2) {
d.this.r5(intent, i2);
}
});
}
@Override
public void onCbBottomSheetCancel() {
FrameLayout frameLayout = this.l1;
if (frameLayout != null) {
frameLayout.removeAllViews();
this.l1.setVisibility(8);
}
E5();
}
@Override
public void onClick(View view) {
if (view.getId() == g0.resentOtp) {
try {
this.Q0 = "regenerate_click_collapsed";
addEventAnalytics("user_input", "regenerate_click_collapsed");
this.K1 = null;
this.V0.loadUrl("javascript:" + this.K0.getString(getString(i0.cb_regen_otp)));
this.isListenerAttached = false;
this.P1 = true;
F5();
this.I0 = "";
return;
} catch (JSONException e2) {
com.payu.custombrowser.util.d.a(e2.getMessage());
return;
}
}
if (view.getId() == g0.btnSubmitOtpCollapsed) {
try {
j5();
this.K1 = null;
this.N1 = false;
this.M1 = Boolean.TRUE;
F5();
if (this.a2.getText().toString().length() > 5) {
com.payu.custombrowser.b bVar = this.M0;
if (bVar != null) {
if (!bVar.isAdded()) {
this.M0.showNow(getActivity().getSupportFragmentManager(), "CbBottomSheet");
}
this.M0.loading(getString(i0.cb_confirming_your_payment));
}
addEventAnalytics("user_input", "submit_otp_collpased");
this.V0.loadUrl("javascript:" + this.K0.getString(getString(i0.cb_process_otp)) + "(\"" + this.a2.getText().toString() + "\")");
}
} catch (JSONException e3) {
com.payu.custombrowser.util.d.a(e3.getMessage());
}
}
}
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
this.surePayS2SPayUId = null;
this.isSnoozeEnabled = this.q1.K(CBConstant.SNOOZE_ENABLED, this.G0.getApplicationContext());
f2 = false;
SnoozeConfigMap g2 = this.q1.g(com.payu.custombrowser.util.h.l(this.G0, CBConstant.SNOOZE_SHARED_PREF));
this.V1 = g2;
int[] percentageAndTimeout = g2.getPercentageAndTimeout(CBConstant.DEFAULT_PAYMENT_URLS);
this.U1 = percentageAndTimeout;
this.snoozeUrlLoadingPercentage = percentageAndTimeout[0];
this.snoozeUrlLoadingTimeout = percentageAndTimeout[1];
this.X1 = this.q1.b(this.V1, CBConstant.DEFAULT_PAYMENT_URLS);
snoozeImageDownloadTimeout = com.payu.custombrowser.util.h.f(this.G0.getApplicationContext(), "com.payu.custombrowser.payucustombrowser", CBConstant.SNOOZE_IMAGE_DOWNLOAD_TIME_OUT, 0);
cbOnCreate();
this.q1.C(this.customBrowserConfig);
initAnalytics(Bank.keyAnalytics);
this.H1 = false;
if (this.G0 != null) {
this.q1.C(this.customBrowserConfig);
this.surePayS2SPayUId = null;
this.surePayS2Surl = null;
}
if (this.customBrowserConfig != null) {
addEventAnalytics("snooze_enable_count", "" + this.customBrowserConfig.getEnableSurePay());
addEventAnalytics("snooze_mode_set_merchant", this.customBrowserConfig.getSurePayMode() == 1 ? "WARN" : "FAIL");
}
}
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
View inflate;
View findViewById;
super.onCreateView(layoutInflater, viewGroup, bundle);
if (this.k1) {
inflate = layoutInflater.inflate(h0.bankold, viewGroup, false);
inflate.bringToFront();
cbOldFlowOnCreateView();
findViewById = inflate;
} else {
inflate = layoutInflater.inflate(h0.bank, viewGroup, false);
this.p1 = inflate.findViewById(g0.trans_overlay);
this.V0 = (WebView) inflate.findViewById(g0.webview);
this.E1 = inflate.findViewById(g0.cb_blank_overlay);
findViewById = inflate.findViewById(g0.parent);
cbOnCreateView();
}
this.l1 = (FrameLayout) inflate.findViewById(g0.help_view);
this.m1 = (FrameLayout) inflate.findViewById(g0.payuBottomSheetCollapsed);
this.n1 = (FrameLayout) inflate.findViewById(g0.flFullScreenLoader);
View inflate2 = this.G0.getLayoutInflater().inflate(h0.cb_full_screen_loader, (ViewGroup) null);
CustomBrowserConfig customBrowserConfig = this.customBrowserConfig;
if (customBrowserConfig != null && customBrowserConfig.getProgressDialogCustomView() != null) {
inflate2 = this.customBrowserConfig.getProgressDialogCustomView();
com.payu.custombrowser.util.b.A((ImageView) inflate2.findViewById(g0.payu_progress_loader), this.G0);
}
this.n1.addView(inflate2);
this.o1 = inflate.findViewById(g0.view);
this.a1 = com.payu.custombrowser.widgets.a.a(this.G0, null);
C5();
z5();
this.mAnalyticsMap = new HashMap<>();
findViewById.setOnTouchListener(new n());
return inflate;
}
public void onDestroy() {
super.onDestroy();
this.q1.I(this.timerProgress);
this.q1.I(this.L1);
H5();
CountDownTimer countDownTimer = this.slowUserCountDownTimer;
if (countDownTimer != null) {
countDownTimer.cancel();
}
addEventAnalytics("snooze_count", "" + (this.snoozeVisibleCountBackwdJourney + this.snoozeVisibleCountFwdJourney));
com.payu.custombrowser.bean.b.SINGLETON.setPayuCustomBrowserCallback(null);
androidx.appcompat.app.c cVar = this.O0;
if (cVar != null && cVar.isShowing()) {
this.O0.dismiss();
}
if (this.snoozeBroadCastReceiver != null && this.isSnoozeBroadCastReceiverRegistered && !f2) {
androidx.localbroadcastmanager.content.a.b(this.G0.getApplicationContext()).c(this.snoozeBroadCastReceiver);
}
PayUDeviceAnalytics payUDeviceAnalytics = this.D1;
if (payUDeviceAnalytics != null) {
payUDeviceAnalytics.cancelTimer();
}
l0.a(this.G0.getApplicationContext()).cancelTimer();
this.q1.I(this.L1);
CountDownTimer countDownTimer2 = this.s1;
if (countDownTimer2 != null) {
countDownTimer2.cancel();
}
logOnTerminate();
Bank.J2 = null;
Bank.keyAnalytics = null;
Bank.transactionID = null;
Bank.D2 = null;
WebView webView = this.V0;
if (webView != null) {
webView.destroy();
}
this.q1.S(this.customBrowserConfig);
this.surePayS2SPayUId = null;
}
public void onDestroyView() {
super.onDestroyView();
this.q1.I(this.timerProgress);
androidx.appcompat.app.c cVar = this.O0;
if (cVar != null && cVar.isShowing()) {
this.O0.dismiss();
}
com.payu.custombrowser.widgets.a aVar = this.Z0;
if (aVar != null) {
aVar.dismiss();
}
}
abstract void onPageStarted();
public void onRequestPermissionsResult(int i2, String[] strArr, int[] iArr) {
this.R1 = false;
if (this.T1) {
try {
this.V0.loadUrl("javascript:" + this.K0.getString(getString(i0.cb_otp)));
} catch (JSONException e2) {
com.payu.custombrowser.util.d.a(e2.getMessage());
}
}
if (androidx.core.content.b.checkSelfPermission(this.G0, "android.permission.RECEIVE_SMS") == 0) {
this.P1 = true;
this.K1 = null;
}
this.L0.onRequestPermissionsResult(i2, strArr, iArr);
if (this.T1) {
F5();
com.payu.custombrowser.b bVar = this.M0;
if (bVar != null) {
if (!bVar.isAdded()) {
Bank.I2 = System.currentTimeMillis();
com.payu.custombrowser.util.b.x(getActivity().getApplicationContext(), "Custom Browser Loaded", Bank.E2, "CB Loaded", Bank.G2, Bank.F2, Bank.E2, Bank.H2, String.valueOf(TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis())));
this.M0.showNow(getActivity().getSupportFragmentManager(), "CbBottomSheet");
}
this.M0.enterOtp(this.O1);
}
}
}
public void onResume() {
super.onResume();
if (this.F1) {
this.F1 = false;
cancelTransactionNotification();
Intent intent = this.G1;
if (intent == null) {
addEventAnalytics("internet_not_restored_dialog_recent_app", PostingDraft.NO_AD_ID);
return;
}
if (this.backwardJourneyStarted) {
try {
if (Integer.parseInt(new JSONObject(intent.getStringExtra("value")).optString(getString(i0.cb_snooze_verify_api_status))) == 1) {
addEventAnalytics("transaction_verified_dialog_recent_app", PostingDraft.NO_AD_ID);
} else {
addEventAnalytics("transaction_not_verified_dialog_recent_app", PostingDraft.NO_AD_ID);
}
} catch (Exception unused) {
addEventAnalytics("transaction_not_verified_dialog_recent_app", PostingDraft.NO_AD_ID);
}
} else {
addEventAnalytics("internet_restored_dialog_recent_app", PostingDraft.NO_AD_ID);
}
q5(this.G1);
}
}
public void postDataToSurl(String str, String str2) {
new Thread(new b(this, str2, str)).start();
}
abstract void reloadWebView();
abstract void reloadWebView(String str);
abstract void reloadWebView(String str, String str2);
public void resumeTransaction(Intent intent) {
this.customBrowserConfig = (CustomBrowserConfig) intent.getExtras().getParcelable("cb_config");
if (intent.getStringExtra(CBConstant.CURRENT_URL) == null || intent.getStringExtra(CBConstant.S2S_RETRY_URL) != null) {
if (intent.getStringExtra(CBConstant.S2S_RETRY_URL) != null) {
reloadWebView(intent.getStringExtra(CBConstant.S2S_RETRY_URL), null);
return;
} else {
reloadWebView(this.customBrowserConfig.getPostURL(), this.customBrowserConfig.getPayuPostData());
return;
}
}
if (intent.getStringExtra(CBConstant.CURRENT_URL).equalsIgnoreCase(this.customBrowserConfig.getPostURL())) {
if (this.customBrowserConfig.getPostURL().contentEquals("https://secure.payu.in/_payment") || this.customBrowserConfig.getPostURL().contentEquals(CBConstant.TEST_PAYMENT_URL)) {
markPreviousTxnAsUserCanceled(com.payu.custombrowser.util.b.k(this.G0.getApplicationContext(), "sure_pay_cancelled", this.customBrowserConfig.getTransactionID(), "", Bank.keyAnalytics, this.customBrowserConfig.getTransactionID(), ""));
}
reloadWebView(this.customBrowserConfig.getPostURL(), this.customBrowserConfig.getPayuPostData());
return;
}
if (Bank.isUrlWhiteListed(intent.getStringExtra(CBConstant.CURRENT_URL))) {
reloadWebView(intent.getStringExtra(CBConstant.CURRENT_URL));
return;
}
if (this.customBrowserConfig.getPostURL().contentEquals("https://secure.payu.in/_payment") || this.customBrowserConfig.getPostURL().contentEquals(CBConstant.TEST_PAYMENT_URL)) {
markPreviousTxnAsUserCanceled(com.payu.custombrowser.util.b.k(this.G0.getApplicationContext(), "sure_pay_cancelled", this.customBrowserConfig.getTransactionID(), "", Bank.keyAnalytics, this.customBrowserConfig.getTransactionID(), ""));
}
reloadWebView(this.customBrowserConfig.getPostURL(), this.customBrowserConfig.getPayuPostData());
}
protected void showCbBlankOverlay(int i2) {
View view = this.E1;
if (view != null) {
view.setVisibility(i2);
}
}
protected void showSlowUserWarningNotification() {
Activity activity = this.G0;
if (activity == null || activity.isFinishing()) {
return;
}
new Intent();
}
public void showTransactionStatusDialog(java.lang.String r10, boolean r11) {
throw new UnsupportedOperationException("Method not decompiled: com.payu.custombrowser.d.showTransactionStatusDialog(java.lang.String, boolean):void");
}
public void updateHeight(View view) {
if (this.Y0 == 0) {
a();
l5();
}
a(view);
}
public void updateLoaderHeight() {
if (this.I1 == 0) {
this.V0.measure(-1, -1);
this.I1 = (int) (this.V0.getMeasuredHeight() * 0.35d);
}
}
protected void updateSnoozeDialogWithMessage(String str, String str2) {
androidx.appcompat.app.c cVar = this.O0;
if (cVar != null && cVar.isShowing()) {
this.O0.cancel();
this.O0.dismiss();
}
B5();
Activity activity = this.G0;
if (activity == null || activity.isFinishing()) {
return;
}
View inflate = this.G0.getLayoutInflater().inflate(h0.cb_layout_snooze, (ViewGroup) null);
((TextView) inflate.findViewById(g0.snooze_header_txt)).setText(str);
inflate.findViewById(g0.text_view_cancel_snooze_window).setVisibility(8);
((TextView) inflate.findViewById(g0.text_view_snooze_message)).setText(str2);
SnoozeLoaderView snoozeLoaderView = (SnoozeLoaderView) inflate.findViewById(g0.snooze_loader_view);
snoozeLoaderView.setVisibility(0);
snoozeLoaderView.h();
inflate.findViewById(g0.button_snooze_transaction).setVisibility(8);
inflate.findViewById(g0.text_view_retry_message_detail).setVisibility(8);
inflate.findViewById(g0.button_retry_transaction).setVisibility(8);
inflate.findViewById(g0.button_cancel_transaction).setVisibility(8);
inflate.findViewById(g0.t_confirm).setVisibility(8);
inflate.findViewById(g0.t_nconfirm).setVisibility(8);
inflate.findViewById(g0.button_go_back_snooze).setVisibility(8);
androidx.appcompat.app.c create = new c.a(this.G0).create();
this.O0 = create;
create.h(inflate);
this.O0.setCancelable(false);
this.O0.setCanceledOnTouchOutside(false);
this.O0.show();
}
void w5() {
CountDownTimer countDownTimer = this.e2;
if (countDownTimer != null) {
countDownTimer.cancel();
this.e2 = null;
}
}
void x5() {
w5();
FrameLayout frameLayout = this.m1;
if (frameLayout != null) {
frameLayout.removeAllViews();
}
}
}