Swiggy v4.51.1版本的 MD5 值为:5af7ec91512a0a8c1510e3f8bac20b8b
以下内容为反编译后的 chmha.java 源代码,内容仅作参考
package zihjx;
import android.annotation.SuppressLint;
import android.content.IntentFilter;
import android.os.Bundle;
import android.util.Base64;
import android.webkit.WebView;
import android.widget.ProgressBar;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import com.newrelic.agent.android.api.v2.TraceFieldInterface;
import com.newrelic.agent.android.background.ApplicationStateMonitor;
import com.newrelic.agent.android.instrumentation.Instrumented;
import com.newrelic.agent.android.tracing.Trace;
import com.newrelic.agent.android.tracing.TraceMachine;
import com.phonepe.intent.sdk.api.B2BPGRequest;
import com.phonepe.intent.sdk.api.TransactionRequest;
import com.phonepe.intent.sdk.bridges.BridgeHandler;
import com.phonepe.intent.sdk.bridges.DataStore;
import com.phonepe.intent.sdk.bridges.PermissionsHandler;
import jmjou.jmjou;
import krrvc.i;
import krrvc.l;
import krrvc.m;
import org.json.JSONObject;
import rmqfk.jmbjl;
import rmqfk.oohtx;
@Instrumented
public abstract class chmha extends AppCompatActivity implements chmha.b, TraceFieldInterface {
public jmjou.e a;
public PermissionsHandler b;
public DataStore c;
public BridgeHandler d;
public WebView e;
public jmjou f;
public krrvc.d g;
public ProgressBar h;
public String i;
public Trace j;
public void c1() {
this.h.setVisibility(8);
}
public void h1() {
this.h.setVisibility(8);
this.e.setVisibility(0);
}
public void l1(String str) {
this.e.loadUrl(str);
}
public void G(String str) {
int i;
try {
if (!((rmqfk.b) this.f.f(rmqfk.b.class)).b.b().getBoolean("isWebViewCacheEnabled", true)) {
i = 2;
} else {
i = -1;
}
this.e.getSettings().setCacheMode(i);
} catch (Exception e) {
m.d("BaseWebActivity", e.getMessage(), e);
}
int cacheMode = this.e.getSettings().getCacheMode();
m.c("CacheMode", "CacheMode: " + cacheMode);
this.e.loadUrl(str);
}
public final void Z0() {
runOnUiThread(new Runnable() {
@Override
public final void run() {
chmha.this.c1();
}
});
}
@Override
public void _nr_setTrace(Trace trace) {
try {
this.j = trace;
} catch (Exception unused) {
}
}
public final void b1() {
runOnUiThread(new Runnable() {
@Override
public final void run() {
chmha.this.h1();
}
});
}
@SuppressLint({"AddJavascriptInterface"})
public void g1() {
this.e.addJavascriptInterface(this.c, DataStore.TAG);
this.e.addJavascriptInterface(this.d, BridgeHandler.TAG);
this.e.addJavascriptInterface(this.a, "SMSManager");
this.e.addJavascriptInterface(this.b, PermissionsHandler.TAG);
}
@Override
public final void h(String str, String str2, String str3, String str4, String str5) {
((i) this.f.f(i.class)).getClass();
boolean z = false;
final String format = String.format("javascript:%s('%s' , '%s' , '%s' , '%s')", str, str2, str3, str4, str5);
WebView webView = this.e;
if (webView != null && webView.getVisibility() == 0) {
z = true;
}
if (!isFinishing() || z) {
runOnUiThread(new Runnable() {
@Override
public final void run() {
chmha.this.l1(format);
}
});
}
}
@Override
public void onCreate(Bundle bundle) {
TransactionRequest transactionRequest;
B2BPGRequest b2BPGRequest;
String data;
JSONObject jSONObject;
TraceMachine.startTracing("chmha");
String str = null;
try {
TraceMachine.enterMethod(this.j, "chmha#onCreate", null);
} catch (NoSuchFieldError unused) {
TraceMachine.enterMethod(null, "chmha#onCreate", null);
}
super.onCreate(bundle);
setContentView(com.phonepe.intent.sdk.c.activity_phonepe_web);
this.e = (WebView) findViewById(com.phonepe.intent.sdk.b.phonepe_webview);
this.h = (ProgressBar) findViewById(com.phonepe.intent.sdk.b.progressBar);
this.f = (jmjou) getIntent().getParcelableExtra("data_factory");
jmjou.a = getApplicationContext();
jmjou.chmha chmhaVar = (jmjou.chmha) this.f.f(jmjou.chmha.class);
if (getIntent().getParcelableExtra("request") instanceof TransactionRequest) {
transactionRequest = (TransactionRequest) getIntent().getParcelableExtra("request");
b2BPGRequest = null;
} else if (getIntent().getParcelableExtra("request") instanceof B2BPGRequest) {
b2BPGRequest = (B2BPGRequest) getIntent().getParcelableExtra("request");
transactionRequest = null;
} else {
transactionRequest = null;
b2BPGRequest = null;
}
this.i = "default";
if (transactionRequest != null || b2BPGRequest != null) {
try {
if (transactionRequest != null) {
data = transactionRequest.getData();
} else {
if (b2BPGRequest != null) {
data = b2BPGRequest.getData();
}
jSONObject = new JSONObject(new String(Base64.decode(str, 0)));
if (jSONObject.has("paymentSources")) {
JSONObject jSONObject2 = jSONObject.getJSONArray("paymentSources").getJSONObject(0);
if (jSONObject2.has("mode")) {
this.i = jSONObject2.getString("mode");
}
}
}
str = data;
jSONObject = new JSONObject(new String(Base64.decode(str, 0)));
if (jSONObject.has("paymentSources")) {
}
} catch (Exception e) {
m.d("BaseWebActivity", e.getMessage(), e);
}
}
chmhaVar.put("activity", this);
chmhaVar.put("bridgeCallback", this);
chmhaVar.put("nativeCardCallback", this);
chmhaVar.put("ObjectFactory", this.f);
this.a = (jmjou.e) this.f.g(jmjou.e.class, chmhaVar);
this.d = (BridgeHandler) this.f.g(BridgeHandler.class, chmhaVar);
this.b = (PermissionsHandler) this.f.g(PermissionsHandler.class, chmhaVar);
this.c = (DataStore) this.f.g(DataStore.class, chmhaVar);
krrvc.d dVar = (krrvc.d) this.f.f(krrvc.d.class);
this.g = dVar;
dVar.a(dVar.b("SDK_BASE_WEB_ACTIVITY_CREATED"));
l.b(this.f);
g1();
TraceMachine.exitMethod();
}
@Override
public void onDestroy() {
super.onDestroy();
l.j(this.f);
this.e.removeJavascriptInterface("SMSManager");
this.e.removeJavascriptInterface(PermissionsHandler.TAG);
this.e.removeJavascriptInterface(BridgeHandler.TAG);
this.e.removeJavascriptInterface(DataStore.TAG);
this.a.stopListeningToOTP();
}
@Override
public final void onRequestPermissionsResult(int i, @NonNull String[] strArr, @NonNull int[] iArr) {
String str;
if (i != 1011) {
switch (i) {
case 456:
case 457:
case 458:
jmjou.e eVar = this.a;
eVar.getClass();
if (iArr.length > 0) {
if (iArr[0] == 0) {
String str2 = strArr[0];
str2.getClass();
if (str2.equals("android.permission.READ_SMS")) {
eVar.b.a = eVar;
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction("android.provider.Telephony.SMS_RECEIVED");
intentFilter.setPriority(999);
intentFilter.addCategory("android.intent.category.DEFAULT");
eVar.a.registerReceiver(eVar.b, intentFilter);
return;
}
return;
}
String str3 = strArr[0];
str3.getClass();
char c = 65535;
switch (str3.hashCode()) {
case -2062386608:
if (str3.equals("android.permission.READ_SMS")) {
c = 0;
break;
}
break;
case -5573545:
if (str3.equals("android.permission.READ_PHONE_STATE")) {
c = 1;
break;
}
break;
case 52602690:
if (str3.equals("android.permission.SEND_SMS")) {
c = 2;
break;
}
break;
}
switch (c) {
case 0:
str = "PERMISSION_DENIED_READ_SMS";
break;
case 1:
str = "PERMISSION_DENIED_READ_PHONE_STATE";
break;
case 2:
str = "PERMISSION_DENIED_SEND_SMS";
break;
default:
str = null;
break;
}
jmbjl jmbjlVar = (jmbjl) eVar.g.f(jmbjl.class);
jmbjlVar.put("code", str);
String jsonString = jmbjlVar.toJsonString();
rmqfk.jmjou jmjouVar = (rmqfk.jmjou) eVar.g.f(rmqfk.jmjou.class);
jmjouVar.getClass();
jmjouVar.put("data", ((oohtx) eVar.g.f(oohtx.class)).toJsonObject());
String jsonString2 = jmjouVar.toJsonString();
m.c("SMSManager", String.format("calling onBridgeCallBack callback = {%s}, error = {%s}, response={%s}, context={%s}, body={%s}.", eVar.c, jsonString, null, eVar.d, jsonString2));
eVar.f.h(eVar.c, jsonString, null, eVar.d, jsonString2);
return;
}
return;
default:
return;
}
}
PermissionsHandler permissionsHandler = this.b;
if (permissionsHandler != null) {
permissionsHandler.onPermissionReceived(strArr, iArr);
}
}
@Override
public void onStart() {
super.onStart();
ApplicationStateMonitor.getInstance().activityStarted();
}
@Override
public final void onStop() {
ApplicationStateMonitor.getInstance().activityStopped();
super.onStop();
this.h.setVisibility(8);
}
}