Swiggy v4.51.1版本的 MD5 值为:5af7ec91512a0a8c1510e3f8bac20b8b
以下内容为反编译后的 p.java 源代码,内容仅作参考
package in.swiggy.android.deeplinks.processor;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.newrelic.agent.android.instrumentation.GsonInstrumentation;
import com.newrelic.agent.android.instrumentation.Instrumented;
import in.swiggy.android.SwiggyApplication;
import in.swiggy.android.activities.DeepLinkActivity;
import in.swiggy.android.activities.HomeActivity;
import in.swiggy.android.payment.behaviour.b;
import in.swiggy.android.swiggylynx.ui.LynxActivity;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.text.StringsKt__StringsKt;
@Instrumented
public final class p extends e<in.swiggy.android.deeplinks.resolver.interfaces.h> implements in.swiggy.android.payment.behaviour.b {
public static final a i = new a(null);
public static final int j = 8;
private final SharedPreferences e;
public in.swiggy.android.apputils.bottombar.a f;
public in.swiggy.android.commons.utils.a g;
public in.swiggy.android.swiggylynx.lynxdata.a h;
public static final class a {
public a(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private final String a(String str) {
if (!in.swiggy.android.commons.utils.f0.e(str)) {
return "?" + str;
}
return "";
}
private final String b(Uri uri) {
boolean A;
String str;
String c;
String encodedQuery;
boolean U;
boolean C;
String path = uri.getPath();
A = kotlin.text.q.A(path, "/swiggy-genie", false, 2, null);
if (!A) {
if (path != null) {
C = kotlin.text.q.C(path);
}
if (path != null) {
if (path.length() > 0) {
str = path;
} else {
str = null;
}
if (str != null) {
String host = uri.getHost();
if (host != null) {
kotlin.jvm.internal.o.h(host);
U = StringsKt__StringsKt.U(host, "www.swiggy.com", false, 2, null);
if (U) {
c = p.i.d(path);
encodedQuery = uri.getEncodedQuery();
if (encodedQuery == null) {
a aVar = p.i;
kotlin.jvm.internal.o.h(encodedQuery);
return ((Object) c) + aVar.a(encodedQuery);
}
return c;
}
}
c = p.i.c(path);
encodedQuery = uri.getEncodedQuery();
if (encodedQuery == null) {
}
}
}
return "";
}
path = "/go";
if (path != null) {
}
return "";
}
private final String c(String str) {
String z0;
String z02;
z0 = StringsKt__StringsKt.z0(str, "/");
z02 = StringsKt__StringsKt.z0(z0, "stores");
return z02;
}
private final String d(String str) {
String z0;
z0 = StringsKt__StringsKt.z0(str, "/");
return z0;
}
public final Bundle e(Uri uri, in.swiggy.android.swiggylynx.lynxdata.c dashLynxData, boolean z) {
kotlin.jvm.internal.o.k(uri, "uri");
kotlin.jvm.internal.o.k(dashLynxData, "dashLynxData");
return new in.swiggy.android.swiggylynx.ui.k(dashLynxData.a(b(uri), z), false, null, null, null, null, null, 126, null).h();
}
private a() {
}
}
public static final class b extends TypeToken<List<? extends String>> {
b() {
}
}
public p(SwiggyApplication mApp, in.swiggy.android.deeplinks.resolver.interfaces.h dashWebLinkResolver, SharedPreferences sharedPreferences) {
super(mApp, dashWebLinkResolver);
kotlin.jvm.internal.o.k(mApp, "mApp");
kotlin.jvm.internal.o.k(dashWebLinkResolver, "dashWebLinkResolver");
kotlin.jvm.internal.o.k(sharedPreferences, "sharedPreferences");
this.e = sharedPreferences;
}
private final boolean n(Intent intent) {
Object fromJson;
boolean S;
String dataString = intent.getDataString();
String string = this.e.getString("dash_store_link_list", "[\"listing\", \"menu\", \"collection\"]");
Gson g = in.swiggy.android.commons.utils.i0.g();
Type type = new b().getType();
if (!(g instanceof Gson)) {
fromJson = g.fromJson(string, type);
} else {
fromJson = GsonInstrumentation.fromJson(g, string, type);
}
kotlin.jvm.internal.o.j(fromJson, "fromJson(...)");
for (String str : (ArrayList) fromJson) {
if (dataString != null) {
S = StringsKt__StringsKt.S(dataString, str, true);
if (S) {
return true;
}
}
}
return false;
}
private final Intent o(Uri uri, boolean z, boolean z2, Bundle bundle) {
Context applicationContext = g().getApplicationContext();
kotlin.jvm.internal.o.j(applicationContext, "getApplicationContext(...)");
m(applicationContext);
Intent intent = new Intent(g(), LynxActivity.class);
boolean z3 = false;
if (bundle != null && bundle.getBoolean("shouldRefresh")) {
z3 = true;
}
intent.putExtras(i.e(uri, k(), z3));
intent.putExtra("isInstamart", z);
intent.putExtra("deeplink", uri.toString());
if (z) {
intent.putExtra("landingActivity", "instamart");
} else if (z2) {
intent.putExtra("isGenie", z2);
intent.putExtra("landingActivity", "genie");
} else {
intent.putExtra("landingActivity", "lynx");
}
if (kotlin.jvm.internal.o.f(uri.getQueryParameter("isQuicks"), "true")) {
intent.putExtra("isQuicks", true);
}
intent.putExtra("show_dash_loaders", true);
if (bundle != null) {
intent.putExtras(bundle);
}
intent.addFlags(67108864);
return intent;
}
static Intent p(p pVar, Uri uri, boolean z, boolean z2, Bundle bundle, int i2, Object obj) {
if ((i2 & 8) != 0) {
bundle = null;
}
return pVar.o(uri, z, z2, bundle);
}
@Override
public Intent b(Intent intent) {
kotlin.jvm.internal.o.k(intent, "intent");
Uri data = intent.getData();
String dataString = intent.getDataString();
if (l().d(dataString, "instamart") && data != null && kotlin.jvm.internal.o.f("true", this.e.getString("enable_dash_instamart", "true"))) {
return o(data, true, false, intent.getExtras());
}
if (n(intent) && data != null && kotlin.jvm.internal.o.f("true", this.e.getString("enable_dash_stores", "true"))) {
return p(this, data, false, false, null, 8, null);
}
if (l().d(dataString, "go") && data != null && kotlin.jvm.internal.o.f("true", this.e.getString("enable_dash_genie_v2", "true"))) {
return p(this, data, false, true, null, 8, null);
}
if (l().d(dataString, "order-anything") && data != null && kotlin.jvm.internal.o.f("true", this.e.getString("enable_dash_genie_v2", "true"))) {
return p(this, data, false, true, null, 8, null);
}
if (l().d(dataString, "genie/onboarding") && data != null && kotlin.jvm.internal.o.f("true", this.e.getString("enable_dash_genie_v2", "true"))) {
return p(this, data, false, true, null, 8, null);
}
if (l().d(dataString, "kyc") && data != null) {
return p(this, data, false, false, null, 8, null);
}
if (data == null) {
data = Uri.EMPTY;
}
Uri uri = data;
kotlin.jvm.internal.o.h(uri);
return p(this, uri, false, false, null, 8, null);
}
@Override
public void d(Intent childIntent, AppCompatActivity activity) {
boolean U;
kotlin.jvm.internal.o.k(childIntent, "childIntent");
kotlin.jvm.internal.o.k(activity, "activity");
if (activity instanceof DeepLinkActivity) {
super.d(childIntent, activity);
return;
}
ComponentName component = childIntent.getComponent();
String str = (component == null || (str = component.getClassName()) == null) ? "" : "";
String simpleName = HomeActivity.class.getSimpleName();
kotlin.jvm.internal.o.j(simpleName, "getSimpleName(...)");
U = StringsKt__StringsKt.U(str, simpleName, false, 2, null);
if (U) {
childIntent.addFlags(603979776);
}
activity.startActivityForResult(childIntent, 1201);
}
public final in.swiggy.android.swiggylynx.lynxdata.a k() {
in.swiggy.android.swiggylynx.lynxdata.a aVar = this.h;
if (aVar != null) {
return aVar;
}
kotlin.jvm.internal.o.C("dashLynxData");
return null;
}
public final in.swiggy.android.apputils.bottombar.a l() {
in.swiggy.android.apputils.bottombar.a aVar = this.f;
if (aVar != null) {
return aVar;
}
kotlin.jvm.internal.o.C("dashWebLinkProcessorUtils");
return null;
}
public void m(Context context) {
b.a.a(this, context);
}
}