Swiggy v4.51.1版本的 MD5 值为:5af7ec91512a0a8c1510e3f8bac20b8b
以下内容为反编译后的 LoginLimitErrorActivity.java 源代码,内容仅作参考
package in.swiggy.android.activities;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.View;
import androidx.compose.runtime.ComposerKt;
import androidx.compose.ui.platform.ComposeView;
import androidx.compose.ui.platform.ViewCompositionStrategy;
import androidx.databinding.ViewDataBinding;
import in.swiggy.android.R;
import in.swiggy.android.composer.feature.swiggyOneDeviceLimit.ui.LoginLimitErrorScreenKt;
import in.swiggy.android.dls.compose.theme.SwiggyThemeKt;
import in.swiggy.android.dls.theme.ThemeColorMode;
import in.swiggy.android.mvvm.services.LoginLimitErrorService;
import in.swiggy.android.mvvm.viewmodels.loginsignup.LoginLimitErrorActivityViewModel;
import in.swiggy.android.tejas.feature.timeline.model.Destination;
import io.reactivex.processors.PublishProcessor;
import java.util.Arrays;
import kotlin.Unit;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.FunctionReferenceImpl;
import org.json.JSONObject;
public final class LoginLimitErrorActivity extends MvvmSwiggyBaseActivity {
public static final a E = new a(null);
public static final int F = 8;
private static final String G = "source_screen";
private static final String H = "onBoarding";
private static final String I = "account";
private static final String J = Destination.CUSTOMER_HOME;
private static final String K = "swiggy_one_device_limit";
private static final String L = "instamart";
private static final String M = "food";
private static final String N = "dineout";
private static final int O = 21;
private static final int P = 22;
private static final int Q = 23;
private static final int R = 24;
private static final int S = 25;
private static final String T = "navigateToAccount";
private final io.reactivex.disposables.a A = new io.reactivex.disposables.a();
public dagger.b<LoginLimitErrorActivityViewModel> B;
public dagger.b<LoginLimitErrorService> C;
public PublishProcessor<Integer> D;
private LoginLimitErrorActivityViewModel w;
private in.swiggy.android.databinding.m0 x;
private String y;
private String z;
public static final class a {
public a(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
public final String a() {
return LoginLimitErrorActivity.I;
}
public final int b() {
return LoginLimitErrorActivity.P;
}
public final String c() {
return LoginLimitErrorActivity.J;
}
public final int d() {
return LoginLimitErrorActivity.Q;
}
public final String e() {
return LoginLimitErrorActivity.T;
}
public final String f() {
return LoginLimitErrorActivity.H;
}
public final int g() {
return LoginLimitErrorActivity.O;
}
public final String h() {
return LoginLimitErrorActivity.G;
}
public final String i() {
return LoginLimitErrorActivity.K;
}
public final void j(Context context, int i, String sourceScreen, String deviceLimit) {
kotlin.jvm.internal.o.k(context, "context");
kotlin.jvm.internal.o.k(sourceScreen, "sourceScreen");
kotlin.jvm.internal.o.k(deviceLimit, "deviceLimit");
Intent intent = new Intent(context, LoginLimitErrorActivity.class);
intent.putExtra(h(), sourceScreen);
intent.putExtra(i(), deviceLimit);
if (context instanceof LoginActivityV2) {
((LoginActivityV2) context).startActivityForResult(intent, i);
} else if (context instanceof ForgotPasswordOTPActivityV2) {
((ForgotPasswordOTPActivityV2) context).startActivityForResult(intent, i);
} else if (context instanceof HomeActivity) {
((HomeActivity) context).startActivityForResult(intent, i);
}
}
private a() {
}
}
private final void Y1() {
Intent intent = getIntent();
String str = G;
if (intent.hasExtra(str)) {
this.y = getIntent().getStringExtra(str);
this.z = getIntent().getStringExtra(K);
}
}
public static final void Z1(Function1 tmp0, Object obj) {
kotlin.jvm.internal.o.k(tmp0, "$tmp0");
tmp0.invoke(obj);
}
public final void a2(boolean z) {
boolean A;
boolean A2;
A = kotlin.text.q.A(this.y, H, false, 2, null);
if (A) {
this.i.edit().remove("nuxLocationSetupInProgress").apply();
}
LoginLimitErrorActivityViewModel loginLimitErrorActivityViewModel = this.w;
if (loginLimitErrorActivityViewModel != null) {
loginLimitErrorActivityViewModel.Z7(false);
}
A2 = kotlin.text.q.A(this.y, J, false, 2, null);
if (A2) {
Intent intent = new Intent();
if (z) {
intent.putExtra(T, true);
} else {
intent.putExtra(T, false);
}
setResult(0, intent);
} else {
setResult(0);
}
finish();
}
private final void b2() {
in.swiggy.android.databinding.m0 m0Var = this.x;
if (m0Var != null) {
setSupportActionBar(m0Var.C);
m0Var.C.setTitle(getString(R.string.title_activity_login_limit_exceeded));
m0Var.C.setTitleAllCaps(false);
m0Var.C.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
LoginLimitErrorActivity.c2(LoginLimitErrorActivity.this, view);
}
});
}
}
public static final void c2(LoginLimitErrorActivity this$0, View view) {
kotlin.jvm.internal.o.k(this$0, "this$0");
this$0.A.dispose();
this$0.V1().w0(2);
LoginLimitErrorActivityViewModel loginLimitErrorActivityViewModel = this$0.w;
if (loginLimitErrorActivityViewModel != null) {
loginLimitErrorActivityViewModel.X7(true, false, new LoginLimitErrorActivity$setUpToolBar$1$1$1(this$0));
}
}
@Override
public in.swiggy.android.mvvm.services.r A1() {
if (this.o == null) {
this.o = new LoginLimitErrorService(this);
dagger.b<LoginLimitErrorService> X1 = X1();
in.swiggy.android.mvvm.services.r rVar = this.o;
kotlin.jvm.internal.o.i(rVar, "null cannot be cast to non-null type in.swiggy.android.mvvm.services.LoginLimitErrorService");
X1.injectMembers((LoginLimitErrorService) rVar);
}
in.swiggy.android.mvvm.services.r mUiComponentService = this.o;
kotlin.jvm.internal.o.j(mUiComponentService, "mUiComponentService");
return mUiComponentService;
}
@Override
public in.swiggy.android.mvvm.base.c Q0() {
in.swiggy.android.databinding.m0 m0Var;
if (this.w == null) {
in.swiggy.android.mvvm.services.r A1 = A1();
kotlin.jvm.internal.o.i(A1, "null cannot be cast to non-null type in.swiggy.android.mvvm.services.interfaces.ILoginLimitErrorService");
this.w = new LoginLimitErrorActivityViewModel((in.swiggy.android.mvvm.services.interfaces.d) A1);
dagger.b<LoginLimitErrorActivityViewModel> W1 = W1();
LoginLimitErrorActivityViewModel loginLimitErrorActivityViewModel = this.w;
kotlin.jvm.internal.o.i(loginLimitErrorActivityViewModel, "null cannot be cast to non-null type in.swiggy.android.mvvm.viewmodels.loginsignup.LoginLimitErrorActivityViewModel");
W1.injectMembers(loginLimitErrorActivityViewModel);
ViewDataBinding b1 = b1();
if (b1 instanceof in.swiggy.android.databinding.m0) {
m0Var = (in.swiggy.android.databinding.m0) b1;
} else {
m0Var = null;
}
this.x = m0Var;
b2();
}
LoginLimitErrorActivityViewModel loginLimitErrorActivityViewModel2 = this.w;
kotlin.jvm.internal.o.i(loginLimitErrorActivityViewModel2, "null cannot be cast to non-null type in.swiggy.android.mvvm.base.ViewModel");
return loginLimitErrorActivityViewModel2;
}
public final PublishProcessor<Integer> V1() {
PublishProcessor<Integer> publishProcessor = this.D;
if (publishProcessor != null) {
return publishProcessor;
}
kotlin.jvm.internal.o.C("limitErrorProcessor");
return null;
}
public final dagger.b<LoginLimitErrorActivityViewModel> W1() {
dagger.b<LoginLimitErrorActivityViewModel> bVar = this.B;
if (bVar != null) {
return bVar;
}
kotlin.jvm.internal.o.C("loginLimitErrorActivityViewModelMembersInjector");
return null;
}
public final dagger.b<LoginLimitErrorService> X1() {
dagger.b<LoginLimitErrorService> bVar = this.C;
if (bVar != null) {
return bVar;
}
kotlin.jvm.internal.o.C("loginLimitErrorServiceMembersInjector");
return null;
}
@Override
public String d0() {
return "login_limit-error_page";
}
@Override
protected int g1() {
return R.layout.activity_login_limit_error;
}
@Override
public void onActivityResult(int i, int i2, Intent intent) {
LoginLimitErrorActivityViewModel loginLimitErrorActivityViewModel;
super.onActivityResult(i, i2, intent);
if (i == 9 && i2 == -1 && intent != null && intent.hasExtra("isBreachResolved") && intent.hasExtra("isCurrentDeviceLoggedOut")) {
boolean f = kotlin.jvm.internal.o.f(intent.getStringExtra("isBreachResolved"), "true");
boolean f2 = kotlin.jvm.internal.o.f(intent.getStringExtra("isCurrentDeviceLoggedOut"), "true");
if (f) {
if (f2) {
LoginLimitErrorActivityViewModel loginLimitErrorActivityViewModel2 = this.w;
if (loginLimitErrorActivityViewModel2 != null) {
loginLimitErrorActivityViewModel2.X7(false, false, new LoginLimitErrorActivity$onActivityResult$1$1(this));
}
} else {
setResult(-1);
finish();
}
LoginLimitErrorActivityViewModel loginLimitErrorActivityViewModel3 = this.w;
if (loginLimitErrorActivityViewModel3 != null) {
loginLimitErrorActivityViewModel3.Z7(false);
}
} else if (f2 && (loginLimitErrorActivityViewModel = this.w) != null) {
loginLimitErrorActivityViewModel.X7(false, false, new LoginLimitErrorActivity$onActivityResult$1$2(this));
}
}
}
@Override
public void onBackPressed() {
this.A.dispose();
V1().w0(2);
LoginLimitErrorActivityViewModel loginLimitErrorActivityViewModel = this.w;
if (loginLimitErrorActivityViewModel != null) {
loginLimitErrorActivityViewModel.Y7("click-back-physicalbutton-logout-devicelimit", "back button logout");
}
LoginLimitErrorActivityViewModel loginLimitErrorActivityViewModel2 = this.w;
if (loginLimitErrorActivityViewModel2 != null) {
loginLimitErrorActivityViewModel2.X7(false, false, new LoginLimitErrorActivity$onBackPressed$1(this));
}
}
@Override
public void onCreate(Bundle bundle) {
boolean A;
String str;
JSONObject jSONObject;
final String str2;
String str3;
final String str4;
final String str5;
ComposeView composeView;
super.onCreate(bundle);
io.reactivex.disposables.a aVar = this.A;
PublishProcessor<Integer> V1 = V1();
final Function1<Integer, Unit> function1 = new Function1<Integer, Unit>() {
public class AnonymousClass1 extends FunctionReferenceImpl implements Function1<Boolean, Unit> {
AnonymousClass1(Object obj) {
super(1, obj, LoginLimitErrorActivity.class, "postLogout", "postLogout(Z)V", 0);
}
public final void h(boolean z) {
((LoginLimitErrorActivity) this.receiver).a2(z);
}
@Override
public Unit invoke(Boolean bool) {
h(bool.booleanValue());
return Unit.a;
}
}
{
super(1);
}
public final void a(Integer num) {
String str6;
LoginLimitErrorActivityViewModel loginLimitErrorActivityViewModel;
SharedPreferences a2;
LoginLimitErrorActivityViewModel loginLimitErrorActivityViewModel2;
if (num != null && num.intValue() == 1) {
loginLimitErrorActivityViewModel2 = LoginLimitErrorActivity.this.w;
if (loginLimitErrorActivityViewModel2 != null) {
loginLimitErrorActivityViewModel2.Z7(false);
}
LoginLimitErrorActivity.this.setResult(-1);
LoginLimitErrorActivity.this.finish();
} else if (num != null && num.intValue() == -1) {
str6 = LoginLimitErrorActivity.this.y;
if (kotlin.jvm.internal.o.f(str6, Destination.CUSTOMER_HOME) && (a2 = in.swiggy.android.analytics.newrelic.newrelichelper.a.a.a()) != null) {
in.swiggy.android.commons.extension.a.b(a2, "home_screen_force_refresh_flag", Boolean.TRUE);
}
loginLimitErrorActivityViewModel = LoginLimitErrorActivity.this.w;
if (loginLimitErrorActivityViewModel != null) {
loginLimitErrorActivityViewModel.X7(false, false, new AnonymousClass1(LoginLimitErrorActivity.this));
}
LoginLimitErrorActivity.this.setResult(0);
LoginLimitErrorActivity.this.finish();
}
}
@Override
public Unit invoke(Integer num) {
a(num);
return Unit.a;
}
};
aVar.c(V1.f0(new io.reactivex.functions.d() {
@Override
public final void accept(Object obj) {
LoginLimitErrorActivity.Z1(Function1.this, obj);
}
}));
Y1();
String str6 = null;
A = kotlin.text.q.A(this.y, H, false, 2, null);
if (A) {
this.i.edit().putBoolean("nuxLocationSetupInProgress", true).apply();
}
SharedPreferences a2 = in.swiggy.android.analytics.newrelic.newrelichelper.a.a.a();
if (a2 != null) {
str = a2.getString("abuse_breach_strings_map", "{ \"title\": \"Uh oh, login limit exceeded!\",\n \"subtitle\": \"Swiggy One can be used only on <b>%s device</b> at a time. To continue enjoying your benefits, logout from additional devices.\",\n \"primary_cta_text\": \"Manage devices\",\n \"secondary_cta_text\": \"Logout from this device\",\n \"policy_link\": \"https://www.swiggy.com/terms-and-conditions\"\n}");
} else {
str = null;
}
if (str != null) {
jSONObject = new JSONObject(str);
} else {
jSONObject = null;
}
if (jSONObject != null) {
str2 = jSONObject.optString("title");
} else {
str2 = null;
}
if (jSONObject != null) {
str3 = jSONObject.optString("subtitle");
} else {
str3 = null;
}
if (str3 != null) {
kotlin.jvm.internal.v vVar = kotlin.jvm.internal.v.a;
String format = String.format(str3, Arrays.copyOf(new Object[]{this.z}, 1));
kotlin.jvm.internal.o.j(format, "format(...)");
str4 = format;
} else {
str4 = null;
}
if (jSONObject != null) {
str5 = jSONObject.optString("primary_cta_text");
} else {
str5 = null;
}
if (jSONObject != null) {
str6 = jSONObject.optString("secondary_cta_text");
}
final String str7 = str6;
in.swiggy.android.databinding.m0 m0Var = this.x;
if (m0Var != null && (composeView = m0Var.B) != null) {
composeView.setViewCompositionStrategy(ViewCompositionStrategy.DisposeOnViewTreeLifecycleDestroyed.b);
composeView.setContent(androidx.compose.runtime.internal.b.c(-1085845781, true, new Function2<androidx.compose.runtime.i, Integer, Unit>() {
{
super(2);
}
public final void a(androidx.compose.runtime.i iVar, int i) {
if ((i & 11) == 2 && iVar.b()) {
iVar.j();
return;
}
if (ComposerKt.K()) {
ComposerKt.V(-1085845781, i, -1, "in.swiggy.android.activities.LoginLimitErrorActivity.onCreate.<anonymous>.<anonymous> (LoginLimitErrorActivity.kt:177)");
}
ThemeColorMode themeColorMode = ThemeColorMode.Light;
final LoginLimitErrorActivity loginLimitErrorActivity = LoginLimitErrorActivity.this;
final String str8 = str2;
final String str9 = str4;
final String str10 = str5;
final String str11 = str7;
SwiggyThemeKt.a(themeColorMode, androidx.compose.runtime.internal.b.b(iVar, -1102888618, true, new Function2<androidx.compose.runtime.i, Integer, Unit>() {
{
super(2);
}
public final void a(androidx.compose.runtime.i iVar2, int i2) {
String str12;
if ((i2 & 11) == 2 && iVar2.b()) {
iVar2.j();
return;
}
if (ComposerKt.K()) {
ComposerKt.V(-1102888618, i2, -1, "in.swiggy.android.activities.LoginLimitErrorActivity.onCreate.<anonymous>.<anonymous>.<anonymous> (LoginLimitErrorActivity.kt:178)");
}
str12 = LoginLimitErrorActivity.this.z;
if (str12 == null) {
str12 = "";
}
String str13 = str12;
final LoginLimitErrorActivity loginLimitErrorActivity2 = LoginLimitErrorActivity.this;
Function0<Unit> function0 = new Function0<Unit>() {
{
super(0);
}
@Override
public Unit invoke() {
invoke2();
return Unit.a;
}
public final void invoke2() {
LoginLimitErrorActivityViewModel loginLimitErrorActivityViewModel;
loginLimitErrorActivityViewModel = LoginLimitErrorActivity.this.w;
if (loginLimitErrorActivityViewModel != null) {
loginLimitErrorActivityViewModel.V7();
}
}
};
final LoginLimitErrorActivity loginLimitErrorActivity3 = LoginLimitErrorActivity.this;
Function0<Unit> function02 = new Function0<Unit>() {
{
super(0);
}
@Override
public Unit invoke() {
invoke2();
return Unit.a;
}
public final void invoke2() {
LoginLimitErrorActivityViewModel loginLimitErrorActivityViewModel;
String str14;
loginLimitErrorActivityViewModel = LoginLimitErrorActivity.this.w;
if (loginLimitErrorActivityViewModel != null) {
str14 = LoginLimitErrorActivity.this.z;
loginLimitErrorActivityViewModel.W7(str14);
}
}
};
final LoginLimitErrorActivity loginLimitErrorActivity4 = LoginLimitErrorActivity.this;
LoginLimitErrorScreenKt.b(new in.swiggy.android.composer.feature.swiggyOneDeviceLimit.state.a(str13, function0, function02, new Function0<Unit>() {
public class C05571 extends FunctionReferenceImpl implements Function1<Boolean, Unit> {
C05571(Object obj) {
super(1, obj, LoginLimitErrorActivity.class, "postLogout", "postLogout(Z)V", 0);
}
public final void h(boolean z) {
((LoginLimitErrorActivity) this.receiver).a2(z);
}
@Override
public Unit invoke(Boolean bool) {
h(bool.booleanValue());
return Unit.a;
}
}
{
super(0);
}
@Override
public Unit invoke() {
invoke2();
return Unit.a;
}
public final void invoke2() {
io.reactivex.disposables.a aVar2;
LoginLimitErrorActivityViewModel loginLimitErrorActivityViewModel;
aVar2 = LoginLimitErrorActivity.this.A;
aVar2.dispose();
LoginLimitErrorActivity.this.V1().w0(3);
loginLimitErrorActivityViewModel = LoginLimitErrorActivity.this.w;
if (loginLimitErrorActivityViewModel != null) {
loginLimitErrorActivityViewModel.X7(false, true, new C05571(LoginLimitErrorActivity.this));
}
}
}, str8, str9, str10, str11), null, iVar2, in.swiggy.android.composer.feature.swiggyOneDeviceLimit.state.a.i, 2);
if (ComposerKt.K()) {
ComposerKt.U();
}
}
@Override
public Unit invoke(androidx.compose.runtime.i iVar2, Integer num) {
a(iVar2, num.intValue());
return Unit.a;
}
}), iVar, 54);
if (ComposerKt.K()) {
ComposerKt.U();
}
}
@Override
public Unit invoke(androidx.compose.runtime.i iVar, Integer num) {
a(iVar, num.intValue());
return Unit.a;
}
}));
}
}
@Override
public void onDestroy() {
super.onDestroy();
this.A.dispose();
}
}