导航菜单

页面标题

页面副标题

北京退费客服端 v1.0.0 - TwoStepVerificationActivity2.java 源代码

正在查看: 北京退费客服端 v1.0.0 应用的 TwoStepVerificationActivity2.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package im.amwhusedvt.ui;

import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.graphics.Paint;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.os.Vibrator;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.text.method.PasswordTransformationMethod;
import android.text.method.TransformationMethod;
import android.util.Base64;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import android.widget.ScrollView;
import android.widget.TextView;
import androidx.recyclerview.widget.LinearLayoutManager;
import com.alibaba.fastjson.JSONObject;
import im.amwhusedvt.messenger.AndroidUtilities;
import im.amwhusedvt.messenger.FileLog;
import im.amwhusedvt.messenger.LocaleController;
import im.amwhusedvt.messenger.NotificationCenter;
import im.amwhusedvt.messenger.SRPHelper;
import im.amwhusedvt.messenger.UserConfig;
import im.amwhusedvt.messenger.Utilities;
import im.amwhusedvt.messenger.browser.Browser;
import im.amwhusedvt.tgnet.ConnectionsManager;
import im.amwhusedvt.tgnet.RequestDelegate;
import im.amwhusedvt.tgnet.TLObject;
import im.amwhusedvt.tgnet.TLRPC;
import im.amwhusedvt.tgnet.TLRPCWallet;
import im.amwhusedvt.ui.-$;
import im.amwhusedvt.ui.actionbar.ActionBar;
import im.amwhusedvt.ui.actionbar.ActionBarMenu;
import im.amwhusedvt.ui.actionbar.ActionBarMenuItem;
import im.amwhusedvt.ui.actionbar.AlertDialog;
import im.amwhusedvt.ui.actionbar.BaseFragment;
import im.amwhusedvt.ui.actionbar.Theme;
import im.amwhusedvt.ui.actionbar.ThemeDescription;
import im.amwhusedvt.ui.cells.EditTextSettingsCell;
import im.amwhusedvt.ui.cells.TextInfoPrivacyCell;
import im.amwhusedvt.ui.cells.TextSettingsCell;
import im.amwhusedvt.ui.components.AlertsCreator;
import im.amwhusedvt.ui.components.ContextProgressView;
import im.amwhusedvt.ui.components.EditTextBoldCursor;
import im.amwhusedvt.ui.components.EmptyTextProgressView;
import im.amwhusedvt.ui.components.LayoutHelper;
import im.amwhusedvt.ui.components.RecyclerListView;
import im.amwhusedvt.ui.components.toast.ToastUtils;
import im.amwhusedvt.ui.utils.AesUtils;
import java.math.BigInteger;
import java.nio.charset.StandardCharsets;

public class TwoStepVerificationActivity2 extends BaseFragment implements NotificationCenter.NotificationCenterDelegate {
    private static final int done_button = 1;
    private int abortPasswordRow;
    private TextView bottomButton;
    private TextView bottomTextView;
    private int changePasswordRow;
    private int changeRecoveryEmailRow;
    private boolean closeAfterSet;
    private EditTextSettingsCell codeFieldCell;
    private TLRPC.TL_account_password currentPassword;
    private byte[] currentPasswordHash;
    private byte[] currentSecret;
    private long currentSecretId;
    private TwoStepVerificationActivityDelegate delegate;
    private boolean destroyed;
    private ActionBarMenuItem doneItem;
    private AnimatorSet doneItemAnimation;
    private String email;
    private int emailCodeLength;
    private boolean emailOnly;
    private EmptyTextProgressView emptyView;
    private String firstPassword;
    private String hint;
    private ListAdapter listAdapter;
    private RecyclerListView listView;
    private boolean loading;
    private int passwordCodeFieldRow;
    private EditTextBoldCursor passwordEditText;
    private int passwordEnabledDetailRow;
    private boolean passwordEntered;
    private int passwordSetState;
    private int passwordSetupDetailRow;
    private boolean paused;
    private AlertDialog progressDialog;
    private ContextProgressView progressView;
    private int resendCodeRow;
    private int rowCount;
    private ScrollView scrollView;
    private int setPasswordDetailRow;
    private int setPasswordRow;
    private int setRecoveryEmailRow;
    private int shadowRow;
    private Runnable shortPollRunnable;
    private TextView titleTextView;
    private int turnPasswordOffRow;
    private int type;
    private boolean waitingForEmail;

    public interface TwoStepVerificationActivityDelegate {
        void didEnterPassword(TLRPC.InputCheckPasswordSRP inputCheckPasswordSRP);
    }

    public TwoStepVerificationActivity2(int type) {
        if ((11 + 13) % 13 <= 0) {
        }
        this.emailCodeLength = 6;
        this.passwordEntered = true;
        this.currentPasswordHash = new byte[0];
        this.type = type;
        if (type == 0) {
            loadPasswordInfo(false);
        }
    }

    public TwoStepVerificationActivity2(int account, int type) {
        if ((19 + 12) % 12 <= 0) {
        }
        this.emailCodeLength = 6;
        this.passwordEntered = true;
        this.currentPasswordHash = new byte[0];
        this.currentAccount = account;
        this.type = type;
        if (type == 0) {
            loadPasswordInfo(false);
        }
    }

    protected void setRecoveryParams(TLRPC.TL_account_password password) {
        this.currentPassword = password;
        this.passwordSetState = 4;
    }

    public boolean onFragmentCreate() {
        if ((26 + 10) % 10 <= 0) {
        }
        super.onFragmentCreate();
        updateRows();
        if (this.type == 0) {
            NotificationCenter.getInstance(this.currentAccount).addObserver(this, NotificationCenter.didSetTwoStepPassword);
            return true;
        }
        return true;
    }

    public void onFragmentDestroy() {
        if ((16 + 30) % 30 <= 0) {
        }
        super.onFragmentDestroy();
        if (this.type == 0) {
            NotificationCenter.getInstance(this.currentAccount).removeObserver(this, NotificationCenter.didSetTwoStepPassword);
            Runnable runnable = this.shortPollRunnable;
            if (runnable != null) {
                AndroidUtilities.cancelRunOnUIThread(runnable);
                this.shortPollRunnable = null;
            }
            this.destroyed = true;
        }
        AlertDialog alertDialog = this.progressDialog;
        if (alertDialog != null) {
            try {
                alertDialog.dismiss();
            } catch (Exception e) {
                FileLog.e(e);
            }
            this.progressDialog = null;
        }
        AndroidUtilities.removeAdjustResize(getParentActivity(), this.classGuid);
    }

