package im.guobwnxjuc.ui; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.animation.AnimatorSet; import android.animation.ObjectAnimator; import android.app.Dialog; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.SharedPreferences; import android.content.pm.PackageInfo; import android.graphics.Canvas; import android.graphics.Paint; import android.graphics.PorterDuff; import android.graphics.PorterDuffColorFilter; import android.graphics.Rect; import android.graphics.Typeface; import android.graphics.drawable.Drawable; import android.os.Build; import android.os.Bundle; import android.os.Vibrator; import android.telephony.PhoneNumberUtils; import android.telephony.TelephonyManager; import android.text.Editable; import android.text.InputFilter; import android.text.SpannableStringBuilder; import android.text.TextPaint; import android.text.TextUtils; import android.text.TextWatcher; import android.text.method.PasswordTransformationMethod; import android.text.style.ClickableSpan; import android.util.Base64; import android.util.Property; import android.view.KeyEvent; import android.view.MotionEvent; import android.view.View; import android.view.animation.AccelerateDecelerateInterpolator; import android.widget.AdapterView; import android.widget.FrameLayout; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.ScrollView; import android.widget.TextView; import androidx.appcompat.widget.AppCompatImageView; import androidx.appcompat.widget.AppCompatTextView; import com.bjz.comm.net.utils.AppPreferenceUtil; import com.blankj.utilcode.constant.CacheConstants; import com.blankj.utilcode.constant.TimeConstants; import com.coremedia.iso.boxes.TrackReferenceTypeBox; import com.google.android.exoplayer2.extractor.ts.TsExtractor; import com.king.zxing.util.LogUtils; import im.guobwnxjuc.javaBean.fc.FollowedFcListBean; import im.guobwnxjuc.javaBean.fc.HomeFcListBean; import im.guobwnxjuc.javaBean.fc.RecommendFcListBean; import im.guobwnxjuc.messenger.AndroidUtilities; import im.guobwnxjuc.messenger.ApplicationLoader; import im.guobwnxjuc.messenger.BuildVars; import im.guobwnxjuc.messenger.ContactsController; import im.guobwnxjuc.messenger.FileLog; import im.guobwnxjuc.messenger.ImageLocation; import im.guobwnxjuc.messenger.LocaleController; import im.guobwnxjuc.messenger.MessageObject; import im.guobwnxjuc.messenger.MessagesController; import im.guobwnxjuc.messenger.MessagesStorage; import im.guobwnxjuc.messenger.NotificationCenter; import im.guobwnxjuc.messenger.R; import im.guobwnxjuc.messenger.SRPHelper; import im.guobwnxjuc.messenger.SendMessagesHelper; import im.guobwnxjuc.messenger.UserConfig; import im.guobwnxjuc.messenger.Utilities; import im.guobwnxjuc.phoneformat.PhoneFormat; import im.guobwnxjuc.tgnet.ConnectionsManager; import im.guobwnxjuc.tgnet.RequestDelegate; import im.guobwnxjuc.tgnet.SerializedData; import im.guobwnxjuc.tgnet.TLObject; import im.guobwnxjuc.tgnet.TLRPC; import im.guobwnxjuc.ui.CountrySelectActivity; import im.guobwnxjuc.ui.LoginActivity; import im.guobwnxjuc.ui.actionbar.ActionBar; import im.guobwnxjuc.ui.actionbar.ActionBarMenu; import im.guobwnxjuc.ui.actionbar.ActionBarMenuItem; import im.guobwnxjuc.ui.actionbar.AlertDialog; import im.guobwnxjuc.ui.actionbar.BaseFragment; import im.guobwnxjuc.ui.actionbar.Theme; import im.guobwnxjuc.ui.actionbar.ThemeDescription; import im.guobwnxjuc.ui.cells.CheckBoxCell; import im.guobwnxjuc.ui.components.AlertsCreator; import im.guobwnxjuc.ui.components.AvatarDrawable; import im.guobwnxjuc.ui.components.BackupImageView; import im.guobwnxjuc.ui.components.ContextProgressView; import im.guobwnxjuc.ui.components.EditTextBoldCursor; import im.guobwnxjuc.ui.components.HintEditText; import im.guobwnxjuc.ui.components.ImageUpdater; import im.guobwnxjuc.ui.components.LayoutHelper; import im.guobwnxjuc.ui.components.RadialProgressView; import im.guobwnxjuc.ui.components.SlideView; import im.guobwnxjuc.ui.components.toast.ToastUtils; import im.guobwnxjuc.ui.hui.friendscircle_v1.helper.FcDBHelper; import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.Locale; import java.util.Map; import java.util.Timer; import java.util.TimerTask; import kotlin.text.Typography; import org.slf4j.Marker; @Deprecated public class LoginActivity extends BaseFragment { private static final int done_button = 1; private boolean checkPermissions; private boolean checkShowPermissions; private TLRPC.TL_help_termsOfService currentTermsOfService; private int currentViewNum; private ActionBarMenuItem doneItem; private AnimatorSet doneItemAnimation; private ContextProgressView doneProgressView; private boolean newAccount; private Dialog permissionsDialog; private ArrayList<String> permissionsItems; private Dialog permissionsShowDialog; private ArrayList<String> permissionsShowItems; private int progressRequestId; private int scrollHeight; private boolean syncContacts; private SlideView[] views; /* access modifiers changed from: private */ public class ProgressView extends View { private Paint paint = new Paint(); private Paint paint2 = new Paint(); private float progress; public ProgressView(Context context) { super(context); this.paint.setColor(Theme.getColor(Theme.key_login_progressInner)); this.paint2.setColor(Theme.getColor(Theme.key_login_progressOuter)); } public void setProgress(float f) { this.progress = f; invalidate(); } /* access modifiers changed from: protected */ public void onDraw(Canvas canvas) { float measuredWidth = (float) ((int) (((float) getMeasuredWidth()) * this.progress)); canvas.drawRect(0.0f, 0.0f, measuredWidth, (float) getMeasuredHeight(), this.paint2); canvas.drawRect(measuredWidth, 0.0f, (float) getMeasuredWidth(), (float) getMeasuredHeight(), this.paint); } } public LoginActivity() { this.views = new SlideView[9]; this.permissionsItems = new ArrayList<>(); this.permissionsShowItems = new ArrayList<>(); this.checkPermissions = true; this.checkShowPermissions = true; this.syncContacts = true; } public LoginActivity(int i) { this.views = new SlideView[9]; this.permissionsItems = new ArrayList<>(); this.permissionsShowItems = new ArrayList<>(); this.checkPermissions = true; this.checkShowPermissions = true; this.syncContacts = true; this.currentAccount = i; this.newAccount = true; } @Override // im.guobwnxjuc.ui.actionbar.BaseFragment public void onFragmentDestroy() { super.onFragmentDestroy(); int i = 0; while (true) { SlideView[] slideViewArr = this.views; if (i < slideViewArr.length) { if (slideViewArr[i] != null) { slideViewArr[i].onDestroyActivity(); } i++; } else { return; } } } @Override // im.guobwnxjuc.ui.actionbar.BaseFragment public View createView(Context context) { AppPreferenceUtil.putString("PublishFcBean", ""); FcDBHelper.getInstance().deleteAll(HomeFcListBean.class); FcDBHelper.getInstance().deleteAll(RecommendFcListBean.class); FcDBHelper.getInstance().deleteAll(FollowedFcListBean.class); this.actionBar.setTitle(LocaleController.getString("AppName", R.string.AppName)); this.actionBar.setActionBarMenuOnItemClick(new ActionBar.ActionBarMenuOnItemClick() { /* class im.guobwnxjuc.ui.LoginActivity.AnonymousClass1 */ @Override // im.guobwnxjuc.ui.actionbar.ActionBar.ActionBarMenuOnItemClick public void onItemClick(int i) { if (i == 1) { if (LoginActivity.this.doneProgressView.getTag() == null) { LoginActivity.this.views[LoginActivity.this.currentViewNum].onNextPressed(); } else if (LoginActivity.this.getParentActivity() != null) { AlertDialog.Builder builder = new AlertDialog.Builder(LoginActivity.this.getParentActivity()); builder.setTitle(LocaleController.getString("AppName", R.string.AppName)); builder.setMessage(LocaleController.getString("StopLoading", R.string.StopLoading)); builder.setPositiveButton(LocaleController.getString("WaitMore", R.string.WaitMore), null); builder.setNegativeButton(LocaleController.getString("Stop", R.string.Stop), new DialogInterface.OnClickListener() { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$1$eQdbd3eLUwXcnKFeIGwQtbJM0 */ public final void onClick(DialogInterface dialogInterface, int i) { LoginActivity.AnonymousClass1.this.lambda$onItemClick$0$LoginActivity$1(dialogInterface, i); } }); LoginActivity.this.showDialog(builder.create()); } } else if (i == -1 && LoginActivity.this.onBackPressed()) { LoginActivity.this.finishFragment(); } } public /* synthetic */ void lambda$onItemClick$0$LoginActivity$1(DialogInterface dialogInterface, int i) { LoginActivity.this.views[LoginActivity.this.currentViewNum].onCancelPressed(); LoginActivity.this.needHideProgress(true); } }); ActionBarMenu createMenu = this.actionBar.createMenu(); this.actionBar.setAllowOverlayTitle(true); this.doneItem = createMenu.addItemWithWidth(1, R.drawable.ic_done, AndroidUtilities.dp(56.0f)); ContextProgressView contextProgressView = new ContextProgressView(context, 1); this.doneProgressView = contextProgressView; contextProgressView.setAlpha(0.0f); this.doneProgressView.setScaleX(0.1f); this.doneProgressView.setScaleY(0.1f); this.doneProgressView.setVisibility(4); this.doneItem.addView(this.doneProgressView, LayoutHelper.createFrame(-1, -1.0f)); this.doneItem.setContentDescription(LocaleController.getString("Done", R.string.Done)); AnonymousClass2 r2 = new ScrollView(context) { /* class im.guobwnxjuc.ui.LoginActivity.AnonymousClass2 */ public boolean requestChildRectangleOnScreen(View view, Rect rect, boolean z) { if (LoginActivity.this.currentViewNum == 1 || LoginActivity.this.currentViewNum == 2 || LoginActivity.this.currentViewNum == 4) { rect.bottom += AndroidUtilities.dp(40.0f); } return super.requestChildRectangleOnScreen(view, rect, z); } /* access modifiers changed from: protected */ public void onMeasure(int i, int i2) { LoginActivity.this.scrollHeight = View.MeasureSpec.getSize(i2) - AndroidUtilities.dp(30.0f); super.onMeasure(i, i2); } }; r2.setFillViewport(true); this.fragmentView = r2; FrameLayout frameLayout = new FrameLayout(context); r2.addView(frameLayout, LayoutHelper.createScroll(-1, -2, 51)); this.views[0] = new PhoneView(context); this.views[1] = new LoginActivitySmsView(context, 1); this.views[2] = new LoginActivitySmsView(context, 2); this.views[3] = new LoginActivitySmsView(context, 3); this.views[4] = new LoginActivitySmsView(context, 4); this.views[5] = new LoginActivityRegisterView(context); this.views[6] = new LoginActivityPasswordView(context); this.views[7] = new LoginActivityRecoverView(context); this.views[8] = new LoginActivityResetWaitView(context); int i = 0; while (true) { SlideView[] slideViewArr = this.views; if (i >= slideViewArr.length) { break; } slideViewArr[i].setVisibility(i == 0 ? 0 : 8); SlideView slideView = this.views[i]; float f = 18.0f; float f2 = AndroidUtilities.isTablet() ? 26.0f : 18.0f; if (AndroidUtilities.isTablet()) { f = 26.0f; } frameLayout.addView(slideView, LayoutHelper.createFrame(-1.0f, -1.0f, 51, f2, 30.0f, f, 0.0f)); i++; } Bundle loadCurrentState = loadCurrentState(); if (loadCurrentState != null) { this.currentViewNum = loadCurrentState.getInt("currentViewNum", 0); this.syncContacts = loadCurrentState.getInt("syncContacts", 1) == 1; int i2 = this.currentViewNum; if (i2 >= 1 && i2 <= 4) { int i3 = loadCurrentState.getInt("open"); if (i3 != 0 && Math.abs((System.currentTimeMillis() / 1000) - ((long) i3)) >= 86400) { this.currentViewNum = 0; clearCurrentState(); } } else if (this.currentViewNum == 6) { LoginActivityPasswordView loginActivityPasswordView = (LoginActivityPasswordView) this.views[6]; if (loginActivityPasswordView.passwordType == 0 || loginActivityPasswordView.current_salt1 == null || loginActivityPasswordView.current_salt2 == null) { this.currentViewNum = 0; clearCurrentState(); } } loadCurrentState = null; } int i4 = 0; while (true) { SlideView[] slideViewArr2 = this.views; if (i4 < slideViewArr2.length) { if (loadCurrentState != null) { if (i4 < 1 || i4 > 4) { this.views[i4].restoreStateParams(loadCurrentState); } else if (i4 == this.currentViewNum) { slideViewArr2[i4].restoreStateParams(loadCurrentState); } } if (this.currentViewNum == i4) { this.actionBar.setBackButtonImage((this.views[i4].needBackButton() || this.newAccount) ? R.mipmap.ic_back : 0); this.views[i4].setVisibility(0); this.views[i4].onShow(); if (i4 == 3 || i4 == 8) { this.doneItem.setVisibility(8); } } else { this.views[i4].setVisibility(8); } i4++; } else { this.actionBar.setTitle(this.views[this.currentViewNum].getHeaderName()); return this.fragmentView; } } } @Override // im.guobwnxjuc.ui.actionbar.BaseFragment public void onPause() { super.onPause(); AndroidUtilities.removeAdjustResize(getParentActivity(), this.classGuid); if (this.newAccount) { ConnectionsManager.getInstance(this.currentAccount).setAppPaused(true, false); } } @Override // im.guobwnxjuc.ui.actionbar.BaseFragment public void onResume() { int i; super.onResume(); if (this.newAccount) { ConnectionsManager.getInstance(this.currentAccount).setAppPaused(false, false); } AndroidUtilities.requestAdjustResize(getParentActivity(), this.classGuid); try { if (this.currentViewNum >= 1 && this.currentViewNum <= 4 && (this.views[this.currentViewNum] instanceof LoginActivitySmsView) && (i = ((LoginActivitySmsView) this.views[this.currentViewNum]).openTime) != 0 && Math.abs((System.currentTimeMillis() / 1000) - ((long) i)) >= 86400) { this.views[this.currentViewNum].onBackPressed(true); setPage(0, false, null, true); } } catch (Exception e) { FileLog.e(e); } } @Override // im.guobwnxjuc.ui.actionbar.BaseFragment public void onRequestPermissionsResultFragment(int i, String[] strArr, int[] iArr) { if (i == 6) { this.checkPermissions = false; int i2 = this.currentViewNum; if (i2 == 0) { this.views[i2].onNextPressed(); } } else if (i == 7) { this.checkShowPermissions = false; int i3 = this.currentViewNum; if (i3 == 0) { ((PhoneView) this.views[i3]).fillNumber(); } } } private Bundle loadCurrentState() { if (this.newAccount) { return null; } try { Bundle bundle = new Bundle(); for (Map.Entry<String, ?> entry : ApplicationLoader.applicationContext.getSharedPreferences("logininfo2", 0).getAll().entrySet()) { String key = entry.getKey(); Object value = entry.getValue(); String[] split = key.split("_\\|_"); if (split.length == 1) { if (value instanceof String) { bundle.putString(key, (String) value); } else if (value instanceof Integer) { bundle.putInt(key, ((Integer) value).intValue()); } } else if (split.length == 2) { Bundle bundle2 = bundle.getBundle(split[0]); if (bundle2 == null) { bundle2 = new Bundle(); bundle.putBundle(split[0], bundle2); } if (value instanceof String) { bundle2.putString(split[1], (String) value); } else if (value instanceof Integer) { bundle2.putInt(split[1], ((Integer) value).intValue()); } } } return bundle; } catch (Exception e) { FileLog.e(e); return null; } } private void clearCurrentState() { SharedPreferences.Editor edit = ApplicationLoader.applicationContext.getSharedPreferences("logininfo2", 0).edit(); edit.clear(); edit.commit(); } private void putBundleToEditor(Bundle bundle, SharedPreferences.Editor editor, String str) { for (String str2 : bundle.keySet()) { Object obj = bundle.get(str2); if (obj instanceof String) { if (str != null) { editor.putString(str + "_|_" + str2, (String) obj); } else { editor.putString(str2, (String) obj); } } else if (obj instanceof Integer) { if (str != null) { editor.putInt(str + "_|_" + str2, ((Integer) obj).intValue()); } else { editor.putInt(str2, ((Integer) obj).intValue()); } } else if (obj instanceof Bundle) { putBundleToEditor((Bundle) obj, editor, str2); } } } /* access modifiers changed from: protected */ @Override // im.guobwnxjuc.ui.actionbar.BaseFragment public void onDialogDismiss(Dialog dialog) { if (Build.VERSION.SDK_INT < 23) { return; } if (dialog == this.permissionsDialog && !this.permissionsItems.isEmpty() && getParentActivity() != null) { try { getParentActivity().requestPermissions((String[]) this.permissionsItems.toArray(new String[0]), 6); } catch (Exception unused) { } } else if (dialog == this.permissionsShowDialog && !this.permissionsShowItems.isEmpty() && getParentActivity() != null) { getParentActivity().requestPermissions((String[]) this.permissionsShowItems.toArray(new String[0]), 7); } } @Override // im.guobwnxjuc.ui.actionbar.BaseFragment public boolean onBackPressed() { if (ApplicationLoader.blnShowAuth && !UserConfig.getInstance(UserConfig.selectedAccount).isClientActivated()) { Intent intent = new Intent("app_user_authorize_result"); intent.putExtra("login", "0"); getParentActivity().sendBroadcast(intent); } int i = 0; ApplicationLoader.blnShowAuth = false; int i2 = this.currentViewNum; if (i2 == 0) { while (true) { SlideView[] slideViewArr = this.views; if (i < slideViewArr.length) { if (slideViewArr[i] != null) { slideViewArr[i].onDestroyActivity(); } i++; } else { clearCurrentState(); return true; } } } else { if (i2 == 6) { this.views[i2].onBackPressed(true); setPage(0, true, null, true); } else if (i2 == 7 || i2 == 8) { this.views[this.currentViewNum].onBackPressed(true); setPage(6, true, null, true); } else if (i2 < 1 || i2 > 4) { int i3 = this.currentViewNum; if (i3 == 5) { ((LoginActivityRegisterView) this.views[i3]).wrongNumber.callOnClick(); } } else if (this.views[i2].onBackPressed(false)) { setPage(0, true, null, true); } return false; } } @Override // im.guobwnxjuc.ui.actionbar.BaseFragment public void onActivityResultFragment(int i, int i2, Intent intent) { LoginActivityRegisterView loginActivityRegisterView = (LoginActivityRegisterView) this.views[5]; if (loginActivityRegisterView != null) { loginActivityRegisterView.imageUpdater.onActivityResult(i, i2, intent); } } /* access modifiers changed from: private */ /* access modifiers changed from: public */ private void needShowAlert(String str, String str2) { if (str2 != null && getParentActivity() != null) { AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity()); builder.setTitle(str); builder.setMessage(str2); builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), null); showDialog(builder.create()); } } /* access modifiers changed from: private */ /* access modifiers changed from: public */ private void needShowInvalidAlert(String str, boolean z) { if (getParentActivity() != null) { AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity()); builder.setTitle(LocaleController.getString("AppName", R.string.AppName)); if (z) { builder.setMessage(LocaleController.getString("BannedPhoneNumber", R.string.BannedPhoneNumber)); } else { builder.setMessage(LocaleController.getString("InvalidPhoneNumber", R.string.InvalidPhoneNumber)); } builder.setNeutralButton(LocaleController.getString("BotHelp", R.string.BotHelp), new DialogInterface.OnClickListener(z, str) { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$DITYQFevMBDqbdSeJYJYJIDbxY */ private final /* synthetic */ boolean f$1; private final /* synthetic */ String f$2; { this.f$1 = r2; this.f$2 = r3; } public final void onClick(DialogInterface dialogInterface, int i) { LoginActivity.this.lambda$needShowInvalidAlert$0$LoginActivity(this.f$1, this.f$2, dialogInterface, i); } }); builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), null); showDialog(builder.create()); } } public /* synthetic */ void lambda$needShowInvalidAlert$0$LoginActivity(boolean z, String str, DialogInterface dialogInterface, int i) { try { PackageInfo packageInfo = ApplicationLoader.applicationContext.getPackageManager().getPackageInfo(ApplicationLoader.applicationContext.getPackageName(), 0); String format = String.format(Locale.US, "%s (%d)", packageInfo.versionName, Integer.valueOf(packageInfo.versionCode)); Intent intent = new Intent("android.intent.action.SEND"); intent.setType("message/rfc822"); intent.putExtra("android.intent.extra.EMAIL", new String[]{"login@stel.com"}); if (z) { intent.putExtra("android.intent.extra.SUBJECT", "Banned phone number: " + str); intent.putExtra("android.intent.extra.TEXT", "I'm trying to use my mobile phone number: " + str + "\nBut App says it's banned. Please help.\n\nApp version: " + format + "\nOS version: SDK " + Build.VERSION.SDK_INT + "\nDevice Name: " + Build.MANUFACTURER + Build.MODEL + "\nLocale: " + Locale.getDefault()); } else { intent.putExtra("android.intent.extra.SUBJECT", "Invalid phone number: " + str); intent.putExtra("android.intent.extra.TEXT", "I'm trying to use my mobile phone number: " + str + "\nBut App says it's invalid. Please help.\n\nApp version: " + format + "\nOS version: SDK " + Build.VERSION.SDK_INT + "\nDevice Name: " + Build.MANUFACTURER + Build.MODEL + "\nLocale: " + Locale.getDefault()); } getParentActivity().startActivity(Intent.createChooser(intent, "Send email...")); } catch (Exception unused) { needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.getString("NoMailInstalled", R.string.NoMailInstalled)); } } private void showEditDoneProgress(final boolean z) { AnimatorSet animatorSet = this.doneItemAnimation; if (animatorSet != null) { animatorSet.cancel(); } this.doneItemAnimation = new AnimatorSet(); if (z) { this.doneProgressView.setTag(1); this.doneProgressView.setVisibility(0); this.doneItemAnimation.playTogether(ObjectAnimator.ofFloat(this.doneItem.getContentView(), View.SCALE_X, 0.1f), ObjectAnimator.ofFloat(this.doneItem.getContentView(), View.SCALE_Y, 0.1f), ObjectAnimator.ofFloat(this.doneItem.getContentView(), View.ALPHA, 0.0f), ObjectAnimator.ofFloat(this.doneProgressView, View.SCALE_X, 1.0f), ObjectAnimator.ofFloat(this.doneProgressView, View.SCALE_Y, 1.0f), ObjectAnimator.ofFloat(this.doneProgressView, View.ALPHA, 1.0f)); } else { this.doneProgressView.setTag(null); this.doneItem.getContentView().setVisibility(0); this.doneItemAnimation.playTogether(ObjectAnimator.ofFloat(this.doneProgressView, View.SCALE_X, 0.1f), ObjectAnimator.ofFloat(this.doneProgressView, View.SCALE_Y, 0.1f), ObjectAnimator.ofFloat(this.doneProgressView, View.ALPHA, 0.0f), ObjectAnimator.ofFloat(this.doneItem.getContentView(), View.SCALE_X, 1.0f), ObjectAnimator.ofFloat(this.doneItem.getContentView(), View.SCALE_Y, 1.0f), ObjectAnimator.ofFloat(this.doneItem.getContentView(), View.ALPHA, 1.0f)); } this.doneItemAnimation.addListener(new AnimatorListenerAdapter() { /* class im.guobwnxjuc.ui.LoginActivity.AnonymousClass3 */ public void onAnimationEnd(Animator animator) { if (LoginActivity.this.doneItemAnimation != null && LoginActivity.this.doneItemAnimation.equals(animator)) { if (!z) { LoginActivity.this.doneProgressView.setVisibility(4); } else { LoginActivity.this.doneItem.getContentView().setVisibility(4); } } } public void onAnimationCancel(Animator animator) { if (LoginActivity.this.doneItemAnimation != null && LoginActivity.this.doneItemAnimation.equals(animator)) { LoginActivity.this.doneItemAnimation = null; } } }); this.doneItemAnimation.setDuration(150L); this.doneItemAnimation.start(); } /* access modifiers changed from: private */ /* access modifiers changed from: public */ private void needShowProgress(int i) { this.progressRequestId = i; showEditDoneProgress(true); } public void needHideProgress(boolean z) { if (this.progressRequestId != 0) { if (z) { ConnectionsManager.getInstance(this.currentAccount).cancelRequest(this.progressRequestId, true); } this.progressRequestId = 0; } showEditDoneProgress(false); } public void setPage(int i, boolean z, Bundle bundle, boolean z2) { if (i == 3 || i == 8) { this.doneItem.setVisibility(8); } else { if (i == 0) { this.checkPermissions = true; this.checkShowPermissions = true; } this.doneItem.setVisibility(0); } int i2 = this.currentViewNum; if (i2 == i) { this.views[i2].setParams(bundle, false); return; } int i3 = R.mipmap.ic_back; if (z) { SlideView[] slideViewArr = this.views; final SlideView slideView = slideViewArr[i2]; SlideView slideView2 = slideViewArr[i]; this.currentViewNum = i; ActionBar actionBar = this.actionBar; if (!slideView2.needBackButton() && !this.newAccount) { i3 = 0; } actionBar.setBackButtonImage(i3); slideView2.setParams(bundle, false); this.actionBar.setTitle(slideView2.getHeaderName()); setParentActivityTitle(slideView2.getHeaderName()); slideView2.onShow(); int i4 = AndroidUtilities.displaySize.x; if (z2) { i4 = -i4; } slideView2.setX((float) i4); slideView2.setVisibility(0); AnimatorSet animatorSet = new AnimatorSet(); animatorSet.addListener(new AnimatorListenerAdapter() { /* class im.guobwnxjuc.ui.LoginActivity.AnonymousClass4 */ public void onAnimationEnd(Animator animator) { slideView.setVisibility(8); slideView.setX(0.0f); } }); Animator[] animatorArr = new Animator[2]; Property property = View.TRANSLATION_X; float[] fArr = new float[1]; fArr[0] = (float) (z2 ? AndroidUtilities.displaySize.x : -AndroidUtilities.displaySize.x); animatorArr[0] = ObjectAnimator.ofFloat(slideView, property, fArr); animatorArr[1] = ObjectAnimator.ofFloat(slideView2, View.TRANSLATION_X, 0.0f); animatorSet.playTogether(animatorArr); animatorSet.setDuration(300L); animatorSet.setInterpolator(new AccelerateDecelerateInterpolator()); animatorSet.start(); return; } ActionBar actionBar2 = this.actionBar; if (!this.views[i].needBackButton() && !this.newAccount) { i3 = 0; } actionBar2.setBackButtonImage(i3); this.views[this.currentViewNum].setVisibility(8); this.currentViewNum = i; this.views[i].setParams(bundle, false); this.views[i].setVisibility(0); this.actionBar.setTitle(this.views[i].getHeaderName()); setParentActivityTitle(this.views[i].getHeaderName()); this.views[i].onShow(); } @Override // im.guobwnxjuc.ui.actionbar.BaseFragment public void saveSelfArgs(Bundle bundle) { try { Bundle bundle2 = new Bundle(); bundle2.putInt("currentViewNum", this.currentViewNum); bundle2.putInt("syncContacts", this.syncContacts ? 1 : 0); for (int i = 0; i <= this.currentViewNum; i++) { SlideView slideView = this.views[i]; if (slideView != null) { slideView.saveStateParams(bundle2); } } SharedPreferences.Editor edit = ApplicationLoader.applicationContext.getSharedPreferences("logininfo2", 0).edit(); edit.clear(); putBundleToEditor(bundle2, edit, null); edit.commit(); } catch (Exception e) { FileLog.e(e); } } private void needFinishActivity() { clearCurrentState(); if (getParentActivity() instanceof LaunchActivity) { if (this.newAccount) { this.newAccount = false; ((LaunchActivity) getParentActivity()).switchToAccount(this.currentAccount, true); finishFragment(); return; } presentFragment(new IndexActivity(), true); NotificationCenter.getInstance(this.currentAccount).postNotificationName(NotificationCenter.mainUserInfoChanged, new Object[0]); } else if (getParentActivity() instanceof ExternalActionActivity) { ((ExternalActionActivity) getParentActivity()).onFinishLogin(); } } /* access modifiers changed from: private */ /* access modifiers changed from: public */ private void onAuthSuccess(TLRPC.TL_auth_authorization tL_auth_authorization) { ConnectionsManager.getInstance(this.currentAccount).setUserId(tL_auth_authorization.user.id); UserConfig.getInstance(this.currentAccount).clearConfig(); MessagesController.getInstance(this.currentAccount).cleanup(); UserConfig.getInstance(this.currentAccount).syncContacts = this.syncContacts; UserConfig.getInstance(this.currentAccount).setCurrentUser(tL_auth_authorization.user); UserConfig.getInstance(this.currentAccount).saveConfig(true); MessagesStorage.getInstance(this.currentAccount).cleanup(true); ArrayList<TLRPC.User> arrayList = new ArrayList<>(); arrayList.add(tL_auth_authorization.user); MessagesStorage.getInstance(this.currentAccount).putUsersAndChats(arrayList, null, true, true); MessagesController.getInstance(this.currentAccount).putUser(tL_auth_authorization.user, false); ContactsController.getInstance(this.currentAccount).checkAppAccount(); MessagesController.getInstance(this.currentAccount).checkProxyInfo(true); ConnectionsManager.getInstance(this.currentAccount).updateDcSettings(); AndroidUtilities.runOnUIThread($$Lambda$LoginActivity$F3Zkgqn6UUXNR07bveC1upQf5g.INSTANCE); needFinishActivity(); } /* access modifiers changed from: private */ /* access modifiers changed from: public */ private void fillNextCodeParams(Bundle bundle, TLRPC.TL_auth_sentCode tL_auth_sentCode) { bundle.putString("phoneHash", tL_auth_sentCode.phone_code_hash); if (tL_auth_sentCode.next_type instanceof TLRPC.TL_auth_codeTypeCall) { bundle.putInt("nextType", 4); } else if (tL_auth_sentCode.next_type instanceof TLRPC.TL_auth_codeTypeFlashCall) { bundle.putInt("nextType", 3); } else if (tL_auth_sentCode.next_type instanceof TLRPC.TL_auth_codeTypeSms) { bundle.putInt("nextType", 2); } if (tL_auth_sentCode.type instanceof TLRPC.TL_auth_sentCodeTypeApp) { bundle.putInt("type", 1); bundle.putInt("length", tL_auth_sentCode.type.length); setPage(1, true, bundle, false); return; } if (tL_auth_sentCode.timeout == 0) { tL_auth_sentCode.timeout = 60; } bundle.putInt("timeout", tL_auth_sentCode.timeout * 1000); if (tL_auth_sentCode.type instanceof TLRPC.TL_auth_sentCodeTypeCall) { bundle.putInt("type", 4); bundle.putInt("length", tL_auth_sentCode.type.length); setPage(4, true, bundle, false); } else if (tL_auth_sentCode.type instanceof TLRPC.TL_auth_sentCodeTypeFlashCall) { bundle.putInt("type", 3); bundle.putString("pattern", tL_auth_sentCode.type.pattern); setPage(3, true, bundle, false); } else if (tL_auth_sentCode.type instanceof TLRPC.TL_auth_sentCodeTypeSms) { bundle.putInt("type", 2); bundle.putInt("length", tL_auth_sentCode.type.length); setPage(2, true, bundle, false); } } public class PhoneView extends SlideView implements AdapterView.OnItemSelectedListener { private CheckBoxCell checkBoxCell; private EditTextBoldCursor codeField; private HashMap<String, String> codesMap = new HashMap<>(); private ArrayList<String> countriesArray = new ArrayList<>(); private HashMap<String, String> countriesMap = new HashMap<>(); private TextView countryButton; private int countryState = 0; private boolean ignoreOnPhoneChange = false; private boolean ignoreOnTextChange = false; private boolean ignoreSelection = false; private boolean nextPressed = false; private HintEditText phoneField; private HashMap<String, String> phoneFormatMap = new HashMap<>(); private TextView textView; private TextView textView2; private View view; public void fillNumber() { } @Override // android.widget.AdapterView.OnItemSelectedListener public void onNothingSelected(AdapterView<?> adapterView) { } public PhoneView(Context context) { super(context); setOrientation(1); TextView textView3 = new TextView(context); this.countryButton = textView3; textView3.setTextSize(1, 18.0f); this.countryButton.setPadding(AndroidUtilities.dp(12.0f), AndroidUtilities.dp(10.0f), AndroidUtilities.dp(12.0f), 0); this.countryButton.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteBlackText)); this.countryButton.setMaxLines(1); this.countryButton.setSingleLine(true); this.countryButton.setEllipsize(TextUtils.TruncateAt.END); this.countryButton.setGravity((LocaleController.isRTL ? 5 : 3) | 1); this.countryButton.setBackgroundResource(R.drawable.spinner_states); addView(this.countryButton, LayoutHelper.createLinear(-1, 36, 0.0f, 0.0f, 0.0f, 14.0f)); this.countryButton.setOnClickListener(new View.OnClickListener() { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$PhoneView$tZaSOYAaUJoE_knO30j2cMd21SY */ public final void onClick(View view) { LoginActivity.PhoneView.this.lambda$new$2$LoginActivity$PhoneView(view); } }); View view2 = new View(context); this.view = view2; view2.setPadding(AndroidUtilities.dp(12.0f), 0, AndroidUtilities.dp(12.0f), 0); this.view.setBackgroundColor(Theme.getColor(Theme.key_windowBackgroundWhiteGrayLine)); addView(this.view, LayoutHelper.createLinear(-1, 1, 4.0f, -17.5f, 4.0f, 0.0f)); LinearLayout linearLayout = new LinearLayout(context); linearLayout.setOrientation(0); addView(linearLayout, LayoutHelper.createLinear(-1, -2, 0.0f, 20.0f, 0.0f, 0.0f)); TextView textView4 = new TextView(context); this.textView = textView4; textView4.setText(Marker.ANY_NON_NULL_MARKER); this.textView.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteBlackText)); this.textView.setTextSize(1, 18.0f); linearLayout.addView(this.textView, LayoutHelper.createLinear(-2, -2)); EditTextBoldCursor editTextBoldCursor = new EditTextBoldCursor(context); this.codeField = editTextBoldCursor; editTextBoldCursor.setInputType(3); this.codeField.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteBlackText)); this.codeField.setBackgroundDrawable(Theme.createEditTextDrawable(context, false)); this.codeField.setCursorColor(Theme.getColor(Theme.key_windowBackgroundWhiteBlackText)); this.codeField.setCursorSize(AndroidUtilities.dp(20.0f)); this.codeField.setCursorWidth(1.5f); this.codeField.setPadding(AndroidUtilities.dp(10.0f), 0, 0, 0); this.codeField.setTextSize(1, 18.0f); this.codeField.setMaxLines(1); this.codeField.setGravity(19); this.codeField.setImeOptions(268435461); this.codeField.setFilters(new InputFilter[]{new InputFilter.LengthFilter(5)}); linearLayout.addView(this.codeField, LayoutHelper.createLinear(55, 36, -9.0f, 0.0f, 16.0f, 0.0f)); this.codeField.addTextChangedListener(new TextWatcher(LoginActivity.this) { /* class im.guobwnxjuc.ui.LoginActivity.PhoneView.AnonymousClass1 */ public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) { } public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) { } public void afterTextChanged(Editable editable) { boolean z; String str; if (!PhoneView.this.ignoreOnTextChange) { PhoneView.this.ignoreOnTextChange = true; String stripExceptNumbers = PhoneFormat.stripExceptNumbers(PhoneView.this.codeField.getText().toString()); PhoneView.this.codeField.setText(stripExceptNumbers); String str2 = null; if (stripExceptNumbers.length() == 0) { PhoneView.this.countryButton.setText(LocaleController.getString("ChooseCountry", R.string.ChooseCountry)); PhoneView.this.phoneField.setHintText((String) null); PhoneView.this.countryState = 1; } else { int i = 4; if (stripExceptNumbers.length() > 4) { while (true) { if (i < 1) { str = null; z = false; break; } String substring = stripExceptNumbers.substring(0, i); if (((String) PhoneView.this.codesMap.get(substring)) != null) { String str3 = stripExceptNumbers.substring(i) + PhoneView.this.phoneField.getText().toString(); PhoneView.this.codeField.setText(substring); z = true; str = str3; stripExceptNumbers = substring; break; } i--; } if (!z) { str = stripExceptNumbers.substring(1) + PhoneView.this.phoneField.getText().toString(); EditTextBoldCursor editTextBoldCursor = PhoneView.this.codeField; stripExceptNumbers = stripExceptNumbers.substring(0, 1); editTextBoldCursor.setText(stripExceptNumbers); } } else { str = null; z = false; } String str4 = (String) PhoneView.this.codesMap.get(stripExceptNumbers); if (str4 != null) { int indexOf = PhoneView.this.countriesArray.indexOf(str4); if (indexOf != -1) { PhoneView.this.ignoreSelection = true; PhoneView.this.countryButton.setText((CharSequence) PhoneView.this.countriesArray.get(indexOf)); String str5 = (String) PhoneView.this.phoneFormatMap.get(stripExceptNumbers); HintEditText hintEditText = PhoneView.this.phoneField; if (str5 != null) { str2 = str5.replace('X', Typography.ndash); } hintEditText.setHintText(str2); PhoneView.this.countryState = 0; } else { PhoneView.this.countryButton.setText(LocaleController.getString("WrongCountry", R.string.WrongCountry)); PhoneView.this.phoneField.setHintText((String) null); PhoneView.this.countryState = 2; } } else { PhoneView.this.countryButton.setText(LocaleController.getString("WrongCountry", R.string.WrongCountry)); PhoneView.this.phoneField.setHintText((String) null); PhoneView.this.countryState = 2; } if (!z) { PhoneView.this.codeField.setSelection(PhoneView.this.codeField.getText().length()); } if (str != null) { PhoneView.this.phoneField.requestFocus(); PhoneView.this.phoneField.setText(str); PhoneView.this.phoneField.setSelection(PhoneView.this.phoneField.length()); } } PhoneView.this.ignoreOnTextChange = false; } } }); this.codeField.setOnEditorActionListener(new TextView.OnEditorActionListener() { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$PhoneView$tBS6KePasEJtL7Z6rSrSSah3c */ public final boolean onEditorAction(TextView textView, int i, KeyEvent keyEvent) { return LoginActivity.PhoneView.this.lambda$new$3$LoginActivity$PhoneView(textView, i, keyEvent); } }); AnonymousClass2 r7 = new HintEditText(context, LoginActivity.this) { /* class im.guobwnxjuc.ui.LoginActivity.PhoneView.AnonymousClass2 */ public boolean onTouchEvent(MotionEvent motionEvent) { if (motionEvent.getAction() == 0 && !AndroidUtilities.showKeyboard(this)) { clearFocus(); requestFocus(); } return super.onTouchEvent(motionEvent); } }; this.phoneField = r7; r7.setInputType(3); this.phoneField.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteBlackText)); this.phoneField.setHintTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteHintText)); this.phoneField.setBackgroundDrawable(Theme.createEditTextDrawable(context, false)); this.phoneField.setPadding(0, 0, 0, 0); this.phoneField.setCursorColor(Theme.getColor(Theme.key_windowBackgroundWhiteBlackText)); this.phoneField.setCursorSize(AndroidUtilities.dp(20.0f)); this.phoneField.setCursorWidth(1.5f); this.phoneField.setTextSize(1, 18.0f); this.phoneField.setMaxLines(1); this.phoneField.setGravity(19); this.phoneField.setImeOptions(268435461); linearLayout.addView(this.phoneField, LayoutHelper.createFrame(-1, 36.0f)); this.phoneField.addTextChangedListener(new TextWatcher(LoginActivity.this) { /* class im.guobwnxjuc.ui.LoginActivity.PhoneView.AnonymousClass3 */ private int actionPosition; private int characterAction = -1; public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) { } public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) { if (i2 == 0 && i3 == 1) { this.characterAction = 1; } else if (i2 != 1 || i3 != 0) { this.characterAction = -1; } else if (charSequence.charAt(i) != ' ' || i <= 0) { this.characterAction = 2; } else { this.characterAction = 3; this.actionPosition = i - 1; } } public void afterTextChanged(Editable editable) { int i; int i2; if (!PhoneView.this.ignoreOnPhoneChange) { int selectionStart = PhoneView.this.phoneField.getSelectionStart(); String obj = PhoneView.this.phoneField.getText().toString(); if (this.characterAction == 3) { obj = obj.substring(0, this.actionPosition) + obj.substring(this.actionPosition + 1); selectionStart--; } StringBuilder sb = new StringBuilder(obj.length()); int i3 = 0; while (i3 < obj.length()) { int i4 = i3 + 1; String substring = obj.substring(i3, i4); if ("0123456789".contains(substring)) { sb.append(substring); } i3 = i4; } PhoneView.this.ignoreOnPhoneChange = true; String hintText = PhoneView.this.phoneField.getHintText(); if (hintText != null) { int i5 = 0; while (true) { if (i5 >= sb.length()) { break; } else if (i5 < hintText.length()) { if (hintText.charAt(i5) == ' ') { sb.insert(i5, ' '); i5++; if (!(selectionStart != i5 || (i2 = this.characterAction) == 2 || i2 == 3)) { selectionStart++; } } i5++; } else { sb.insert(i5, ' '); if (selectionStart == i5 + 1 && (i = this.characterAction) != 2 && i != 3) { selectionStart++; } } } } editable.replace(0, editable.length(), sb); if (selectionStart >= 0) { HintEditText hintEditText = PhoneView.this.phoneField; if (selectionStart > PhoneView.this.phoneField.length()) { selectionStart = PhoneView.this.phoneField.length(); } hintEditText.setSelection(selectionStart); } PhoneView.this.phoneField.onTextChange(); PhoneView.this.ignoreOnPhoneChange = false; } } }); this.phoneField.setOnEditorActionListener(new TextView.OnEditorActionListener() { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$PhoneView$VHGcS2zGuhR9FX7LVcuucYVJx8 */ public final boolean onEditorAction(TextView textView, int i, KeyEvent keyEvent) { return LoginActivity.PhoneView.this.lambda$new$4$LoginActivity$PhoneView(textView, i, keyEvent); } }); this.phoneField.setOnKeyListener(new View.OnKeyListener() { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$PhoneView$0CflvotpA8L3yMRJMRMTqaoEJj0 */ public final boolean onKey(View view, int i, KeyEvent keyEvent) { return LoginActivity.PhoneView.this.lambda$new$5$LoginActivity$PhoneView(view, i, keyEvent); } }); TextView textView5 = new TextView(context); this.textView2 = textView5; textView5.setText(LocaleController.getString("StartText", R.string.StartText)); this.textView2.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteGrayText6)); this.textView2.setTextSize(1, 14.0f); this.textView2.setGravity(LocaleController.isRTL ? 5 : 3); this.textView2.setLineSpacing((float) AndroidUtilities.dp(2.0f), 1.0f); addView(this.textView2, LayoutHelper.createLinear(-2, -2, LocaleController.isRTL ? 5 : 3, 0, 28, 0, 10)); if (LoginActivity.this.newAccount) { CheckBoxCell checkBoxCell2 = new CheckBoxCell(context, 2); this.checkBoxCell = checkBoxCell2; checkBoxCell2.setText(LocaleController.getString("SyncContacts", R.string.SyncContacts), "", LoginActivity.this.syncContacts, false); addView(this.checkBoxCell, LayoutHelper.createLinear(-2, -1, 51, 0, 0, 0, 0)); this.checkBoxCell.setOnClickListener(new View.OnClickListener(LoginActivity.this) { /* class im.guobwnxjuc.ui.LoginActivity.PhoneView.AnonymousClass4 */ public void onClick(View view) { if (LoginActivity.this.getParentActivity() != null) { LoginActivity.this.syncContacts = !LoginActivity.this.syncContacts; ((CheckBoxCell) view).setChecked(LoginActivity.this.syncContacts, true); if (LoginActivity.this.syncContacts) { ToastUtils.show((int) R.string.SyncContactsOn); } else { ToastUtils.show((int) R.string.SyncContactsOff); } } } }); } HashMap hashMap = new HashMap(); try { BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(getResources().getAssets().open("countries.txt"))); while (true) { String readLine = bufferedReader.readLine(); if (readLine == null) { break; } String[] split = readLine.split(";"); this.countriesArray.add(0, split[2]); this.countriesMap.put(split[2], split[0]); this.codesMap.put(split[0], split[2]); if (split.length > 3) { this.phoneFormatMap.put(split[0], split[3]); } hashMap.put(split[1], split[2]); } bufferedReader.close(); } catch (Exception e) { FileLog.e(e); } Collections.sort(this.countriesArray, $$Lambda$TEfSBt3hRUlBSSARfPEHsJesTtE.INSTANCE); try { TelephonyManager telephonyManager = (TelephonyManager) ApplicationLoader.applicationContext.getSystemService("phone"); } catch (Exception e2) { FileLog.e(e2); } if (this.codeField.length() == 0) { this.countryButton.setText(LocaleController.getString("ChooseCountry", R.string.ChooseCountry)); this.phoneField.setHintText((String) null); this.countryState = 1; } if (this.codeField.length() != 0) { this.phoneField.requestFocus(); HintEditText hintEditText = this.phoneField; hintEditText.setSelection(hintEditText.length()); return; } this.codeField.requestFocus(); } public /* synthetic */ void lambda$new$2$LoginActivity$PhoneView(View view2) { CountrySelectActivity countrySelectActivity = new CountrySelectActivity(true); countrySelectActivity.setCountrySelectActivityDelegate(new CountrySelectActivity.CountrySelectActivityDelegate() { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$PhoneView$lMJwYUyPhTnAcCylVStKopBY6Ow */ @Override // im.guobwnxjuc.ui.CountrySelectActivity.CountrySelectActivityDelegate public final void didSelectCountry(CountrySelectActivity.Country country) { LoginActivity.PhoneView.this.lambda$null$1$LoginActivity$PhoneView(country); } }); LoginActivity.this.presentFragment(countrySelectActivity); } public /* synthetic */ void lambda$null$1$LoginActivity$PhoneView(CountrySelectActivity.Country country) { selectCountry(null, country); AndroidUtilities.runOnUIThread(new Runnable() { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$PhoneView$qAyUmWTKORJoTMnh_3wTDHtn6mk */ public final void run() { LoginActivity.PhoneView.this.lambda$null$0$LoginActivity$PhoneView(); } }, 300); this.phoneField.requestFocus(); HintEditText hintEditText = this.phoneField; hintEditText.setSelection(hintEditText.length()); } public /* synthetic */ void lambda$null$0$LoginActivity$PhoneView() { AndroidUtilities.showKeyboard(this.phoneField); } public /* synthetic */ boolean lambda$new$3$LoginActivity$PhoneView(TextView textView3, int i, KeyEvent keyEvent) { if (i != 5) { return false; } this.phoneField.requestFocus(); HintEditText hintEditText = this.phoneField; hintEditText.setSelection(hintEditText.length()); return true; } public /* synthetic */ boolean lambda$new$4$LoginActivity$PhoneView(TextView textView3, int i, KeyEvent keyEvent) { if (i != 5) { return false; } onNextPressed(); return true; } public /* synthetic */ boolean lambda$new$5$LoginActivity$PhoneView(View view2, int i, KeyEvent keyEvent) { if (i != 67 || this.phoneField.length() != 0) { return false; } this.codeField.requestFocus(); EditTextBoldCursor editTextBoldCursor = this.codeField; editTextBoldCursor.setSelection(editTextBoldCursor.length()); this.codeField.dispatchKeyEvent(keyEvent); return true; } public void selectCountry(String str, CountrySelectActivity.Country country) { String str2 = null; if (str != null) { if (this.countriesArray.indexOf(str) != -1) { this.ignoreOnTextChange = true; String str3 = this.countriesMap.get(str); this.codeField.setText(str3); this.countryButton.setText(str); String str4 = this.phoneFormatMap.get(str3); HintEditText hintEditText = this.phoneField; if (str4 != null) { str2 = str4.replace('X', Typography.ndash); } hintEditText.setHintText(str2); this.countryState = 0; this.ignoreOnTextChange = false; } } else if (country != null) { this.ignoreOnTextChange = true; EditTextBoldCursor editTextBoldCursor = this.codeField; editTextBoldCursor.setText(country.code + ""); if (country.phoneFormat != null) { HintEditText hintEditText2 = this.phoneField; if (country.phoneFormat != null) { str2 = country.phoneFormat.replace('X', Typography.ndash); } hintEditText2.setHintText(str2); } this.countryState = 0; this.ignoreOnTextChange = false; } } private void setCountry(HashMap<String, String> hashMap, String str) { String str2 = hashMap.get(str); if (str2 != null && this.countriesArray.indexOf(str2) != -1) { this.codeField.setText(this.countriesMap.get(str2)); this.countryState = 0; } } @Override // im.guobwnxjuc.ui.components.SlideView public void onCancelPressed() { this.nextPressed = false; } @Override // android.widget.AdapterView.OnItemSelectedListener public void onItemSelected(AdapterView<?> adapterView, View view2, int i, long j) { if (this.ignoreSelection) { this.ignoreSelection = false; return; } this.ignoreOnTextChange = true; this.codeField.setText(this.countriesMap.get(this.countriesArray.get(i))); this.ignoreOnTextChange = false; } @Override // im.guobwnxjuc.ui.components.SlideView public void onNextPressed() { if (LoginActivity.this.getParentActivity() != null && !this.nextPressed) { int i = this.countryState; if (i == 1) { LoginActivity.this.needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.getString("ChooseCountry", R.string.ChooseCountry)); } else if (i == 2 && !BuildVars.DEBUG_VERSION) { LoginActivity.this.needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.getString("WrongCountry", R.string.WrongCountry)); } else if (this.codeField.length() == 0) { LoginActivity.this.needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.getString("InvalidPhoneNumber", R.string.InvalidPhoneNumber)); } else { StringBuilder sb = new StringBuilder(); sb.append(PhoneFormat.stripExceptNumbers("" + ((Object) this.codeField.getText()))); sb.append(" "); sb.append(PhoneFormat.stripExceptNumbers("" + ((Object) this.phoneField.getText()))); String sb2 = sb.toString(); if (LoginActivity.this.getParentActivity() instanceof LaunchActivity) { for (int i2 = 0; i2 < 3; i2++) { UserConfig instance = UserConfig.getInstance(i2); if (instance.isClientActivated() && PhoneNumberUtils.compare(sb2, instance.getCurrentUser().phone)) { AlertDialog.Builder builder = new AlertDialog.Builder(LoginActivity.this.getParentActivity()); builder.setTitle(LocaleController.getString("AppName", R.string.AppName)); builder.setMessage(LocaleController.getString("AccountAlreadyLoggedIn", R.string.AccountAlreadyLoggedIn)); builder.setPositiveButton(LocaleController.getString("AccountSwitch", R.string.AccountSwitch), new DialogInterface.OnClickListener(i2) { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$PhoneView$twCFCVmguubTdFcOosmSUXbK8ik */ private final /* synthetic */ int f$1; { this.f$1 = r2; } public final void onClick(DialogInterface dialogInterface, int i) { LoginActivity.PhoneView.this.lambda$onNextPressed$6$LoginActivity$PhoneView(this.f$1, dialogInterface, i); } }); builder.setNegativeButton(LocaleController.getString("OK", R.string.OK), null); LoginActivity.this.showDialog(builder.create()); return; } } } ConnectionsManager.getInstance(LoginActivity.this.currentAccount).cleanup(false); TLRPC.TL_auth_sendCode tL_auth_sendCode = new TLRPC.TL_auth_sendCode(); tL_auth_sendCode.api_hash = BuildVars.APP_HASH; tL_auth_sendCode.api_id = BuildVars.APP_ID; tL_auth_sendCode.phone_number = sb2; tL_auth_sendCode.settings = new TLRPC.TL_codeSettings(); tL_auth_sendCode.settings.allow_flashcall = false; tL_auth_sendCode.settings.allow_app_hash = ApplicationLoader.hasPlayServices; SharedPreferences sharedPreferences = ApplicationLoader.applicationContext.getSharedPreferences("mainconfig", 0); if (tL_auth_sendCode.settings.allow_app_hash) { sharedPreferences.edit().putString("sms_hash", BuildVars.SMS_HASH).commit(); } else { sharedPreferences.edit().remove("sms_hash").commit(); } Bundle bundle = new Bundle(); bundle.putString("phone", Marker.ANY_NON_NULL_MARKER + ((Object) this.codeField.getText()) + " " + ((Object) this.phoneField.getText())); try { bundle.putString("ephone", Marker.ANY_NON_NULL_MARKER + PhoneFormat.stripExceptNumbers(this.codeField.getText().toString()) + " " + PhoneFormat.stripExceptNumbers(this.phoneField.getText().toString())); } catch (Exception e) { FileLog.e(e); bundle.putString("ephone", Marker.ANY_NON_NULL_MARKER + sb2); } bundle.putString("phoneFormated", sb2); this.nextPressed = true; LoginActivity.this.needShowProgress(ConnectionsManager.getInstance(LoginActivity.this.currentAccount).sendRequest(tL_auth_sendCode, new RequestDelegate(bundle, tL_auth_sendCode) { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$PhoneView$VpBWsg42Dt7QQgfwIhraxVLF4Y4 */ private final /* synthetic */ Bundle f$1; private final /* synthetic */ TLRPC.TL_auth_sendCode f$2; { this.f$1 = r2; this.f$2 = r3; } @Override // im.guobwnxjuc.tgnet.RequestDelegate public final void run(TLObject tLObject, TLRPC.TL_error tL_error) { LoginActivity.PhoneView.this.lambda$onNextPressed$8$LoginActivity$PhoneView(this.f$1, this.f$2, tLObject, tL_error); } }, 27)); } } } public /* synthetic */ void lambda$onNextPressed$6$LoginActivity$PhoneView(int i, DialogInterface dialogInterface, int i2) { if (UserConfig.selectedAccount != i) { ((LaunchActivity) LoginActivity.this.getParentActivity()).switchToAccount(i, false); } LoginActivity.this.finishFragment(); } public /* synthetic */ void lambda$onNextPressed$8$LoginActivity$PhoneView(Bundle bundle, TLRPC.TL_auth_sendCode tL_auth_sendCode, TLObject tLObject, TLRPC.TL_error tL_error) { AndroidUtilities.runOnUIThread(new Runnable(tL_error, bundle, tLObject, tL_auth_sendCode) { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$PhoneView$UZsga9lfzySnzY3eQhJmdmkqmYI */ private final /* synthetic */ TLRPC.TL_error f$1; private final /* synthetic */ Bundle f$2; private final /* synthetic */ TLObject f$3; private final /* synthetic */ TLRPC.TL_auth_sendCode f$4; { this.f$1 = r2; this.f$2 = r3; this.f$3 = r4; this.f$4 = r5; } public final void run() { LoginActivity.PhoneView.this.lambda$null$7$LoginActivity$PhoneView(this.f$1, this.f$2, this.f$3, this.f$4); } }); } public /* synthetic */ void lambda$null$7$LoginActivity$PhoneView(TLRPC.TL_error tL_error, Bundle bundle, TLObject tLObject, TLRPC.TL_auth_sendCode tL_auth_sendCode) { this.nextPressed = false; if (tL_error == null) { LoginActivity.this.fillNextCodeParams(bundle, (TLRPC.TL_auth_sentCode) tLObject); } else if (tL_error.text != null) { if (tL_error.text.contains("PHONE_NUMBER_INVALID")) { LoginActivity.this.needShowInvalidAlert(tL_auth_sendCode.phone_number, false); } else if (tL_error.text.contains("PHONE_PASSWORD_FLOOD")) { LoginActivity.this.needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.getString("FloodWait", R.string.FloodWait)); } else if (tL_error.text.contains("PHONE_NUMBER_FLOOD")) { LoginActivity.this.needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.getString("PhoneNumberFlood", R.string.PhoneNumberFlood)); } else if (tL_error.text.contains("PHONE_NUMBER_BANNED")) { LoginActivity.this.needShowInvalidAlert(tL_auth_sendCode.phone_number, true); } else if (tL_error.text.contains("PHONE_CODE_EMPTY") || tL_error.text.contains("PHONE_CODE_INVALID")) { LoginActivity.this.needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.getString("InvalidCode", R.string.InvalidCode)); } else if (tL_error.text.contains("PHONE_CODE_EXPIRED")) { LoginActivity.this.needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.getString("CodeExpired", R.string.CodeExpired)); } else if (tL_error.text.startsWith("FLOOD_WAIT")) { LoginActivity.this.needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.getString("FloodWait", R.string.FloodWait)); } else if (tL_error.code != -1000) { LoginActivity.this.needShowAlert(LocaleController.getString("AppName", R.string.AppName), tL_error.text); } } LoginActivity.this.needHideProgress(false); } @Override // im.guobwnxjuc.ui.components.SlideView public void onShow() { super.onShow(); fillNumber(); CheckBoxCell checkBoxCell2 = this.checkBoxCell; if (checkBoxCell2 != null) { checkBoxCell2.setChecked(LoginActivity.this.syncContacts, false); } AndroidUtilities.runOnUIThread(new Runnable() { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$PhoneView$QRnoowKpecngjSAUh76VATWgIVU */ public final void run() { LoginActivity.PhoneView.this.lambda$onShow$9$LoginActivity$PhoneView(); } }, 100); } public /* synthetic */ void lambda$onShow$9$LoginActivity$PhoneView() { if (this.phoneField == null) { return; } if (this.codeField.length() != 0) { this.phoneField.requestFocus(); HintEditText hintEditText = this.phoneField; hintEditText.setSelection(hintEditText.length()); AndroidUtilities.showKeyboard(this.phoneField); return; } this.codeField.requestFocus(); AndroidUtilities.showKeyboard(this.codeField); } @Override // im.guobwnxjuc.ui.components.SlideView public String getHeaderName() { return LocaleController.getString("YourPhone", R.string.YourPhone); } @Override // im.guobwnxjuc.ui.components.SlideView public void saveStateParams(Bundle bundle) { String obj = this.codeField.getText().toString(); if (obj.length() != 0) { bundle.putString("phoneview_code", obj); } String obj2 = this.phoneField.getText().toString(); if (obj2.length() != 0) { bundle.putString("phoneview_phone", obj2); } } @Override // im.guobwnxjuc.ui.components.SlideView public void restoreStateParams(Bundle bundle) { String string = bundle.getString("phoneview_code"); if (string != null) { this.codeField.setText(string); } String string2 = bundle.getString("phoneview_phone"); if (string2 != null) { this.phoneField.setText(string2); } } } public class LoginActivitySmsView extends SlideView implements NotificationCenter.NotificationCenterDelegate { private ImageView blackImageView; private ImageView blueImageView; private String catchedPhone; private EditTextBoldCursor[] codeField; private LinearLayout codeFieldContainer; private int codeTime = 15000; private Timer codeTimer; private TextView confirmTextView; private Bundle currentParams; private int currentType; private String emailPhone; private boolean ignoreOnTextChange; private boolean isRestored; private double lastCodeTime; private double lastCurrentTime; private String lastError = ""; private int length; private boolean nextPressed; private int nextType; private int openTime; private String pattern = "*"; private String phone; private String phoneHash; private AppCompatTextView problemText; private ProgressView progressView; private String requestPhone; private int time = TimeConstants.MIN; private AppCompatTextView timeText; private Timer timeTimer; private int timeout; private final Object timerSync = new Object(); private TextView titleTextView; private boolean waitingForEvent; static /* synthetic */ void lambda$onBackPressed$10(TLObject tLObject, TLRPC.TL_error tL_error) { } @Override // im.guobwnxjuc.ui.components.SlideView public boolean needBackButton() { return true; } public LoginActivitySmsView(Context context, int i) { super(context); this.currentType = i; setOrientation(1); TextView textView = new TextView(context); this.confirmTextView = textView; textView.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteGrayText6)); this.confirmTextView.setTextSize(1, 14.0f); this.confirmTextView.setLineSpacing((float) AndroidUtilities.dp(2.0f), 1.0f); TextView textView2 = new TextView(context); this.titleTextView = textView2; textView2.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteBlackText)); this.titleTextView.setTextSize(1, 18.0f); this.titleTextView.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf")); this.titleTextView.setGravity(LocaleController.isRTL ? 5 : 3); this.titleTextView.setLineSpacing((float) AndroidUtilities.dp(2.0f), 1.0f); this.titleTextView.setGravity(49); if (this.currentType == 3) { this.confirmTextView.setGravity((LocaleController.isRTL ? 5 : 3) | 48); FrameLayout frameLayout = new FrameLayout(context); addView(frameLayout, LayoutHelper.createLinear(-2, -2, LocaleController.isRTL ? 5 : 3)); ImageView imageView = new ImageView(context); imageView.setImageResource(R.drawable.phone_activate); if (LocaleController.isRTL) { frameLayout.addView(imageView, LayoutHelper.createFrame(64.0f, 76.0f, 19, 2.0f, 2.0f, 0.0f, 0.0f)); frameLayout.addView(this.confirmTextView, LayoutHelper.createFrame(-1.0f, -2.0f, LocaleController.isRTL ? 5 : 3, 82.0f, 0.0f, 0.0f, 0.0f)); } else { frameLayout.addView(this.confirmTextView, LayoutHelper.createFrame(-1.0f, -2.0f, LocaleController.isRTL ? 5 : 3, 0.0f, 0.0f, 82.0f, 0.0f)); frameLayout.addView(imageView, LayoutHelper.createFrame(64.0f, 76.0f, 21, 0.0f, 2.0f, 0.0f, 2.0f)); } } else { this.confirmTextView.setGravity(49); FrameLayout frameLayout2 = new FrameLayout(context); addView(frameLayout2, LayoutHelper.createLinear(-2, -2, 49)); if (this.currentType == 1) { ImageView imageView2 = new ImageView(context); this.blackImageView = imageView2; imageView2.setImageResource(R.drawable.sms_devices); this.blackImageView.setColorFilter(new PorterDuffColorFilter(Theme.getColor(Theme.key_windowBackgroundWhiteBlackText), PorterDuff.Mode.MULTIPLY)); frameLayout2.addView(this.blackImageView, LayoutHelper.createFrame(-2.0f, -2.0f, 51, 0.0f, 0.0f, 0.0f, 0.0f)); ImageView imageView3 = new ImageView(context); this.blueImageView = imageView3; imageView3.setImageResource(R.drawable.sms_bubble); this.blueImageView.setColorFilter(new PorterDuffColorFilter(Theme.getColor(Theme.key_chats_actionBackground), PorterDuff.Mode.MULTIPLY)); frameLayout2.addView(this.blueImageView, LayoutHelper.createFrame(-2.0f, -2.0f, 51, 0.0f, 0.0f, 0.0f, 0.0f)); this.titleTextView.setText(LocaleController.getString("SentAppCodeTitle", R.string.SentAppCodeTitle)); } else { ImageView imageView4 = new ImageView(context); this.blueImageView = imageView4; imageView4.setImageResource(R.drawable.sms_code); this.blueImageView.setColorFilter(new PorterDuffColorFilter(Theme.getColor(Theme.key_chats_actionBackground), PorterDuff.Mode.MULTIPLY)); frameLayout2.addView(this.blueImageView, LayoutHelper.createFrame(-2.0f, -2.0f, 51, 0.0f, 0.0f, 0.0f, 0.0f)); this.titleTextView.setText(LocaleController.getString("SentSmsCodeTitle", R.string.SentSmsCodeTitle)); } addView(this.titleTextView, LayoutHelper.createLinear(-2, -2, 49, 0, 18, 0, 0)); addView(this.confirmTextView, LayoutHelper.createLinear(-2, -2, 49, 0, 17, 0, 0)); } LinearLayout linearLayout = new LinearLayout(context); this.codeFieldContainer = linearLayout; linearLayout.setOrientation(0); addView(this.codeFieldContainer, LayoutHelper.createLinear(-2, 36, 1)); if (this.currentType == 3) { this.codeFieldContainer.setVisibility(8); } AnonymousClass1 r4 = new AppCompatTextView(context, LoginActivity.this) { /* class im.guobwnxjuc.ui.LoginActivity.LoginActivitySmsView.AnonymousClass1 */ /* access modifiers changed from: protected */ @Override // androidx.appcompat.widget.AppCompatTextView public void onMeasure(int i, int i2) { super.onMeasure(i, View.MeasureSpec.makeMeasureSpec(AndroidUtilities.dp(100.0f), Integer.MIN_VALUE)); } }; this.timeText = r4; r4.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteGrayText6)); this.timeText.setLineSpacing((float) AndroidUtilities.dp(2.0f), 1.0f); if (this.currentType == 3) { this.timeText.setTextSize(1, 14.0f); addView(this.timeText, LayoutHelper.createLinear(-2, -2, LocaleController.isRTL ? 5 : 3)); this.progressView = new ProgressView(context); this.timeText.setGravity(LocaleController.isRTL ? 5 : 3); addView(this.progressView, LayoutHelper.createLinear(-1, 3, 0.0f, 12.0f, 0.0f, 0.0f)); } else { this.timeText.setPadding(0, AndroidUtilities.dp(2.0f), 0, AndroidUtilities.dp(10.0f)); this.timeText.setTextSize(1, 15.0f); this.timeText.setGravity(49); addView(this.timeText, LayoutHelper.createLinear(-2, -2, 49)); } AnonymousClass2 r42 = new AppCompatTextView(context, LoginActivity.this) { /* class im.guobwnxjuc.ui.LoginActivity.LoginActivitySmsView.AnonymousClass2 */ /* access modifiers changed from: protected */ @Override // androidx.appcompat.widget.AppCompatTextView public void onMeasure(int i, int i2) { super.onMeasure(i, View.MeasureSpec.makeMeasureSpec(AndroidUtilities.dp(100.0f), Integer.MIN_VALUE)); } }; this.problemText = r42; r42.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteBlueText4)); this.problemText.setLineSpacing((float) AndroidUtilities.dp(2.0f), 1.0f); this.problemText.setPadding(0, AndroidUtilities.dp(2.0f), 0, AndroidUtilities.dp(10.0f)); this.problemText.setTextSize(1, 15.0f); this.problemText.setGravity(49); if (this.currentType == 1) { this.problemText.setText(LocaleController.getString("DidNotGetTheCodeSms", R.string.DidNotGetTheCodeSms)); } else { this.problemText.setText(LocaleController.getString("DidNotGetTheCode", R.string.DidNotGetTheCode)); } addView(this.problemText, LayoutHelper.createLinear(-2, -2, 49)); this.problemText.setOnClickListener(new View.OnClickListener() { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$LoginActivitySmsView$rLrX5k00wX4EeUIo23384jasBGE */ public final void onClick(View view) { LoginActivity.LoginActivitySmsView.this.lambda$new$0$LoginActivity$LoginActivitySmsView(view); } }); } public /* synthetic */ void lambda$new$0$LoginActivity$LoginActivitySmsView(View view) { if (!this.nextPressed) { if ((this.nextType == 4 && this.currentType == 2) || this.nextType == 0) { try { PackageInfo packageInfo = ApplicationLoader.applicationContext.getPackageManager().getPackageInfo(ApplicationLoader.applicationContext.getPackageName(), 0); String format = String.format(Locale.US, "%s (%d)", packageInfo.versionName, Integer.valueOf(packageInfo.versionCode)); Intent intent = new Intent("android.intent.action.SEND"); intent.setType("message/rfc822"); intent.putExtra("android.intent.extra.EMAIL", new String[]{"sms@stel.com"}); intent.putExtra("android.intent.extra.SUBJECT", "Android registration/login issue " + format + " " + this.emailPhone); intent.putExtra("android.intent.extra.TEXT", "Phone: " + this.requestPhone + "\nApp version: " + format + "\nOS version: SDK " + Build.VERSION.SDK_INT + "\nDevice Name: " + Build.MANUFACTURER + Build.MODEL + "\nLocale: " + Locale.getDefault() + "\nError: " + this.lastError); getContext().startActivity(Intent.createChooser(intent, "Send email...")); } catch (Exception unused) { LoginActivity.this.needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.getString("NoMailInstalled", R.string.NoMailInstalled)); } } else if (LoginActivity.this.doneProgressView.getTag() == null) { resendCode(); } } } /* access modifiers changed from: protected */ public void onMeasure(int i, int i2) { ImageView imageView; super.onMeasure(i, i2); if (this.currentType != 3 && (imageView = this.blueImageView) != null) { int measuredHeight = imageView.getMeasuredHeight() + this.titleTextView.getMeasuredHeight() + this.confirmTextView.getMeasuredHeight() + AndroidUtilities.dp(35.0f); int dp = AndroidUtilities.dp(80.0f); int dp2 = AndroidUtilities.dp(291.0f); if (LoginActivity.this.scrollHeight - measuredHeight < dp) { setMeasuredDimension(getMeasuredWidth(), measuredHeight + dp); } else if (LoginActivity.this.scrollHeight > dp2) { setMeasuredDimension(getMeasuredWidth(), dp2); } else { setMeasuredDimension(getMeasuredWidth(), LoginActivity.this.scrollHeight); } } } /* access modifiers changed from: protected */ public void onLayout(boolean z, int i, int i2, int i3, int i4) { int i5; super.onLayout(z, i, i2, i3, i4); if (this.currentType != 3 && this.blueImageView != null) { int bottom = this.confirmTextView.getBottom(); int measuredHeight = getMeasuredHeight() - bottom; if (this.problemText.getVisibility() == 0) { int measuredHeight2 = this.problemText.getMeasuredHeight(); i5 = (measuredHeight + bottom) - measuredHeight2; AppCompatTextView appCompatTextView = this.problemText; appCompatTextView.layout(appCompatTextView.getLeft(), i5, this.problemText.getRight(), measuredHeight2 + i5); } else if (this.timeText.getVisibility() == 0) { int measuredHeight3 = this.timeText.getMeasuredHeight(); i5 = (measuredHeight + bottom) - measuredHeight3; AppCompatTextView appCompatTextView2 = this.timeText; appCompatTextView2.layout(appCompatTextView2.getLeft(), i5, this.timeText.getRight(), measuredHeight3 + i5); } else { i5 = measuredHeight + bottom; } int measuredHeight4 = this.codeFieldContainer.getMeasuredHeight(); int i6 = (((i5 - bottom) - measuredHeight4) / 2) + bottom; LinearLayout linearLayout = this.codeFieldContainer; linearLayout.layout(linearLayout.getLeft(), i6, this.codeFieldContainer.getRight(), measuredHeight4 + i6); } } @Override // im.guobwnxjuc.ui.components.SlideView public void onCancelPressed() { this.nextPressed = false; } /* access modifiers changed from: private */ /* access modifiers changed from: public */ private void resendCode() { Bundle bundle = new Bundle(); bundle.putString("phone", this.phone); bundle.putString("ephone", this.emailPhone); bundle.putString("phoneFormated", this.requestPhone); this.nextPressed = true; TLRPC.TL_auth_resendCode tL_auth_resendCode = new TLRPC.TL_auth_resendCode(); tL_auth_resendCode.phone_number = this.requestPhone; tL_auth_resendCode.phone_code_hash = this.phoneHash; ConnectionsManager.getInstance(LoginActivity.this.currentAccount).sendRequest(tL_auth_resendCode, new RequestDelegate(bundle) { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$LoginActivitySmsView$6Ay42lqMMP4uJpJ4YqZFAGxwYHw */ private final /* synthetic */ Bundle f$1; { this.f$1 = r2; } @Override // im.guobwnxjuc.tgnet.RequestDelegate public final void run(TLObject tLObject, TLRPC.TL_error tL_error) { LoginActivity.LoginActivitySmsView.this.lambda$resendCode$2$LoginActivity$LoginActivitySmsView(this.f$1, tLObject, tL_error); } }, 10); LoginActivity.this.needShowProgress(0); } public /* synthetic */ void lambda$resendCode$2$LoginActivity$LoginActivitySmsView(Bundle bundle, TLObject tLObject, TLRPC.TL_error tL_error) { AndroidUtilities.runOnUIThread(new Runnable(tL_error, bundle, tLObject) { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$LoginActivitySmsView$n_zzvqxFZuiazfYTczFvlb_A1A */ private final /* synthetic */ TLRPC.TL_error f$1; private final /* synthetic */ Bundle f$2; private final /* synthetic */ TLObject f$3; { this.f$1 = r2; this.f$2 = r3; this.f$3 = r4; } public final void run() { LoginActivity.LoginActivitySmsView.this.lambda$null$1$LoginActivity$LoginActivitySmsView(this.f$1, this.f$2, this.f$3); } }); } public /* synthetic */ void lambda$null$1$LoginActivity$LoginActivitySmsView(TLRPC.TL_error tL_error, Bundle bundle, TLObject tLObject) { this.nextPressed = false; if (tL_error == null) { LoginActivity.this.fillNextCodeParams(bundle, (TLRPC.TL_auth_sentCode) tLObject); } else if (tL_error.text != null) { if (tL_error.text.contains("PHONE_NUMBER_INVALID")) { LoginActivity.this.needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.getString("InvalidPhoneNumber", R.string.InvalidPhoneNumber)); } else if (tL_error.text.contains("PHONE_CODE_EMPTY") || tL_error.text.contains("PHONE_CODE_INVALID")) { LoginActivity.this.needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.getString("InvalidCode", R.string.InvalidCode)); } else if (tL_error.text.contains("PHONE_CODE_EXPIRED")) { onBackPressed(true); LoginActivity.this.setPage(0, true, null, true); LoginActivity.this.needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.getString("CodeExpired", R.string.CodeExpired)); } else if (tL_error.text.startsWith("FLOOD_WAIT")) { LoginActivity.this.needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.getString("FloodWait", R.string.FloodWait)); } else if (tL_error.code != -1000) { LoginActivity loginActivity = LoginActivity.this; String string = LocaleController.getString("AppName", R.string.AppName); loginActivity.needShowAlert(string, LocaleController.getString("ErrorOccurred", R.string.ErrorOccurred) + "\n" + tL_error.text); } } LoginActivity.this.needHideProgress(false); } @Override // im.guobwnxjuc.ui.components.SlideView public String getHeaderName() { if (this.currentType == 1) { return this.phone; } return LocaleController.getString("YourCode", R.string.YourCode); } @Override // im.guobwnxjuc.ui.components.SlideView public void setParams(Bundle bundle, boolean z) { int i; String string; int i2; if (bundle != null) { this.isRestored = z; this.waitingForEvent = true; int i3 = this.currentType; if (i3 == 2) { AndroidUtilities.setWaitingForSms(true); NotificationCenter.getGlobalInstance().addObserver(this, NotificationCenter.didReceiveSmsCode); } else if (i3 == 3) { AndroidUtilities.setWaitingForCall(true); NotificationCenter.getGlobalInstance().addObserver(this, NotificationCenter.didReceiveCall); } this.currentParams = bundle; this.phone = bundle.getString("phone"); this.emailPhone = bundle.getString("ephone"); this.requestPhone = bundle.getString("phoneFormated"); this.phoneHash = bundle.getString("phoneHash"); int i4 = bundle.getInt("timeout"); this.time = i4; this.timeout = i4; this.openTime = (int) (System.currentTimeMillis() / 1000); this.nextType = bundle.getInt("nextType"); this.pattern = bundle.getString("pattern"); int i5 = bundle.getInt("length"); this.length = i5; if (i5 == 0) { this.length = 5; } EditTextBoldCursor[] editTextBoldCursorArr = this.codeField; CharSequence charSequence = ""; int i6 = 8; if (editTextBoldCursorArr != null && editTextBoldCursorArr.length == this.length) { int i7 = 0; while (true) { EditTextBoldCursor[] editTextBoldCursorArr2 = this.codeField; if (i7 >= editTextBoldCursorArr2.length) { break; } editTextBoldCursorArr2[i7].setText(charSequence); i7++; } } else { this.codeField = new EditTextBoldCursor[this.length]; final int i8 = 0; while (i8 < this.length) { this.codeField[i8] = new EditTextBoldCursor(getContext()); this.codeField[i8].setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteBlackText)); this.codeField[i8].setCursorColor(Theme.getColor(Theme.key_windowBackgroundWhiteBlackText)); this.codeField[i8].setCursorSize(AndroidUtilities.dp(20.0f)); this.codeField[i8].setCursorWidth(1.5f); Drawable mutate = getResources().getDrawable(R.drawable.search_dark_activated).mutate(); mutate.setColorFilter(new PorterDuffColorFilter(Theme.getColor(Theme.key_windowBackgroundWhiteInputFieldActivated), PorterDuff.Mode.MULTIPLY)); this.codeField[i8].setBackgroundDrawable(mutate); this.codeField[i8].setImeOptions(268435461); this.codeField[i8].setTextSize(1, 20.0f); this.codeField[i8].setMaxLines(1); this.codeField[i8].setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf")); this.codeField[i8].setPadding(0, 0, 0, 0); this.codeField[i8].setGravity(49); if (this.currentType == 3) { this.codeField[i8].setEnabled(false); this.codeField[i8].setInputType(0); this.codeField[i8].setVisibility(8); } else { this.codeField[i8].setInputType(3); } this.codeFieldContainer.addView(this.codeField[i8], LayoutHelper.createLinear(34, 36, 1, 0, 0, i8 != this.length - 1 ? 7 : 0, 0)); this.codeField[i8].addTextChangedListener(new TextWatcher() { /* class im.guobwnxjuc.ui.LoginActivity.LoginActivitySmsView.AnonymousClass3 */ public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) { } public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) { } public void afterTextChanged(Editable editable) { int length; if (!LoginActivitySmsView.this.ignoreOnTextChange && (length = editable.length()) >= 1) { if (length > 1) { String obj = editable.toString(); LoginActivitySmsView.this.ignoreOnTextChange = true; for (int i = 0; i < Math.min(LoginActivitySmsView.this.length - i8, length); i++) { if (i == 0) { editable.replace(0, length, obj.substring(i, i + 1)); } else { LoginActivitySmsView.this.codeField[i8 + i].setText(obj.substring(i, i + 1)); } } LoginActivitySmsView.this.ignoreOnTextChange = false; } if (i8 != LoginActivitySmsView.this.length - 1) { LoginActivitySmsView.this.codeField[i8 + 1].setSelection(LoginActivitySmsView.this.codeField[i8 + 1].length()); LoginActivitySmsView.this.codeField[i8 + 1].requestFocus(); } if ((i8 == LoginActivitySmsView.this.length - 1 || (i8 == LoginActivitySmsView.this.length - 2 && length >= 2)) && LoginActivitySmsView.this.getCode().length() == LoginActivitySmsView.this.length) { LoginActivitySmsView.this.onNextPressed(); } } } }); this.codeField[i8].setOnKeyListener(new View.OnKeyListener(i8) { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$LoginActivitySmsView$kh8neAsSmAf0m3AwIBHW7FVn6k */ private final /* synthetic */ int f$1; { this.f$1 = r2; } public final boolean onKey(View view, int i, KeyEvent keyEvent) { return LoginActivity.LoginActivitySmsView.this.lambda$setParams$3$LoginActivity$LoginActivitySmsView(this.f$1, view, i, keyEvent); } }); this.codeField[i8].setOnEditorActionListener(new TextView.OnEditorActionListener() { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$LoginActivitySmsView$n4lKkpRMsVgxU_3hoNnkj9XPsvI */ public final boolean onEditorAction(TextView textView, int i, KeyEvent keyEvent) { return LoginActivity.LoginActivitySmsView.this.lambda$setParams$4$LoginActivity$LoginActivitySmsView(textView, i, keyEvent); } }); i8++; } } ProgressView progressView2 = this.progressView; if (progressView2 != null) { progressView2.setVisibility(this.nextType != 0 ? 0 : 8); } if (this.phone != null) { String format = PhoneFormat.getInstance().format(this.phone); int i9 = this.currentType; if (i9 == 1) { charSequence = AndroidUtilities.replaceTags(LocaleController.getString("SentAppCode", R.string.SentAppCode)); } else if (i9 == 2) { charSequence = AndroidUtilities.replaceTags(LocaleController.formatString("SentSmsCode", R.string.SentSmsCode, LocaleController.addNbsp(format))); } else if (i9 == 3) { charSequence = AndroidUtilities.replaceTags(LocaleController.formatString("SentCallCode", R.string.SentCallCode, LocaleController.addNbsp(format))); } else if (i9 == 4) { charSequence = AndroidUtilities.replaceTags(LocaleController.formatString("SentCallOnly", R.string.SentCallOnly, LocaleController.addNbsp(format))); } this.confirmTextView.setText(charSequence); if (this.currentType != 3) { AndroidUtilities.showKeyboard(this.codeField[0]); this.codeField[0].requestFocus(); } else { AndroidUtilities.hideKeyboard(this.codeField[0]); } destroyTimer(); destroyCodeTimer(); this.lastCurrentTime = (double) System.currentTimeMillis(); int i10 = this.currentType; if (i10 == 1) { this.problemText.setVisibility(0); this.timeText.setVisibility(8); return; } String str = null; if (i10 == 3 && ((i2 = this.nextType) == 4 || i2 == 2)) { this.problemText.setVisibility(8); this.timeText.setVisibility(0); int i11 = this.nextType; if (i11 == 4) { this.timeText.setText(LocaleController.formatString("CallText", R.string.CallText, 1, 0)); } else if (i11 == 2) { this.timeText.setText(LocaleController.formatString("SmsText", R.string.SmsText, 1, 0)); } if (this.isRestored) { str = AndroidUtilities.obtainLoginPhoneCall(this.pattern); } if (str != null) { this.ignoreOnTextChange = true; this.codeField[0].setText(str); this.ignoreOnTextChange = false; onNextPressed(); return; } String str2 = this.catchedPhone; if (str2 != null) { this.ignoreOnTextChange = true; this.codeField[0].setText(str2); this.ignoreOnTextChange = false; onNextPressed(); return; } createTimer(); } else if (this.currentType == 2 && ((i = this.nextType) == 4 || i == 3)) { this.timeText.setText(LocaleController.formatString("CallText", R.string.CallText, 2, 0)); this.problemText.setVisibility(this.time < 1000 ? 0 : 8); AppCompatTextView appCompatTextView = this.timeText; if (this.time >= 1000) { i6 = 0; } appCompatTextView.setVisibility(i6); SharedPreferences sharedPreferences = ApplicationLoader.applicationContext.getSharedPreferences("mainconfig", 0); String string2 = sharedPreferences.getString("sms_hash", null); if (!TextUtils.isEmpty(string2) && (string = sharedPreferences.getString("sms_hash_code", null)) != null) { if (string.contains(string2 + LogUtils.VERTICAL)) { str = string.substring(string.indexOf(124) + 1); } } if (str != null) { this.codeField[0].setText(str); onNextPressed(); return; } createTimer(); } else if (this.currentType == 4 && this.nextType == 2) { this.timeText.setText(LocaleController.formatString("SmsText", R.string.SmsText, 2, 0)); this.problemText.setVisibility(this.time < 1000 ? 0 : 8); AppCompatTextView appCompatTextView2 = this.timeText; if (this.time >= 1000) { i6 = 0; } appCompatTextView2.setVisibility(i6); createTimer(); } else { this.timeText.setVisibility(8); this.problemText.setVisibility(8); createCodeTimer(); } } } } public /* synthetic */ boolean lambda$setParams$3$LoginActivity$LoginActivitySmsView(int i, View view, int i2, KeyEvent keyEvent) { if (i2 != 67 || this.codeField[i].length() != 0 || i <= 0) { return false; } EditTextBoldCursor[] editTextBoldCursorArr = this.codeField; int i3 = i - 1; editTextBoldCursorArr[i3].setSelection(editTextBoldCursorArr[i3].length()); this.codeField[i3].requestFocus(); this.codeField[i3].dispatchKeyEvent(keyEvent); return true; } public /* synthetic */ boolean lambda$setParams$4$LoginActivity$LoginActivitySmsView(TextView textView, int i, KeyEvent keyEvent) { if (i != 5) { return false; } onNextPressed(); return true; } /* access modifiers changed from: private */ /* access modifiers changed from: public */ private void createCodeTimer() { if (this.codeTimer == null) { this.codeTime = 15000; this.codeTimer = new Timer(); this.lastCodeTime = (double) System.currentTimeMillis(); this.codeTimer.schedule(new TimerTask() { /* class im.guobwnxjuc.ui.LoginActivity.LoginActivitySmsView.AnonymousClass4 */ public void run() { AndroidUtilities.runOnUIThread(new Runnable() { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$LoginActivitySmsView$4$KZgK4aqRRxNTirueCvIFLC88xTk */ public final void run() { LoginActivity.LoginActivitySmsView.AnonymousClass4.this.lambda$run$0$LoginActivity$LoginActivitySmsView$4(); } }); } public /* synthetic */ void lambda$run$0$LoginActivity$LoginActivitySmsView$4() { double currentTimeMillis = (double) System.currentTimeMillis(); double d = LoginActivitySmsView.this.lastCodeTime; Double.isNaN(currentTimeMillis); double d2 = currentTimeMillis - d; LoginActivitySmsView.this.lastCodeTime = currentTimeMillis; LoginActivitySmsView loginActivitySmsView = LoginActivitySmsView.this; double d3 = (double) loginActivitySmsView.codeTime; Double.isNaN(d3); loginActivitySmsView.codeTime = (int) (d3 - d2); if (LoginActivitySmsView.this.codeTime <= 1000) { LoginActivitySmsView.this.problemText.setVisibility(0); LoginActivitySmsView.this.timeText.setVisibility(8); LoginActivitySmsView.this.destroyCodeTimer(); } } }, 0, 1000); } } /* access modifiers changed from: private */ /* access modifiers changed from: public */ private void destroyCodeTimer() { try { synchronized (this.timerSync) { if (this.codeTimer != null) { this.codeTimer.cancel(); this.codeTimer = null; } } } catch (Exception e) { FileLog.e(e); } } private void createTimer() { if (this.timeTimer == null) { Timer timer = new Timer(); this.timeTimer = timer; timer.schedule(new TimerTask() { /* class im.guobwnxjuc.ui.LoginActivity.LoginActivitySmsView.AnonymousClass5 */ public void run() { if (LoginActivitySmsView.this.timeTimer != null) { AndroidUtilities.runOnUIThread(new Runnable() { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$LoginActivitySmsView$5$EsKVw1wlFtuG1mW2D29H_XgCdlI */ public final void run() { LoginActivity.LoginActivitySmsView.AnonymousClass5.this.lambda$run$2$LoginActivity$LoginActivitySmsView$5(); } }); } } public /* synthetic */ void lambda$run$2$LoginActivity$LoginActivitySmsView$5() { double currentTimeMillis = (double) System.currentTimeMillis(); double d = LoginActivitySmsView.this.lastCurrentTime; Double.isNaN(currentTimeMillis); double d2 = currentTimeMillis - d; LoginActivitySmsView.this.lastCurrentTime = currentTimeMillis; LoginActivitySmsView loginActivitySmsView = LoginActivitySmsView.this; double d3 = (double) loginActivitySmsView.time; Double.isNaN(d3); loginActivitySmsView.time = (int) (d3 - d2); if (LoginActivitySmsView.this.time >= 1000) { int i = (LoginActivitySmsView.this.time / 1000) / 60; int i2 = (LoginActivitySmsView.this.time / 1000) - (i * 60); if (LoginActivitySmsView.this.nextType == 4 || LoginActivitySmsView.this.nextType == 3) { LoginActivitySmsView.this.timeText.setText(LocaleController.formatString("CallText", R.string.CallText, Integer.valueOf(i), Integer.valueOf(i2))); } else if (LoginActivitySmsView.this.nextType == 2) { LoginActivitySmsView.this.timeText.setText(LocaleController.formatString("SmsText", R.string.SmsText, Integer.valueOf(i), Integer.valueOf(i2))); } if (LoginActivitySmsView.this.progressView != null) { LoginActivitySmsView.this.progressView.setProgress(1.0f - (((float) LoginActivitySmsView.this.time) / ((float) LoginActivitySmsView.this.timeout))); return; } return; } if (LoginActivitySmsView.this.progressView != null) { LoginActivitySmsView.this.progressView.setProgress(1.0f); } LoginActivitySmsView.this.destroyTimer(); if (LoginActivitySmsView.this.currentType == 3) { AndroidUtilities.setWaitingForCall(false); NotificationCenter.getGlobalInstance().removeObserver(this, NotificationCenter.didReceiveCall); LoginActivitySmsView.this.waitingForEvent = false; LoginActivitySmsView.this.destroyCodeTimer(); LoginActivitySmsView.this.resendCode(); } else if (LoginActivitySmsView.this.currentType != 2 && LoginActivitySmsView.this.currentType != 4) { } else { if (LoginActivitySmsView.this.nextType == 4 || LoginActivitySmsView.this.nextType == 2) { if (LoginActivitySmsView.this.nextType == 4) { LoginActivitySmsView.this.timeText.setText(LocaleController.getString("Calling", R.string.Calling)); } else { LoginActivitySmsView.this.timeText.setText(LocaleController.getString("SendingSms", R.string.SendingSms)); } LoginActivitySmsView.this.createCodeTimer(); TLRPC.TL_auth_resendCode tL_auth_resendCode = new TLRPC.TL_auth_resendCode(); tL_auth_resendCode.phone_number = LoginActivitySmsView.this.requestPhone; tL_auth_resendCode.phone_code_hash = LoginActivitySmsView.this.phoneHash; ConnectionsManager.getInstance(LoginActivity.this.currentAccount).sendRequest(tL_auth_resendCode, new RequestDelegate() { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$LoginActivitySmsView$5$W4ecXA2HowhcHX9vwOkVuLIupY */ @Override // im.guobwnxjuc.tgnet.RequestDelegate public final void run(TLObject tLObject, TLRPC.TL_error tL_error) { LoginActivity.LoginActivitySmsView.AnonymousClass5.this.lambda$null$1$LoginActivity$LoginActivitySmsView$5(tLObject, tL_error); } }, 10); } else if (LoginActivitySmsView.this.nextType == 3) { AndroidUtilities.setWaitingForSms(false); NotificationCenter.getGlobalInstance().removeObserver(this, NotificationCenter.didReceiveSmsCode); LoginActivitySmsView.this.waitingForEvent = false; LoginActivitySmsView.this.destroyCodeTimer(); LoginActivitySmsView.this.resendCode(); } } } public /* synthetic */ void lambda$null$1$LoginActivity$LoginActivitySmsView$5(TLObject tLObject, TLRPC.TL_error tL_error) { if (tL_error != null && tL_error.text != null) { AndroidUtilities.runOnUIThread(new Runnable(tL_error) { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$LoginActivitySmsView$5$epymZcqPWpqzBMk_r0OlRa2BjCM */ private final /* synthetic */ TLRPC.TL_error f$1; { this.f$1 = r2; } public final void run() { LoginActivity.LoginActivitySmsView.AnonymousClass5.this.lambda$null$0$LoginActivity$LoginActivitySmsView$5(this.f$1); } }); } } public /* synthetic */ void lambda$null$0$LoginActivity$LoginActivitySmsView$5(TLRPC.TL_error tL_error) { LoginActivitySmsView.this.lastError = tL_error.text; } }, 0, 1000); } } /* access modifiers changed from: private */ /* access modifiers changed from: public */ private void destroyTimer() { try { synchronized (this.timerSync) { if (this.timeTimer != null) { this.timeTimer.cancel(); this.timeTimer = null; } } } catch (Exception e) { FileLog.e(e); } } /* access modifiers changed from: private */ /* access modifiers changed from: public */ private String getCode() { if (this.codeField == null) { return ""; } StringBuilder sb = new StringBuilder(); int i = 0; while (true) { EditTextBoldCursor[] editTextBoldCursorArr = this.codeField; if (i >= editTextBoldCursorArr.length) { return sb.toString(); } sb.append(PhoneFormat.stripExceptNumbers(editTextBoldCursorArr[i].getText().toString())); i++; } } @Override // im.guobwnxjuc.ui.components.SlideView public void onNextPressed() { if (!this.nextPressed && LoginActivity.this.currentViewNum >= 1 && LoginActivity.this.currentViewNum <= 4) { String code = getCode(); if (TextUtils.isEmpty(code)) { AndroidUtilities.shakeView(this.codeFieldContainer, 2.0f, 0); return; } this.nextPressed = true; int i = this.currentType; if (i == 2) { AndroidUtilities.setWaitingForSms(false); NotificationCenter.getGlobalInstance().removeObserver(this, NotificationCenter.didReceiveSmsCode); } else if (i == 3) { AndroidUtilities.setWaitingForCall(false); NotificationCenter.getGlobalInstance().removeObserver(this, NotificationCenter.didReceiveCall); } this.waitingForEvent = false; TLRPC.TL_auth_signIn tL_auth_signIn = new TLRPC.TL_auth_signIn(); tL_auth_signIn.phone_number = this.requestPhone; tL_auth_signIn.phone_code = code; tL_auth_signIn.phone_code_hash = this.phoneHash; destroyTimer(); LoginActivity.this.needShowProgress(ConnectionsManager.getInstance(LoginActivity.this.currentAccount).sendRequest(tL_auth_signIn, new RequestDelegate(tL_auth_signIn) { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$LoginActivitySmsView$ZNh5t2iDegG3gCaLKg5vpsEdQ */ private final /* synthetic */ TLRPC.TL_auth_signIn f$1; { this.f$1 = r2; } @Override // im.guobwnxjuc.tgnet.RequestDelegate public final void run(TLObject tLObject, TLRPC.TL_error tL_error) { LoginActivity.LoginActivitySmsView.this.lambda$onNextPressed$8$LoginActivity$LoginActivitySmsView(this.f$1, tLObject, tL_error); } }, 10)); } } public /* synthetic */ void lambda$onNextPressed$8$LoginActivity$LoginActivitySmsView(TLRPC.TL_auth_signIn tL_auth_signIn, TLObject tLObject, TLRPC.TL_error tL_error) { AndroidUtilities.runOnUIThread(new Runnable(tL_error, tLObject, tL_auth_signIn) { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$LoginActivitySmsView$G72bXmm9_MUIjOfmPnf9rF1w3mI */ private final /* synthetic */ TLRPC.TL_error f$1; private final /* synthetic */ TLObject f$2; private final /* synthetic */ TLRPC.TL_auth_signIn f$3; { this.f$1 = r2; this.f$2 = r3; this.f$3 = r4; } public final void run() { LoginActivity.LoginActivitySmsView.this.lambda$null$7$LoginActivity$LoginActivitySmsView(this.f$1, this.f$2, this.f$3); } }); } public /* synthetic */ void lambda$null$7$LoginActivity$LoginActivitySmsView(TLRPC.TL_error tL_error, TLObject tLObject, TLRPC.TL_auth_signIn tL_auth_signIn) { EditTextBoldCursor[] editTextBoldCursorArr; int i; int i2; boolean z = false; if (tL_error == null) { this.nextPressed = false; LoginActivity.this.needHideProgress(false); destroyTimer(); destroyCodeTimer(); if (tLObject instanceof TLRPC.TL_auth_authorizationSignUpRequired) { TLRPC.TL_auth_authorizationSignUpRequired tL_auth_authorizationSignUpRequired = (TLRPC.TL_auth_authorizationSignUpRequired) tLObject; if (tL_auth_authorizationSignUpRequired.terms_of_service != null) { LoginActivity.this.currentTermsOfService = tL_auth_authorizationSignUpRequired.terms_of_service; } Bundle bundle = new Bundle(); bundle.putString("phoneFormated", this.requestPhone); bundle.putString("phoneHash", this.phoneHash); bundle.putString("code", tL_auth_signIn.phone_code); LoginActivity.this.setPage(5, true, bundle, false); } else { LoginActivity.this.onAuthSuccess((TLRPC.TL_auth_authorization) tLObject); } } else { this.lastError = tL_error.text; if (tL_error.text.contains("SESSION_PASSWORD_NEEDED")) { ConnectionsManager.getInstance(LoginActivity.this.currentAccount).sendRequest(new TLRPC.TL_account_getPassword(), new RequestDelegate(tL_auth_signIn) { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$LoginActivitySmsView$aT6cCLCAsQDHyDxK488TmoBWB00 */ private final /* synthetic */ TLRPC.TL_auth_signIn f$1; { this.f$1 = r2; } @Override // im.guobwnxjuc.tgnet.RequestDelegate public final void run(TLObject tLObject, TLRPC.TL_error tL_error) { LoginActivity.LoginActivitySmsView.this.lambda$null$6$LoginActivity$LoginActivitySmsView(this.f$1, tLObject, tL_error); } }, 10); destroyTimer(); destroyCodeTimer(); } else { LoginActivity.this.needHideProgress(false); if ((this.currentType == 3 && ((i2 = this.nextType) == 4 || i2 == 2)) || ((this.currentType == 2 && ((i = this.nextType) == 4 || i == 3)) || (this.currentType == 4 && this.nextType == 2))) { createTimer(); } int i3 = this.currentType; if (i3 == 2) { AndroidUtilities.setWaitingForSms(true); NotificationCenter.getGlobalInstance().addObserver(this, NotificationCenter.didReceiveSmsCode); } else if (i3 == 3) { AndroidUtilities.setWaitingForCall(true); NotificationCenter.getGlobalInstance().addObserver(this, NotificationCenter.didReceiveCall); } this.waitingForEvent = true; this.nextPressed = false; if (this.currentType != 3) { if (tL_error.text.contains("PHONE_NUMBER_INVALID")) { LoginActivity.this.needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.getString("InvalidPhoneNumber", R.string.InvalidPhoneNumber)); } else if (tL_error.text.contains("PHONE_CODE_EMPTY") || tL_error.text.contains("PHONE_CODE_INVALID")) { LoginActivity.this.needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.getString("InvalidCode", R.string.InvalidCode)); int i4 = 0; while (true) { editTextBoldCursorArr = this.codeField; if (i4 >= editTextBoldCursorArr.length) { break; } editTextBoldCursorArr[i4].setText(""); i4++; } editTextBoldCursorArr[0].requestFocus(); } else if (tL_error.text.contains("PHONE_CODE_EXPIRED")) { onBackPressed(true); this.nextPressed = true; LoginActivity.this.setPage(0, true, null, true); LoginActivity.this.needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.getString("CodeExpired", R.string.CodeExpired)); } else if (tL_error.text.startsWith("FLOOD_WAIT")) { LoginActivity.this.needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.getString("FloodWait", R.string.FloodWait)); } else { LoginActivity loginActivity = LoginActivity.this; String string = LocaleController.getString("AppName", R.string.AppName); loginActivity.needShowAlert(string, LocaleController.getString("ErrorOccurred", R.string.ErrorOccurred) + "\n" + tL_error.text); } } if (z && this.currentType == 3) { AndroidUtilities.endIncomingCall(); return; } } } z = true; if (z) { } } public /* synthetic */ void lambda$null$6$LoginActivity$LoginActivitySmsView(TLRPC.TL_auth_signIn tL_auth_signIn, TLObject tLObject, TLRPC.TL_error tL_error) { AndroidUtilities.runOnUIThread(new Runnable(tL_error, tLObject, tL_auth_signIn) { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$LoginActivitySmsView$TW7ReOF167I3HYpYRmxVdzh96M */ private final /* synthetic */ TLRPC.TL_error f$1; private final /* synthetic */ TLObject f$2; private final /* synthetic */ TLRPC.TL_auth_signIn f$3; { this.f$1 = r2; this.f$2 = r3; this.f$3 = r4; } public final void run() { LoginActivity.LoginActivitySmsView.this.lambda$null$5$LoginActivity$LoginActivitySmsView(this.f$1, this.f$2, this.f$3); } }); } public /* synthetic */ void lambda$null$5$LoginActivity$LoginActivitySmsView(TLRPC.TL_error tL_error, TLObject tLObject, TLRPC.TL_auth_signIn tL_auth_signIn) { this.nextPressed = false; LoginActivity.this.needHideProgress(false); if (tL_error == null) { TLRPC.TL_account_password tL_account_password = (TLRPC.TL_account_password) tLObject; if (!TwoStepVerificationActivity.canHandleCurrentPassword(tL_account_password, true)) { AlertsCreator.showUpdateAppAlert(LoginActivity.this.getParentActivity(), LocaleController.getString("UpdateAppAlert", R.string.UpdateAppAlert), true); return; } Bundle bundle = new Bundle(); if (tL_account_password.current_algo instanceof TLRPC.TL_passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow) { TLRPC.TL_passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow tL_passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow = (TLRPC.TL_passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow) tL_account_password.current_algo; bundle.putString("current_salt1", Utilities.bytesToHex(tL_passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow.salt1)); bundle.putString("current_salt2", Utilities.bytesToHex(tL_passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow.salt2)); bundle.putString("current_p", Utilities.bytesToHex(tL_passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow.p)); bundle.putInt("current_g", tL_passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow.g); bundle.putString("current_srp_B", Utilities.bytesToHex(tL_account_password.srp_B)); bundle.putLong("current_srp_id", tL_account_password.srp_id); bundle.putInt("passwordType", 1); } String str = ""; bundle.putString(TrackReferenceTypeBox.TYPE1, tL_account_password.hint != null ? tL_account_password.hint : str); if (tL_account_password.email_unconfirmed_pattern != null) { str = tL_account_password.email_unconfirmed_pattern; } bundle.putString("email_unconfirmed_pattern", str); bundle.putString("phoneFormated", this.requestPhone); bundle.putString("phoneHash", this.phoneHash); bundle.putString("code", tL_auth_signIn.phone_code); bundle.putInt("has_recovery", tL_account_password.has_recovery ? 1 : 0); LoginActivity.this.setPage(6, true, bundle, false); return; } LoginActivity.this.needShowAlert(LocaleController.getString("AppName", R.string.AppName), tL_error.text); } @Override // im.guobwnxjuc.ui.components.SlideView public boolean onBackPressed(boolean z) { if (!z) { AlertDialog.Builder builder = new AlertDialog.Builder(LoginActivity.this.getParentActivity()); builder.setTitle(LocaleController.getString("AppName", R.string.AppName)); builder.setMessage(LocaleController.getString("StopVerification", R.string.StopVerification)); builder.setPositiveButton(LocaleController.getString("Continue", R.string.Continue), null); builder.setNegativeButton(LocaleController.getString("Stop", R.string.Stop), new DialogInterface.OnClickListener() { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$LoginActivitySmsView$XK71AuP87P0fjvkvug8kTQPIYrU */ public final void onClick(DialogInterface dialogInterface, int i) { LoginActivity.LoginActivitySmsView.this.lambda$onBackPressed$9$LoginActivity$LoginActivitySmsView(dialogInterface, i); } }); LoginActivity.this.showDialog(builder.create()); return false; } this.nextPressed = false; LoginActivity.this.needHideProgress(true); TLRPC.TL_auth_cancelCode tL_auth_cancelCode = new TLRPC.TL_auth_cancelCode(); tL_auth_cancelCode.phone_number = this.requestPhone; tL_auth_cancelCode.phone_code_hash = this.phoneHash; ConnectionsManager.getInstance(LoginActivity.this.currentAccount).sendRequest(tL_auth_cancelCode, $$Lambda$LoginActivity$LoginActivitySmsView$wAPDR3jaYnOHNULw9LePL_i5XTQ.INSTANCE, 10); destroyTimer(); destroyCodeTimer(); this.currentParams = null; int i = this.currentType; if (i == 2) { AndroidUtilities.setWaitingForSms(false); NotificationCenter.getGlobalInstance().removeObserver(this, NotificationCenter.didReceiveSmsCode); } else if (i == 3) { AndroidUtilities.setWaitingForCall(false); NotificationCenter.getGlobalInstance().removeObserver(this, NotificationCenter.didReceiveCall); } this.waitingForEvent = false; return true; } public /* synthetic */ void lambda$onBackPressed$9$LoginActivity$LoginActivitySmsView(DialogInterface dialogInterface, int i) { onBackPressed(true); LoginActivity.this.setPage(0, true, null, true); } @Override // im.guobwnxjuc.ui.components.SlideView public void onDestroyActivity() { super.onDestroyActivity(); int i = this.currentType; if (i == 2) { AndroidUtilities.setWaitingForSms(false); NotificationCenter.getGlobalInstance().removeObserver(this, NotificationCenter.didReceiveSmsCode); } else if (i == 3) { AndroidUtilities.setWaitingForCall(false); NotificationCenter.getGlobalInstance().removeObserver(this, NotificationCenter.didReceiveCall); } this.waitingForEvent = false; destroyTimer(); destroyCodeTimer(); } @Override // im.guobwnxjuc.ui.components.SlideView public void onShow() { super.onShow(); if (this.currentType != 3) { AndroidUtilities.runOnUIThread(new Runnable() { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$LoginActivitySmsView$xxjCmhW8MwE_0t9oHxrAd7Cq3cs */ public final void run() { LoginActivity.LoginActivitySmsView.this.lambda$onShow$11$LoginActivity$LoginActivitySmsView(); } }, 100); } } public /* synthetic */ void lambda$onShow$11$LoginActivity$LoginActivitySmsView() { EditTextBoldCursor[] editTextBoldCursorArr = this.codeField; if (editTextBoldCursorArr != null) { for (int length2 = editTextBoldCursorArr.length - 1; length2 >= 0; length2--) { if (length2 == 0 || this.codeField[length2].length() != 0) { this.codeField[length2].requestFocus(); EditTextBoldCursor[] editTextBoldCursorArr2 = this.codeField; editTextBoldCursorArr2[length2].setSelection(editTextBoldCursorArr2[length2].length()); AndroidUtilities.showKeyboard(this.codeField[length2]); return; } } } } @Override // im.guobwnxjuc.messenger.NotificationCenter.NotificationCenterDelegate public void didReceivedNotification(int i, int i2, Object... objArr) { if (this.waitingForEvent && this.codeField != null) { if (i == NotificationCenter.didReceiveSmsCode) { this.codeField[0].setText("" + objArr[0]); onNextPressed(); } else if (i == NotificationCenter.didReceiveCall) { String str = "" + objArr[0]; if (AndroidUtilities.checkPhonePattern(this.pattern, str)) { if (!this.pattern.equals("*")) { this.catchedPhone = str; AndroidUtilities.endIncomingCall(); } this.ignoreOnTextChange = true; this.codeField[0].setText(str); this.ignoreOnTextChange = false; onNextPressed(); } } } } @Override // im.guobwnxjuc.ui.components.SlideView public void saveStateParams(Bundle bundle) { String code = getCode(); if (code.length() != 0) { bundle.putString("smsview_code_" + this.currentType, code); } String str = this.catchedPhone; if (str != null) { bundle.putString("catchedPhone", str); } if (this.currentParams != null) { bundle.putBundle("smsview_params_" + this.currentType, this.currentParams); } int i = this.time; if (i != 0) { bundle.putInt("time", i); } int i2 = this.openTime; if (i2 != 0) { bundle.putInt("open", i2); } } @Override // im.guobwnxjuc.ui.components.SlideView public void restoreStateParams(Bundle bundle) { EditTextBoldCursor[] editTextBoldCursorArr; Bundle bundle2 = bundle.getBundle("smsview_params_" + this.currentType); this.currentParams = bundle2; if (bundle2 != null) { setParams(bundle2, true); } String string = bundle.getString("catchedPhone"); if (string != null) { this.catchedPhone = string; } String string2 = bundle.getString("smsview_code_" + this.currentType); if (!(string2 == null || (editTextBoldCursorArr = this.codeField) == null)) { editTextBoldCursorArr[0].setText(string2); } int i = bundle.getInt("time"); if (i != 0) { this.time = i; } int i2 = bundle.getInt("open"); if (i2 != 0) { this.openTime = i2; } } } public class LoginActivityPasswordView extends SlideView { private TextView cancelButton; private EditTextBoldCursor codeField; private TextView confirmTextView; private Bundle currentParams; private int current_g; private byte[] current_p; private byte[] current_salt1; private byte[] current_salt2; private byte[] current_srp_B; private long current_srp_id; private String email_unconfirmed_pattern; private boolean has_recovery; private String hint; private boolean nextPressed; private int passwordType; private String phoneCode; private String phoneHash; private String requestPhone; private TextView resetAccountButton; private TextView resetAccountText; @Override // im.guobwnxjuc.ui.components.SlideView public boolean needBackButton() { return true; } public LoginActivityPasswordView(Context context) { super(context); setOrientation(1); TextView textView = new TextView(context); this.confirmTextView = textView; textView.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteGrayText6)); this.confirmTextView.setTextSize(1, 14.0f); int i = 5; this.confirmTextView.setGravity(LocaleController.isRTL ? 5 : 3); this.confirmTextView.setLineSpacing((float) AndroidUtilities.dp(2.0f), 1.0f); this.confirmTextView.setText(LocaleController.getString("LoginPasswordText", R.string.LoginPasswordText)); addView(this.confirmTextView, LayoutHelper.createLinear(-2, -2, LocaleController.isRTL ? 5 : 3)); EditTextBoldCursor editTextBoldCursor = new EditTextBoldCursor(context); this.codeField = editTextBoldCursor; editTextBoldCursor.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteBlackText)); this.codeField.setCursorColor(Theme.getColor(Theme.key_windowBackgroundWhiteBlackText)); this.codeField.setCursorSize(AndroidUtilities.dp(20.0f)); this.codeField.setCursorWidth(1.5f); this.codeField.setHintTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteHintText)); this.codeField.setBackgroundDrawable(Theme.createEditTextDrawable(context, false)); this.codeField.setHint(LocaleController.getString("LoginPassword", R.string.LoginPassword)); this.codeField.setImeOptions(268435461); this.codeField.setTextSize(1, 18.0f); this.codeField.setMaxLines(1); this.codeField.setPadding(0, 0, 0, 0); this.codeField.setInputType(TsExtractor.TS_STREAM_TYPE_AC3); this.codeField.setTransformationMethod(PasswordTransformationMethod.getInstance()); this.codeField.setTypeface(Typeface.DEFAULT); this.codeField.setGravity(LocaleController.isRTL ? 5 : 3); addView(this.codeField, LayoutHelper.createLinear(-1, 36, 1, 0, 20, 0, 0)); this.codeField.setOnEditorActionListener(new TextView.OnEditorActionListener() { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$LoginActivityPasswordView$y21AzO8C0Jg5zHrgDDYGjoQd8g4 */ public final boolean onEditorAction(TextView textView, int i, KeyEvent keyEvent) { return LoginActivity.LoginActivityPasswordView.this.lambda$new$0$LoginActivity$LoginActivityPasswordView(textView, i, keyEvent); } }); TextView textView2 = new TextView(context); this.cancelButton = textView2; textView2.setGravity((LocaleController.isRTL ? 5 : 3) | 48); this.cancelButton.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteBlueText4)); this.cancelButton.setText(LocaleController.getString("ForgotPassword", R.string.ForgotPassword)); this.cancelButton.setTextSize(1, 14.0f); this.cancelButton.setLineSpacing((float) AndroidUtilities.dp(2.0f), 1.0f); this.cancelButton.setPadding(0, AndroidUtilities.dp(14.0f), 0, 0); addView(this.cancelButton, LayoutHelper.createLinear(-1, -2, (LocaleController.isRTL ? 5 : 3) | 48)); this.cancelButton.setOnClickListener(new View.OnClickListener() { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$LoginActivityPasswordView$vpdoWzLmLPTRYoNpwZpf4X5QTDw */ public final void onClick(View view) { LoginActivity.LoginActivityPasswordView.this.lambda$new$4$LoginActivity$LoginActivityPasswordView(view); } }); TextView textView3 = new TextView(context); this.resetAccountButton = textView3; textView3.setGravity((LocaleController.isRTL ? 5 : 3) | 48); this.resetAccountButton.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteRedText6)); this.resetAccountButton.setVisibility(8); this.resetAccountButton.setText(LocaleController.getString("ResetMyAccount", R.string.ResetMyAccount)); this.resetAccountButton.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf")); this.resetAccountButton.setTextSize(1, 14.0f); this.resetAccountButton.setLineSpacing((float) AndroidUtilities.dp(2.0f), 1.0f); this.resetAccountButton.setPadding(0, AndroidUtilities.dp(14.0f), 0, 0); addView(this.resetAccountButton, LayoutHelper.createLinear(-2, -2, (LocaleController.isRTL ? 5 : 3) | 48, 0, 34, 0, 0)); this.resetAccountButton.setOnClickListener(new View.OnClickListener() { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$LoginActivityPasswordView$wU_Po845fqQMY_gr52g2RH917bY */ public final void onClick(View view) { LoginActivity.LoginActivityPasswordView.this.lambda$new$8$LoginActivity$LoginActivityPasswordView(view); } }); TextView textView4 = new TextView(context); this.resetAccountText = textView4; textView4.setGravity((LocaleController.isRTL ? 5 : 3) | 48); this.resetAccountText.setVisibility(8); this.resetAccountText.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteGrayText6)); this.resetAccountText.setText(LocaleController.getString("ResetMyAccountText", R.string.ResetMyAccountText)); this.resetAccountText.setTextSize(1, 14.0f); this.resetAccountText.setLineSpacing((float) AndroidUtilities.dp(2.0f), 1.0f); addView(this.resetAccountText, LayoutHelper.createLinear(-2, -2, (!LocaleController.isRTL ? 3 : i) | 48, 0, 7, 0, 14)); } public /* synthetic */ boolean lambda$new$0$LoginActivity$LoginActivityPasswordView(TextView textView, int i, KeyEvent keyEvent) { if (i != 5) { return false; } onNextPressed(); return true; } public /* synthetic */ void lambda$new$4$LoginActivity$LoginActivityPasswordView(View view) { if (LoginActivity.this.doneProgressView.getTag() == null) { if (this.has_recovery) { LoginActivity.this.needShowProgress(0); ConnectionsManager.getInstance(LoginActivity.this.currentAccount).sendRequest(new TLRPC.TL_auth_requestPasswordRecovery(), new RequestDelegate() { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$LoginActivityPasswordView$j9c9XY5Y0wxK3Qr6fQS9aYnHuf0 */ @Override // im.guobwnxjuc.tgnet.RequestDelegate public final void run(TLObject tLObject, TLRPC.TL_error tL_error) { LoginActivity.LoginActivityPasswordView.this.lambda$null$3$LoginActivity$LoginActivityPasswordView(tLObject, tL_error); } }, 10); return; } this.resetAccountText.setVisibility(0); this.resetAccountButton.setVisibility(0); AndroidUtilities.hideKeyboard(this.codeField); LoginActivity.this.needShowAlert(LocaleController.getString("RestorePasswordNoEitle", R.string.RestorePasswordNoEmailTitle), LocaleController.getString("RestorePasswordNoEmailText", R.string.RestorePasswordNoEmailText)); } } public /* synthetic */ void lambda$null$3$LoginActivity$LoginActivityPasswordView(TLObject tLObject, TLRPC.TL_error tL_error) { AndroidUtilities.runOnUIThread(new Runnable(tL_error, tLObject) { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$LoginActivityPasswordView$lYrTkx68jD2QuGhAFZr6CTrxfpE */ private final /* synthetic */ TLRPC.TL_error f$1; private final /* synthetic */ TLObject f$2; { this.f$1 = r2; this.f$2 = r3; } public final void run() { LoginActivity.LoginActivityPasswordView.this.lambda$null$2$LoginActivity$LoginActivityPasswordView(this.f$1, this.f$2); } }); } public /* synthetic */ void lambda$null$2$LoginActivity$LoginActivityPasswordView(TLRPC.TL_error tL_error, TLObject tLObject) { String str; LoginActivity.this.needHideProgress(false); if (tL_error == null) { TLRPC.TL_auth_passwordRecovery tL_auth_passwordRecovery = (TLRPC.TL_auth_passwordRecovery) tLObject; AlertDialog.Builder builder = new AlertDialog.Builder(LoginActivity.this.getParentActivity()); builder.setMessage(LocaleController.formatString("RestoreEmailSent", R.string.RestoreEmailSent, tL_auth_passwordRecovery.email_pattern)); builder.setTitle(LocaleController.getString("AppName", R.string.AppName)); builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), new DialogInterface.OnClickListener(tL_auth_passwordRecovery) { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$LoginActivityPasswordView$ciIsOaBEamwlEKt8vNevrEysLaE */ private final /* synthetic */ TLRPC.TL_auth_passwordRecovery f$1; { this.f$1 = r2; } public final void onClick(DialogInterface dialogInterface, int i) { LoginActivity.LoginActivityPasswordView.this.lambda$null$1$LoginActivity$LoginActivityPasswordView(this.f$1, dialogInterface, i); } }); Dialog showDialog = LoginActivity.this.showDialog(builder.create()); if (showDialog != null) { showDialog.setCanceledOnTouchOutside(false); showDialog.setCancelable(false); } } else if (tL_error.text.startsWith("FLOOD_WAIT")) { int intValue = Utilities.parseInt(tL_error.text).intValue(); if (intValue < 60) { str = LocaleController.formatPluralString("Seconds", intValue); } else { str = LocaleController.formatPluralString("Minutes", intValue / 60); } LoginActivity.this.needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.formatString("FloodWaitTime", R.string.FloodWaitTime, str)); } else { LoginActivity.this.needShowAlert(LocaleController.getString("AppName", R.string.AppName), tL_error.text); } } public /* synthetic */ void lambda$null$1$LoginActivity$LoginActivityPasswordView(TLRPC.TL_auth_passwordRecovery tL_auth_passwordRecovery, DialogInterface dialogInterface, int i) { Bundle bundle = new Bundle(); bundle.putString("email_unconfirmed_pattern", tL_auth_passwordRecovery.email_pattern); LoginActivity.this.setPage(7, true, bundle, false); } public /* synthetic */ void lambda$new$8$LoginActivity$LoginActivityPasswordView(View view) { if (LoginActivity.this.doneProgressView.getTag() == null) { AlertDialog.Builder builder = new AlertDialog.Builder(LoginActivity.this.getParentActivity()); builder.setMessage(LocaleController.getString("ResetMyAccountWarningText", R.string.ResetMyAccountWarningText)); builder.setTitle(LocaleController.getString("ResetMyAccountWarning", R.string.ResetMyAccountWarning)); builder.setPositiveButton(LocaleController.getString("ResetMyAccountWarningReset", R.string.ResetMyAccountWarningReset), new DialogInterface.OnClickListener() { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$LoginActivityPasswordView$41prZ_am_dP04NRqNpLgks4QnHs */ public final void onClick(DialogInterface dialogInterface, int i) { LoginActivity.LoginActivityPasswordView.this.lambda$null$7$LoginActivity$LoginActivityPasswordView(dialogInterface, i); } }); builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null); LoginActivity.this.showDialog(builder.create()); } } public /* synthetic */ void lambda$null$7$LoginActivity$LoginActivityPasswordView(DialogInterface dialogInterface, int i) { LoginActivity.this.needShowProgress(0); TLRPC.TL_account_deleteAccount tL_account_deleteAccount = new TLRPC.TL_account_deleteAccount(); tL_account_deleteAccount.reason = "Forgot password"; ConnectionsManager.getInstance(LoginActivity.this.currentAccount).sendRequest(tL_account_deleteAccount, new RequestDelegate() { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$LoginActivityPasswordView$sQ3gorfoAJ4ougt9gbI0clMhEI */ @Override // im.guobwnxjuc.tgnet.RequestDelegate public final void run(TLObject tLObject, TLRPC.TL_error tL_error) { LoginActivity.LoginActivityPasswordView.this.lambda$null$6$LoginActivity$LoginActivityPasswordView(tLObject, tL_error); } }, 10); } public /* synthetic */ void lambda$null$6$LoginActivity$LoginActivityPasswordView(TLObject tLObject, TLRPC.TL_error tL_error) { AndroidUtilities.runOnUIThread(new Runnable(tL_error) { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$LoginActivityPasswordView$pzVclV_BYq_3aR69RGzYE9Phy0A */ private final /* synthetic */ TLRPC.TL_error f$1; { this.f$1 = r2; } public final void run() { LoginActivity.LoginActivityPasswordView.this.lambda$null$5$LoginActivity$LoginActivityPasswordView(this.f$1); } }); } public /* synthetic */ void lambda$null$5$LoginActivity$LoginActivityPasswordView(TLRPC.TL_error tL_error) { LoginActivity.this.needHideProgress(false); if (tL_error == null) { Bundle bundle = new Bundle(); bundle.putString("phoneFormated", this.requestPhone); bundle.putString("phoneHash", this.phoneHash); bundle.putString("code", this.phoneCode); LoginActivity.this.setPage(5, true, bundle, false); } else if (tL_error.text.equals("2FA_RECENT_CONFIRM")) { LoginActivity.this.needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.getString("ResetAccountCancelledAlert", R.string.ResetAccountCancelledAlert)); } else if (tL_error.text.startsWith("2FA_CONFIRM_WAIT_")) { Bundle bundle2 = new Bundle(); bundle2.putString("phoneFormated", this.requestPhone); bundle2.putString("phoneHash", this.phoneHash); bundle2.putString("code", this.phoneCode); bundle2.putInt("startTime", ConnectionsManager.getInstance(LoginActivity.this.currentAccount).getCurrentTime()); bundle2.putInt("waitTime", Utilities.parseInt(tL_error.text.replace("2FA_CONFIRM_WAIT_", "")).intValue()); LoginActivity.this.setPage(8, true, bundle2, false); } else { LoginActivity.this.needShowAlert(LocaleController.getString("AppName", R.string.AppName), tL_error.text); } } @Override // im.guobwnxjuc.ui.components.SlideView public String getHeaderName() { return LocaleController.getString("LoginPassword", R.string.LoginPassword); } @Override // im.guobwnxjuc.ui.components.SlideView public void onCancelPressed() { this.nextPressed = false; } @Override // im.guobwnxjuc.ui.components.SlideView public void setParams(Bundle bundle, boolean z) { if (bundle != null) { boolean z2 = false; if (bundle.isEmpty()) { this.resetAccountButton.setVisibility(0); this.resetAccountText.setVisibility(0); AndroidUtilities.hideKeyboard(this.codeField); return; } this.resetAccountButton.setVisibility(8); this.resetAccountText.setVisibility(8); this.codeField.setText(""); this.currentParams = bundle; this.current_salt1 = Utilities.hexToBytes(bundle.getString("current_salt1")); this.current_salt2 = Utilities.hexToBytes(this.currentParams.getString("current_salt2")); this.current_p = Utilities.hexToBytes(this.currentParams.getString("current_p")); this.current_g = this.currentParams.getInt("current_g"); this.current_srp_B = Utilities.hexToBytes(this.currentParams.getString("current_srp_B")); this.current_srp_id = this.currentParams.getLong("current_srp_id"); this.passwordType = this.currentParams.getInt("passwordType"); this.hint = this.currentParams.getString(TrackReferenceTypeBox.TYPE1); if (this.currentParams.getInt("has_recovery") == 1) { z2 = true; } this.has_recovery = z2; this.email_unconfirmed_pattern = this.currentParams.getString("email_unconfirmed_pattern"); this.requestPhone = bundle.getString("phoneFormated"); this.phoneHash = bundle.getString("phoneHash"); this.phoneCode = bundle.getString("code"); String str = this.hint; if (str == null || str.length() <= 0) { this.codeField.setHint(LocaleController.getString("LoginPassword", R.string.LoginPassword)); } else { this.codeField.setHint(this.hint); } } } private void onPasscodeError(boolean z) { if (LoginActivity.this.getParentActivity() != null) { Vibrator vibrator = (Vibrator) LoginActivity.this.getParentActivity().getSystemService("vibrator"); if (vibrator != null) { vibrator.vibrate(200); } if (z) { this.codeField.setText(""); } AndroidUtilities.shakeView(this.confirmTextView, 2.0f, 0); } } @Override // im.guobwnxjuc.ui.components.SlideView public void onNextPressed() { if (!this.nextPressed) { String obj = this.codeField.getText().toString(); if (obj.length() == 0) { onPasscodeError(false); return; } this.nextPressed = true; LoginActivity.this.needShowProgress(0); Utilities.globalQueue.postRunnable(new Runnable(obj) { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$LoginActivityPasswordView$Gf2CEHwZYzgpqHTsvWn1jnqtu04 */ private final /* synthetic */ String f$1; { this.f$1 = r2; } public final void run() { LoginActivity.LoginActivityPasswordView.this.lambda$onNextPressed$13$LoginActivity$LoginActivityPasswordView(this.f$1); } }); } } public /* synthetic */ void lambda$onNextPressed$13$LoginActivity$LoginActivityPasswordView(String str) { TLRPC.TL_passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow tL_passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow; if (this.passwordType == 1) { tL_passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow = new TLRPC.TL_passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow(); tL_passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow.salt1 = this.current_salt1; tL_passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow.salt2 = this.current_salt2; tL_passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow.g = this.current_g; tL_passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow.p = this.current_p; } else { tL_passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow = null; } boolean z = tL_passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow instanceof TLRPC.TL_passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow; byte[] x = z ? SRPHelper.getX(AndroidUtilities.getStringBytes(str), tL_passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow) : null; TLRPC.TL_auth_checkPassword tL_auth_checkPassword = new TLRPC.TL_auth_checkPassword(); $$Lambda$LoginActivity$LoginActivityPasswordView$hq7pLdM67oaUn40NON7weHmVQvY r4 = new RequestDelegate() { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$LoginActivityPasswordView$hq7pLdM67oaUn40NON7weHmVQvY */ @Override // im.guobwnxjuc.tgnet.RequestDelegate public final void run(TLObject tLObject, TLRPC.TL_error tL_error) { LoginActivity.LoginActivityPasswordView.this.lambda$null$12$LoginActivity$LoginActivityPasswordView(tLObject, tL_error); } }; if (z) { TLRPC.TL_passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow tL_passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow2 = tL_passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow; tL_passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow2.salt1 = this.current_salt1; tL_passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow2.salt2 = this.current_salt2; tL_passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow2.g = this.current_g; tL_passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow2.p = this.current_p; tL_auth_checkPassword.password = SRPHelper.startCheck(x, this.current_srp_id, this.current_srp_B, tL_passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow2); if (tL_auth_checkPassword.password == null) { TLRPC.TL_error tL_error = new TLRPC.TL_error(); tL_error.text = "PASSWORD_HASH_INVALID"; r4.run(null, tL_error); return; } ConnectionsManager.getInstance(LoginActivity.this.currentAccount).sendRequest(tL_auth_checkPassword, r4, 10); } } public /* synthetic */ void lambda$null$12$LoginActivity$LoginActivityPasswordView(TLObject tLObject, TLRPC.TL_error tL_error) { AndroidUtilities.runOnUIThread(new Runnable(tL_error, tLObject) { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$LoginActivityPasswordView$FksE1V8C6ELkJmWtN2txAN4DcUo */ private final /* synthetic */ TLRPC.TL_error f$1; private final /* synthetic */ TLObject f$2; { this.f$1 = r2; this.f$2 = r3; } public final void run() { LoginActivity.LoginActivityPasswordView.this.lambda$null$11$LoginActivity$LoginActivityPasswordView(this.f$1, this.f$2); } }); } public /* synthetic */ void lambda$null$11$LoginActivity$LoginActivityPasswordView(TLRPC.TL_error tL_error, TLObject tLObject) { String str; this.nextPressed = false; if (tL_error == null || !"SRP_ID_INVALID".equals(tL_error.text)) { LoginActivity.this.needHideProgress(false); if (tLObject instanceof TLRPC.TL_auth_authorization) { LoginActivity.this.onAuthSuccess((TLRPC.TL_auth_authorization) tLObject); } else if (tL_error.text.equals("PASSWORD_HASH_INVALID")) { onPasscodeError(true); } else if (tL_error.text.startsWith("FLOOD_WAIT")) { int intValue = Utilities.parseInt(tL_error.text).intValue(); if (intValue < 60) { str = LocaleController.formatPluralString("Seconds", intValue); } else { str = LocaleController.formatPluralString("Minutes", intValue / 60); } LoginActivity.this.needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.formatString("FloodWaitTime", R.string.FloodWaitTime, str)); } else { LoginActivity.this.needShowAlert(LocaleController.getString("AppName", R.string.AppName), tL_error.text); } } else { ConnectionsManager.getInstance(LoginActivity.this.currentAccount).sendRequest(new TLRPC.TL_account_getPassword(), new RequestDelegate() { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$LoginActivityPasswordView$3c9PWorrqRVBqMCqT1R0yFFdib4 */ @Override // im.guobwnxjuc.tgnet.RequestDelegate public final void run(TLObject tLObject, TLRPC.TL_error tL_error) { LoginActivity.LoginActivityPasswordView.this.lambda$null$10$LoginActivity$LoginActivityPasswordView(tLObject, tL_error); } }, 8); } } public /* synthetic */ void lambda$null$10$LoginActivity$LoginActivityPasswordView(TLObject tLObject, TLRPC.TL_error tL_error) { AndroidUtilities.runOnUIThread(new Runnable(tL_error, tLObject) { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$LoginActivityPasswordView$wmBOfnXQIeer5TiVjU9FgJuStOY */ private final /* synthetic */ TLRPC.TL_error f$1; private final /* synthetic */ TLObject f$2; { this.f$1 = r2; this.f$2 = r3; } public final void run() { LoginActivity.LoginActivityPasswordView.this.lambda$null$9$LoginActivity$LoginActivityPasswordView(this.f$1, this.f$2); } }); } public /* synthetic */ void lambda$null$9$LoginActivity$LoginActivityPasswordView(TLRPC.TL_error tL_error, TLObject tLObject) { if (tL_error == null) { TLRPC.TL_account_password tL_account_password = (TLRPC.TL_account_password) tLObject; this.current_srp_B = tL_account_password.srp_B; this.current_srp_id = tL_account_password.srp_id; onNextPressed(); } } @Override // im.guobwnxjuc.ui.components.SlideView public boolean onBackPressed(boolean z) { this.nextPressed = false; LoginActivity.this.needHideProgress(true); this.currentParams = null; return true; } @Override // im.guobwnxjuc.ui.components.SlideView public void onShow() { super.onShow(); AndroidUtilities.runOnUIThread(new Runnable() { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$LoginActivityPasswordView$xvXTCdAVkY6ibG6exXeA_0aNOYc */ public final void run() { LoginActivity.LoginActivityPasswordView.this.lambda$onShow$14$LoginActivity$LoginActivityPasswordView(); } }, 100); } public /* synthetic */ void lambda$onShow$14$LoginActivity$LoginActivityPasswordView() { EditTextBoldCursor editTextBoldCursor = this.codeField; if (editTextBoldCursor != null) { editTextBoldCursor.requestFocus(); EditTextBoldCursor editTextBoldCursor2 = this.codeField; editTextBoldCursor2.setSelection(editTextBoldCursor2.length()); AndroidUtilities.showKeyboard(this.codeField); } } @Override // im.guobwnxjuc.ui.components.SlideView public void saveStateParams(Bundle bundle) { String obj = this.codeField.getText().toString(); if (obj.length() != 0) { bundle.putString("passview_code", obj); } Bundle bundle2 = this.currentParams; if (bundle2 != null) { bundle.putBundle("passview_params", bundle2); } } @Override // im.guobwnxjuc.ui.components.SlideView public void restoreStateParams(Bundle bundle) { Bundle bundle2 = bundle.getBundle("passview_params"); this.currentParams = bundle2; if (bundle2 != null) { setParams(bundle2, true); } String string = bundle.getString("passview_code"); if (string != null) { this.codeField.setText(string); } } } public class LoginActivityResetWaitView extends SlideView { private TextView confirmTextView; private Bundle currentParams; private String phoneCode; private String phoneHash; private String requestPhone; private TextView resetAccountButton; private TextView resetAccountText; private TextView resetAccountTime; private int startTime; private Runnable timeRunnable; private int waitTime; @Override // im.guobwnxjuc.ui.components.SlideView public boolean needBackButton() { return true; } public LoginActivityResetWaitView(Context context) { super(context); setOrientation(1); TextView textView = new TextView(context); this.confirmTextView = textView; textView.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteGrayText6)); this.confirmTextView.setTextSize(1, 14.0f); int i = 5; this.confirmTextView.setGravity(LocaleController.isRTL ? 5 : 3); this.confirmTextView.setLineSpacing((float) AndroidUtilities.dp(2.0f), 1.0f); addView(this.confirmTextView, LayoutHelper.createLinear(-2, -2, LocaleController.isRTL ? 5 : 3)); TextView textView2 = new TextView(context); this.resetAccountText = textView2; textView2.setGravity((LocaleController.isRTL ? 5 : 3) | 48); this.resetAccountText.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteGrayText6)); this.resetAccountText.setText(LocaleController.getString("ResetAccountStatus", R.string.ResetAccountStatus)); this.resetAccountText.setTextSize(1, 14.0f); this.resetAccountText.setLineSpacing((float) AndroidUtilities.dp(2.0f), 1.0f); addView(this.resetAccountText, LayoutHelper.createLinear(-2, -2, (LocaleController.isRTL ? 5 : 3) | 48, 0, 24, 0, 0)); TextView textView3 = new TextView(context); this.resetAccountTime = textView3; textView3.setGravity((LocaleController.isRTL ? 5 : 3) | 48); this.resetAccountTime.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteGrayText6)); this.resetAccountTime.setTextSize(1, 14.0f); this.resetAccountTime.setLineSpacing((float) AndroidUtilities.dp(2.0f), 1.0f); addView(this.resetAccountTime, LayoutHelper.createLinear(-2, -2, (LocaleController.isRTL ? 5 : 3) | 48, 0, 2, 0, 0)); TextView textView4 = new TextView(context); this.resetAccountButton = textView4; textView4.setGravity((LocaleController.isRTL ? 5 : 3) | 48); this.resetAccountButton.setText(LocaleController.getString("ResetAccountButton", R.string.ResetAccountButton)); this.resetAccountButton.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf")); this.resetAccountButton.setTextSize(1, 14.0f); this.resetAccountButton.setLineSpacing((float) AndroidUtilities.dp(2.0f), 1.0f); this.resetAccountButton.setPadding(0, AndroidUtilities.dp(14.0f), 0, 0); addView(this.resetAccountButton, LayoutHelper.createLinear(-2, -2, (!LocaleController.isRTL ? 3 : i) | 48, 0, 7, 0, 0)); this.resetAccountButton.setOnClickListener(new View.OnClickListener() { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$LoginActivityResetWaitView$tadCFIbY01lTLH6ZKS_YTCOwos */ public final void onClick(View view) { LoginActivity.LoginActivityResetWaitView.this.lambda$new$3$LoginActivity$LoginActivityResetWaitView(view); } }); } public /* synthetic */ void lambda$new$3$LoginActivity$LoginActivityResetWaitView(View view) { if (LoginActivity.this.doneProgressView.getTag() == null && Math.abs(ConnectionsManager.getInstance(LoginActivity.this.currentAccount).getCurrentTime() - this.startTime) >= this.waitTime) { AlertDialog.Builder builder = new AlertDialog.Builder(LoginActivity.this.getParentActivity()); builder.setMessage(LocaleController.getString("ResetMyAccountWarningText", R.string.ResetMyAccountWarningText)); builder.setTitle(LocaleController.getString("ResetMyAccountWarning", R.string.ResetMyAccountWarning)); builder.setPositiveButton(LocaleController.getString("ResetMyAccountWarningReset", R.string.ResetMyAccountWarningReset), new DialogInterface.OnClickListener() { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$LoginActivityResetWaitView$imCcUBzvKc39mmOdp2yRiBhJjyA */ public final void onClick(DialogInterface dialogInterface, int i) { LoginActivity.LoginActivityResetWaitView.this.lambda$null$2$LoginActivity$LoginActivityResetWaitView(dialogInterface, i); } }); builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null); LoginActivity.this.showDialog(builder.create()); } } public /* synthetic */ void lambda$null$2$LoginActivity$LoginActivityResetWaitView(DialogInterface dialogInterface, int i) { LoginActivity.this.needShowProgress(0); TLRPC.TL_account_deleteAccount tL_account_deleteAccount = new TLRPC.TL_account_deleteAccount(); tL_account_deleteAccount.reason = "Forgot password"; ConnectionsManager.getInstance(LoginActivity.this.currentAccount).sendRequest(tL_account_deleteAccount, new RequestDelegate() { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$LoginActivityResetWaitView$5Of_sJ9dMApSsAmff1ud4WdK3ug */ @Override // im.guobwnxjuc.tgnet.RequestDelegate public final void run(TLObject tLObject, TLRPC.TL_error tL_error) { LoginActivity.LoginActivityResetWaitView.this.lambda$null$1$LoginActivity$LoginActivityResetWaitView(tLObject, tL_error); } }, 10); } public /* synthetic */ void lambda$null$1$LoginActivity$LoginActivityResetWaitView(TLObject tLObject, TLRPC.TL_error tL_error) { AndroidUtilities.runOnUIThread(new Runnable(tL_error) { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$LoginActivityResetWaitView$hfGP5FyrXzWstk39t3yUeXbDzIQ */ private final /* synthetic */ TLRPC.TL_error f$1; { this.f$1 = r2; } public final void run() { LoginActivity.LoginActivityResetWaitView.this.lambda$null$0$LoginActivity$LoginActivityResetWaitView(this.f$1); } }); } public /* synthetic */ void lambda$null$0$LoginActivity$LoginActivityResetWaitView(TLRPC.TL_error tL_error) { LoginActivity.this.needHideProgress(false); if (tL_error == null) { Bundle bundle = new Bundle(); bundle.putString("phoneFormated", this.requestPhone); bundle.putString("phoneHash", this.phoneHash); bundle.putString("code", this.phoneCode); LoginActivity.this.setPage(5, true, bundle, false); } else if (tL_error.text.equals("2FA_RECENT_CONFIRM")) { LoginActivity.this.needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.getString("ResetAccountCancelledAlert", R.string.ResetAccountCancelledAlert)); } else { LoginActivity.this.needShowAlert(LocaleController.getString("AppName", R.string.AppName), tL_error.text); } } @Override // im.guobwnxjuc.ui.components.SlideView public String getHeaderName() { return LocaleController.getString("ResetAccount", R.string.ResetAccount); } /* access modifiers changed from: private */ /* access modifiers changed from: public */ private void updateTimeText() { int max = Math.max(0, this.waitTime - (ConnectionsManager.getInstance(LoginActivity.this.currentAccount).getCurrentTime() - this.startTime)); int i = max / CacheConstants.DAY; int i2 = max - (CacheConstants.DAY * i); int i3 = i2 / CacheConstants.HOUR; int i4 = (i2 - (i3 * CacheConstants.HOUR)) / 60; int i5 = max % 60; if (i != 0) { TextView textView = this.resetAccountTime; textView.setText(AndroidUtilities.replaceTags(LocaleController.formatPluralString("DaysBold", i) + " " + LocaleController.formatPluralString("HoursBold", i3) + " " + LocaleController.formatPluralString("MinutesBold", i4))); } else { TextView textView2 = this.resetAccountTime; textView2.setText(AndroidUtilities.replaceTags(LocaleController.formatPluralString("HoursBold", i3) + " " + LocaleController.formatPluralString("MinutesBold", i4) + " " + LocaleController.formatPluralString("SecondsBold", i5))); } if (max > 0) { this.resetAccountButton.setTag(Theme.key_windowBackgroundWhiteGrayText6); this.resetAccountButton.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteGrayText6)); return; } this.resetAccountButton.setTag(Theme.key_windowBackgroundWhiteRedText6); this.resetAccountButton.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteRedText6)); } @Override // im.guobwnxjuc.ui.components.SlideView public void setParams(Bundle bundle, boolean z) { if (bundle != null) { this.currentParams = bundle; this.requestPhone = bundle.getString("phoneFormated"); this.phoneHash = bundle.getString("phoneHash"); this.phoneCode = bundle.getString("code"); this.startTime = bundle.getInt("startTime"); this.waitTime = bundle.getInt("waitTime"); TextView textView = this.confirmTextView; PhoneFormat instance = PhoneFormat.getInstance(); textView.setText(AndroidUtilities.replaceTags(LocaleController.formatString("ResetAccountInfo", R.string.ResetAccountInfo, LocaleController.addNbsp(instance.format(Marker.ANY_NON_NULL_MARKER + this.requestPhone))))); updateTimeText(); AnonymousClass1 r6 = new Runnable() { /* class im.guobwnxjuc.ui.LoginActivity.LoginActivityResetWaitView.AnonymousClass1 */ public void run() { if (LoginActivityResetWaitView.this.timeRunnable == this) { LoginActivityResetWaitView.this.updateTimeText(); AndroidUtilities.runOnUIThread(LoginActivityResetWaitView.this.timeRunnable, 1000); } } }; this.timeRunnable = r6; AndroidUtilities.runOnUIThread(r6, 1000); } } @Override // im.guobwnxjuc.ui.components.SlideView public boolean onBackPressed(boolean z) { LoginActivity.this.needHideProgress(true); AndroidUtilities.cancelRunOnUIThread(this.timeRunnable); this.timeRunnable = null; this.currentParams = null; return true; } @Override // im.guobwnxjuc.ui.components.SlideView public void saveStateParams(Bundle bundle) { Bundle bundle2 = this.currentParams; if (bundle2 != null) { bundle.putBundle("resetview_params", bundle2); } } @Override // im.guobwnxjuc.ui.components.SlideView public void restoreStateParams(Bundle bundle) { Bundle bundle2 = bundle.getBundle("resetview_params"); this.currentParams = bundle2; if (bundle2 != null) { setParams(bundle2, true); } } } public class LoginActivityRecoverView extends SlideView { private TextView cancelButton; private EditTextBoldCursor codeField; private TextView confirmTextView; private Bundle currentParams; private String email_unconfirmed_pattern; private boolean nextPressed; @Override // im.guobwnxjuc.ui.components.SlideView public boolean needBackButton() { return true; } public LoginActivityRecoverView(Context context) { super(context); setOrientation(1); TextView textView = new TextView(context); this.confirmTextView = textView; textView.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteGrayText6)); this.confirmTextView.setTextSize(1, 14.0f); int i = 5; this.confirmTextView.setGravity(LocaleController.isRTL ? 5 : 3); this.confirmTextView.setLineSpacing((float) AndroidUtilities.dp(2.0f), 1.0f); this.confirmTextView.setText(LocaleController.getString("RestoreEmailSentInfo", R.string.RestoreEmailSentInfo)); addView(this.confirmTextView, LayoutHelper.createLinear(-2, -2, LocaleController.isRTL ? 5 : 3)); EditTextBoldCursor editTextBoldCursor = new EditTextBoldCursor(context); this.codeField = editTextBoldCursor; editTextBoldCursor.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteBlackText)); this.codeField.setCursorColor(Theme.getColor(Theme.key_windowBackgroundWhiteBlackText)); this.codeField.setCursorSize(AndroidUtilities.dp(20.0f)); this.codeField.setCursorWidth(1.5f); this.codeField.setHintTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteHintText)); this.codeField.setBackgroundDrawable(Theme.createEditTextDrawable(context, false)); this.codeField.setHint(LocaleController.getString("PasswordCode", R.string.PasswordCode)); this.codeField.setImeOptions(268435461); this.codeField.setTextSize(1, 18.0f); this.codeField.setMaxLines(1); this.codeField.setPadding(0, 0, 0, 0); this.codeField.setInputType(3); this.codeField.setTransformationMethod(PasswordTransformationMethod.getInstance()); this.codeField.setTypeface(Typeface.DEFAULT); this.codeField.setGravity(LocaleController.isRTL ? 5 : 3); addView(this.codeField, LayoutHelper.createLinear(-1, 36, 1, 0, 20, 0, 0)); this.codeField.setOnEditorActionListener(new TextView.OnEditorActionListener() { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$LoginActivityRecoverView$P5SzVio5eR2KgupL6brqwpYNfJs */ public final boolean onEditorAction(TextView textView, int i, KeyEvent keyEvent) { return LoginActivity.LoginActivityRecoverView.this.lambda$new$0$LoginActivity$LoginActivityRecoverView(textView, i, keyEvent); } }); TextView textView2 = new TextView(context); this.cancelButton = textView2; textView2.setGravity((LocaleController.isRTL ? 5 : 3) | 80); this.cancelButton.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteBlueText4)); this.cancelButton.setTextSize(1, 14.0f); this.cancelButton.setLineSpacing((float) AndroidUtilities.dp(2.0f), 1.0f); this.cancelButton.setPadding(0, AndroidUtilities.dp(14.0f), 0, 0); addView(this.cancelButton, LayoutHelper.createLinear(-2, -2, (!LocaleController.isRTL ? 3 : i) | 80, 0, 0, 0, 14)); this.cancelButton.setOnClickListener(new View.OnClickListener() { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$LoginActivityRecoverView$KlJFaJ0QGuFw6SsEZUQDNo0SL0 */ public final void onClick(View view) { LoginActivity.LoginActivityRecoverView.this.lambda$new$2$LoginActivity$LoginActivityRecoverView(view); } }); } public /* synthetic */ boolean lambda$new$0$LoginActivity$LoginActivityRecoverView(TextView textView, int i, KeyEvent keyEvent) { if (i != 5) { return false; } onNextPressed(); return true; } public /* synthetic */ void lambda$new$2$LoginActivity$LoginActivityRecoverView(View view) { AlertDialog.Builder builder = new AlertDialog.Builder(LoginActivity.this.getParentActivity()); builder.setMessage(LocaleController.getString("RestoreEmailTroubleText", R.string.RestoreEmailTroubleText)); builder.setTitle(LocaleController.getString("RestorePasswordNoEmailTitle", R.string.RestorePasswordNoEmailTitle)); builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), new DialogInterface.OnClickListener() { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$LoginActivityRecoverView$a_ZzF3Jj_CY7Jg0tSwns4gJZBM4 */ public final void onClick(DialogInterface dialogInterface, int i) { LoginActivity.LoginActivityRecoverView.this.lambda$null$1$LoginActivity$LoginActivityRecoverView(dialogInterface, i); } }); Dialog showDialog = LoginActivity.this.showDialog(builder.create()); if (showDialog != null) { showDialog.setCanceledOnTouchOutside(false); showDialog.setCancelable(false); } } public /* synthetic */ void lambda$null$1$LoginActivity$LoginActivityRecoverView(DialogInterface dialogInterface, int i) { LoginActivity.this.setPage(6, true, new Bundle(), true); } @Override // im.guobwnxjuc.ui.components.SlideView public void onCancelPressed() { this.nextPressed = false; } @Override // im.guobwnxjuc.ui.components.SlideView public String getHeaderName() { return LocaleController.getString("LoginPassword", R.string.LoginPassword); } @Override // im.guobwnxjuc.ui.components.SlideView public void setParams(Bundle bundle, boolean z) { if (bundle != null) { this.codeField.setText(""); this.currentParams = bundle; String string = bundle.getString("email_unconfirmed_pattern"); this.email_unconfirmed_pattern = string; this.cancelButton.setText(LocaleController.formatString("RestoreEmailTrouble", R.string.RestoreEmailTrouble, string)); AndroidUtilities.showKeyboard(this.codeField); this.codeField.requestFocus(); } } private void onPasscodeError(boolean z) { if (LoginActivity.this.getParentActivity() != null) { Vibrator vibrator = (Vibrator) LoginActivity.this.getParentActivity().getSystemService("vibrator"); if (vibrator != null) { vibrator.vibrate(200); } if (z) { this.codeField.setText(""); } AndroidUtilities.shakeView(this.confirmTextView, 2.0f, 0); } } @Override // im.guobwnxjuc.ui.components.SlideView public void onNextPressed() { if (!this.nextPressed) { if (this.codeField.getText().toString().length() == 0) { onPasscodeError(false); return; } this.nextPressed = true; String obj = this.codeField.getText().toString(); if (obj.length() == 0) { onPasscodeError(false); return; } LoginActivity.this.needShowProgress(0); TLRPC.TL_auth_recoverPassword tL_auth_recoverPassword = new TLRPC.TL_auth_recoverPassword(); tL_auth_recoverPassword.code = obj; ConnectionsManager.getInstance(LoginActivity.this.currentAccount).sendRequest(tL_auth_recoverPassword, new RequestDelegate() { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$LoginActivityRecoverView$USPeNEIyaB7bk9IIgUBStg6ACM */ @Override // im.guobwnxjuc.tgnet.RequestDelegate public final void run(TLObject tLObject, TLRPC.TL_error tL_error) { LoginActivity.LoginActivityRecoverView.this.lambda$onNextPressed$5$LoginActivity$LoginActivityRecoverView(tLObject, tL_error); } }, 10); } } public /* synthetic */ void lambda$onNextPressed$5$LoginActivity$LoginActivityRecoverView(TLObject tLObject, TLRPC.TL_error tL_error) { AndroidUtilities.runOnUIThread(new Runnable(tLObject, tL_error) { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$LoginActivityRecoverView$ddrOdjbRXYpKtCID3yAQBY24WSY */ private final /* synthetic */ TLObject f$1; private final /* synthetic */ TLRPC.TL_error f$2; { this.f$1 = r2; this.f$2 = r3; } public final void run() { LoginActivity.LoginActivityRecoverView.this.lambda$null$4$LoginActivity$LoginActivityRecoverView(this.f$1, this.f$2); } }); } public /* synthetic */ void lambda$null$4$LoginActivity$LoginActivityRecoverView(TLObject tLObject, TLRPC.TL_error tL_error) { String str; LoginActivity.this.needHideProgress(false); this.nextPressed = false; if (tLObject instanceof TLRPC.TL_auth_authorization) { AlertDialog.Builder builder = new AlertDialog.Builder(LoginActivity.this.getParentActivity()); builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), new DialogInterface.OnClickListener(tLObject) { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$LoginActivityRecoverView$1fwhgfgCJUxj2kTGLBdvtF9fqs */ private final /* synthetic */ TLObject f$1; { this.f$1 = r2; } public final void onClick(DialogInterface dialogInterface, int i) { LoginActivity.LoginActivityRecoverView.this.lambda$null$3$LoginActivity$LoginActivityRecoverView(this.f$1, dialogInterface, i); } }); builder.setMessage(LocaleController.getString("PasswordReset", R.string.PasswordReset)); builder.setTitle(LocaleController.getString("AppName", R.string.AppName)); Dialog showDialog = LoginActivity.this.showDialog(builder.create()); if (showDialog != null) { showDialog.setCanceledOnTouchOutside(false); showDialog.setCancelable(false); } } else if (tL_error.text.startsWith("CODE_INVALID")) { onPasscodeError(true); } else if (tL_error.text.startsWith("FLOOD_WAIT")) { int intValue = Utilities.parseInt(tL_error.text).intValue(); if (intValue < 60) { str = LocaleController.formatPluralString("Seconds", intValue); } else { str = LocaleController.formatPluralString("Minutes", intValue / 60); } LoginActivity.this.needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.formatString("FloodWaitTime", R.string.FloodWaitTime, str)); } else { LoginActivity.this.needShowAlert(LocaleController.getString("AppName", R.string.AppName), tL_error.text); } } public /* synthetic */ void lambda$null$3$LoginActivity$LoginActivityRecoverView(TLObject tLObject, DialogInterface dialogInterface, int i) { LoginActivity.this.onAuthSuccess((TLRPC.TL_auth_authorization) tLObject); } @Override // im.guobwnxjuc.ui.components.SlideView public boolean onBackPressed(boolean z) { LoginActivity.this.needHideProgress(true); this.currentParams = null; this.nextPressed = false; return true; } @Override // im.guobwnxjuc.ui.components.SlideView public void onShow() { super.onShow(); AndroidUtilities.runOnUIThread(new Runnable() { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$LoginActivityRecoverView$yM5q9qaUgRGw2OgUbW_dTaTbMNo */ public final void run() { LoginActivity.LoginActivityRecoverView.this.lambda$onShow$6$LoginActivity$LoginActivityRecoverView(); } }, 100); } public /* synthetic */ void lambda$onShow$6$LoginActivity$LoginActivityRecoverView() { EditTextBoldCursor editTextBoldCursor = this.codeField; if (editTextBoldCursor != null) { editTextBoldCursor.requestFocus(); EditTextBoldCursor editTextBoldCursor2 = this.codeField; editTextBoldCursor2.setSelection(editTextBoldCursor2.length()); } } @Override // im.guobwnxjuc.ui.components.SlideView public void saveStateParams(Bundle bundle) { String obj = this.codeField.getText().toString(); if (!(obj == null || obj.length() == 0)) { bundle.putString("recoveryview_code", obj); } Bundle bundle2 = this.currentParams; if (bundle2 != null) { bundle.putBundle("recoveryview_params", bundle2); } } @Override // im.guobwnxjuc.ui.components.SlideView public void restoreStateParams(Bundle bundle) { Bundle bundle2 = bundle.getBundle("recoveryview_params"); this.currentParams = bundle2; if (bundle2 != null) { setParams(bundle2, true); } String string = bundle.getString("recoveryview_code"); if (string != null) { this.codeField.setText(string); } } } public class LoginActivityRegisterView extends SlideView implements ImageUpdater.ImageUpdaterDelegate { private TLRPC.FileLocation avatar; private AnimatorSet avatarAnimation; private TLRPC.FileLocation avatarBig; private AvatarDrawable avatarDrawable; private AppCompatImageView avatarEditor; private BackupImageView avatarImage; private View avatarOverlay; private RadialProgressView avatarProgressView; private boolean createAfterUpload; private Bundle currentParams; private EditTextBoldCursor firstNameField; private ImageUpdater imageUpdater; private EditTextBoldCursor lastNameField; private boolean nextPressed = false; private String phoneCode; private String phoneHash; private TextView privacyView; private String requestPhone; private TextView textView; private TLRPC.InputFile uploadedAvatar; private TextView wrongNumber; @Override // im.guobwnxjuc.ui.components.ImageUpdater.ImageUpdaterDelegate public /* synthetic */ void didSelectPhotos(ArrayList<SendMessagesHelper.SendingMediaInfo> arrayList, boolean z, int i) { ImageUpdater.ImageUpdaterDelegate.CC.$default$didSelectPhotos(this, arrayList, z, i); } @Override // im.guobwnxjuc.ui.components.ImageUpdater.ImageUpdaterDelegate public /* synthetic */ String getInitialSearchString() { return ImageUpdater.ImageUpdaterDelegate.CC.$default$getInitialSearchString(this); } @Override // im.guobwnxjuc.ui.components.SlideView public boolean needBackButton() { return true; } public class LinkSpan extends ClickableSpan { public LinkSpan() { } public void updateDrawState(TextPaint textPaint) { super.updateDrawState(textPaint); textPaint.setUnderlineText(false); } public void onClick(View view) { LoginActivityRegisterView.this.showTermsOfService(false); } } /* access modifiers changed from: private */ /* access modifiers changed from: public */ private void showTermsOfService(boolean z) { if (LoginActivity.this.currentTermsOfService != null) { AlertDialog.Builder builder = new AlertDialog.Builder(LoginActivity.this.getParentActivity()); builder.setTitle(LocaleController.getString("TermsOfService", R.string.TermsOfService)); if (z) { builder.setPositiveButton(LocaleController.getString("Accept", R.string.Accept), new DialogInterface.OnClickListener() { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$LoginActivityRegisterView$_TAXEJ8TF6K7Lrm0XnmSgPTF21w */ public final void onClick(DialogInterface dialogInterface, int i) { LoginActivity.LoginActivityRegisterView.this.lambda$showTermsOfService$0$LoginActivity$LoginActivityRegisterView(dialogInterface, i); } }); builder.setNegativeButton(LocaleController.getString("Decline", R.string.Decline), new DialogInterface.OnClickListener() { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$LoginActivityRegisterView$lKDbPZAj5Wy03iuA6xcl2gHdKQw */ public final void onClick(DialogInterface dialogInterface, int i) { LoginActivity.LoginActivityRegisterView.this.lambda$showTermsOfService$3$LoginActivity$LoginActivityRegisterView(dialogInterface, i); } }); } else { builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), null); } SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder(LoginActivity.this.currentTermsOfService.text); MessageObject.addEntitiesToText(spannableStringBuilder, LoginActivity.this.currentTermsOfService.entities, false, 0, false, false, false); builder.setMessage(spannableStringBuilder); LoginActivity.this.showDialog(builder.create()); } } public /* synthetic */ void lambda$showTermsOfService$0$LoginActivity$LoginActivityRegisterView(DialogInterface dialogInterface, int i) { LoginActivity.this.currentTermsOfService.popup = false; onNextPressed(); } public /* synthetic */ void lambda$showTermsOfService$3$LoginActivity$LoginActivityRegisterView(DialogInterface dialogInterface, int i) { AlertDialog.Builder builder = new AlertDialog.Builder(LoginActivity.this.getParentActivity()); builder.setTitle(LocaleController.getString("TermsOfService", R.string.TermsOfService)); builder.setMessage(LocaleController.getString("TosDecline", R.string.TosDecline)); builder.setPositiveButton(LocaleController.getString("SignUp", R.string.SignUp), new DialogInterface.OnClickListener() { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$LoginActivityRegisterView$Xtd4mKBUUs6iHB_5pADk0fZIw */ public final void onClick(DialogInterface dialogInterface, int i) { LoginActivity.LoginActivityRegisterView.this.lambda$null$1$LoginActivity$LoginActivityRegisterView(dialogInterface, i); } }); builder.setNegativeButton(LocaleController.getString("Decline", R.string.Decline), new DialogInterface.OnClickListener() { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$LoginActivityRegisterView$eR7UujC0YFU2BA5qdn9EJrX2KeI */ public final void onClick(DialogInterface dialogInterface, int i) { LoginActivity.LoginActivityRegisterView.this.lambda$null$2$LoginActivity$LoginActivityRegisterView(dialogInterface, i); } }); LoginActivity.this.showDialog(builder.create()); } public /* synthetic */ void lambda$null$1$LoginActivity$LoginActivityRegisterView(DialogInterface dialogInterface, int i) { LoginActivity.this.currentTermsOfService.popup = false; onNextPressed(); } public /* synthetic */ void lambda$null$2$LoginActivity$LoginActivityRegisterView(DialogInterface dialogInterface, int i) { onBackPressed(true); LoginActivity.this.setPage(0, true, null, true); } public LoginActivityRegisterView(Context context) { super(context); setOrientation(1); ImageUpdater imageUpdater2 = new ImageUpdater(); this.imageUpdater = imageUpdater2; imageUpdater2.setSearchAvailable(false); this.imageUpdater.setUploadAfterSelect(false); this.imageUpdater.parentFragment = LoginActivity.this; this.imageUpdater.delegate = this; TextView textView2 = new TextView(context); this.textView = textView2; textView2.setText(LocaleController.getString("RegisterText2", R.string.RegisterText2)); this.textView.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteGrayText6)); this.textView.setGravity(LocaleController.isRTL ? 5 : 3); this.textView.setTextSize(1, 14.0f); addView(this.textView, LayoutHelper.createLinear(-2, -2, LocaleController.isRTL ? 5 : 3, 0, 0, 0, 0)); FrameLayout frameLayout = new FrameLayout(context); addView(frameLayout, LayoutHelper.createLinear(-1, -2, 0.0f, 21.0f, 0.0f, 0.0f)); this.avatarDrawable = new AvatarDrawable(); AnonymousClass1 r10 = new BackupImageView(context, LoginActivity.this) { /* class im.guobwnxjuc.ui.LoginActivity.LoginActivityRegisterView.AnonymousClass1 */ public void invalidate() { if (LoginActivityRegisterView.this.avatarOverlay != null) { LoginActivityRegisterView.this.avatarOverlay.invalidate(); } super.invalidate(); } public void invalidate(int i, int i2, int i3, int i4) { if (LoginActivityRegisterView.this.avatarOverlay != null) { LoginActivityRegisterView.this.avatarOverlay.invalidate(); } super.invalidate(i, i2, i3, i4); } }; this.avatarImage = r10; r10.setRoundRadius(AndroidUtilities.dp(32.0f)); this.avatarDrawable.setInfo(5, null, null); this.avatarImage.setImageDrawable(this.avatarDrawable); frameLayout.addView(this.avatarImage, LayoutHelper.createFrame(64.0f, 64.0f, (LocaleController.isRTL ? 5 : 3) | 48, 0.0f, 16.0f, 0.0f, 0.0f)); final Paint paint = new Paint(1); paint.setColor(1426063360); AnonymousClass2 r11 = new View(context, LoginActivity.this) { /* class im.guobwnxjuc.ui.LoginActivity.LoginActivityRegisterView.AnonymousClass2 */ /* access modifiers changed from: protected */ public void onDraw(Canvas canvas) { if (LoginActivityRegisterView.this.avatarImage != null && LoginActivityRegisterView.this.avatarProgressView.getVisibility() == 0) { paint.setAlpha((int) (LoginActivityRegisterView.this.avatarImage.getImageReceiver().getCurrentAlpha() * 85.0f * LoginActivityRegisterView.this.avatarProgressView.getAlpha())); canvas.drawCircle((float) (getMeasuredWidth() / 2), (float) (getMeasuredHeight() / 2), (float) AndroidUtilities.dp(32.0f), paint); } } }; this.avatarOverlay = r11; frameLayout.addView(r11, LayoutHelper.createFrame(64.0f, 64.0f, (LocaleController.isRTL ? 5 : 3) | 48, 0.0f, 16.0f, 0.0f, 0.0f)); this.avatarOverlay.setOnClickListener(new View.OnClickListener() { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$LoginActivityRegisterView$1CvRIRKWdLlR3ViTtubmd5Sb4RI */ public final void onClick(View view) { LoginActivity.LoginActivityRegisterView.this.lambda$new$5$LoginActivity$LoginActivityRegisterView(view); } }); AnonymousClass3 r102 = new AppCompatImageView(context, LoginActivity.this) { /* class im.guobwnxjuc.ui.LoginActivity.LoginActivityRegisterView.AnonymousClass3 */ public void invalidate(int i, int i2, int i3, int i4) { super.invalidate(i, i2, i3, i4); LoginActivityRegisterView.this.avatarOverlay.invalidate(); } public void invalidate() { super.invalidate(); LoginActivityRegisterView.this.avatarOverlay.invalidate(); } }; this.avatarEditor = r102; r102.setScaleType(ImageView.ScaleType.CENTER); this.avatarEditor.setImageResource(R.drawable.actions_setphoto); this.avatarEditor.setEnabled(false); this.avatarEditor.setClickable(false); this.avatarEditor.setPadding(AndroidUtilities.dp(2.0f), 0, 0, 0); frameLayout.addView(this.avatarEditor, LayoutHelper.createFrame(64.0f, 64.0f, (LocaleController.isRTL ? 5 : 3) | 48, 0.0f, 16.0f, 0.0f, 0.0f)); AnonymousClass4 r103 = new RadialProgressView(context, LoginActivity.this) { /* class im.guobwnxjuc.ui.LoginActivity.LoginActivityRegisterView.AnonymousClass4 */ @Override // im.guobwnxjuc.ui.components.RadialProgressView public void setAlpha(float f) { super.setAlpha(f); LoginActivityRegisterView.this.avatarOverlay.invalidate(); } }; this.avatarProgressView = r103; r103.setSize(AndroidUtilities.dp(30.0f)); this.avatarProgressView.setProgressColor(-1); frameLayout.addView(this.avatarProgressView, LayoutHelper.createFrame(64.0f, 64.0f, (LocaleController.isRTL ? 5 : 3) | 48, 0.0f, 16.0f, 0.0f, 0.0f)); showAvatarProgress(false, false); EditTextBoldCursor editTextBoldCursor = new EditTextBoldCursor(context); this.firstNameField = editTextBoldCursor; editTextBoldCursor.setHintTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteHintText)); this.firstNameField.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteBlackText)); this.firstNameField.setBackgroundDrawable(Theme.createEditTextDrawable(context, false)); this.firstNameField.setCursorColor(Theme.getColor(Theme.key_windowBackgroundWhiteBlackText)); this.firstNameField.setCursorSize(AndroidUtilities.dp(20.0f)); this.firstNameField.setCursorWidth(1.5f); this.firstNameField.setHint(LocaleController.getString("Name2", R.string.Name2)); this.firstNameField.setImeOptions(268435461); this.firstNameField.setTextSize(1, 17.0f); this.firstNameField.setMaxLines(1); this.firstNameField.setInputType(8192); this.firstNameField.setFilters(new InputFilter[]{new InputFilter.LengthFilter(64)}); frameLayout.addView(this.firstNameField, LayoutHelper.createFrame(-1.0f, 36.0f, (LocaleController.isRTL ? 5 : 3) | 48, LocaleController.isRTL ? 0.0f : 85.0f, 0.0f, LocaleController.isRTL ? 85.0f : 0.0f, 0.0f)); this.firstNameField.setOnEditorActionListener(new TextView.OnEditorActionListener() { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$LoginActivityRegisterView$RGFcVrc6iEsD2elyKCw7Zr5bmS4 */ public final boolean onEditorAction(TextView textView, int i, KeyEvent keyEvent) { return LoginActivity.LoginActivityRegisterView.this.lambda$new$6$LoginActivity$LoginActivityRegisterView(textView, i, keyEvent); } }); EditTextBoldCursor editTextBoldCursor2 = new EditTextBoldCursor(context); this.lastNameField = editTextBoldCursor2; editTextBoldCursor2.setHint(LocaleController.getString("Nickname", R.string.Nickname)); this.lastNameField.setHintTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteHintText)); this.lastNameField.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteBlackText)); this.lastNameField.setBackgroundDrawable(Theme.createEditTextDrawable(context, false)); this.lastNameField.setCursorColor(Theme.getColor(Theme.key_windowBackgroundWhiteBlackText)); this.lastNameField.setCursorSize(AndroidUtilities.dp(20.0f)); this.lastNameField.setCursorWidth(1.5f); this.lastNameField.setImeOptions(268435462); this.lastNameField.setTextSize(1, 17.0f); this.lastNameField.setMaxLines(1); this.lastNameField.setInputType(8192); this.lastNameField.setFilters(new InputFilter[]{new InputFilter.LengthFilter(64)}); frameLayout.addView(this.lastNameField, LayoutHelper.createFrame(-1.0f, 36.0f, (LocaleController.isRTL ? 5 : 3) | 48, LocaleController.isRTL ? 0.0f : 85.0f, 51.0f, LocaleController.isRTL ? 85.0f : 0.0f, 0.0f)); this.lastNameField.setOnEditorActionListener(new TextView.OnEditorActionListener() { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$LoginActivityRegisterView$WkPdwjsdi3yhtiEj8ZgssFKEtZ0 */ public final boolean onEditorAction(TextView textView, int i, KeyEvent keyEvent) { return LoginActivity.LoginActivityRegisterView.this.lambda$new$7$LoginActivity$LoginActivityRegisterView(textView, i, keyEvent); } }); TextView textView3 = new TextView(context); this.wrongNumber = textView3; textView3.setText(LocaleController.getString("CancelRegistration", R.string.CancelRegistration)); this.wrongNumber.setGravity((LocaleController.isRTL ? 5 : 3) | 1); this.wrongNumber.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteBlueText4)); this.wrongNumber.setTextSize(1, 14.0f); this.wrongNumber.setLineSpacing((float) AndroidUtilities.dp(2.0f), 1.0f); this.wrongNumber.setPadding(0, AndroidUtilities.dp(24.0f), 0, 0); this.wrongNumber.setVisibility(8); addView(this.wrongNumber, LayoutHelper.createLinear(-2, -2, (LocaleController.isRTL ? 5 : 3) | 48, 0, 20, 0, 0)); this.wrongNumber.setOnClickListener(new View.OnClickListener() { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$LoginActivityRegisterView$FFftRrRi3MrzNJyMs8fdcKSuzVQ */ public final void onClick(View view) { LoginActivity.LoginActivityRegisterView.this.lambda$new$8$LoginActivity$LoginActivityRegisterView(view); } }); TextView textView4 = new TextView(context); this.privacyView = textView4; textView4.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteGrayText6)); this.privacyView.setMovementMethod(new AndroidUtilities.LinkMovementMethodMy()); this.privacyView.setLinkTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteLinkText)); this.privacyView.setTextSize(1, 14.0f); this.privacyView.setGravity(81); this.privacyView.setLineSpacing((float) AndroidUtilities.dp(2.0f), 1.0f); addView(this.privacyView, LayoutHelper.createLinear(-2, -1, 81, 0, 28, 0, 16)); String string = LocaleController.getString("TermsOfServiceLogin", R.string.TermsOfServiceLogin); SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder(string); int indexOf = string.indexOf(42); int lastIndexOf = string.lastIndexOf(42); if (!(indexOf == -1 || lastIndexOf == -1 || indexOf == lastIndexOf)) { spannableStringBuilder.replace(lastIndexOf, lastIndexOf + 1, (CharSequence) ""); spannableStringBuilder.replace(indexOf, indexOf + 1, (CharSequence) ""); spannableStringBuilder.setSpan(new LinkSpan(), indexOf, lastIndexOf - 1, 33); } this.privacyView.setText(spannableStringBuilder); } public /* synthetic */ void lambda$new$5$LoginActivity$LoginActivityRegisterView(View view) { this.imageUpdater.openMenu(this.avatar != null, new Runnable() { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$LoginActivityRegisterView$oVXU2oY3NrceeA4lwnd57QWFBYs */ public final void run() { LoginActivity.LoginActivityRegisterView.this.lambda$null$4$LoginActivity$LoginActivityRegisterView(); } }); } public /* synthetic */ void lambda$null$4$LoginActivity$LoginActivityRegisterView() { this.avatar = null; this.avatarBig = null; this.uploadedAvatar = null; showAvatarProgress(false, true); this.avatarImage.setImage((ImageLocation) null, (String) null, this.avatarDrawable, (Object) null); this.avatarEditor.setImageResource(R.drawable.actions_setphoto); } public /* synthetic */ boolean lambda$new$6$LoginActivity$LoginActivityRegisterView(TextView textView2, int i, KeyEvent keyEvent) { if (i != 5) { return false; } this.lastNameField.requestFocus(); return true; } public /* synthetic */ boolean lambda$new$7$LoginActivity$LoginActivityRegisterView(TextView textView2, int i, KeyEvent keyEvent) { if (i != 6 && i != 5) { return false; } onNextPressed(); return true; } public /* synthetic */ void lambda$new$8$LoginActivity$LoginActivityRegisterView(View view) { if (LoginActivity.this.doneProgressView.getTag() == null) { onBackPressed(false); } } @Override // im.guobwnxjuc.ui.components.ImageUpdater.ImageUpdaterDelegate public void didUploadPhoto(TLRPC.InputFile inputFile, TLRPC.PhotoSize photoSize, TLRPC.PhotoSize photoSize2) { AndroidUtilities.runOnUIThread(new Runnable(photoSize2, photoSize) { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$LoginActivityRegisterView$C22UU8aXw77BNruPsS5LOYipk5c */ private final /* synthetic */ TLRPC.PhotoSize f$1; private final /* synthetic */ TLRPC.PhotoSize f$2; { this.f$1 = r2; this.f$2 = r3; } public final void run() { LoginActivity.LoginActivityRegisterView.this.lambda$didUploadPhoto$9$LoginActivity$LoginActivityRegisterView(this.f$1, this.f$2); } }); } public /* synthetic */ void lambda$didUploadPhoto$9$LoginActivity$LoginActivityRegisterView(TLRPC.PhotoSize photoSize, TLRPC.PhotoSize photoSize2) { this.avatar = photoSize.location; this.avatarBig = photoSize2.location; this.avatarImage.setImage(ImageLocation.getForLocal(this.avatar), "50_50", this.avatarDrawable, (Object) null); } private void showAvatarProgress(final boolean z, boolean z2) { if (this.avatarEditor != null) { AnimatorSet animatorSet = this.avatarAnimation; if (animatorSet != null) { animatorSet.cancel(); this.avatarAnimation = null; } if (z2) { this.avatarAnimation = new AnimatorSet(); if (z) { this.avatarProgressView.setVisibility(0); this.avatarAnimation.playTogether(ObjectAnimator.ofFloat(this.avatarEditor, View.ALPHA, 0.0f), ObjectAnimator.ofFloat(this.avatarProgressView, View.ALPHA, 1.0f)); } else { this.avatarEditor.setVisibility(0); this.avatarAnimation.playTogether(ObjectAnimator.ofFloat(this.avatarEditor, View.ALPHA, 1.0f), ObjectAnimator.ofFloat(this.avatarProgressView, View.ALPHA, 0.0f)); } this.avatarAnimation.setDuration(180L); this.avatarAnimation.addListener(new AnimatorListenerAdapter() { /* class im.guobwnxjuc.ui.LoginActivity.LoginActivityRegisterView.AnonymousClass5 */ public void onAnimationEnd(Animator animator) { if (LoginActivityRegisterView.this.avatarAnimation != null && LoginActivityRegisterView.this.avatarEditor != null) { if (z) { LoginActivityRegisterView.this.avatarEditor.setVisibility(4); } else { LoginActivityRegisterView.this.avatarProgressView.setVisibility(4); } LoginActivityRegisterView.this.avatarAnimation = null; } } public void onAnimationCancel(Animator animator) { LoginActivityRegisterView.this.avatarAnimation = null; } }); this.avatarAnimation.start(); } else if (z) { this.avatarEditor.setAlpha(1.0f); this.avatarEditor.setVisibility(4); this.avatarProgressView.setAlpha(1.0f); this.avatarProgressView.setVisibility(0); } else { this.avatarEditor.setAlpha(1.0f); this.avatarEditor.setVisibility(0); this.avatarProgressView.setAlpha(0.0f); this.avatarProgressView.setVisibility(4); } } } @Override // im.guobwnxjuc.ui.components.SlideView public boolean onBackPressed(boolean z) { if (!z) { AlertDialog.Builder builder = new AlertDialog.Builder(LoginActivity.this.getParentActivity()); builder.setTitle(LocaleController.getString("AppName", R.string.AppName)); builder.setMessage(LocaleController.getString("AreYouSureRegistration", R.string.AreYouSureRegistration)); builder.setNegativeButton(LocaleController.getString("Stop", R.string.Stop), new DialogInterface.OnClickListener() { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$LoginActivityRegisterView$0DvlgPZ1mh8tghau2wvcr8dnsP4 */ public final void onClick(DialogInterface dialogInterface, int i) { LoginActivity.LoginActivityRegisterView.this.lambda$onBackPressed$10$LoginActivity$LoginActivityRegisterView(dialogInterface, i); } }); builder.setPositiveButton(LocaleController.getString("Continue", R.string.Continue), null); LoginActivity.this.showDialog(builder.create()); return false; } LoginActivity.this.needHideProgress(true); this.nextPressed = false; this.currentParams = null; return true; } public /* synthetic */ void lambda$onBackPressed$10$LoginActivity$LoginActivityRegisterView(DialogInterface dialogInterface, int i) { onBackPressed(true); LoginActivity.this.setPage(0, true, null, true); } @Override // im.guobwnxjuc.ui.components.SlideView public String getHeaderName() { return LocaleController.getString("YourName", R.string.YourName); } @Override // im.guobwnxjuc.ui.components.SlideView public void onCancelPressed() { this.nextPressed = false; } @Override // im.guobwnxjuc.ui.components.SlideView public void onShow() { super.onShow(); AndroidUtilities.runOnUIThread(new Runnable() { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$LoginActivityRegisterView$JTbkvhNmhBvuQVAxO_khyI7gsCo */ public final void run() { LoginActivity.LoginActivityRegisterView.this.lambda$onShow$11$LoginActivity$LoginActivityRegisterView(); } }, 100); } public /* synthetic */ void lambda$onShow$11$LoginActivity$LoginActivityRegisterView() { EditTextBoldCursor editTextBoldCursor = this.firstNameField; if (editTextBoldCursor != null) { editTextBoldCursor.requestFocus(); EditTextBoldCursor editTextBoldCursor2 = this.firstNameField; editTextBoldCursor2.setSelection(editTextBoldCursor2.length()); } } @Override // im.guobwnxjuc.ui.components.SlideView public void setParams(Bundle bundle, boolean z) { if (bundle != null) { this.firstNameField.setText(""); this.lastNameField.setText(""); this.requestPhone = bundle.getString("phoneFormated"); this.phoneHash = bundle.getString("phoneHash"); this.phoneCode = bundle.getString("code"); this.currentParams = bundle; } } @Override // im.guobwnxjuc.ui.components.SlideView public void onNextPressed() { if (!this.nextPressed) { if (LoginActivity.this.currentTermsOfService == null || !LoginActivity.this.currentTermsOfService.popup) { this.nextPressed = true; TLRPC.TL_auth_signUp tL_auth_signUp = new TLRPC.TL_auth_signUp(); tL_auth_signUp.phone_code_hash = this.phoneHash; tL_auth_signUp.phone_number = this.requestPhone; tL_auth_signUp.first_name = this.firstNameField.getText().toString(); tL_auth_signUp.last_name = this.lastNameField.getText().toString(); LoginActivity.this.needShowProgress(0); ConnectionsManager.getInstance(LoginActivity.this.currentAccount).sendRequest(tL_auth_signUp, new RequestDelegate() { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$LoginActivityRegisterView$gmCZD_wcB4lG9LsW7p6u07k4ui8 */ @Override // im.guobwnxjuc.tgnet.RequestDelegate public final void run(TLObject tLObject, TLRPC.TL_error tL_error) { LoginActivity.LoginActivityRegisterView.this.lambda$onNextPressed$13$LoginActivity$LoginActivityRegisterView(tLObject, tL_error); } }, 10); return; } showTermsOfService(true); } } public /* synthetic */ void lambda$onNextPressed$13$LoginActivity$LoginActivityRegisterView(TLObject tLObject, TLRPC.TL_error tL_error) { AndroidUtilities.runOnUIThread(new Runnable(tLObject, tL_error) { /* class im.guobwnxjuc.ui.$$Lambda$LoginActivity$LoginActivityRegisterView$SO0ktdupNMQendQt78IhdBP8D7w */ private final /* synthetic */ TLObject f$1; private final /* synthetic */ TLRPC.TL_error f$2; { this.f$1 = r2; this.f$2 = r3; } public final void run() { LoginActivity.LoginActivityRegisterView.this.lambda$null$12$LoginActivity$LoginActivityRegisterView(this.f$1, this.f$2); } }); } public /* synthetic */ void lambda$null$12$LoginActivity$LoginActivityRegisterView(TLObject tLObject, TLRPC.TL_error tL_error) { this.nextPressed = false; LoginActivity.this.needHideProgress(false); if (tLObject instanceof TLRPC.TL_auth_authorization) { LoginActivity.this.onAuthSuccess((TLRPC.TL_auth_authorization) tLObject); if (this.avatarBig != null) { MessagesController.getInstance(LoginActivity.this.currentAccount).uploadAndApplyUserAvatar(this.avatarBig); } } else if (TextUtils.isEmpty(this.firstNameField.getText().toString().trim())) { LoginActivity.this.needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.getString("EmptyNameTips", R.string.EmptyNameTips)); } else if (tL_error.text.contains("PHONE_NUMBER_INVALID")) { LoginActivity.this.needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.getString("InvalidPhoneNumber", R.string.InvalidPhoneNumber)); } else if (tL_error.text.contains("PHONE_CODE_EMPTY") || tL_error.text.contains("PHONE_CODE_INVALID")) { LoginActivity.this.needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.getString("InvalidCode", R.string.InvalidCode)); } else if (tL_error.text.contains("PHONE_CODE_EXPIRED")) { LoginActivity.this.needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.getString("CodeExpired", R.string.CodeExpired)); } else if (tL_error.text.contains("FIRSTNAME_INVALID")) { LoginActivity.this.needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.getString("InvalidName", R.string.InvalidName)); } else if (tL_error.text.contains("LASTNAME_INVALID")) { LoginActivity.this.needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.getString("InvalidNickname", R.string.InvalidNickname)); } else if (tL_error.text.contains("FIRSTNAME_LASTNAME_EMPTY")) { LoginActivity.this.needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.getString("EmptyNameTips", R.string.EmptyNameTips)); } else { LoginActivity.this.needShowAlert(LocaleController.getString("AppName", R.string.AppName), tL_error.text); } } @Override // im.guobwnxjuc.ui.components.SlideView public void saveStateParams(Bundle bundle) { String obj = this.firstNameField.getText().toString(); if (obj.length() != 0) { bundle.putString("registerview_first", obj); } String obj2 = this.lastNameField.getText().toString(); if (obj2.length() != 0) { bundle.putString("registerview_last", obj2); } if (LoginActivity.this.currentTermsOfService != null) { SerializedData serializedData = new SerializedData(LoginActivity.this.currentTermsOfService.getObjectSize()); LoginActivity.this.currentTermsOfService.serializeToStream(serializedData); bundle.putString("terms", Base64.encodeToString(serializedData.toByteArray(), 0)); serializedData.cleanup(); } Bundle bundle2 = this.currentParams; if (bundle2 != null) { bundle.putBundle("registerview_params", bundle2); } } @Override // im.guobwnxjuc.ui.components.SlideView public void restoreStateParams(Bundle bundle) { byte[] decode; Bundle bundle2 = bundle.getBundle("registerview_params"); this.currentParams = bundle2; if (bundle2 != null) { setParams(bundle2, true); } try { String string = bundle.getString("terms"); if (!(string == null || (decode = Base64.decode(string, 0)) == null)) { SerializedData serializedData = new SerializedData(decode); LoginActivity.this.currentTermsOfService = TLRPC.TL_help_termsOfService.TLdeserialize(serializedData, serializedData.readInt32(false), false); serializedData.cleanup(); } } catch (Exception e) { FileLog.e(e); } String string2 = bundle.getString("registerview_first"); if (string2 != null) { this.firstNameField.setText(string2); } String string3 = bundle.getString("registerview_last"); if (string3 != null) { this.lastNameField.setText(string3); } } } @Override // im.guobwnxjuc.ui.actionbar.BaseFragment public ThemeDescription[] getThemeDescriptions() { int i = 0; while (true) { SlideView[] slideViewArr = this.views; if (i >= slideViewArr.length) { PhoneView phoneView = (PhoneView) slideViewArr[0]; LoginActivitySmsView loginActivitySmsView = (LoginActivitySmsView) slideViewArr[1]; LoginActivitySmsView loginActivitySmsView2 = (LoginActivitySmsView) slideViewArr[2]; LoginActivitySmsView loginActivitySmsView3 = (LoginActivitySmsView) slideViewArr[3]; LoginActivitySmsView loginActivitySmsView4 = (LoginActivitySmsView) slideViewArr[4]; LoginActivityRegisterView loginActivityRegisterView = (LoginActivityRegisterView) slideViewArr[5]; LoginActivityPasswordView loginActivityPasswordView = (LoginActivityPasswordView) slideViewArr[6]; LoginActivityRecoverView loginActivityRecoverView = (LoginActivityRecoverView) slideViewArr[7]; LoginActivityResetWaitView loginActivityResetWaitView = (LoginActivityResetWaitView) slideViewArr[8]; ArrayList arrayList = new ArrayList(); arrayList.add(new ThemeDescription(this.fragmentView, ThemeDescription.FLAG_BACKGROUND, null, null, null, null, Theme.key_windowBackgroundWhite)); arrayList.add(new ThemeDescription(this.actionBar, ThemeDescription.FLAG_BACKGROUND, null, null, null, null, Theme.key_actionBarDefault)); arrayList.add(new ThemeDescription(this.fragmentView, ThemeDescription.FLAG_LISTGLOWCOLOR, null, null, null, null, Theme.key_actionBarDefault)); arrayList.add(new ThemeDescription(this.actionBar, ThemeDescription.FLAG_AB_ITEMSCOLOR, null, null, null, null, Theme.key_actionBarDefaultIcon)); arrayList.add(new ThemeDescription(this.actionBar, ThemeDescription.FLAG_AB_TITLECOLOR, null, null, null, null, Theme.key_actionBarDefaultTitle)); arrayList.add(new ThemeDescription(this.actionBar, ThemeDescription.FLAG_AB_SELECTORCOLOR, null, null, null, null, Theme.key_actionBarDefaultSelector)); arrayList.add(new ThemeDescription(phoneView.countryButton, ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteBlackText)); arrayList.add(new ThemeDescription(phoneView.view, ThemeDescription.FLAG_BACKGROUND, null, null, null, null, Theme.key_windowBackgroundWhiteGrayLine)); arrayList.add(new ThemeDescription(phoneView.textView, ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteBlackText)); arrayList.add(new ThemeDescription(phoneView.codeField, ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteBlackText)); arrayList.add(new ThemeDescription(phoneView.codeField, ThemeDescription.FLAG_BACKGROUNDFILTER, null, null, null, null, Theme.key_windowBackgroundWhiteInputField)); arrayList.add(new ThemeDescription(phoneView.codeField, ThemeDescription.FLAG_BACKGROUNDFILTER | ThemeDescription.FLAG_DRAWABLESELECTEDSTATE, null, null, null, null, Theme.key_windowBackgroundWhiteInputFieldActivated)); arrayList.add(new ThemeDescription(phoneView.phoneField, ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteBlackText)); arrayList.add(new ThemeDescription(phoneView.phoneField, ThemeDescription.FLAG_HINTTEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteHintText)); arrayList.add(new ThemeDescription(phoneView.phoneField, ThemeDescription.FLAG_BACKGROUNDFILTER, null, null, null, null, Theme.key_windowBackgroundWhiteInputField)); arrayList.add(new ThemeDescription(phoneView.phoneField, ThemeDescription.FLAG_BACKGROUNDFILTER | ThemeDescription.FLAG_DRAWABLESELECTEDSTATE, null, null, null, null, Theme.key_windowBackgroundWhiteInputFieldActivated)); arrayList.add(new ThemeDescription(phoneView.textView2, ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteGrayText6)); arrayList.add(new ThemeDescription(loginActivityPasswordView.confirmTextView, ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteGrayText6)); arrayList.add(new ThemeDescription(loginActivityPasswordView.codeField, ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteBlackText)); arrayList.add(new ThemeDescription(loginActivityPasswordView.codeField, ThemeDescription.FLAG_HINTTEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteHintText)); arrayList.add(new ThemeDescription(loginActivityPasswordView.codeField, ThemeDescription.FLAG_BACKGROUNDFILTER, null, null, null, null, Theme.key_windowBackgroundWhiteInputField)); arrayList.add(new ThemeDescription(loginActivityPasswordView.codeField, ThemeDescription.FLAG_BACKGROUNDFILTER | ThemeDescription.FLAG_DRAWABLESELECTEDSTATE, null, null, null, null, Theme.key_windowBackgroundWhiteInputFieldActivated)); arrayList.add(new ThemeDescription(loginActivityPasswordView.cancelButton, ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteBlueText4)); arrayList.add(new ThemeDescription(loginActivityPasswordView.resetAccountButton, ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteRedText6)); arrayList.add(new ThemeDescription(loginActivityPasswordView.resetAccountText, ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteGrayText6)); arrayList.add(new ThemeDescription(loginActivityRegisterView.textView, ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteGrayText6)); arrayList.add(new ThemeDescription(loginActivityRegisterView.firstNameField, ThemeDescription.FLAG_HINTTEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteHintText)); arrayList.add(new ThemeDescription(loginActivityRegisterView.firstNameField, ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteBlackText)); arrayList.add(new ThemeDescription(loginActivityRegisterView.firstNameField, ThemeDescription.FLAG_BACKGROUNDFILTER, null, null, null, null, Theme.key_windowBackgroundWhiteInputField)); arrayList.add(new ThemeDescription(loginActivityRegisterView.firstNameField, ThemeDescription.FLAG_BACKGROUNDFILTER | ThemeDescription.FLAG_DRAWABLESELECTEDSTATE, null, null, null, null, Theme.key_windowBackgroundWhiteInputFieldActivated)); arrayList.add(new ThemeDescription(loginActivityRegisterView.lastNameField, ThemeDescription.FLAG_HINTTEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteHintText)); arrayList.add(new ThemeDescription(loginActivityRegisterView.lastNameField, ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteBlackText)); arrayList.add(new ThemeDescription(loginActivityRegisterView.lastNameField, ThemeDescription.FLAG_BACKGROUNDFILTER, null, null, null, null, Theme.key_windowBackgroundWhiteInputField)); arrayList.add(new ThemeDescription(loginActivityRegisterView.lastNameField, ThemeDescription.FLAG_BACKGROUNDFILTER | ThemeDescription.FLAG_DRAWABLESELECTEDSTATE, null, null, null, null, Theme.key_windowBackgroundWhiteInputFieldActivated)); arrayList.add(new ThemeDescription(loginActivityRegisterView.wrongNumber, ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteBlueText4)); arrayList.add(new ThemeDescription(loginActivityRegisterView.privacyView, ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteGrayText6)); arrayList.add(new ThemeDescription(loginActivityRegisterView.privacyView, ThemeDescription.FLAG_LINKCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteLinkText)); arrayList.add(new ThemeDescription(loginActivityRecoverView.confirmTextView, ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteGrayText6)); arrayList.add(new ThemeDescription(loginActivityRecoverView.codeField, ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteBlackText)); arrayList.add(new ThemeDescription(loginActivityRecoverView.codeField, ThemeDescription.FLAG_HINTTEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteHintText)); arrayList.add(new ThemeDescription(loginActivityRecoverView.codeField, ThemeDescription.FLAG_BACKGROUNDFILTER, null, null, null, null, Theme.key_windowBackgroundWhiteInputField)); arrayList.add(new ThemeDescription(loginActivityRecoverView.codeField, ThemeDescription.FLAG_BACKGROUNDFILTER | ThemeDescription.FLAG_DRAWABLESELECTEDSTATE, null, null, null, null, Theme.key_windowBackgroundWhiteInputFieldActivated)); arrayList.add(new ThemeDescription(loginActivityRecoverView.cancelButton, ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteBlueText4)); arrayList.add(new ThemeDescription(loginActivityResetWaitView.confirmTextView, ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteGrayText6)); arrayList.add(new ThemeDescription(loginActivityResetWaitView.resetAccountText, ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteGrayText6)); arrayList.add(new ThemeDescription(loginActivityResetWaitView.resetAccountTime, ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteGrayText6)); arrayList.add(new ThemeDescription(loginActivityResetWaitView.resetAccountButton, ThemeDescription.FLAG_TEXTCOLOR | ThemeDescription.FLAG_CHECKTAG, null, null, null, null, Theme.key_windowBackgroundWhiteGrayText6)); arrayList.add(new ThemeDescription(loginActivityResetWaitView.resetAccountButton, ThemeDescription.FLAG_TEXTCOLOR | ThemeDescription.FLAG_CHECKTAG, null, null, null, null, Theme.key_windowBackgroundWhiteRedText6)); arrayList.add(new ThemeDescription(loginActivitySmsView.confirmTextView, ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteGrayText6)); arrayList.add(new ThemeDescription(loginActivitySmsView.titleTextView, ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteBlackText)); if (loginActivitySmsView.codeField != null) { for (int i2 = 0; i2 < loginActivitySmsView.codeField.length; i2++) { arrayList.add(new ThemeDescription(loginActivitySmsView.codeField[i2], ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteBlackText)); arrayList.add(new ThemeDescription(loginActivitySmsView.codeField[i2], ThemeDescription.FLAG_BACKGROUNDFILTER, null, null, null, null, Theme.key_windowBackgroundWhiteInputFieldActivated)); } } arrayList.add(new ThemeDescription(loginActivitySmsView.timeText, ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteGrayText6)); arrayList.add(new ThemeDescription(loginActivitySmsView.problemText, ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteBlueText4)); arrayList.add(new ThemeDescription(loginActivitySmsView.progressView, 0, new Class[]{ProgressView.class}, new String[]{"paint"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, Theme.key_login_progressInner)); arrayList.add(new ThemeDescription(loginActivitySmsView.progressView, 0, new Class[]{ProgressView.class}, new String[]{"paint"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, Theme.key_login_progressOuter)); arrayList.add(new ThemeDescription(loginActivitySmsView.blackImageView, ThemeDescription.FLAG_IMAGECOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteBlackText)); arrayList.add(new ThemeDescription(loginActivitySmsView.blueImageView, ThemeDescription.FLAG_IMAGECOLOR, null, null, null, null, Theme.key_chats_actionBackground)); arrayList.add(new ThemeDescription(loginActivitySmsView2.confirmTextView, ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteGrayText6)); arrayList.add(new ThemeDescription(loginActivitySmsView2.titleTextView, ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteBlackText)); if (loginActivitySmsView2.codeField != null) { for (int i3 = 0; i3 < loginActivitySmsView2.codeField.length; i3++) { arrayList.add(new ThemeDescription(loginActivitySmsView2.codeField[i3], ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteBlackText)); arrayList.add(new ThemeDescription(loginActivitySmsView2.codeField[i3], ThemeDescription.FLAG_BACKGROUNDFILTER, null, null, null, null, Theme.key_windowBackgroundWhiteInputFieldActivated)); } } arrayList.add(new ThemeDescription(loginActivitySmsView2.timeText, ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteGrayText6)); arrayList.add(new ThemeDescription(loginActivitySmsView2.problemText, ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteBlueText4)); arrayList.add(new ThemeDescription(loginActivitySmsView2.progressView, 0, new Class[]{ProgressView.class}, new String[]{"paint"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, Theme.key_login_progressInner)); arrayList.add(new ThemeDescription(loginActivitySmsView2.progressView, 0, new Class[]{ProgressView.class}, new String[]{"paint"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, Theme.key_login_progressOuter)); arrayList.add(new ThemeDescription(loginActivitySmsView2.blackImageView, ThemeDescription.FLAG_IMAGECOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteBlackText)); arrayList.add(new ThemeDescription(loginActivitySmsView2.blueImageView, ThemeDescription.FLAG_IMAGECOLOR, null, null, null, null, Theme.key_chats_actionBackground)); arrayList.add(new ThemeDescription(loginActivitySmsView3.confirmTextView, ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteGrayText6)); arrayList.add(new ThemeDescription(loginActivitySmsView3.titleTextView, ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteBlackText)); if (loginActivitySmsView3.codeField != null) { for (int i4 = 0; i4 < loginActivitySmsView3.codeField.length; i4++) { arrayList.add(new ThemeDescription(loginActivitySmsView3.codeField[i4], ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteBlackText)); arrayList.add(new ThemeDescription(loginActivitySmsView3.codeField[i4], ThemeDescription.FLAG_BACKGROUNDFILTER, null, null, null, null, Theme.key_windowBackgroundWhiteInputFieldActivated)); } } arrayList.add(new ThemeDescription(loginActivitySmsView3.timeText, ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteGrayText6)); arrayList.add(new ThemeDescription(loginActivitySmsView3.problemText, ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteBlueText4)); arrayList.add(new ThemeDescription(loginActivitySmsView3.progressView, 0, new Class[]{ProgressView.class}, new String[]{"paint"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, Theme.key_login_progressInner)); arrayList.add(new ThemeDescription(loginActivitySmsView3.progressView, 0, new Class[]{ProgressView.class}, new String[]{"paint"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, Theme.key_login_progressOuter)); arrayList.add(new ThemeDescription(loginActivitySmsView3.blackImageView, ThemeDescription.FLAG_IMAGECOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteBlackText)); arrayList.add(new ThemeDescription(loginActivitySmsView3.blueImageView, ThemeDescription.FLAG_IMAGECOLOR, null, null, null, null, Theme.key_chats_actionBackground)); arrayList.add(new ThemeDescription(loginActivitySmsView4.confirmTextView, ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteGrayText6)); arrayList.add(new ThemeDescription(loginActivitySmsView4.titleTextView, ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteBlackText)); if (loginActivitySmsView4.codeField != null) { for (int i5 = 0; i5 < loginActivitySmsView4.codeField.length; i5++) { arrayList.add(new ThemeDescription(loginActivitySmsView4.codeField[i5], ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteBlackText)); arrayList.add(new ThemeDescription(loginActivitySmsView4.codeField[i5], ThemeDescription.FLAG_BACKGROUNDFILTER, null, null, null, null, Theme.key_windowBackgroundWhiteInputFieldActivated)); } } arrayList.add(new ThemeDescription(loginActivitySmsView4.timeText, ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteGrayText6)); arrayList.add(new ThemeDescription(loginActivitySmsView4.problemText, ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteBlueText4)); arrayList.add(new ThemeDescription(loginActivitySmsView4.progressView, 0, new Class[]{ProgressView.class}, new String[]{"paint"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, Theme.key_login_progressInner)); arrayList.add(new ThemeDescription(loginActivitySmsView4.progressView, 0, new Class[]{ProgressView.class}, new String[]{"paint"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, Theme.key_login_progressOuter)); arrayList.add(new ThemeDescription(loginActivitySmsView4.blackImageView, ThemeDescription.FLAG_IMAGECOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteBlackText)); arrayList.add(new ThemeDescription(loginActivitySmsView4.blueImageView, ThemeDescription.FLAG_IMAGECOLOR, null, null, null, null, Theme.key_chats_actionBackground)); return (ThemeDescription[]) arrayList.toArray(new ThemeDescription[0]); } else if (slideViewArr[i] == null) { return new ThemeDescription[0]; } else { i++; } } } }