Swiggy v4.51.1版本的 MD5 值为:5af7ec91512a0a8c1510e3f8bac20b8b
以下内容为反编译后的 SeoAttributionModel.java 源代码,内容仅作参考
package in.swiggy.android.seo;
import android.net.Uri;
import in.swiggy.android.commons.extension.KotlinExtensionsKt;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;
import kotlin.Unit;
import kotlin.collections.i0;
import kotlin.collections.s;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.o;
import kotlin.ranges.n;
import kotlin.text.StringsKt__StringsKt;
public final class SeoAttributionModel {
public static final a h = new a(null);
public static final int i = 8;
private String a;
private String b;
private String c = "-";
private String d = "-";
private String e;
private String f;
private boolean g;
public static final class a {
public a(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private a() {
}
}
public SeoAttributionModel(String str, String str2) {
String str3;
String str4;
boolean S;
boolean S2;
Set<String> queryParameterNames;
int x;
int e;
int d;
this.a = "-";
this.b = "-";
if (str == null) {
str3 = "-";
} else {
str3 = str;
}
this.e = str3;
this.f = "-";
this.g = true;
if (str != null) {
S2 = StringsKt__StringsKt.S(str, "utm_", true);
if (S2) {
Uri parse = Uri.parse(str);
Map<String, String> map = null;
if (parse != null && (queryParameterNames = parse.getQueryParameterNames()) != null) {
o.h(queryParameterNames);
Set<String> set = queryParameterNames;
x = s.x(set, 10);
e = i0.e(x);
d = n.d(e, 16);
map = new LinkedHashMap<>(d);
for (Object obj : set) {
map.put(obj, parse.getQueryParameter((String) obj));
}
}
if (map != null) {
m(map, str2);
}
KotlinExtensionsKt.p(str, str2, new Function2<String, String, Unit>() {
{
super(2);
}
@Override
public Unit invoke(String str5, String str6) {
invoke2(str5, str6);
return Unit.a;
}
public final void invoke2(String webPageUrl, String referralUrl) {
o.k(webPageUrl, "webPageUrl");
o.k(referralUrl, "referralUrl");
if (SeoAttributionModel.this.j(webPageUrl, referralUrl) || SeoAttributionModel.this.k(webPageUrl)) {
SeoAttributionModel.this.l(false);
}
}
});
}
}
if (str2 != null) {
S = StringsKt__StringsKt.S(str2, "google", true);
if (S) {
str4 = "SEO";
this.a = str4;
this.b = str2;
KotlinExtensionsKt.p(str, str2, new Function2<String, String, Unit>() {
{
super(2);
}
@Override
public Unit invoke(String str5, String str6) {
invoke2(str5, str6);
return Unit.a;
}
public final void invoke2(String webPageUrl, String referralUrl) {
o.k(webPageUrl, "webPageUrl");
o.k(referralUrl, "referralUrl");
if (SeoAttributionModel.this.j(webPageUrl, referralUrl) || SeoAttributionModel.this.k(webPageUrl)) {
SeoAttributionModel.this.l(false);
}
}
});
}
}
str4 = "Referral";
this.a = str4;
this.b = str2;
KotlinExtensionsKt.p(str, str2, new Function2<String, String, Unit>() {
{
super(2);
}
@Override
public Unit invoke(String str5, String str6) {
invoke2(str5, str6);
return Unit.a;
}
public final void invoke2(String webPageUrl, String referralUrl) {
o.k(webPageUrl, "webPageUrl");
o.k(referralUrl, "referralUrl");
if (SeoAttributionModel.this.j(webPageUrl, referralUrl) || SeoAttributionModel.this.k(webPageUrl)) {
SeoAttributionModel.this.l(false);
}
}
});
}
public final boolean j(String str, String str2) {
if (o.f(str, "-") && o.f(str2, "-")) {
return true;
}
return false;
}
public final boolean k(String str) {
boolean U;
boolean U2;
U = StringsKt__StringsKt.U(str, "stores.swiggy.com", false, 2, null);
if (!U) {
U2 = StringsKt__StringsKt.U(str, "www.swiggy.com/instamart", false, 2, null);
if (!U2) {
return false;
}
}
return true;
}
private final void m(Map<String, String> map, String str) {
String str2 = map.get("utm_source");
if (o.f(str2, "GooglePlaceOrder")) {
this.a = "SEO";
this.f = "GooglePlaceOrder";
this.b = str;
return;
}
String str3 = "-";
if (str2 == null) {
str2 = "-";
}
this.a = str2;
String str4 = map.get("utm_medium");
if (str4 == null) {
str4 = "-";
}
this.b = str4;
String str5 = map.get("utm_content");
if (str5 == null) {
str5 = "-";
}
this.d = str5;
String str6 = map.get("utm_campaign");
if (str6 != null) {
str3 = str6;
}
this.c = str3;
}
public final boolean c() {
return this.g;
}
public final String d() {
return this.e;
}
public final String e() {
return this.f;
}
public final String f() {
return this.c;
}
public final String g() {
return this.d;
}
public final String h() {
return this.b;
}
public final String i() {
return this.a;
}
public final void l(boolean z) {
this.g = z;
}
}