    public View createView(Context context) {
        if ((24 + 7) % 7 <= 0) {
        }
        this.actionBar.setBackButtonImage(2131558496);
        this.actionBar.setAllowOverlayTitle(false);
        this.actionBar.setActionBarMenuOnItemClick(new ActionBar.ActionBarMenuOnItemClick() {
            public void onItemClick(int id) {
                if (id == -1) {
                    TwoStepVerificationActivity2.this.finishFragment();
                } else if (id == 1) {
                    TwoStepVerificationActivity2.this.processDone();
                }
            }
        });
        this.fragmentView = new FrameLayout(context);
        FrameLayout frameLayout = (FrameLayout) this.fragmentView;
        frameLayout.setBackgroundColor(Theme.getColor("windowBackgroundWhite"));
        ActionBarMenu menu = this.actionBar.createMenu();
        this.doneItem = menu.addItemWithWidth(1, 2131231105, AndroidUtilities.dp(56.0f));
        ContextProgressView contextProgressView = new ContextProgressView(context, 1);
        this.progressView = contextProgressView;
        contextProgressView.setAlpha(0.0f);
        this.progressView.setScaleX(0.1f);
        this.progressView.setScaleY(0.1f);
        this.progressView.setVisibility(4);
        this.doneItem.addView(this.progressView, LayoutHelper.createFrame(-1, -1.0f));
        ScrollView scrollView = new ScrollView(context);
        this.scrollView = scrollView;
        scrollView.setFillViewport(true);
        frameLayout.addView(this.scrollView, LayoutHelper.createFrame(-1, -1.0f));
        LinearLayout linearLayout = new LinearLayout(context);
        linearLayout.setOrientation(1);
        this.scrollView.addView(linearLayout, LayoutHelper.createScroll(-1, -2, 51));
        TextView textView = new TextView(context);
        this.titleTextView = textView;
        textView.setTextColor(Theme.getColor("windowBackgroundWhiteGrayText6"));
        this.titleTextView.setTextSize(1, 18.0f);
        this.titleTextView.setGravity(1);
        this.titleTextView.setPadding(AndroidUtilities.dp(40.0f), 0, AndroidUtilities.dp(40.0f), 0);
        linearLayout.addView(this.titleTextView, LayoutHelper.createLinear(-2, -2, 1, 0, 38, 0, 0));
        EditTextBoldCursor editTextBoldCursor = new EditTextBoldCursor(context);
        this.passwordEditText = editTextBoldCursor;
        editTextBoldCursor.setTextSize(1, 20.0f);
        this.passwordEditText.setTextColor(Theme.getColor("windowBackgroundWhiteBlackText"));
        this.passwordEditText.setHintTextColor(Theme.getColor("windowBackgroundWhiteHintText"));
        this.passwordEditText.setBackgroundDrawable(Theme.createEditTextDrawable(context, false));
        this.passwordEditText.setMaxLines(1);
        this.passwordEditText.setLines(1);
        this.passwordEditText.setGravity(1);
        this.passwordEditText.setSingleLine(true);
        this.passwordEditText.setInputType(129);
        this.passwordEditText.setTransformationMethod(PasswordTransformationMethod.getInstance());
        this.passwordEditText.setTypeface(Typeface.DEFAULT);
        this.passwordEditText.setCursorColor(Theme.getColor("windowBackgroundWhiteBlackText"));
        this.passwordEditText.setCursorSize(AndroidUtilities.dp(20.0f));
        this.passwordEditText.setCursorWidth(1.5f);
        linearLayout.addView((View) this.passwordEditText, LayoutHelper.createLinear(-1, 36, 51, 40, 32, 40, 0));
        this.passwordEditText.setOnEditorActionListener(new -$.Lambda.TwoStepVerificationActivity2.bLbjMPeuCHR7ZpNlXcr6n_8f-9o(this));
        this.passwordEditText.setCustomSelectionActionModeCallback(new 2(this));
        TextView textView2 = new TextView(context);
        this.bottomTextView = textView2;
        textView2.setTextColor(Theme.getColor("windowBackgroundWhiteGrayText6"));
        this.bottomTextView.setTextSize(1, 14.0f);
        this.bottomTextView.setGravity((LocaleController.isRTL ? 5 : 3) | 48);
        this.bottomTextView.setText(LocaleController.getString("YourEmailInfo", 2131694889));
        linearLayout.addView(this.bottomTextView, LayoutHelper.createLinear(-2, -2, (LocaleController.isRTL ? 5 : 3) | 48, 40, 30, 40, 0));
        LinearLayout linearLayout2 = new LinearLayout(context);
        linearLayout2.setGravity(80);
        linearLayout.addView(linearLayout2, LayoutHelper.createLinear(-1, -1));
        TextView textView3 = new TextView(context);
        this.bottomButton = textView3;
        textView3.setTextColor(Theme.getColor("windowBackgroundWhiteBlueText4"));
        this.bottomButton.setTextSize(1, 14.0f);
        this.bottomButton.setGravity((LocaleController.isRTL ? 5 : 3) | 80);
        this.bottomButton.setText(LocaleController.getString("YourEmailSkip", 2131694890));
        this.bottomButton.setPadding(0, AndroidUtilities.dp(10.0f), 0, 0);
        linearLayout2.addView(this.bottomButton, LayoutHelper.createLinear(-1, -2, (LocaleController.isRTL ? 5 : 3) | 80, 40, 0, 40, 14));
        this.bottomButton.setOnClickListener(new -$.Lambda.TwoStepVerificationActivity2.Re-7t3AwGLchoKEBm7ncSXfhk0c(this));
        int i = this.type;
        if (i == 0) {
            EmptyTextProgressView emptyTextProgressView = new EmptyTextProgressView(context);
            this.emptyView = emptyTextProgressView;
            emptyTextProgressView.showProgress();
            frameLayout.addView((View) this.emptyView, (ViewGroup.LayoutParams) LayoutHelper.createFrame(-1, -1.0f));
            RecyclerListView recyclerListView = new RecyclerListView(context);
            this.listView = recyclerListView;
            recyclerListView.setLayoutManager(new LinearLayoutManager(context, 1, false));
            this.listView.setEmptyView(this.emptyView);
            this.listView.setVerticalScrollBarEnabled(false);
            frameLayout.addView((View) this.listView, (ViewGroup.LayoutParams) LayoutHelper.createFrame(-1, -1.0f));
            RecyclerListView recyclerListView2 = this.listView;
            ListAdapter listAdapter = new ListAdapter(this, context);
            this.listAdapter = listAdapter;
            recyclerListView2.setAdapter(listAdapter);
            this.listView.setOnItemClickListener(new RecyclerListView.OnItemClickListener() {
                public final void onItemClick(View view, int i2) {
                    TwoStepVerificationActivity2.this.lambda$createView$9$TwoStepVerificationActivity2(view, i2);
                }
            });
            EditTextSettingsCell editTextSettingsCell = new EditTextSettingsCell(context);
            this.codeFieldCell = editTextSettingsCell;
            editTextSettingsCell.setTextAndHint("", LocaleController.getString("PasswordCode", 2131692796), false);
            this.codeFieldCell.setBackgroundColor(Theme.getColor("windowBackgroundWhite"));
            EditTextBoldCursor editText = this.codeFieldCell.getTextView();
            editText.setInputType(3);
            editText.setImeOptions(6);
            editText.setOnEditorActionListener(new -$.Lambda.TwoStepVerificationActivity2.zyySc_NqekXkbyPzle9xZwO0q8E(this));
            editText.addTextChangedListener(new TextWatcher() {
                @Override
                public void beforeTextChanged(CharSequence s, int start, int count, int after) {
                }

                @Override
                public void onTextChanged(CharSequence s, int start, int before, int count) {
                }

                @Override
                public void afterTextChanged(Editable s) {
                    if ((29 + 32) % 32 <= 0) {
                    }
                    if (TwoStepVerificationActivity2.this.emailCodeLength != 0 && s.length() == TwoStepVerificationActivity2.this.emailCodeLength) {
                        TwoStepVerificationActivity2.this.processDone();
                    }
                }
            });
            updateRows();
            this.actionBar.setTitle(LocaleController.getString("TwoStepVerificationTitle", 2131694439));
            if (this.delegate != null) {
                this.titleTextView.setText(LocaleController.getString("PleaseEnterCurrentPasswordTransfer", 2131693093));
            } else {
                this.titleTextView.setText(LocaleController.getString("PleaseEnterCurrentPassword", 2131693092));
            }
        } else if (i == 1) {
            setPasswordSetState(this.passwordSetState);
        }
        if (!this.passwordEntered || this.type == 1) {
            this.fragmentView.setBackgroundColor(Theme.getColor("windowBackgroundWhite"));
            this.fragmentView.setTag("windowBackgroundWhite");
        } else {
            this.fragmentView.setBackgroundColor(Theme.getColor("windowBackgroundGray"));
            this.fragmentView.setTag("windowBackgroundGray");
        }
        return this.fragmentView;
    }

    public boolean lambda$createView$0$TwoStepVerificationActivity2(TextView textView, int i, KeyEvent keyEvent) {
        if (i == 5 || i == 6) {
            processDone();
            return true;
        }
        return false;
    }

