discord-jadx/app/src/main/java/c/a/a/r.java

218 lines
9.9 KiB
Java
Raw Normal View History

2021-07-24 02:37:17 +00:00
package c.a.a;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.fragment.app.Fragment;
2021-08-03 07:33:18 +00:00
import androidx.fragment.app.FragmentActivity;
2021-08-24 07:28:10 +00:00
import c.a.i.b5;
import com.discord.R;
2021-08-03 07:33:18 +00:00
import com.discord.api.auth.mfa.EnableMfaResponse;
2021-07-24 02:37:17 +00:00
import com.discord.app.AppDialog;
2021-08-03 07:33:18 +00:00
import com.discord.restapi.RestAPIParams;
import com.discord.utilities.error.Error;
import com.discord.utilities.rest.RestAPI;
2021-07-24 02:37:17 +00:00
import com.discord.utilities.rx.ObservableExtensionsKt;
2021-08-03 07:33:18 +00:00
import com.discord.utilities.view.extensions.ViewExtensions;
2021-07-24 02:37:17 +00:00
import com.discord.utilities.viewbinding.FragmentViewBindingDelegate;
import com.discord.utilities.viewbinding.FragmentViewBindingDelegateKt;
import com.discord.views.LoadingButton;
2021-08-03 07:33:18 +00:00
import com.google.android.material.button.MaterialButton;
import com.google.android.material.textfield.TextInputLayout;
2021-07-24 02:37:17 +00:00
import d0.z.d.k;
import d0.z.d.m;
import d0.z.d.o;
import kotlin.Unit;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.reflect.KProperty;
2021-08-03 07:33:18 +00:00
import rx.Observable;
/* compiled from: WidgetEnableTwoFactorPasswordDialog.kt */
2021-07-24 02:37:17 +00:00
public final class r extends AppDialog {
2021-08-18 07:29:27 +00:00
public static final /* synthetic */ KProperty[] i = {c.d.b.a.a.W(r.class, "binding", "getBinding()Lcom/discord/databinding/WidgetEnableTwoFactorPasswordDialogBinding;", 0)};
2021-07-24 02:37:17 +00:00
public static final a j = new a(null);
public final FragmentViewBindingDelegate k = FragmentViewBindingDelegateKt.viewBinding$default(this, b.i, null, 2, null);
2021-08-03 07:33:18 +00:00
public Function1<? super String, Unit> l = c.i;
2021-07-24 02:37:17 +00:00
2021-08-03 07:33:18 +00:00
/* compiled from: WidgetEnableTwoFactorPasswordDialog.kt */
2021-07-24 02:37:17 +00:00
public static final class a {
public a(DefaultConstructorMarker defaultConstructorMarker) {
}
}
2021-08-03 07:33:18 +00:00
/* compiled from: WidgetEnableTwoFactorPasswordDialog.kt */
2021-08-24 07:28:10 +00:00
public static final /* synthetic */ class b extends k implements Function1<View, b5> {
2021-07-24 02:37:17 +00:00
public static final b i = new b();
public b() {
2021-08-24 07:28:10 +00:00
super(1, b5.class, "bind", "bind(Landroid/view/View;)Lcom/discord/databinding/WidgetEnableTwoFactorPasswordDialogBinding;", 0);
2021-07-24 02:37:17 +00:00
}
/* Return type fixed from 'java.lang.Object' to match base method */
/* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
@Override // kotlin.jvm.functions.Function1
2021-08-24 07:28:10 +00:00
public b5 invoke(View view) {
2021-07-24 02:37:17 +00:00
View view2 = view;
m.checkNotNullParameter(view2, "p1");
int i2 = R.id.enable_two_factor_password_body_container;
LinearLayout linearLayout = (LinearLayout) view2.findViewById(R.id.enable_two_factor_password_body_container);
2021-08-03 07:33:18 +00:00
if (linearLayout != null) {
i2 = R.id.enable_two_factor_password_body_text;
TextView textView = (TextView) view2.findViewById(R.id.enable_two_factor_password_body_text);
2021-07-24 02:37:17 +00:00
if (textView != null) {
i2 = R.id.enable_two_factor_password_cancel;
MaterialButton materialButton = (MaterialButton) view2.findViewById(R.id.enable_two_factor_password_cancel);
2021-08-03 07:33:18 +00:00
if (materialButton != null) {
i2 = R.id.enable_two_factor_password_header;
TextView textView2 = (TextView) view2.findViewById(R.id.enable_two_factor_password_header);
2021-08-03 07:33:18 +00:00
if (textView2 != null) {
i2 = R.id.enable_two_factor_password_header_container;
LinearLayout linearLayout2 = (LinearLayout) view2.findViewById(R.id.enable_two_factor_password_header_container);
2021-08-03 07:33:18 +00:00
if (linearLayout2 != null) {
i2 = R.id.enable_two_factor_password_ok;
LoadingButton loadingButton = (LoadingButton) view2.findViewById(R.id.enable_two_factor_password_ok);
2021-08-03 07:33:18 +00:00
if (loadingButton != null) {
i2 = R.id.enable_two_factor_password_view_input;
TextInputLayout textInputLayout = (TextInputLayout) view2.findViewById(R.id.enable_two_factor_password_view_input);
2021-08-03 07:33:18 +00:00
if (textInputLayout != null) {
2021-08-24 07:28:10 +00:00
return new b5((LinearLayout) view2, linearLayout, textView, materialButton, textView2, linearLayout2, loadingButton, textInputLayout);
2021-08-03 07:33:18 +00:00
}
}
}
}
2021-07-24 02:37:17 +00:00
}
}
}
throw new NullPointerException("Missing required view with ID: ".concat(view2.getResources().getResourceName(i2)));
}
}
2021-08-03 07:33:18 +00:00
/* compiled from: WidgetEnableTwoFactorPasswordDialog.kt */
public static final class c extends o implements Function1<String, Unit> {
public static final c i = new c();
2021-07-24 02:37:17 +00:00
2021-08-03 07:33:18 +00:00
public c() {
2021-07-24 02:37:17 +00:00
super(1);
}
/* Return type fixed from 'java.lang.Object' to match base method */
/* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
@Override // kotlin.jvm.functions.Function1
2021-08-03 07:33:18 +00:00
public Unit invoke(String str) {
m.checkNotNullParameter(str, "it");
2021-07-24 02:37:17 +00:00
return Unit.a;
}
}
2021-08-03 07:33:18 +00:00
/* compiled from: WidgetEnableTwoFactorPasswordDialog.kt */
public static final class d implements View.OnClickListener {
public final /* synthetic */ r i;
public final /* synthetic */ View j;
2021-07-24 02:37:17 +00:00
2021-08-03 07:33:18 +00:00
/* compiled from: WidgetEnableTwoFactorPasswordDialog.kt */
public static final class a extends o implements Function1<EnableMfaResponse, Unit> {
public static final a i = new a();
2021-07-24 02:37:17 +00:00
2021-08-03 07:33:18 +00:00
public a() {
super(1);
}
/* Return type fixed from 'java.lang.Object' to match base method */
/* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
@Override // kotlin.jvm.functions.Function1
public Unit invoke(EnableMfaResponse enableMfaResponse) {
m.checkNotNullParameter(enableMfaResponse, "it");
return Unit.a;
2021-07-24 02:37:17 +00:00
}
}
2021-08-03 07:33:18 +00:00
/* compiled from: WidgetEnableTwoFactorPasswordDialog.kt */
public static final class b extends o implements Function1<Error, Unit> {
public final /* synthetic */ d this$0;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public b(d dVar) {
super(1);
this.this$0 = dVar;
}
/* Return type fixed from 'java.lang.Object' to match base method */
/* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
@Override // kotlin.jvm.functions.Function1
public Unit invoke(Error error) {
Error error2 = error;
m.checkNotNullParameter(error2, "error");
r rVar = this.this$0.i;
KProperty[] kPropertyArr = r.i;
2021-08-24 07:28:10 +00:00
rVar.g().f71c.setIsLoading(false);
2021-08-03 07:33:18 +00:00
Error.Response response = error2.getResponse();
m.checkNotNullExpressionValue(response, "error.response");
if (response.getCode() == 60005) {
error2.setShowErrorToasts(false);
this.this$0.i.dismiss();
r rVar2 = this.this$0.i;
Function1<? super String, Unit> function1 = rVar2.l;
TextInputLayout textInputLayout = rVar2.g().d;
m.checkNotNullExpressionValue(textInputLayout, "binding.enableTwoFactorPasswordViewInput");
function1.invoke(ViewExtensions.getTextOrEmpty(textInputLayout));
}
return Unit.a;
}
}
2021-07-24 02:37:17 +00:00
2021-08-03 07:33:18 +00:00
public d(r rVar, View view) {
this.i = rVar;
this.j = view;
2021-07-24 02:37:17 +00:00
}
2021-08-03 07:33:18 +00:00
@Override // android.view.View.OnClickListener
public final void onClick(View view) {
r rVar = this.i;
KProperty[] kPropertyArr = r.i;
TextInputLayout textInputLayout = rVar.g().d;
m.checkNotNullExpressionValue(textInputLayout, "binding.enableTwoFactorPasswordViewInput");
String textOrEmpty = ViewExtensions.getTextOrEmpty(textInputLayout);
2021-08-24 07:28:10 +00:00
this.i.g().f71c.setIsLoading(true);
2021-08-03 07:33:18 +00:00
Observable ui$default = ObservableExtensionsKt.ui$default(ObservableExtensionsKt.restSubscribeOn$default(RestAPI.Companion.getApi().enableMFA(new RestAPIParams.EnableMFA("random code", "random secret", textOrEmpty)), false, 1, null), this.i, null, 2, null);
a aVar = a.i;
ObservableExtensionsKt.appSubscribe$default(ui$default, this.i.getClass(), this.j.getContext(), (Function1) null, new b(this), (Function0) null, (Function0) null, aVar, 52, (Object) null);
2021-07-24 02:37:17 +00:00
}
}
2021-08-03 07:33:18 +00:00
/* compiled from: WidgetEnableTwoFactorPasswordDialog.kt */
public static final class e implements View.OnClickListener {
public final /* synthetic */ r i;
public e(r rVar) {
this.i = rVar;
}
2021-07-24 02:37:17 +00:00
2021-08-03 07:33:18 +00:00
@Override // android.view.View.OnClickListener
public final void onClick(View view) {
FragmentActivity activity = this.i.getActivity();
if (activity != null) {
activity.onBackPressed();
}
}
2021-07-24 02:37:17 +00:00
}
2021-08-03 07:33:18 +00:00
public r() {
super(R.layout.widget_enable_two_factor_password_dialog);
2021-07-24 02:37:17 +00:00
}
2021-08-24 07:28:10 +00:00
public final b5 g() {
return (b5) this.k.getValue((Fragment) this, i[0]);
2021-07-24 02:37:17 +00:00
}
@Override // com.discord.app.AppDialog
public void onViewBound(View view) {
m.checkNotNullParameter(view, "view");
super.onViewBound(view);
setCancelable(false);
2021-08-24 07:28:10 +00:00
g().f71c.setIsLoading(false);
g().f71c.setOnClickListener(new d(this, view));
2021-08-03 07:33:18 +00:00
g().b.setOnClickListener(new e(this));
2021-07-24 02:37:17 +00:00
}
}