Swiggy v4.51.1版本的 MD5 值为:5af7ec91512a0a8c1510e3f8bac20b8b
以下内容为反编译后的 ChallengeHtmlActivity.java 源代码,内容仅作参考
package com.wibmo.threeds2.sdk.ui;
import android.app.Activity;
import android.content.Intent;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.net.http.SslError;
import android.os.Bundle;
import android.util.Log;
import android.webkit.SslErrorHandler;
import android.webkit.WebChromeClient;
import android.webkit.WebResourceRequest;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import com.newrelic.agent.android.hybrid.data.HexAttribute;
import com.payu.threedsbase.constants.APIConstants;
import com.payu.threedsbase.constants.PayU3DS2ErrorConstants;
import com.wibmo.threeds2.sdk.cfg.ConfigParameters;
import com.wibmo.threeds2.sdk.cfg.ErrorMessage;
import com.wibmo.threeds2.sdk.h;
import com.wibmo.threeds2.sdk.j;
import com.wibmo.threeds2.sdk.pojo.CReq;
import com.wibmo.threeds2.sdk.pojo.ErrorMessages;
import com.wibmo.threeds2.sdk.util.f;
import in.swiggy.android.tejas.oldapi.models.intdef.TrackOrderState;
import rx.b;
public class ChallengeHtmlActivity extends com.wibmo.threeds2.sdk.ui.a {
SDKWebView s;
boolean t;
private f r = new f();
String u = "";
private boolean v = false;
private Boolean w = Boolean.FALSE;
public class a implements b.a<Boolean> {
final String a;
a(String str) {
this.a = str;
}
@Override
public void a(rx.f<? super Boolean> fVar) {
CReq R;
try {
R = com.wibmo.threeds2.sdk.ui.a.p.R();
R.setChallengeHTMLDataEntry(this.a);
} finally {
try {
} finally {
}
}
if (!ChallengeHtmlActivity.this.r.b(ChallengeHtmlActivity.this)) {
return;
}
com.wibmo.threeds2.sdk.ui.a.p.q(R, com.wibmo.threeds2.sdk.ui.a.q);
fVar.onNext(new Boolean(true));
}
}
public class b implements rx.c<Boolean> {
b() {
}
@Override
public void a() {
ChallengeHtmlActivity.this.r.a();
}
@Override
public void onNext(Boolean bool) {
com.wibmo.threeds2.sdk.ui.b bVar;
ChallengeHtmlActivity.this.a = com.wibmo.threeds2.sdk.ui.a.p.K();
ChallengeHtmlActivity.this.b = com.wibmo.threeds2.sdk.ui.a.p.M();
ChallengeHtmlActivity challengeHtmlActivity = ChallengeHtmlActivity.this;
if (!challengeHtmlActivity.l) {
if (challengeHtmlActivity.w.booleanValue() && (bVar = ChallengeHtmlActivity.this.j) != null && bVar.isShowing()) {
e.k(ChallengeHtmlActivity.this.j);
} else {
com.wibmo.threeds2.sdk.ui.d dVar = ChallengeHtmlActivity.this.i;
if (dVar != null && dVar.isShowing()) {
e.l(ChallengeHtmlActivity.this.i);
} else {
com.wibmo.threeds2.sdk.ui.c cVar = ChallengeHtmlActivity.this.h;
if (cVar != null && cVar.isShowing()) {
ChallengeHtmlActivity.this.h.dismiss();
}
}
}
}
ChallengeHtmlActivity challengeHtmlActivity2 = ChallengeHtmlActivity.this;
ErrorMessages errorMessages = challengeHtmlActivity2.b;
if (errorMessages != null) {
if (errorMessages.getErrorCode().equalsIgnoreCase("302")) {
ChallengeHtmlActivity challengeHtmlActivity3 = ChallengeHtmlActivity.this;
String i = challengeHtmlActivity3.m.i();
StringBuilder sb = new StringBuilder();
sb.append("errorCode: ");
sb.append(ChallengeHtmlActivity.this.b.getErrorCode());
sb.append(", errorMessage: ");
Resources resources = ChallengeHtmlActivity.this.getResources();
int i2 = j.we_could_not_decrypt_cres;
sb.append(resources.getString(i2));
com.wibmo.threeds2.sdk.util.e.d(challengeHtmlActivity3, i, "sdk_challenge_runtime_error", sb.toString());
com.wibmo.threeds2.sdk.ui.a.p.B().c(new com.wibmo.threeds2.sdk.event.c("1", ChallengeHtmlActivity.this.getResources().getString(i2)));
ChallengeHtmlActivity.this.finish();
return;
}
ErrorMessage errorMessage = new ErrorMessage(ChallengeHtmlActivity.this.b.getAcsTransID(), ChallengeHtmlActivity.this.b.getErrorCode(), ChallengeHtmlActivity.this.b.getErrorDescription(), ChallengeHtmlActivity.this.b.getErrorDetail());
errorMessage.f(ChallengeHtmlActivity.this.b.getErrorComponent());
errorMessage.g(ChallengeHtmlActivity.this.b.getErrorMessageType());
errorMessage.h(ChallengeHtmlActivity.this.b.getMessageType());
Activity activity = com.wibmo.threeds2.sdk.ui.a.q;
String i3 = ChallengeHtmlActivity.this.m.i();
com.wibmo.threeds2.sdk.util.e.d(activity, i3, "sdk_challenge_protocol_error", "messageType: " + errorMessage.d() + ", acsTransID: " + errorMessage.e());
com.wibmo.threeds2.sdk.ui.a.p.B().f(new com.wibmo.threeds2.sdk.event.b(TrackOrderState.ORDER_CANCELLED, errorMessage));
ChallengeHtmlActivity.this.finish();
return;
}
challengeHtmlActivity2.r1();
}
@Override
public void onError(Throwable th) {
com.wibmo.threeds2.sdk.ui.b bVar;
ChallengeHtmlActivity challengeHtmlActivity = ChallengeHtmlActivity.this;
if (!challengeHtmlActivity.l) {
if (challengeHtmlActivity.w.booleanValue() && (bVar = ChallengeHtmlActivity.this.j) != null && bVar.isShowing()) {
e.k(ChallengeHtmlActivity.this.j);
} else {
com.wibmo.threeds2.sdk.ui.d dVar = ChallengeHtmlActivity.this.i;
if (dVar != null && dVar.isShowing()) {
e.l(ChallengeHtmlActivity.this.i);
} else {
com.wibmo.threeds2.sdk.ui.c cVar = ChallengeHtmlActivity.this.h;
if (cVar != null && cVar.isShowing()) {
ChallengeHtmlActivity.this.h.dismiss();
}
}
}
}
Log.e("wibmo.3dssdk.ChHtml", "We have error: " + th, th);
}
}
public class c extends WebChromeClient {
c(ChallengeHtmlActivity challengeHtmlActivity) {
}
@Override
public void onProgressChanged(WebView webView, int i) {
}
}
private void B1(String str) {
str.length();
String y1 = y1(str, str.toLowerCase(), 0);
if (y1 != null) {
str = y1;
}
this.s.loadData(str, "text/html", "utf-8");
}
public void D1(String str) {
E1(str.substring(str.indexOf("?") + 1));
}
private void E1(String str) {
this.h = null;
if (com.wibmo.threeds2.sdk.ui.a.p != null) {
ConfigParameters configParameters = this.m;
if (configParameters != null && configParameters.l()) {
this.j = new com.wibmo.threeds2.sdk.ui.b(this, this.m.e());
this.w = Boolean.TRUE;
} else {
this.w = Boolean.FALSE;
}
this.i = new com.wibmo.threeds2.sdk.ui.d(this);
if (!isFinishing() && !this.l) {
if (this.w.booleanValue()) {
this.j.show();
} else {
this.i.show();
}
}
}
rx.b.a(new a(str)).k(rx.schedulers.a.c()).d(rx.android.schedulers.a.b()).h(new b());
}
private String y1(String str, String str2, int i) {
boolean z;
int indexOf;
int i2;
int indexOf2 = str2.indexOf("<form");
if (indexOf2 != -1) {
int indexOf3 = str2.indexOf(HexAttribute.HEX_ATTR_JSERROR_METHOD, indexOf2 + 5);
str.substring(indexOf3, indexOf3 + 80);
if (indexOf3 != -1) {
int indexOf4 = str2.indexOf("\"", indexOf3);
if (indexOf4 == -1) {
indexOf4 = str2.indexOf("'", indexOf3);
z = true;
} else {
z = false;
}
if (indexOf4 != -1) {
if (z) {
indexOf = str2.indexOf("'", indexOf4 + 1);
} else {
indexOf = str2.indexOf("\"", indexOf4 + 1);
}
if (indexOf != -1) {
str.substring(indexOf4 + 1, indexOf);
return str.substring(0, i2) + "GET" + str.substring(indexOf);
}
}
}
}
return null;
}
private void z1() {
this.s.loadData("<html><body><center><h4>please wait</h4><center></body></html>", "text/html", "utf-8");
this.s.setWebChromeClient(new c(this));
this.s.setWebViewClientInternal(new d());
}
public void F1() {
if (this.a.getAcsUiType().equals(APIConstants.WIBMO_SDK_MAX_TIMEOUT)) {
if (this.a.getAcsHTMLRefreshHTML() != null && !this.a.getAcsHTMLRefreshHTML().isEmpty()) {
this.g = true;
}
if (this.a.getAcsHTMLRefreshHTML() != null && !this.a.getAcsHTMLRefreshHTML().isEmpty() && this.g) {
String acsHTMLRefreshHTML = this.a.getAcsHTMLRefreshHTML();
this.u = acsHTMLRefreshHTML;
String str = new String(org.jose4j.base64url.b.g(acsHTMLRefreshHTML));
if (str.length() > 30) {
str.substring(0, 30);
}
B1(str);
}
}
}
@Override
public void onActivityResult(int i, int i2, Intent intent) {
super.onActivityResult(i, i2, intent);
}
@Override
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
if (bundle != null) {
this.l = ((Boolean) bundle.getSerializable("configChanged")).booleanValue();
this.v = bundle.getBoolean("refresh_ui", false);
}
setContentView(h.activity_challenge_html);
this.s = (SDKWebView) findViewById(com.wibmo.threeds2.sdk.f.web_view);
ConfigParameters configParameters = this.m;
if (configParameters != null && configParameters.l()) {
this.w = Boolean.TRUE;
} else {
this.w = Boolean.FALSE;
}
z1();
r1();
}
@Override
public void onDestroy() {
com.wibmo.threeds2.sdk.ui.b bVar;
super.onDestroy();
if (!this.l) {
if (this.w.booleanValue() && (bVar = this.j) != null && bVar.isShowing()) {
e.k(this.j);
} else {
com.wibmo.threeds2.sdk.ui.d dVar = this.i;
if (dVar != null && dVar.isShowing()) {
e.l(this.i);
} else {
com.wibmo.threeds2.sdk.ui.c cVar = this.h;
if (cVar != null && cVar.isShowing()) {
this.h.dismiss();
}
}
}
}
if (com.wibmo.threeds2.sdk.ui.a.p != null) {
if (this.w.booleanValue()) {
com.wibmo.threeds2.sdk.ui.a.p.G().dismiss();
} else {
com.wibmo.threeds2.sdk.ui.a.p.I().dismiss();
}
}
}
@Override
public void onPause() {
super.onPause();
this.v = true;
}
@Override
public void onResume() {
super.onResume();
if (this.v) {
F1();
}
}
@Override
public void onSaveInstanceState(Bundle bundle) {
super.onSaveInstanceState(bundle);
bundle.putSerializable("configChanged", Boolean.TRUE);
bundle.putBoolean("refresh_ui", true);
}
@Override
protected void onStart() {
super.onStart();
}
@Override
protected void w1() {
if (this.a != null) {
this.a.getAcsUiType();
if (this.a.getAcsHTML() == null || this.a.getAcsHTML().isEmpty()) {
Log.e("wibmo.3dssdk.ChHtml", "We do not have acsHTML!");
}
if (this.g) {
this.u = this.a.getAcsHTMLRefreshHTML();
this.g = true;
} else {
this.u = this.a.getAcsHTML();
}
String str = new String(org.jose4j.base64url.b.g(this.u));
if (str.length() > 30) {
str.substring(0, 30);
}
B1(str);
}
}
public class d extends WebViewClient {
boolean a = false;
d() {
}
@Override
public void onLoadResource(WebView webView, String str) {
if (str.startsWith("data:")) {
super.onLoadResource(webView, str);
}
}
@Override
public void onPageFinished(WebView webView, String str) {
str.startsWith("data:");
ChallengeHtmlActivity.this.t = true;
if (this.a) {
Log.w("wibmo.3dssdk.ChHtml", "Stop loading already done");
} else if (!str.startsWith("data:") && str.toLowerCase().startsWith("https://emv3ds/challenge")) {
this.a = true;
webView.stopLoading();
}
}
@Override
public void onPageStarted(WebView webView, String str, Bitmap bitmap) {
if (!str.startsWith("data:") && str.toLowerCase().startsWith("https://emv3ds/challenge")) {
this.a = true;
webView.stopLoading();
ChallengeHtmlActivity.this.D1(str);
return;
}
super.onPageStarted(webView, str, bitmap);
}
@Override
public void onReceivedSslError(WebView webView, SslErrorHandler sslErrorHandler, SslError sslError) {
sslErrorHandler.cancel();
com.wibmo.threeds2.sdk.ui.a.p.B().c(new com.wibmo.threeds2.sdk.event.c("1", PayU3DS2ErrorConstants.ERROR_WHILE_LOADING_PAGE));
ChallengeHtmlActivity.this.finish();
}
@Override
public boolean shouldOverrideUrlLoading(WebView webView, WebResourceRequest webResourceRequest) {
webResourceRequest.getUrl().toString();
return shouldOverrideUrlLoading(webView, webResourceRequest.getUrl().toString());
}
@Override
public boolean shouldOverrideUrlLoading(WebView webView, String str) {
if (str.toLowerCase().startsWith("https://emv3ds/challenge")) {
ChallengeHtmlActivity.this.D1(str);
return true;
}
return false;
}
}
}