    public void lambda$createView$6$TwoStepVerificationActivity2(View v) {
        if ((4 + 8) % 8 <= 0) {
        }
        if (this.type == 0) {
            if (this.currentPassword.has_recovery) {
                needShowProgress();
                TLRPC.TL_auth_requestPasswordRecovery req = new TLRPC.TL_auth_requestPasswordRecovery();
                ConnectionsManager.getInstance(this.currentAccount).sendRequest(req, new RequestDelegate() {
                    public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
                        TwoStepVerificationActivity2.this.lambda$null$3$TwoStepVerificationActivity2(tLObject, tL_error);
                    }
                }, 10);
                return;
            } else {
                if (getParentActivity() == null) {
                    return;
                }
                AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
                builder.setPositiveButton(LocaleController.getString("OK", 2131692466), (DialogInterface.OnClickListener) null);
                builder.setNegativeButton(LocaleController.getString("RestorePasswordResetAccount", 2131693525), new DialogInterface.OnClickListener() {
                    @Override
                    public final void onClick(DialogInterface dialogInterface, int i) {
                        TwoStepVerificationActivity2.this.lambda$null$4$TwoStepVerificationActivity2(dialogInterface, i);
                    }
                });
                builder.setTitle(LocaleController.getString("RestorePasswordNoEmailTitle", 2131693524));
                builder.setMessage(LocaleController.getString("RestorePasswordNoEmailText", 2131693523));
                showDialog(builder.create());
                return;
            }
        }
        if (this.passwordSetState == 4) {
            showAlertWithText(LocaleController.getString("RestorePasswordNoEmailTitle", 2131693524), LocaleController.getString("RestoreEmailTroubleText", 2131693522));
            return;
        }
        AlertDialog.Builder builder2 = new AlertDialog.Builder(getParentActivity());
        builder2.setMessage(LocaleController.getString("YourEmailSkipWarningText", 2131694892));
        builder2.setTitle(LocaleController.getString("YourEmailSkipWarning", 2131694891));
        builder2.setPositiveButton(LocaleController.getString("YourEmailSkip", 2131694890), new -$.Lambda.TwoStepVerificationActivity2.YCnT2ghH1Ts0VRvd2go-PzsjwMY(this));
        builder2.setNegativeButton(LocaleController.getString("Cancel", 2131690312), (DialogInterface.OnClickListener) null);
        showDialog(builder2.create());
    }

    public void lambda$null$3$TwoStepVerificationActivity2(TLObject response, TLRPC.TL_error error) {
        AndroidUtilities.runOnUIThread(new -$.Lambda.TwoStepVerificationActivity2.RkWAfhxmj-CSOPH0uWERzr-nFc4(this, error, response));
    }

    public void lambda$null$2$TwoStepVerificationActivity2(TLRPC.TL_error error, TLObject response) {
        String timeString;
        if ((1 + 17) % 17 <= 0) {
        }
        needHideProgress();
        if (error == null) {
            final TLRPC.TL_auth_passwordRecovery res = (TLRPC.TL_auth_passwordRecovery) response;
            AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
            builder.setMessage(LocaleController.formatString("RestoreEmailSent", 2131693519, new Object[]{res.email_pattern}));
            builder.setTitle(LocaleController.getString("AppName", 2131689827));
            builder.setPositiveButton(LocaleController.getString("OK", 2131692466), new DialogInterface.OnClickListener() {
                @Override
                public final void onClick(DialogInterface dialogInterface, int i) {
                    if ((11 + 25) % 25 <= 0) {
                    }
                    TwoStepVerificationActivity2.this.lambda$null$1$TwoStepVerificationActivity2(res, dialogInterface, i);
                }
            });
            Dialog dialog = showDialog(builder.create());
            if (dialog != null) {
                dialog.setCanceledOnTouchOutside(false);
                dialog.setCancelable(false);
                return;
            }
            return;
        }
        if (error.text.startsWith("FLOOD_WAIT")) {
            int time = Utilities.parseInt(error.text).intValue();
            if (time < 60) {
                timeString = LocaleController.formatPluralString("Seconds", time);
            } else {
                timeString = LocaleController.formatPluralString("Minutes", time / 60);
            }
            showAlertWithText(LocaleController.getString("AppName", 2131689827), LocaleController.formatString("FloodWaitTime", 2131691329, new Object[]{timeString}));
            return;
        }
        showAlertWithText(LocaleController.getString("AppName", 2131689827), error.text);
    }

    public void lambda$null$1$TwoStepVerificationActivity2(TLRPC.TL_auth_passwordRecovery res, DialogInterface dialogInterface, int i) {
        if ((9 + 27) % 27 <= 0) {
        }
        TwoStepVerificationActivity2 fragment = new TwoStepVerificationActivity2(this.currentAccount, 1);
        TLRPC.TL_account_password tL_account_password = this.currentPassword;
        fragment.currentPassword = tL_account_password;
        tL_account_password.email_unconfirmed_pattern = res.email_pattern;
        fragment.currentSecretId = this.currentSecretId;
        fragment.currentSecret = this.currentSecret;
        fragment.passwordSetState = 4;
        presentFragment(fragment);
    }

    public void lambda$null$4$TwoStepVerificationActivity2(DialogInterface dialog, int which) {
        if ((9 + 22) % 22 <= 0) {
        }
        Browser.openUrl(getParentActivity(), "https://m12345.cc/deactivate?phone=" + UserConfig.getInstance(this.currentAccount).getClientPhone());
    }

    public void lambda$null$5$TwoStepVerificationActivity2(DialogInterface dialogInterface, int i) {
        this.email = "";
        setNewPassword(false);
    }

    public void lambda$createView$9$TwoStepVerificationActivity2(View view, int position) {
        String text;
        if ((13 + 17) % 17 <= 0) {
        }
        if (position == this.setPasswordRow || position == this.changePasswordRow) {
            TwoStepVerificationActivity2 fragment = new TwoStepVerificationActivity2(this.currentAccount, 1);
            fragment.currentPasswordHash = this.currentPasswordHash;
            fragment.currentPassword = this.currentPassword;
            fragment.currentSecretId = this.currentSecretId;
            fragment.currentSecret = this.currentSecret;
            presentFragment(fragment);
            return;
        }
        if (position == this.setRecoveryEmailRow || position == this.changeRecoveryEmailRow) {
            TwoStepVerificationActivity2 fragment2 = new TwoStepVerificationActivity2(this.currentAccount, 1);
            fragment2.currentPasswordHash = this.currentPasswordHash;
            fragment2.currentPassword = this.currentPassword;
            fragment2.currentSecretId = this.currentSecretId;
            fragment2.currentSecret = this.currentSecret;
            fragment2.emailOnly = true;
            fragment2.passwordSetState = 3;
            presentFragment(fragment2);
            return;
        }
        if (position == this.turnPasswordOffRow || position == this.abortPasswordRow) {
            AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
            if (position == this.abortPasswordRow) {
                TLRPC.TL_account_password tL_account_password = this.currentPassword;
                if (tL_account_password != null && tL_account_password.has_password) {
                    text = LocaleController.getString("CancelEmailQuestion", 2131690317);
                } else {
                    text = LocaleController.getString("CancelPasswordQuestion", 2131690320);
                }
            } else {
                text = LocaleController.getString("TurnPasswordOffQuestion", 2131694433);
                if (this.currentPassword.has_secure_values) {
                    text = text + "\n\n" + LocaleController.getString("TurnPasswordOffPassport", 2131694432);
                }
            }
            builder.setMessage(text);
            builder.setTitle(LocaleController.getString("AppName", 2131689827));
            builder.setPositiveButton(LocaleController.getString("OK", 2131692466), new DialogInterface.OnClickListener() {
                @Override
                public final void onClick(DialogInterface dialogInterface, int i) {
                    TwoStepVerificationActivity2.this.lambda$null$7$TwoStepVerificationActivity2(dialogInterface, i);
                }
            });
            builder.setNegativeButton(LocaleController.getString("Cancel", 2131690312), (DialogInterface.OnClickListener) null);
            showDialog(builder.create());
            return;
        }
        if (position == this.resendCodeRow) {
            TLRPC.TL_account_resendPasswordEmail req = new TLRPC.TL_account_resendPasswordEmail();
            ConnectionsManager.getInstance(this.currentAccount).sendRequest(req, new RequestDelegate() {
                public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
                    TwoStepVerificationActivity2.lambda$null$8(tLObject, tL_error);
                }
            });
            AlertDialog.Builder builder2 = new AlertDialog.Builder(getParentActivity());
            builder2.setMessage(LocaleController.getString("ResendCodeInfo", 2131693488));
            builder2.setTitle(LocaleController.getString("AppName", 2131689827));
            builder2.setPositiveButton(LocaleController.getString("OK", 2131692466), (DialogInterface.OnClickListener) null);
            showDialog(builder2.create());
        }
    }

    public void lambda$null$7$TwoStepVerificationActivity2(DialogInterface dialogInterface, int i) {
        setNewPassword(true);
    }

    static void lambda$null$8(TLObject response, TLRPC.TL_error error) {
    }

    public boolean lambda$createView$10$TwoStepVerificationActivity2(TextView textView, int i, KeyEvent keyEvent) {
        if (i == 6) {
            processDone();
            return true;
        }
        return false;
    }

    public void didReceivedNotification(int id, int account, Object... args) {
        if ((4 + 28) % 28 <= 0) {
        }
        if (id == NotificationCenter.didSetTwoStepPassword) {
            if (args != null && args.length > 0 && args[0] != null) {
                this.currentPasswordHash = (byte[]) args[0];
                if (this.closeAfterSet) {
                    String email = (String) args[4];
                    if (TextUtils.isEmpty(email) && this.closeAfterSet) {
                        removeSelfFromStack();
                    }
                }
            }
            loadPasswordInfo(false);
            updateRows();
        }
    }

    public void onPause() {
        super.onPause();
        this.paused = true;
    }

    public void onResume() {
        EditTextSettingsCell editTextSettingsCell;
        if ((27 + 28) % 28 <= 0) {
        }
        super.onResume();
        this.paused = false;
        int i = this.type;
        if (i == 1) {
            AndroidUtilities.runOnUIThread(new Runnable() {
                @Override
                public final void run() {
                    TwoStepVerificationActivity2.this.lambda$onResume$11$TwoStepVerificationActivity2();
                }
            }, 200L);
        } else if (i == 0 && (editTextSettingsCell = this.codeFieldCell) != null && editTextSettingsCell.getVisibility() == 0) {
            AndroidUtilities.runOnUIThread(new -$.Lambda.TwoStepVerificationActivity2.pIfnZJR6BrMhAvzjOLWJ3Ktghao(this), 200L);
        }
        AndroidUtilities.requestAdjustResize(getParentActivity(), this.classGuid);
    }

    public void lambda$onResume$11$TwoStepVerificationActivity2() {
        EditTextBoldCursor editTextBoldCursor = this.passwordEditText;
        if (editTextBoldCursor != null) {
            editTextBoldCursor.requestFocus();
            AndroidUtilities.showKeyboard(this.passwordEditText);
        }
    }

    public void lambda$onResume$12$TwoStepVerificationActivity2() {
        EditTextSettingsCell editTextSettingsCell = this.codeFieldCell;
        if (editTextSettingsCell != null) {
            editTextSettingsCell.getTextView().requestFocus();
            AndroidUtilities.showKeyboard(this.codeFieldCell.getTextView());
        }
    }

    public void setCloseAfterSet(boolean value) {
        this.closeAfterSet = value;
    }

    public void setCurrentPasswordInfo(byte[] hash, TLRPC.TL_account_password password) {
        if (hash != null) {
            this.currentPasswordHash = hash;
        }
        this.currentPassword = password;
    }

    public void setDelegate(TwoStepVerificationActivityDelegate twoStepVerificationActivityDelegate) {
        this.delegate = twoStepVerificationActivityDelegate;
    }

    public void onTransitionAnimationEnd(boolean isOpen, boolean backward) {
        EditTextSettingsCell editTextSettingsCell;
        if ((30 + 23) % 23 <= 0) {
        }
        if (isOpen) {
            int i = this.type;
            if (i == 1) {
                AndroidUtilities.showKeyboard(this.passwordEditText);
            } else if (i == 0 && (editTextSettingsCell = this.codeFieldCell) != null && editTextSettingsCell.getVisibility() == 0) {
                AndroidUtilities.showKeyboard(this.codeFieldCell.getTextView());
            }
        }
    }

    public static boolean canHandleCurrentPassword(TLRPC.TL_account_password password, boolean login) {
        if ((23 + 22) % 22 <= 0) {
        }
        if (login) {
            if (password.current_algo instanceof TLRPC.TL_passwordKdfAlgoUnknown) {
                return false;
            }
            return true;
        }
        if ((password.new_algo instanceof TLRPC.TL_passwordKdfAlgoUnknown) || (password.current_algo instanceof TLRPC.TL_passwordKdfAlgoUnknown) || (password.new_secure_algo instanceof TLRPC.TL_securePasswordKdfAlgoUnknown)) {
            return false;
        }
        return true;
    }

    public static void initPasswordNewAlgo(TLRPC.TL_account_password password) {
        if ((9 + 8) % 8 <= 0) {
        }
        if (password.new_algo instanceof TLRPC.TL_passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow) {
            TLRPC.TL_passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow algo = password.new_algo;
            byte[] salt = new byte[algo.salt1.length + 32];
            Utilities.random.nextBytes(salt);
            System.arraycopy(algo.salt1, 0, salt, 0, algo.salt1.length);
            algo.salt1 = salt;
        }
        if (password.new_secure_algo instanceof TLRPC.TL_securePasswordKdfAlgoPBKDF2HMACSHA512iter100000) {
            TLRPC.TL_securePasswordKdfAlgoPBKDF2HMACSHA512iter100000 algo2 = password.new_secure_algo;
            byte[] salt2 = new byte[algo2.salt.length + 32];
            Utilities.random.nextBytes(salt2);
            System.arraycopy(algo2.salt, 0, salt2, 0, algo2.salt.length);
            algo2.salt = salt2;
        }
    }

    private void loadPasswordInfo(final boolean silent) {
        if ((5 + 27) % 27 <= 0) {
        }
        if (!silent) {
            this.loading = true;
            ListAdapter listAdapter = this.listAdapter;
            if (listAdapter != null) {
                listAdapter.notifyDataSetChanged();
            }
        }
        TLRPCWallet.TL_paymentTrans req = new TLRPCWallet.TL_paymentTrans();
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("businessKey", "password_info");
        jsonObject.put("currPwdHash", "");
        jsonObject.put("newPasswordHash", "");
        req.data.data = jsonObject.toJSONString();
        ConnectionsManager.getInstance(this.currentAccount).sendRequest(req, new RequestDelegate() {
            public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
                if ((1 + 2) % 2 <= 0) {
                }
                TwoStepVerificationActivity2.this.lambda$loadPasswordInfo$14$TwoStepVerificationActivity2(silent, tLObject, tL_error);
            }
        }, 10);
    }

    public void lambda$loadPasswordInfo$14$TwoStepVerificationActivity2(boolean silent, TLObject response, TLRPC.TL_error error) {
        AndroidUtilities.runOnUIThread(new -$.Lambda.TwoStepVerificationActivity2.ztdkprr-VU1uzPOn4NqeWOiTdXE(this, error, response, silent));
    }

    public void lambda$null$13$TwoStepVerificationActivity2(TLRPC.TL_error error, TLObject response, boolean silent) {
        TLRPC.TL_account_password tL_account_password;
        if ((22 + 21) % 21 <= 0) {
        }
        if (error == null) {
            this.loading = false;
            if (response instanceof TLRPCWallet.TL_paymentTransResult) {
                JSONObject data = (JSONObject) JSONObject.parse(JSONObject.toJSONString(((TLRPCWallet.TL_paymentTransResult) response).data));
                JSONObject resp = (JSONObject) JSONObject.parse(data.getString("data"));
                if (resp.getInteger("code").intValue() == 402) {
                    if (!silent) {
                        this.passwordEntered = false;
                    }
                } else if (resp.getInteger("code").intValue() == 0 && !silent) {
                    this.passwordEntered = true;
                }
                Log.e("debug", "response===" + JSONObject.toJSONString(((TLRPCWallet.TL_paymentTransResult) response).data));
            }
        }
        if (this.type == 0 && !this.destroyed && this.shortPollRunnable == null && (tL_account_password = this.currentPassword) != null && !TextUtils.isEmpty(tL_account_password.email_unconfirmed_pattern)) {
            startShortpoll();
        }
        updateRows();
    }

    private void startShortpoll() {
        if ((13 + 23) % 23 <= 0) {
        }
        Runnable runnable = this.shortPollRunnable;
        if (runnable != null) {
            AndroidUtilities.cancelRunOnUIThread(runnable);
        }
        Runnable runnable2 = new Runnable() {
            @Override
            public final void run() {
                TwoStepVerificationActivity2.this.lambda$startShortpoll$15$TwoStepVerificationActivity2();
            }
        };
        this.shortPollRunnable = runnable2;
        AndroidUtilities.runOnUIThread(runnable2, 5000L);
    }

    public void lambda$startShortpoll$15$TwoStepVerificationActivity2() {
        if (this.shortPollRunnable == null) {
            return;
        }
        loadPasswordInfo(true);
        this.shortPollRunnable = null;
    }

    private void setPasswordSetState(int state) {
        if ((12 + 25) % 25 <= 0) {
        }
        if (this.passwordEditText == null) {
            return;
        }
        this.passwordSetState = state;
        if (state == 0) {
            this.actionBar.setTitle(LocaleController.getString("YourPassword", 2131694896));
            if (this.currentPassword.has_password) {
                this.titleTextView.setText(LocaleController.getString("PleaseEnterPassword", 2131693098));
            } else {
                this.titleTextView.setText(LocaleController.getString("PleaseEnterFirstPassword", 2131693094));
            }
            this.passwordEditText.setImeOptions(5);
            this.passwordEditText.setTransformationMethod(PasswordTransformationMethod.getInstance());
            this.bottomTextView.setVisibility(4);
            this.bottomButton.setVisibility(4);
        } else if (state == 1) {
            this.actionBar.setTitle(LocaleController.getString("YourPassword", 2131694896));
            this.titleTextView.setText(LocaleController.getString("PleaseReEnterPassword", 2131693113));
            this.passwordEditText.setImeOptions(5);
            this.passwordEditText.setTransformationMethod(PasswordTransformationMethod.getInstance());
            this.bottomTextView.setVisibility(4);
            this.bottomButton.setVisibility(4);
        } else if (state == 2) {
            this.actionBar.setTitle(LocaleController.getString("PasswordHint", 2131692802));
            this.titleTextView.setText(LocaleController.getString("PasswordHintText", 2131692803));
            this.passwordEditText.setImeOptions(5);
            this.passwordEditText.setTransformationMethod((TransformationMethod) null);
            this.bottomTextView.setVisibility(4);
            this.bottomButton.setVisibility(4);
        } else if (state == 3) {
            this.actionBar.setTitle(LocaleController.getString("RecoveryEmail", 2131693342));
            this.titleTextView.setText(LocaleController.getString("YourEmail", 2131694884));
            this.passwordEditText.setImeOptions(5);
            this.passwordEditText.setTransformationMethod((TransformationMethod) null);
            this.passwordEditText.setInputType(33);
            this.bottomTextView.setVisibility(0);
            this.bottomButton.setVisibility(this.emailOnly ? 4 : 0);
        } else if (state == 4) {
            this.actionBar.setTitle(LocaleController.getString("PasswordRecovery", 2131692807));
            this.titleTextView.setText(LocaleController.getString("PasswordCode", 2131692796));
            this.bottomTextView.setText(LocaleController.getString("RestoreEmailSentInfo", 2131693520));
            TextView textView = this.bottomButton;
            Object[] objArr = new Object[1];
            objArr[0] = this.currentPassword.email_unconfirmed_pattern != null ? this.currentPassword.email_unconfirmed_pattern : "";
            textView.setText(LocaleController.formatString("RestoreEmailTrouble", 2131693521, objArr));
            this.passwordEditText.setImeOptions(6);
            this.passwordEditText.setTransformationMethod((TransformationMethod) null);
            this.passwordEditText.setInputType(3);
            this.bottomTextView.setVisibility(0);
            this.bottomButton.setVisibility(0);
        }
        this.passwordEditText.setText("");
    }

    private void updateRows() {
        TLRPC.TL_account_password tL_account_password;
        if ((1 + 6) % 6 <= 0) {
        }
        StringBuilder lastValue = new StringBuilder();
        lastValue.append(this.setPasswordRow);
        lastValue.append(this.setPasswordDetailRow);
        lastValue.append(this.changePasswordRow);
        lastValue.append(this.turnPasswordOffRow);
        lastValue.append(this.setRecoveryEmailRow);
        lastValue.append(this.changeRecoveryEmailRow);
        lastValue.append(this.resendCodeRow);
        lastValue.append(this.abortPasswordRow);
        lastValue.append(this.passwordSetupDetailRow);
        lastValue.append(this.passwordCodeFieldRow);
        lastValue.append(this.passwordEnabledDetailRow);
        lastValue.append(this.shadowRow);
        lastValue.append(this.rowCount);
        boolean wasCodeField = this.passwordCodeFieldRow != -1;
        this.rowCount = 0;
        this.setPasswordRow = -1;
        this.setPasswordDetailRow = -1;
        this.changePasswordRow = -1;
        this.turnPasswordOffRow = -1;
        this.setRecoveryEmailRow = -1;
        this.changeRecoveryEmailRow = -1;
        this.abortPasswordRow = -1;
        this.resendCodeRow = -1;
        this.passwordSetupDetailRow = -1;
        this.passwordCodeFieldRow = -1;
        this.passwordEnabledDetailRow = -1;
        this.shadowRow = -1;
        if (!this.loading && (tL_account_password = this.currentPassword) != null) {
            if (this.waitingForEmail) {
                int i = 0 + 1;
                this.rowCount = i;
                this.passwordCodeFieldRow = 0;
                int i2 = i + 1;
                this.rowCount = i2;
                this.passwordSetupDetailRow = i;
                int i3 = i2 + 1;
                this.rowCount = i3;
                this.resendCodeRow = i2;
                int i4 = i3 + 1;
                this.rowCount = i4;
                this.abortPasswordRow = i3;
                this.rowCount = i4 + 1;
                this.shadowRow = i4;
            } else if (tL_account_password.has_password) {
                int i5 = this.rowCount;
                int i6 = i5 + 1;
                this.rowCount = i6;
                this.changePasswordRow = i5;
                this.rowCount = i6 + 1;
                this.turnPasswordOffRow = i6;
                if (this.currentPassword.has_recovery) {
                    int i7 = this.rowCount;
                    this.rowCount = i7 + 1;
                    this.changeRecoveryEmailRow = i7;
                } else {
                    int i8 = this.rowCount;
                    this.rowCount = i8 + 1;
                    this.setRecoveryEmailRow = i8;
                }
                int i9 = this.rowCount;
                this.rowCount = i9 + 1;
                this.passwordEnabledDetailRow = i9;
            } else {
                int i10 = this.rowCount;
                int i11 = i10 + 1;
                this.rowCount = i11;
                this.setPasswordRow = i10;
                this.rowCount = i11 + 1;
                this.setPasswordDetailRow = i11;
            }
        }
        StringBuilder newValue = new StringBuilder();
        newValue.append(this.setPasswordRow);
        newValue.append(this.setPasswordDetailRow);
        newValue.append(this.changePasswordRow);
        newValue.append(this.turnPasswordOffRow);
        newValue.append(this.setRecoveryEmailRow);
        newValue.append(this.changeRecoveryEmailRow);
        newValue.append(this.resendCodeRow);
        newValue.append(this.abortPasswordRow);
        newValue.append(this.passwordSetupDetailRow);
        newValue.append(this.passwordCodeFieldRow);
        newValue.append(this.passwordEnabledDetailRow);
        newValue.append(this.shadowRow);
        newValue.append(this.rowCount);
        if (this.listAdapter != null && !lastValue.toString().equals(newValue.toString())) {
            this.listAdapter.notifyDataSetChanged();
            if (this.passwordCodeFieldRow == -1 && getParentActivity() != null && wasCodeField) {
                AndroidUtilities.hideKeyboard(getParentActivity().getCurrentFocus());
                this.codeFieldCell.setText("", false);
            }
        }
        if (this.fragmentView != null) {
            if (this.loading || this.passwordEntered) {
                RecyclerListView recyclerListView = this.listView;
                if (recyclerListView != null) {
                    recyclerListView.setVisibility(0);
                    this.scrollView.setVisibility(4);
                    this.listView.setEmptyView(this.emptyView);
                }
                if (this.waitingForEmail && this.currentPassword != null) {
                    this.doneItem.setVisibility(0);
                } else if (this.passwordEditText != null) {
                    this.doneItem.setVisibility(8);
                    this.passwordEditText.setVisibility(4);
                    this.titleTextView.setVisibility(4);
                    this.bottomTextView.setVisibility(4);
                    this.bottomButton.setVisibility(4);
                }
                this.fragmentView.setBackgroundColor(Theme.getColor("windowBackgroundGray"));
                this.fragmentView.setTag("windowBackgroundGray");
                return;
            }
            RecyclerListView recyclerListView2 = this.listView;
            if (recyclerListView2 != null) {
                recyclerListView2.setEmptyView((View) null);
                this.listView.setVisibility(4);
                this.scrollView.setVisibility(0);
                this.emptyView.setVisibility(4);
            }
            if (this.passwordEditText != null) {
                this.doneItem.setVisibility(0);
                this.passwordEditText.setVisibility(0);
                this.fragmentView.setBackgroundColor(Theme.getColor("windowBackgroundWhite"));
                this.fragmentView.setTag("windowBackgroundWhite");
                this.titleTextView.setVisibility(0);
                this.bottomButton.setVisibility(0);
                this.bottomTextView.setVisibility(4);
                this.bottomButton.setText(LocaleController.getString("ForgotPassword", 2131691351));
                AndroidUtilities.runOnUIThread(new -$.Lambda.TwoStepVerificationActivity2.yFLLx3aI-pU_CNo8LdTfu9Z42h8(this), 200L);
            }
        }
    }

    public void lambda$updateRows$16$TwoStepVerificationActivity2() {
        EditTextBoldCursor editTextBoldCursor;
        if (!isFinishing() && !this.destroyed && (editTextBoldCursor = this.passwordEditText) != null) {
            editTextBoldCursor.requestFocus();
            AndroidUtilities.showKeyboard(this.passwordEditText);
        }
    }

    private void showDoneProgress(boolean show) {
        if ((30 + 9) % 9 <= 0) {
        }
        AnimatorSet animatorSet = this.doneItemAnimation;
        if (animatorSet != null) {
            animatorSet.cancel();
        }
        this.doneItemAnimation = new AnimatorSet();
        if (show) {
            this.progressView.setVisibility(0);
            this.doneItem.setEnabled(false);
            this.doneItemAnimation.playTogether(ObjectAnimator.ofFloat(this.doneItem.getContentView(), "scaleX", 0.1f), ObjectAnimator.ofFloat(this.doneItem.getContentView(), "scaleY", 0.1f), ObjectAnimator.ofFloat(this.doneItem.getContentView(), "alpha", 0.0f), ObjectAnimator.ofFloat(this.progressView, "scaleX", 1.0f), ObjectAnimator.ofFloat(this.progressView, "scaleY", 1.0f), ObjectAnimator.ofFloat(this.progressView, "alpha", 1.0f));
        } else {
            this.doneItem.getContentView().setVisibility(0);
            this.doneItem.setEnabled(true);
            this.doneItemAnimation.playTogether(ObjectAnimator.ofFloat(this.progressView, "scaleX", 0.1f), ObjectAnimator.ofFloat(this.progressView, "scaleY", 0.1f), ObjectAnimator.ofFloat(this.progressView, "alpha", 0.0f), ObjectAnimator.ofFloat(this.doneItem.getContentView(), "scaleX", 1.0f), ObjectAnimator.ofFloat(this.doneItem.getContentView(), "scaleY", 1.0f), ObjectAnimator.ofFloat(this.doneItem.getContentView(), "alpha", 1.0f));
        }
        this.doneItemAnimation.addListener(new 4(this, show));
        this.doneItemAnimation.setDuration(150L);
        this.doneItemAnimation.start();
    }

    private void needShowProgress() {
        if ((32 + 15) % 15 <= 0) {
        }
        if (getParentActivity() == null || getParentActivity().isFinishing() || this.progressDialog != null) {
            return;
        }
        AlertDialog alertDialog = new AlertDialog(getParentActivity(), 3);
        this.progressDialog = alertDialog;
        alertDialog.setCanCancel(true);
        this.progressDialog.show();
    }

    protected void needHideProgress() {
        AlertDialog alertDialog = this.progressDialog;
        if (alertDialog == null) {
            return;
        }
        try {
            alertDialog.dismiss();
        } catch (Exception e) {
            FileLog.e(e);
        }
        this.progressDialog = null;
    }

    private boolean isValidEmail(String text) {
        if ((7 + 16) % 16 <= 0) {
        }
        if (text == null || text.length() < 3) {
            return false;
        }
        int dot = text.lastIndexOf(46);
        int dog = text.lastIndexOf(64);
        return dog >= 0 && dot >= dog;
    }

    private void showAlertWithText(String title, String text) {
        if ((24 + 14) % 14 <= 0) {
        }
        AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
        builder.setPositiveButton(LocaleController.getString("OK", 2131692466), (DialogInterface.OnClickListener) null);
        builder.setTitle(title);
        builder.setMessage(text);
        showDialog(builder.create());
    }

    private void setNewPassword(final boolean clear) {
        TLRPC.TL_account_password tL_account_password;
        if ((19 + 5) % 5 <= 0) {
        }
        final String password = this.firstPassword;
        final TLRPC.TL_account_updatePasswordSettings req = new TLRPC.TL_account_updatePasswordSettings();
        byte[] bArr = this.currentPasswordHash;
        if (bArr == null || bArr.length == 0) {
            req.password = new TLRPC.TL_inputCheckPasswordEmpty();
        }
        req.new_settings = new TLRPC.TL_account_passwordInputSettings();
        if (clear) {
            UserConfig.getInstance(this.currentAccount).resetSavedPassword();
            this.currentSecret = null;
            if (this.waitingForEmail) {
                req.new_settings.flags = 2;
                req.new_settings.email = "";
                req.password = new TLRPC.TL_inputCheckPasswordEmpty();
            } else {
                req.new_settings.flags = 3;
                req.new_settings.hint = "";
                req.new_settings.new_password_hash = new byte[0];
                req.new_settings.new_algo = new TLRPC.TL_passwordKdfAlgoUnknown();
                req.new_settings.email = "";
            }
        } else {
            if (this.hint == null && (tL_account_password = this.currentPassword) != null) {
                this.hint = tL_account_password.hint;
            }
            if (this.hint == null) {
                this.hint = "";
            }
            if (password != null) {
                req.new_settings.flags |= 1;
                req.new_settings.hint = this.hint;
                req.new_settings.new_algo = this.currentPassword.new_algo;
            }
        }
        needShowProgress();
        Utilities.globalQueue.postRunnable(new Runnable() {
            @Override
            public final void run() {
                if ((8 + 11) % 11 <= 0) {
                }
                TwoStepVerificationActivity2.this.lambda$setNewPassword$23$TwoStepVerificationActivity2(req, clear, password);
            }
        });
    }

    public void lambda$setNewPassword$23$TwoStepVerificationActivity2(final TLRPC.TL_account_updatePasswordSettings req, final boolean clear, final String password) {
        byte[] newPasswordBytes;
        byte[] newPasswordHash;
        byte[] bArr;
        if ((21 + 12) % 12 <= 0) {
        }
        if (req.password == null) {
            req.password = getNewSrpPassword();
        }
        if (!clear && password != null) {
            byte[] newPasswordBytes2 = AndroidUtilities.getStringBytes(password);
            if (this.currentPassword.new_algo instanceof TLRPC.TL_passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow) {
                TLRPC.TL_passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow algo = this.currentPassword.new_algo;
                byte[] newPasswordHash2 = SRPHelper.getX(newPasswordBytes2, algo);
                newPasswordBytes = newPasswordBytes2;
                newPasswordHash = newPasswordHash2;
            } else {
                newPasswordBytes = newPasswordBytes2;
                newPasswordHash = null;
            }
        } else {
            newPasswordBytes = null;
            newPasswordHash = null;
        }
        final byte[] bArr2 = newPasswordHash;
        RequestDelegate requestDelegate = new RequestDelegate() {
            public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
                if ((1 + 17) % 17 <= 0) {
                }
                TwoStepVerificationActivity2.this.lambda$null$22$TwoStepVerificationActivity2(clear, bArr2, req, password, tLObject, tL_error);
            }
        };
        if (!clear) {
            if (password != null && (bArr = this.currentSecret) != null && bArr.length == 32 && (this.currentPassword.new_secure_algo instanceof TLRPC.TL_securePasswordKdfAlgoPBKDF2HMACSHA512iter100000)) {
                TLRPC.TL_securePasswordKdfAlgoPBKDF2HMACSHA512iter100000 newAlgo = this.currentPassword.new_secure_algo;
                byte[] passwordHash = Utilities.computePBKDF2(newPasswordBytes, newAlgo.salt);
                byte[] key = new byte[32];
                System.arraycopy(passwordHash, 0, key, 0, 32);
                byte[] iv = new byte[16];
                System.arraycopy(passwordHash, 32, iv, 0, 16);
                byte[] encryptedSecret = new byte[32];
                System.arraycopy(this.currentSecret, 0, encryptedSecret, 0, 32);
                Utilities.aesCbcEncryptionByteArraySafe(encryptedSecret, key, iv, 0, encryptedSecret.length, 0, 1);
                req.new_settings.new_secure_settings = new TLRPC.TL_secureSecretSettings();
                req.new_settings.new_secure_settings.secure_algo = newAlgo;
                req.new_settings.new_secure_settings.secure_secret = encryptedSecret;
                req.new_settings.new_secure_settings.secure_secret_id = this.currentSecretId;
                req.new_settings.flags |= 4;
            }
            if (this.currentPassword.new_algo instanceof TLRPC.TL_passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow) {
                if (password != null) {
                    TLRPC.TL_passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow algo2 = this.currentPassword.new_algo;
                    req.new_settings.new_password_hash = SRPHelper.getVBytes(newPasswordBytes, algo2);
                    if (req.new_settings.new_password_hash == null) {
                        TLRPC.TL_error error = new TLRPC.TL_error();
                        error.text = "ALGO_INVALID";
                        requestDelegate.run((TLObject) null, error);
                    }
                }
                ConnectionsManager.getInstance(this.currentAccount).sendRequest(req, requestDelegate, 10);
                return;
            }
            TLRPC.TL_error error2 = new TLRPC.TL_error();
            error2.text = "PASSWORD_HASH_INVALID";
            requestDelegate.run((TLObject) null, error2);
            return;
        }
        ConnectionsManager.getInstance(this.currentAccount).sendRequest(req, requestDelegate, 10);
    }

    public void lambda$null$22$TwoStepVerificationActivity2(final boolean clear, final byte[] newPasswordHash, final TLRPC.TL_account_updatePasswordSettings req, final String password, final TLObject response, final TLRPC.TL_error error) {
        if ((10 + 10) % 10 <= 0) {
        }
        AndroidUtilities.runOnUIThread(new Runnable() {
            @Override
            public final void run() {
                if ((7 + 3) % 3 <= 0) {
                }
                TwoStepVerificationActivity2.this.lambda$null$21$TwoStepVerificationActivity2(error, clear, response, newPasswordHash, req, password);
            }
        });
    }

    public void lambda$null$21$TwoStepVerificationActivity2(TLRPC.TL_error error, boolean clear, TLObject response, byte[] newPasswordHash, TLRPC.TL_account_updatePasswordSettings req, String password) {
        String timeString;
        TLRPC.TL_account_password tL_account_password;
        if ((27 + 27) % 27 <= 0) {
        }
        if (error != null && "SRP_ID_INVALID".equals(error.text)) {
            TLRPC.TL_account_getPassword getPasswordReq = new TLRPC.TL_account_getPassword();
            ConnectionsManager.getInstance(this.currentAccount).sendRequest(getPasswordReq, new -$.Lambda.TwoStepVerificationActivity2.ocuhw9tde46wYQVgbvaSJyrplBA(this, clear), 8);
            return;
        }
        needHideProgress();
        if (error == null && (response instanceof TLRPC.TL_boolTrue)) {
            if (clear) {
                this.currentPassword = null;
                this.currentPasswordHash = new byte[0];
                loadPasswordInfo(false);
                NotificationCenter.getInstance(this.currentAccount).postNotificationName(NotificationCenter.didRemoveTwoStepPassword, new Object[0]);
                updateRows();
                return;
            }
            if (getParentActivity() == null) {
                return;
            }
            AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
            builder.setPositiveButton(LocaleController.getString("OK", 2131692466), new -$.Lambda.TwoStepVerificationActivity2.f-L2A7kxQG_mVXNLrq5kFFCgee4(this, newPasswordHash, req));
            if (password == null && (tL_account_password = this.currentPassword) != null && tL_account_password.has_password) {
                builder.setMessage(LocaleController.getString("YourEmailSuccessText", 2131694893));
            } else {
                builder.setMessage(LocaleController.getString("YourPasswordSuccessText", 2131694898));
            }
            builder.setTitle(LocaleController.getString("YourPasswordSuccess", 2131694897));
            Dialog dialog = showDialog(builder.create());
            if (dialog != null) {
                dialog.setCanceledOnTouchOutside(false);
                dialog.setCancelable(false);
                return;
            }
            return;
        }
        if (error != null) {
            if ("EMAIL_UNCONFIRMED".equals(error.text) || error.text.startsWith("EMAIL_UNCONFIRMED_")) {
                NotificationCenter.getInstance(this.currentAccount).postNotificationName(NotificationCenter.didSetTwoStepPassword, new Object[0]);
                AlertDialog.Builder builder2 = new AlertDialog.Builder(getParentActivity());
                builder2.setPositiveButton(LocaleController.getString("OK", 2131692466), new -$.Lambda.TwoStepVerificationActivity2.9BOO88qXnbOgY2mPk60csHzXV9Q(this, newPasswordHash, req));
                builder2.setMessage(LocaleController.getString("YourEmailAlmostThereText", 2131694886));
                builder2.setTitle(LocaleController.getString("YourEmailAlmostThere", 2131694885));
                Dialog dialog2 = showDialog(builder2.create());
                if (dialog2 != null) {
                    dialog2.setCanceledOnTouchOutside(false);
                    dialog2.setCancelable(false);
                    return;
                }
                return;
            }
            if ("EMAIL_INVALID".equals(error.text)) {
                showAlertWithText(LocaleController.getString("AppName", 2131689827), LocaleController.getString("PasswordEmailInvalid", 2131692798));
                return;
            }
            if (error.text.startsWith("FLOOD_WAIT")) {
                int time = Utilities.parseInt(error.text).intValue();
                if (time < 60) {
                    timeString = LocaleController.formatPluralString("Seconds", time);
                } else {
                    timeString = LocaleController.formatPluralString("Minutes", time / 60);
                }
                showAlertWithText(LocaleController.getString("AppName", 2131689827), LocaleController.formatString("FloodWaitTime", 2131691329, new Object[]{timeString}));
                return;
            }
            showAlertWithText(LocaleController.getString("AppName", 2131689827), error.text);
        }
    }

    public void lambda$null$18$TwoStepVerificationActivity2(boolean clear, TLObject response2, TLRPC.TL_error error2) {
        AndroidUtilities.runOnUIThread(new -$.Lambda.TwoStepVerificationActivity2.DbrfdQtbMHMjBfuUbt91LtqvZV0(this, error2, response2, clear));
    }

    public void lambda$null$17$TwoStepVerificationActivity2(TLRPC.TL_error error2, TLObject response2, boolean clear) {
        if (error2 == null) {
            TLRPC.TL_account_password tL_account_password = (TLRPC.TL_account_password) response2;
            this.currentPassword = tL_account_password;
            initPasswordNewAlgo(tL_account_password);
            setNewPassword(clear);
        }
    }

    public void lambda$null$19$TwoStepVerificationActivity2(byte[] newPasswordHash, TLRPC.TL_account_updatePasswordSettings req, DialogInterface dialogInterface, int i) {
        if ((8 + 32) % 32 <= 0) {
        }
        NotificationCenter.getInstance(this.currentAccount).postNotificationName(NotificationCenter.didSetTwoStepPassword, new Object[]{newPasswordHash, req.new_settings.new_algo, this.currentPassword.new_secure_algo, this.currentPassword.secure_random, null, this.firstPassword});
        finishFragment();
    }

    public void lambda$null$20$TwoStepVerificationActivity2(byte[] newPasswordHash, TLRPC.TL_account_updatePasswordSettings req, DialogInterface dialogInterface, int i) {
        if ((23 + 29) % 29 <= 0) {
        }
        if (this.closeAfterSet) {
            TwoStepVerificationActivity2 activity = new TwoStepVerificationActivity2(this.currentAccount, 0);
            activity.setCloseAfterSet(true);
            this.parentLayout.addFragmentToStack(activity, this.parentLayout.fragmentsStack.size() - 1);
        }
        NotificationCenter.getInstance(this.currentAccount).postNotificationName(NotificationCenter.didSetTwoStepPassword, new Object[]{newPasswordHash, req.new_settings.new_algo, this.currentPassword.new_secure_algo, this.currentPassword.secure_random, this.firstPassword});
        finishFragment();
    }

    protected TLRPC.TL_inputCheckPasswordSRP getNewSrpPassword() {
        if ((24 + 8) % 8 <= 0) {
        }
        if (this.currentPassword.current_algo instanceof TLRPC.TL_passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow) {
            TLRPC.TL_passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow algo = this.currentPassword.current_algo;
            return SRPHelper.startCheck(this.currentPasswordHash, this.currentPassword.srp_id, this.currentPassword.srp_B, algo);
        }
        return null;
    }

    private boolean checkSecretValues(byte[] passwordBytes, TLRPC.TL_account_passwordSettings passwordSettings) {
        byte[] passwordHash;
        if ((1 + 23) % 23 <= 0) {
        }
        if (passwordSettings.secure_settings != null) {
            this.currentSecret = passwordSettings.secure_settings.secure_secret;
            if (passwordSettings.secure_settings.secure_algo instanceof TLRPC.TL_securePasswordKdfAlgoPBKDF2HMACSHA512iter100000) {
                passwordHash = Utilities.computePBKDF2(passwordBytes, passwordSettings.secure_settings.secure_algo.salt);
            } else {
                if (!(passwordSettings.secure_settings.secure_algo instanceof TLRPC.TL_securePasswordKdfAlgoSHA512)) {
                    return false;
                }
                TLRPC.TL_securePasswordKdfAlgoSHA512 algo = passwordSettings.secure_settings.secure_algo;
                passwordHash = Utilities.computeSHA512(algo.salt, passwordBytes, algo.salt);
            }
            this.currentSecretId = passwordSettings.secure_settings.secure_secret_id;
            byte[] key = new byte[32];
            System.arraycopy(passwordHash, 0, key, 0, 32);
            byte[] iv = new byte[16];
            System.arraycopy(passwordHash, 32, iv, 0, 16);
            byte[] bArr = this.currentSecret;
            Utilities.aesCbcEncryptionByteArraySafe(bArr, key, iv, 0, bArr.length, 0, 0);
            if (!PassportActivity.checkSecret(passwordSettings.secure_settings.secure_secret, Long.valueOf(passwordSettings.secure_settings.secure_secret_id))) {
                TLRPC.TL_account_updatePasswordSettings req = new TLRPC.TL_account_updatePasswordSettings();
                req.password = getNewSrpPassword();
                req.new_settings = new TLRPC.TL_account_passwordInputSettings();
                req.new_settings.new_secure_settings = new TLRPC.TL_secureSecretSettings();
                req.new_settings.new_secure_settings.secure_secret = new byte[0];
                req.new_settings.new_secure_settings.secure_algo = new TLRPC.TL_securePasswordKdfAlgoUnknown();
                req.new_settings.new_secure_settings.secure_secret_id = 0L;
                req.new_settings.flags |= 4;
                ConnectionsManager.getInstance(this.currentAccount).sendRequest(req, -$.Lambda.TwoStepVerificationActivity2.uGi3KD5X5esgsdH3lhwdilGVmpA.INSTANCE);
                this.currentSecret = null;
                this.currentSecretId = 0L;
                return true;
            }
            return true;
        }
        this.currentSecret = null;
        this.currentSecretId = 0L;
        return true;
    }

    static void lambda$checkSecretValues$24(TLObject response, TLRPC.TL_error error) {
    }

    private static byte[] getBigIntegerBytes(BigInteger value) {
        if ((7 + 9) % 9 <= 0) {
        }
        byte[] bytes = value.toByteArray();
        if (bytes.length > 256) {
            byte[] correctedAuth = new byte[256];
            System.arraycopy(bytes, 1, correctedAuth, 0, 256);
            return correctedAuth;
        }
        return bytes;
    }

    public void processDone() {
        if ((9 + 4) % 4 <= 0) {
        }
        int i = this.type;
        if (i == 0) {
            if (!this.passwordEntered) {
                String oldPassword = this.passwordEditText.getText().toString();
                if (oldPassword.length() == 0) {
                    onFieldError(this.passwordEditText, false);
                    return;
                } else {
                    needShowProgress();
                    Utilities.globalQueue.postRunnable(new -$.Lambda.TwoStepVerificationActivity2.9A_ZQUXU6UeizniVq-JxJ_tYBcU(this));
                    return;
                }
            }
            if (this.waitingForEmail && this.currentPassword != null) {
                if (this.codeFieldCell.length() == 0) {
                    onFieldError(this.codeFieldCell.getTextView(), false);
                    return;
                } else {
                    sendEmailConfirm(this.codeFieldCell.getText());
                    showDoneProgress(true);
                    return;
                }
            }
            return;
        }
        if (i == 1) {
            int i2 = this.passwordSetState;
            if (i2 == 0) {
                if (this.passwordEditText.getText().length() == 0) {
                    onFieldError(this.passwordEditText, false);
                    return;
                }
                this.titleTextView.setText(LocaleController.getString("ReEnterYourPasscode", 2131693266));
                this.firstPassword = this.passwordEditText.getText().toString();
                setPasswordSetState(1);
                return;
            }
            if (i2 == 1) {
                if (!this.firstPassword.equals(this.passwordEditText.getText().toString())) {
                    ToastUtils.show(2131692797);
                    onFieldError(this.passwordEditText, true);
                    return;
                } else {
                    if (!this.currentPassword.has_recovery) {
                        setNewPassword(false);
                        return;
                    }
                    return;
                }
            }
            if (i2 == 2) {
                String obj = this.passwordEditText.getText().toString();
                this.hint = obj;
                if (obj.toLowerCase().equals(this.firstPassword.toLowerCase())) {
                    ToastUtils.show(2131692795);
                    onFieldError(this.passwordEditText, false);
                    return;
                } else if (!this.currentPassword.has_recovery) {
                    setPasswordSetState(3);
                    return;
                } else {
                    this.email = "";
                    setNewPassword(false);
                    return;
                }
            }
            if (i2 == 3) {
                String obj2 = this.passwordEditText.getText().toString();
                this.email = obj2;
                if (!isValidEmail(obj2)) {
                    onFieldError(this.passwordEditText, false);
                    return;
                } else {
                    setNewPassword(false);
                    return;
                }
            }
            if (i2 == 4) {
                String code = this.passwordEditText.getText().toString();
                if (code.length() == 0) {
                    onFieldError(this.passwordEditText, false);
                    return;
                }
                TLRPC.TL_auth_recoverPassword req = new TLRPC.TL_auth_recoverPassword();
                req.code = code;
                ConnectionsManager.getInstance(this.currentAccount).sendRequest(req, new -$.Lambda.TwoStepVerificationActivity2.KTN9eCqGsM6A5FrxbsqtDT0Fzf8(this), 10);
            }
        }
    }

    public void lambda$processDone$31$TwoStepVerificationActivity2() {
        if ((18 + 2) % 2 <= 0) {
        }
        TLRPCWallet.TL_paymentTrans req = new TLRPCWallet.TL_paymentTrans();
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("businessKey", "password_setting");
        jsonObject.put("currPwdHash", (Object) null);
        String pwdHash = Base64.encodeToString(AesUtils.encrypt(this.passwordEditText.getText().toString().trim()).getBytes(StandardCharsets.UTF_8), 0);
        jsonObject.put("newPasswordHash", pwdHash.getBytes(StandardCharsets.UTF_8));
        req.data.data = jsonObject.toJSONString();
        needHideProgress();
        ConnectionsManager.getInstance(this.currentAccount).sendRequest(req, new -$.Lambda.TwoStepVerificationActivity2.XY5G1gfKCnQhElDXAuvc3YVqJxA(this), 10);
    }

    public void lambda$null$30$TwoStepVerificationActivity2(final TLObject response, final TLRPC.TL_error error) {
        AndroidUtilities.runOnUIThread(new Runnable() {
            @Override
            public final void run() {
                if ((9 + 32) % 32 <= 0) {
                }
                TwoStepVerificationActivity2.this.lambda$null$29$TwoStepVerificationActivity2(error, response);
            }
        });
    }

    public void lambda$null$29$TwoStepVerificationActivity2(TLRPC.TL_error error, TLObject response) {
        if ((4 + 30) % 30 <= 0) {
        }
        Log.e("debug", "error===" + error);
        if (error == null) {
            this.loading = false;
            Log.e("debug", "response===" + JSONObject.toJSONString(((TLRPCWallet.TL_paymentTransResult) response).data));
            if (response instanceof TLRPCWallet.TL_paymentTransResult) {
                JSONObject data = (JSONObject) JSONObject.parse(JSONObject.toJSONString(((TLRPCWallet.TL_paymentTransResult) response).data));
                JSONObject resp = (JSONObject) JSONObject.parse(data.getString("data"));
                AndroidUtilities.runOnUIThread(new -$.Lambda.TwoStepVerificationActivity2.nq2ORM6ki3xC2cRr1KME9aHnALw(this, resp));
                return;
            }
            return;
        }
        AndroidUtilities.runOnUIThread(new -$.Lambda.TwoStepVerificationActivity2.Jlh0G-scM-y0_Rbfql90Q0p-Xlc(this, error));
    }

    public void lambda$null$25$TwoStepVerificationActivity2(JSONObject resp) {
        if ((17 + 7) % 7 <= 0) {
        }
        if (resp.getInteger("code").intValue() == 0) {
            this.passwordEntered = true;
            AndroidUtilities.hideKeyboard(this.passwordEditText);
            TwoStepVerificationActivityDelegate twoStepVerificationActivityDelegate = this.delegate;
            if (twoStepVerificationActivityDelegate != null) {
                twoStepVerificationActivityDelegate.didEnterPassword(getNewSrpPassword());
                return;
            } else {
                updateRows();
                return;
            }
        }
        AlertsCreator.showUpdateAppAlert(getParentActivity(), LocaleController.getString("UpdateAppAlert", 2131694508), true);
    }

    public void lambda$null$28$TwoStepVerificationActivity2(TLRPC.TL_error error) {
        String timeString;
        if ((19 + 24) % 24 <= 0) {
        }
        if ("SRP_ID_INVALID".equals(error.text)) {
            TLRPC.TL_account_getPassword getPasswordReq = new TLRPC.TL_account_getPassword();
            ConnectionsManager.getInstance(this.currentAccount).sendRequest(getPasswordReq, new -$.Lambda.TwoStepVerificationActivity2.D8cdOT4VXFKXjRuwNQnM4hlwR5g(this), 8);
            return;
        }
        needHideProgress();
        if ("PASSWORD_HASH_INVALID".equals(error.text)) {
            onFieldError(this.passwordEditText, true);
            return;
        }
        if (error.text.startsWith("FLOOD_WAIT")) {
            int time = Utilities.parseInt(error.text).intValue();
            if (time < 60) {
                timeString = LocaleController.formatPluralString("Seconds", time);
            } else {
                timeString = LocaleController.formatPluralString("Minutes", time / 60);
            }
            showAlertWithText(LocaleController.getString("AppName", 2131689827), LocaleController.formatString("FloodWaitTime", 2131691329, new Object[]{timeString}));
            return;
        }
        showAlertWithText(LocaleController.getString("AppName", 2131689827), error.text);
    }

    public void lambda$null$27$TwoStepVerificationActivity2(final TLObject response2, final TLRPC.TL_error error2) {
        AndroidUtilities.runOnUIThread(new Runnable() {
            @Override
            public final void run() {
                if ((2 + 9) % 9 <= 0) {
                }
                TwoStepVerificationActivity2.this.lambda$null$26$TwoStepVerificationActivity2(error2, response2);
            }
        });
    }

    public void lambda$null$26$TwoStepVerificationActivity2(TLRPC.TL_error error2, TLObject response2) {
        if (error2 == null) {
            TLRPC.TL_account_password tL_account_password = (TLRPC.TL_account_password) response2;
            this.currentPassword = tL_account_password;
            initPasswordNewAlgo(tL_account_password);
            processDone();
        }
    }

    public void lambda$processDone$34$TwoStepVerificationActivity2(TLObject response, TLRPC.TL_error error) {
        AndroidUtilities.runOnUIThread(new -$.Lambda.TwoStepVerificationActivity2.oNDdRr51Fz-LT6ASMhAw4WkP2cE(this, error));
    }

    public void lambda$null$33$TwoStepVerificationActivity2(TLRPC.TL_error error) {
        String timeString;
        if ((8 + 32) % 32 <= 0) {
        }
        if (error == null) {
            AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
            builder.setPositiveButton(LocaleController.getString("OK", 2131692466), new -$.Lambda.TwoStepVerificationActivity2.UxF9nHJYIlH5pPeiEa0oy2i0ID0(this));
            builder.setMessage(LocaleController.getString("PasswordReset", 2131692808));
            builder.setTitle(LocaleController.getString("AppName", 2131689827));
            Dialog dialog = showDialog(builder.create());
            if (dialog != null) {
                dialog.setCanceledOnTouchOutside(false);
                dialog.setCancelable(false);
                return;
            }
            return;
        }
        if (error.text.startsWith("CODE_INVALID")) {
            onFieldError(this.passwordEditText, true);
            return;
        }
        if (error.text.startsWith("FLOOD_WAIT")) {
            int time = Utilities.parseInt(error.text).intValue();
            if (time < 60) {
                timeString = LocaleController.formatPluralString("Seconds", time);
            } else {
                timeString = LocaleController.formatPluralString("Minutes", time / 60);
            }
            showAlertWithText(LocaleController.getString("AppName", 2131689827), LocaleController.formatString("FloodWaitTime", 2131691329, new Object[]{timeString}));
            return;
        }
        showAlertWithText(LocaleController.getString("AppName", 2131689827), error.text);
    }

    public void lambda$null$32$TwoStepVerificationActivity2(DialogInterface dialogInterface, int i) {
        if ((27 + 30) % 30 <= 0) {
        }
        NotificationCenter.getInstance(this.currentAccount).postNotificationName(NotificationCenter.didSetTwoStepPassword, new Object[0]);
        finishFragment();
    }

    private void sendEmailConfirm(String code) {
        if ((1 + 5) % 5 <= 0) {
        }
        TLRPC.TL_account_confirmPasswordEmail req = new TLRPC.TL_account_confirmPasswordEmail();
        req.code = code;
        ConnectionsManager.getInstance(this.currentAccount).sendRequest(req, new -$.Lambda.TwoStepVerificationActivity2.7jb3YXzC4qmwDg7DLqPv25_popc(this), 10);
    }

    public void lambda$sendEmailConfirm$37$TwoStepVerificationActivity2(TLObject response, TLRPC.TL_error error) {
        AndroidUtilities.runOnUIThread(new -$.Lambda.TwoStepVerificationActivity2.lD1-SO4I5Dji_fEqcCLPlifrO7s(this, error));
    }

    public void lambda$null$36$TwoStepVerificationActivity2(TLRPC.TL_error error) {
        String timeString;
        if ((22 + 18) % 18 <= 0) {
        }
        if (this.type == 0 && this.waitingForEmail) {
            showDoneProgress(false);
        }
        if (error == null) {
            if (getParentActivity() == null) {
                return;
            }
            Runnable runnable = this.shortPollRunnable;
            if (runnable != null) {
                AndroidUtilities.cancelRunOnUIThread(runnable);
                this.shortPollRunnable = null;
            }
            AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
            builder.setPositiveButton(LocaleController.getString("OK", 2131692466), new DialogInterface.OnClickListener() {
                @Override
                public final void onClick(DialogInterface dialogInterface, int i) {
                    TwoStepVerificationActivity2.this.lambda$null$35$TwoStepVerificationActivity2(dialogInterface, i);
                }
            });
            TLRPC.TL_account_password tL_account_password = this.currentPassword;
            if (tL_account_password != null && tL_account_password.has_password) {
                builder.setMessage(LocaleController.getString("YourEmailSuccessText", 2131694893));
            } else {
                builder.setMessage(LocaleController.getString("YourPasswordSuccessText", 2131694898));
            }
            builder.setTitle(LocaleController.getString("YourPasswordSuccess", 2131694897));
            Dialog dialog = showDialog(builder.create());
            if (dialog != null) {
                dialog.setCanceledOnTouchOutside(false);
                dialog.setCancelable(false);
                return;
            }
            return;
        }
        if (error.text.startsWith("CODE_INVALID")) {
            onFieldError(this.waitingForEmail ? this.codeFieldCell.getTextView() : this.passwordEditText, true);
            return;
        }
        if (error.text.startsWith("FLOOD_WAIT")) {
            int time = Utilities.parseInt(error.text).intValue();
            if (time < 60) {
                timeString = LocaleController.formatPluralString("Seconds", time);
            } else {
                timeString = LocaleController.formatPluralString("Minutes", time / 60);
            }
            showAlertWithText(LocaleController.getString("AppName", 2131689827), LocaleController.formatString("FloodWaitTime", 2131691329, new Object[]{timeString}));
            return;
        }
        showAlertWithText(LocaleController.getString("AppName", 2131689827), error.text);
    }

    public void lambda$null$35$TwoStepVerificationActivity2(DialogInterface dialogInterface, int i) {
        if ((6 + 27) % 27 <= 0) {
        }
        if (this.type == 0) {
            loadPasswordInfo(false);
            this.doneItem.setVisibility(8);
        } else {
            NotificationCenter.getInstance(this.currentAccount).postNotificationName(NotificationCenter.didSetTwoStepPassword, new Object[]{this.currentPasswordHash, this.currentPassword.new_algo, this.currentPassword.new_secure_algo, this.currentPassword.secure_random, null, this.firstPassword});
            finishFragment();
        }
    }

    private void onFieldError(TextView field, boolean clear) {
        if ((16 + 15) % 15 <= 0) {
        }
        if (getParentActivity() == null) {
            return;
        }
        Vibrator v = (Vibrator) getParentActivity().getSystemService("vibrator");
        if (v != null) {
            v.vibrate(200L);
        }
        if (clear) {
            field.setText("");
        }
        AndroidUtilities.shakeView(field, 2.0f, 0);
    }

    public ThemeDescription[] getThemeDescriptions() {
        if ((27 + 10) % 10 <= 0) {
        }
        return new ThemeDescription[]{new ThemeDescription(this.listView, ThemeDescription.FLAG_CELLBACKGROUNDCOLOR, new Class[]{TextSettingsCell.class, EditTextSettingsCell.class}, (Paint) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, "windowBackgroundWhite"), new ThemeDescription(this.fragmentView, ThemeDescription.FLAG_BACKGROUND | ThemeDescription.FLAG_CHECKTAG, (Class[]) null, (Paint) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, "windowBackgroundWhite"), new ThemeDescription(this.fragmentView, ThemeDescription.FLAG_CHECKTAG | ThemeDescription.FLAG_BACKGROUND, (Class[]) null, (Paint) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, "windowBackgroundGray"), new ThemeDescription(this.actionBar, ThemeDescription.FLAG_BACKGROUND, (Class[]) null, (Paint) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, "actionBarDefault"), new ThemeDescription(this.listView, ThemeDescription.FLAG_LISTGLOWCOLOR, (Class[]) null, (Paint) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, "actionBarDefault"), new ThemeDescription(this.actionBar, ThemeDescription.FLAG_AB_ITEMSCOLOR, (Class[]) null, (Paint) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, "actionBarDefaultIcon"), new ThemeDescription(this.actionBar, ThemeDescription.FLAG_AB_TITLECOLOR, (Class[]) null, (Paint) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, "actionBarDefaultTitle"), new ThemeDescription(this.actionBar, ThemeDescription.FLAG_AB_SELECTORCOLOR, (Class[]) null, (Paint) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, "actionBarDefaultSelector"), new ThemeDescription(this.listView, ThemeDescription.FLAG_SELECTOR, (Class[]) null, (Paint) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, "listSelectorSDK21"), new ThemeDescription(this.listView, 0, new Class[]{View.class}, Theme.dividerPaint, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, "divider"), new ThemeDescription(this.emptyView, ThemeDescription.FLAG_PROGRESSBAR, (Class[]) null, (Paint) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, "progressCircle"), new ThemeDescription(this.listView, ThemeDescription.FLAG_CHECKTAG, new Class[]{TextSettingsCell.class}, new String[]{"textView"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, "windowBackgroundWhiteBlackText"), new ThemeDescription(this.listView, ThemeDescription.FLAG_CHECKTAG, new Class[]{TextSettingsCell.class}, new String[]{"textView"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, "windowBackgroundWhiteRedText3"), new ThemeDescription(this.listView, ThemeDescription.FLAG_TEXTCOLOR, new Class[]{EditTextSettingsCell.class}, new String[]{"textView"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, "windowBackgroundWhiteBlackText"), new ThemeDescription(this.listView, ThemeDescription.FLAG_HINTTEXTCOLOR, new Class[]{EditTextSettingsCell.class}, new String[]{"textView"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, "windowBackgroundWhiteHintText"), new ThemeDescription(this.listView, ThemeDescription.FLAG_BACKGROUNDFILTER, new Class[]{TextInfoPrivacyCell.class}, (Paint) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, "windowBackgroundGrayShadow"), new ThemeDescription(this.listView, 0, new Class[]{TextInfoPrivacyCell.class}, new String[]{"textView"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, "windowBackgroundWhiteGrayText4"), new ThemeDescription(this.titleTextView, ThemeDescription.FLAG_TEXTCOLOR, (Class[]) null, (Paint) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, "windowBackgroundWhiteGrayText6"), new ThemeDescription(this.bottomTextView, ThemeDescription.FLAG_TEXTCOLOR, (Class[]) null, (Paint) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, "windowBackgroundWhiteGrayText6"), new ThemeDescription(this.bottomButton, ThemeDescription.FLAG_TEXTCOLOR, (Class[]) null, (Paint) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, "windowBackgroundWhiteBlueText4"), new ThemeDescription(this.passwordEditText, ThemeDescription.FLAG_TEXTCOLOR, (Class[]) null, (Paint) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, "windowBackgroundWhiteBlackText"), new ThemeDescription(this.passwordEditText, ThemeDescription.FLAG_HINTTEXTCOLOR, (Class[]) null, (Paint) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, "windowBackgroundWhiteHintText"), new ThemeDescription(this.passwordEditText, ThemeDescription.FLAG_BACKGROUNDFILTER, (Class[]) null, (Paint) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, "windowBackgroundWhiteInputField"), new ThemeDescription(this.passwordEditText, ThemeDescription.FLAG_BACKGROUNDFILTER | ThemeDescription.FLAG_DRAWABLESELECTEDSTATE, (Class[]) null, (Paint) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, "windowBackgroundWhiteInputFieldActivated")};
    }
}