正在查看: RummyCircle v11000.89 应用的 PaytmPGActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: RummyCircle v11000.89 应用的 PaytmPGActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.paytm.pgsdk;
import android.R;
import android.annotation.SuppressLint;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
import android.graphics.Color;
import android.net.http.SslError;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.FrameLayout;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import androidx.camera.core.W;
import com.games24x7.pgpayment.PaymentConstants;
import com.games24x7.pgpayment.network.PaymentApiConstants;
import com.google.firebase.perf.network.FirebasePerfOkHttpClient;
import easypay.appinvoke.manager.EasypayWebViewClient;
import easypay.appinvoke.manager.PaytmAssist;
import java.util.HashMap;
import java.util.concurrent.TimeUnit;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import okhttp3.MediaType;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import org.json.JSONException;
import org.json.JSONObject;
public class PaytmPGActivity extends AppCompatActivity implements easypay.appinvoke.listeners.d, easypay.appinvoke.listeners.a {
public static final int m = 0;
public volatile FrameLayout a;
public volatile ProgressBar b;
public volatile PaytmWebView c;
public volatile Bundle d;
public AlertDialog e;
public boolean f;
public PaytmAssist g;
public String h;
public String i;
public EasypayWebViewClient j;
public e k;
public boolean l;
public class a implements View.OnClickListener {
public a() {
}
@Override
public final void onClick(View view) {
j.a("User pressed back button which is present in Header Bar.");
int i = PaytmPGActivity.m;
PaytmPGActivity.this.z();
}
}
public class b implements DialogInterface.OnClickListener {
public b() {
}
@Override
public final void onClick(DialogInterface dialogInterface, int i) {
h hVar;
String str;
String str2;
String str3;
HashMap<String, String> hashMap;
?? r9 = PaytmPGActivity.this;
int i2 = PaytmPGActivity.m;
r9.getClass();
synchronized (h.class) {
try {
if (h.a == null) {
h.a = new h();
}
hVar = h.a;
} catch (Throwable th) {
throw th;
}
}
d dVar = new d(r9);
hVar.getClass();
com.paytm.pgsdk.c cVar = f.c().a;
if (cVar == null || (hashMap = cVar.a) == null) {
str = null;
str2 = null;
str3 = null;
} else {
str2 = hashMap.get("MID");
str3 = cVar.a.get("ORDER_ID");
str = cVar.a.get("TXN_TOKEN");
}
if (str2 == null || str3 == null) {
f.c().d().onTransactionResponse(null);
r9.finish();
return;
}
StringBuilder sb = new StringBuilder();
sb.append("https://" + f.b() + "/theia/api/v2/closeOrder");
sb.append("?orderId=");
sb.append(str3);
String j = android.support.v4.media.a.j(sb, "&mid=", str2);
JSONObject jSONObject = new JSONObject();
JSONObject jSONObject2 = new JSONObject();
JSONObject jSONObject3 = new JSONObject();
try {
jSONObject3.put("mid", str2);
jSONObject3.put("orderId", str3);
jSONObject2.put("tokenType", "TXN_TOKEN");
if (str != null) {
jSONObject2.put("token", str);
}
jSONObject2.put("version", "v2");
jSONObject2.put("requestTimestamp", System.currentTimeMillis());
jSONObject.put("head", jSONObject2);
jSONObject.put("body", jSONObject3);
} catch (JSONException e) {
e.printStackTrace();
}
Request build = new Request.Builder().url(j).header("content-type", PaymentApiConstants.CONTENT_TYPE).header("Accept", PaymentApiConstants.CONTENT_TYPE).post(RequestBody.create(MediaType.parse(PaymentApiConstants.CONTENT_TYPE), jSONObject.toString().getBytes())).build();
OkHttpClient.Builder newBuilder = new OkHttpClient().newBuilder();
TimeUnit timeUnit = TimeUnit.SECONDS;
FirebasePerfOkHttpClient.enqueue(newBuilder.connectTimeout(30L, timeUnit).writeTimeout(30L, timeUnit).readTimeout(30L, timeUnit).build().newCall(build), new g(dVar));
}
}
public class c implements DialogInterface.OnClickListener {
public c() {
}
@Override
public final void onClick(DialogInterface dialogInterface, int i) {
PaytmPGActivity paytmPGActivity = PaytmPGActivity.this;
try {
AlertDialog alertDialog = paytmPGActivity.e;
if (alertDialog == null || !alertDialog.isShowing()) {
return;
}
paytmPGActivity.e.dismiss();
} catch (Exception e) {
j.e(e);
}
}
}
@SuppressLint({"ResourceType"})
public final synchronized boolean A() {
try {
try {
if (getIntent() != null) {
this.f = getIntent().getBooleanExtra("HIDE_HEADER", false);
getIntent().getBooleanExtra("SEND_ALL_CHECKSUM_RESPONSE_PARAMETERS_TO_PG_SERVER", false);
this.h = getIntent().getStringExtra("mid");
this.i = getIntent().getStringExtra("orderId");
this.l = getIntent().getBooleanExtra("IS_ENABLE_ASSIST", true);
j.a("Assist Enabled");
}
j.a("Hide Header " + this.f);
j.a("Initializing the UI of Transaction Page...");
RelativeLayout relativeLayout = new RelativeLayout(this);
RelativeLayout relativeLayout2 = new RelativeLayout(this);
relativeLayout2.setLayoutParams(new RelativeLayout.LayoutParams(-1, -2));
relativeLayout2.setId(1);
relativeLayout2.setBackgroundColor(Color.parseColor("#bdbdbd"));
Button button = new Button(this, null, R.attr.buttonStyleSmall);
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(-2, -2);
layoutParams.addRule(15);
layoutParams.leftMargin = (int) (getResources().getDisplayMetrics().density * 5.0f);
button.setOnClickListener(new a());
button.setLayoutParams(layoutParams);
button.setText("Cancel");
TextView textView = new TextView(this);
RelativeLayout.LayoutParams layoutParams2 = new RelativeLayout.LayoutParams(-2, -2);
layoutParams2.addRule(13);
textView.setLayoutParams(layoutParams2);
textView.setTextColor(-16777216);
textView.setText("Paytm Payments");
relativeLayout2.addView(button);
relativeLayout2.addView(textView);
RelativeLayout relativeLayout3 = new RelativeLayout(this);
RelativeLayout.LayoutParams layoutParams3 = new RelativeLayout.LayoutParams(-1, -1);
layoutParams3.addRule(3, relativeLayout2.getId());
relativeLayout3.setLayoutParams(layoutParams3);
this.c = new PaytmWebView(this);
this.g = PaytmAssist.getAssistInstance();
this.a = new FrameLayout(this, null);
this.c.setVisibility(8);
this.c.setLayoutParams(new RelativeLayout.LayoutParams(-1, -1));
this.b = new ProgressBar(this, null, R.attr.progressBarStyleSmall);
RelativeLayout.LayoutParams layoutParams4 = new RelativeLayout.LayoutParams(-2, -2);
layoutParams4.addRule(13);
this.b.setLayoutParams(layoutParams4);
RelativeLayout.LayoutParams layoutParams5 = new RelativeLayout.LayoutParams(-1, -2);
layoutParams5.addRule(12);
this.a.setId(PaymentConstants.PHONEPE_PAYMENT_REQUEST_CODE);
this.a.setLayoutParams(layoutParams5);
relativeLayout3.addView(this.c);
relativeLayout3.addView(this.a);
relativeLayout.addView(relativeLayout2);
relativeLayout.addView(relativeLayout3);
if (this.f) {
relativeLayout2.setVisibility(8);
}
setContentView(relativeLayout);
C();
j.a("Initialized UI of Transaction Page.");
} catch (Exception e) {
com.paytm.pgsdk.a.b().c("Redirection", e.getMessage());
j.a("Some exception occurred while initializing UI.");
j.e(e);
return false;
}
} catch (Throwable th) {
throw th;
}
return true;
}
public final String B(String str) {
if (str == null || str.isEmpty()) {
com.google.android.play.core.appupdate.e.n(this, "Message received is either null or empty");
return "";
}
Matcher matcher = Pattern.compile("\\d{6}").matcher(str);
if (!matcher.find()) {
return "";
}
Matcher matcher2 = Pattern.compile("\\d{6}").matcher(matcher.group(0));
if (!matcher2.find()) {
return "";
}
String group = matcher2.group(0);
com.google.android.play.core.appupdate.e.n(this, "OTP found: " + group);
return group;
}
public final void C() {
if (!TextUtils.isEmpty(this.h) && !TextUtils.isEmpty(this.i)) {
this.g.startConfigAssist(this, Boolean.valueOf(this.l), Boolean.valueOf(this.l), Integer.valueOf(this.a.getId()), this.c, this, this.i, this.h);
this.c.setWebCLientCallBacks();
this.g.startAssist();
}
EasypayWebViewClient webClientInstance = this.g.getWebClientInstance();
this.j = webClientInstance;
if (webClientInstance == null) {
j.a("EasyPayWebView Client:mwebViewClient Null");
} else {
j.a("EasyPayWebView Client:mwebViewClient");
this.j.addAssistWebClientListener(this);
}
}
public final synchronized void D() {
try {
j.a("Starting the Process...");
if (getIntent() != null && getIntent().getBundleExtra("Parameters") != null) {
this.d = getIntent().getBundleExtra("Parameters");
if (this.d != null && this.d.size() > 0) {
if (f.c() != null && this.c != null) {
this.c.setId(121);
this.c.setVisibility(0);
this.c.postUrl(f.c().b, j.b(this.d).getBytes());
this.c.requestFocus(130);
if (f.c().a != null && f.c().a.a != null) {
if (f.c().a.a.get("prenotificationurl") != null) {
Intent intent = new Intent(getApplicationContext(), (Class<?>) IntentServicePreNotification.class);
intent.putExtra("url", f.c().a.a.get("prenotificationurl"));
getApplicationContext().startService(intent);
}
}
i d = f.c().d();
if (d != null) {
d.onTransactionCancel("Transaction failed due to invaild parameters", null);
}
finish();
} else if (this.c == null) {
i d2 = f.c().d();
if (d2 != null) {
d2.onTransactionCancel("Transaction failed because of values becoming null", null);
}
finish();
}
}
}
} catch (Throwable th) {
throw th;
}
}
public final void l(String str) {
j.a("SMS received:" + str);
}
public final void n(String str) {
j.a("Pg Activity:OnWcPageFinish");
}
public final void o(SslError sslError) {
j.a("Pg Activity:OnWcSslError");
}
public final void onActivityResult(int i, int i2, Intent intent) {
super/*androidx.fragment.app.FragmentActivity*/.onActivityResult(i, i2, intent);
if (i != 105) {
return;
}
String e = W.e("javascript:window.upiIntent.intentAppClosed(", i2, ");");
this.c.loadUrl(e);
j.a("Js for acknowldgement" + e);
}
public final void onBackPressed() {
z();
}
public final synchronized void onCreate(Bundle bundle) {
try {
requestWindowFeature(1);
super/*androidx.fragment.app.FragmentActivity*/.onCreate(bundle);
if (bundle != null) {
if (f.c() != null && f.c().d() != null) {
f.c().d().onErrorProceed("Please retry with valid parameters");
}
finish();
}
if (this.l && androidx.core.content.b.a(this, "android.permission.RECEIVE_SMS") == 0 && androidx.core.content.b.a(this, "android.permission.READ_SMS") == 0) {
this.k = new e(this);
registerReceiver(this.k, new IntentFilter("android.provider.Telephony.SMS_RECEIVED"));
}
if (A()) {
D();
} else {
finish();
i d = f.c().d();
if (d != null) {
d.someUIErrorOccurred("Some error occured while initializing UI of Payment Gateway Activity");
}
}
} catch (Throwable th) {
throw th;
}
}
public final synchronized void onDestroy() {
e eVar;
try {
try {
if (this.l && (eVar = this.k) != null) {
unregisterReceiver(eVar);
}
f.c().e();
h.a = null;
PaytmAssist paytmAssist = this.g;
if (paytmAssist != null) {
paytmAssist.removeAssist();
}
} catch (Exception e) {
com.paytm.pgsdk.a.b().c("Redirection", e.getMessage());
f.c().e();
j.a("Some exception occurred while destroying the PaytmPGActivity.");
j.e(e);
}
super.onDestroy();
if (com.paytm.pgsdk.a.e != null) {
com.paytm.pgsdk.a.e = null;
}
} catch (Throwable th) {
throw th;
}
}
public final void onResume() {
super/*androidx.fragment.app.FragmentActivity*/.onResume();
}
public final void q(String str) {
j.a("Pg Activity:OnWcPageStart");
}
public final synchronized void z() {
j.a("Displaying Confirmation Dialog");
AlertDialog.Builder builder = new AlertDialog.Builder(this, m.CancelDialogeTheme);
builder.setTitle("Cancel Transaction");
builder.setMessage("Are you sure you want to cancel transaction");
builder.setPositiveButton("Yes", new b());
builder.setNegativeButton("No", new c());
AlertDialog create = builder.create();
this.e = create;
create.show();
}
public final void p() {
}
public final void k(String str) {
}
}