Swiggy v4.51.1版本的 MD5 值为:5af7ec91512a0a8c1510e3f8bac20b8b
以下内容为反编译后的 f.java 源代码,内容仅作参考
package in.swiggy.android.apputils;
import android.annotation.SuppressLint;
import android.content.SharedPreferences;
import androidx.databinding.ObservableBoolean;
import com.xiaomi.mipush.sdk.Constants;
import in.swiggy.android.tejas.TejasConstants;
import java.util.Collection;
import java.util.List;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.text.StringsKt__StringsKt;
public final class f {
public static final a e = new a(null);
public in.swiggy.android.repositories.cart.services.i a;
public SharedPreferences b;
private final ObservableBoolean c = new ObservableBoolean();
private String d;
public static final class a {
public a(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
public final String a(SharedPreferences sharedPreferences) {
kotlin.jvm.internal.o.k(sharedPreferences, "sharedPreferences");
String string = sharedPreferences.getString("gifting_personalization_deeplink", "swiggy://webviewV2?webview_url=https://www.swiggy.com/moments/personalization&flow_id=gifting");
if (string == null) {
return "";
}
return string;
}
private a() {
}
}
public final void a(String selectedCollId) {
CharSequence k1;
String str;
CharSequence k12;
List K0;
CharSequence k13;
boolean z;
kotlin.jvm.internal.o.k(selectedCollId, "selectedCollId");
k1 = StringsKt__StringsKt.k1(selectedCollId);
if (k1.toString().length() == 0) {
return;
}
String string = d().getString("enable_gifting_flow_on_collection_ids", "");
if (string == null) {
str = "";
} else {
str = string;
}
k12 = StringsKt__StringsKt.k1(str);
if (k12.toString().length() != 0) {
K0 = StringsKt__StringsKt.K0(str, new String[]{Constants.ACCEPT_TIME_SEPARATOR_SP}, false, 0, 6, null);
List<String> list = K0;
if (!(list instanceof Collection) || !list.isEmpty()) {
for (String str2 : list) {
k13 = StringsKt__StringsKt.k1(str2);
z = kotlin.text.q.z(k13.toString(), selectedCollId, true);
if (z) {
j(TejasConstants.GIFTING_FLOW_ID);
return;
}
}
}
}
}
public final String b() {
return this.d;
}
public final in.swiggy.android.repositories.cart.services.i c() {
in.swiggy.android.repositories.cart.services.i iVar = this.a;
if (iVar != null) {
return iVar;
}
kotlin.jvm.internal.o.C("cartService");
return null;
}
public final SharedPreferences d() {
SharedPreferences sharedPreferences = this.b;
if (sharedPreferences != null) {
return sharedPreferences;
}
kotlin.jvm.internal.o.C("sharedPreferences");
return null;
}
public final boolean e() {
if (g() && c().r().m().cartSourceFlowIdIsGifting()) {
return true;
}
return false;
}
public final boolean f() {
if (!g() && !c().r().m().cartSourceFlowIdIsGifting()) {
return false;
}
return true;
}
public final boolean g() {
return this.c.g();
}
public final boolean h() {
if (!g() && !c().r().m().cartSourceFlowIdIsGifting()) {
return true;
}
return false;
}
public final void i() {
this.c.h(false);
this.d = null;
}
@SuppressLint({"DefaultLocale"})
public final void j(String str) {
String str2;
CharSequence k1;
this.d = str;
if (str != null) {
k1 = StringsKt__StringsKt.k1(str);
String obj = k1.toString();
if (obj != null) {
str2 = obj.toLowerCase();
kotlin.jvm.internal.o.j(str2, "toLowerCase(...)");
if (!kotlin.jvm.internal.o.f(str2, TejasConstants.GIFTING_FLOW_ID)) {
this.c.h(true);
return;
}
return;
}
}
str2 = null;
if (!kotlin.jvm.internal.o.f(str2, TejasConstants.GIFTING_FLOW_ID)) {
}
}
}