♬♬ v1.0.0版本的 MD5 值为:04cc17073568ba22bfb83ea139fbe521
以下内容为反编译后的 CancelAccountDeletionActivity.java 源代码,内容仅作参考
package im.wgogsutsuz.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.drawable.Drawable;
import android.os.Build;
import android.os.Bundle;
import android.telephony.PhoneNumberUtils;
import android.telephony.TelephonyManager;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.view.KeyEvent;
import android.view.View;
import android.view.animation.AccelerateDecelerateInterpolator;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ScrollView;
import android.widget.TextView;
import androidx.recyclerview.widget.ItemTouchHelper;
import com.blankj.utilcode.constant.TimeConstants;
import im.wgogsutsuz.messenger.AndroidUtilities;
import im.wgogsutsuz.messenger.ApplicationLoader;
import im.wgogsutsuz.messenger.BuildVars;
import im.wgogsutsuz.messenger.FileLog;
import im.wgogsutsuz.messenger.LocaleController;
import im.wgogsutsuz.messenger.NotificationCenter;
import im.wgogsutsuz.messenger.R;
import im.wgogsutsuz.phoneformat.PhoneFormat;
import im.wgogsutsuz.tgnet.ConnectionsManager;
import im.wgogsutsuz.tgnet.RequestDelegate;
import im.wgogsutsuz.tgnet.TLObject;
import im.wgogsutsuz.tgnet.TLRPC;
import im.wgogsutsuz.ui.CancelAccountDeletionActivity;
import im.wgogsutsuz.ui.actionbar.ActionBar;
import im.wgogsutsuz.ui.actionbar.ActionBarMenu;
import im.wgogsutsuz.ui.actionbar.ActionBarMenuItem;
import im.wgogsutsuz.ui.actionbar.AlertDialog;
import im.wgogsutsuz.ui.actionbar.BaseFragment;
import im.wgogsutsuz.ui.actionbar.Theme;
import im.wgogsutsuz.ui.actionbar.ThemeDescription;
import im.wgogsutsuz.ui.components.AlertsCreator;
import im.wgogsutsuz.ui.components.EditTextBoldCursor;
import im.wgogsutsuz.ui.components.LayoutHelper;
import im.wgogsutsuz.ui.components.RadialProgressView;
import im.wgogsutsuz.ui.components.SlideView;
import java.util.ArrayList;
import java.util.Locale;
import java.util.Timer;
import java.util.TimerTask;
import obfuse.NPStringFog;
public class CancelAccountDeletionActivity extends BaseFragment {
private static final int done_button = 1;
private boolean checkPermissions;
private int currentViewNum;
private View doneButton;
private Dialog errorDialog;
private String hash;
private Dialog permissionsDialog;
private ArrayList<String> permissionsItems;
private String phone;
private AlertDialog progressDialog;
private int scrollHeight;
private SlideView[] views;
private class ProgressView extends View {
private Paint paint;
private Paint paint2;
private float progress;
public ProgressView(Context context) {
super(context);
this.paint = new Paint();
this.paint2 = new Paint();
this.paint.setColor(Theme.getColor(NPStringFog.decode("5D5E56585F6E41435E5643544242785F5F5443")));
this.paint2.setColor(Theme.getColor(NPStringFog.decode("5D5E56585F6E41435E56435442427E44455443")));
}
public void setProgress(float value) {
this.progress = value;
invalidate();
}
@Override
protected void onDraw(Canvas canvas) {
int start = (int) (getMeasuredWidth() * this.progress);
canvas.drawRect(0.0f, 0.0f, start, getMeasuredHeight(), this.paint2);
canvas.drawRect(start, 0.0f, getMeasuredWidth(), getMeasuredHeight(), this.paint);
}
}
public CancelAccountDeletionActivity(Bundle args) {
super(args);
this.currentViewNum = 0;
this.views = new SlideView[5];
this.permissionsItems = new ArrayList<>();
this.checkPermissions = false;
this.hash = args.getString(NPStringFog.decode("59504259"));
this.phone = args.getString(NPStringFog.decode("41595E5F54"));
}
@Override
public void onFragmentDestroy() {
super.onFragmentDestroy();
int a = 0;
while (true) {
SlideView[] slideViewArr = this.views;
if (a >= slideViewArr.length) {
break;
}
if (slideViewArr[a] != null) {
slideViewArr[a].onDestroyActivity();
}
a++;
}
AlertDialog alertDialog = this.progressDialog;
if (alertDialog != null) {
try {
alertDialog.dismiss();
} catch (Exception e) {
FileLog.e(e);
}
this.progressDialog = null;
}
AndroidUtilities.removeAdjustResize(getParentActivity(), this.classGuid);
}
@Override
public View createView(Context context) {
this.actionBar.setTitle(LocaleController.getString(NPStringFog.decode("7041417F505C54"), R.string.AppName));
this.actionBar.setBackButtonImage(R.mipmap.ic_back);
this.actionBar.setActionBarMenuOnItemClick(new ActionBar.ActionBarMenuOnItemClick() {
@Override
public void onItemClick(int id) {
if (id == 1) {
CancelAccountDeletionActivity.this.views[CancelAccountDeletionActivity.this.currentViewNum].onNextPressed();
} else if (id == -1) {
CancelAccountDeletionActivity.this.finishFragment();
}
}
});
ActionBarMenu menu = this.actionBar.createMenu();
ActionBarMenuItem addItemWithWidth = menu.addItemWithWidth(1, R.drawable.ic_done, AndroidUtilities.dp(56.0f));
this.doneButton = addItemWithWidth;
addItemWithWidth.setVisibility(8);
ScrollView scrollView = new ScrollView(context) {
@Override
public boolean requestChildRectangleOnScreen(View child, Rect rectangle, boolean immediate) {
if (CancelAccountDeletionActivity.this.currentViewNum == 1 || CancelAccountDeletionActivity.this.currentViewNum == 2 || CancelAccountDeletionActivity.this.currentViewNum == 4) {
rectangle.bottom += AndroidUtilities.dp(40.0f);
}
return super.requestChildRectangleOnScreen(child, rectangle, immediate);
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
CancelAccountDeletionActivity.this.scrollHeight = View.MeasureSpec.getSize(heightMeasureSpec) - AndroidUtilities.dp(30.0f);
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}
};
scrollView.setFillViewport(true);
this.fragmentView = scrollView;
FrameLayout frameLayout = new FrameLayout(context);
scrollView.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);
int a = 0;
while (true) {
SlideView[] slideViewArr = this.views;
if (a >= slideViewArr.length) {
this.actionBar.setTitle(this.views[0].getHeaderName());
return this.fragmentView;
}
slideViewArr[a].setVisibility(a == 0 ? 0 : 8);
frameLayout.addView(this.views[a], LayoutHelper.createFrame(-1.0f, a == 0 ? -2.0f : -1.0f, 51, AndroidUtilities.isTablet() ? 26.0f : 18.0f, 30.0f, AndroidUtilities.isTablet() ? 26.0f : 18.0f, 0.0f));
a++;
}
}
@Override
public void onResume() {
super.onResume();
AndroidUtilities.requestAdjustResize(getParentActivity(), this.classGuid);
}
@Override
public void onRequestPermissionsResultFragment(int requestCode, String[] permissions, int[] grantResults) {
if (requestCode == 6) {
this.checkPermissions = false;
int i = this.currentViewNum;
if (i == 0) {
this.views[i].onNextPressed();
}
}
}
@Override
public void onDialogDismiss(Dialog dialog) {
if (Build.VERSION.SDK_INT >= 23 && dialog == this.permissionsDialog && !this.permissionsItems.isEmpty()) {
getParentActivity().requestPermissions((String[]) this.permissionsItems.toArray(new String[0]), 6);
}
if (dialog == this.errorDialog) {
finishFragment();
}
}
@Override
public boolean onBackPressed() {
int a = 0;
while (true) {
SlideView[] slideViewArr = this.views;
if (a < slideViewArr.length) {
if (slideViewArr[a] != null) {
slideViewArr[a].onDestroyActivity();
}
a++;
} else {
return true;
}
}
}
@Override
public void onTransitionAnimationEnd(boolean isOpen, boolean backward) {
if (isOpen) {
this.views[this.currentViewNum].onShow();
}
}
public void needShowProgress() {
if (getParentActivity() == null || getParentActivity().isFinishing() || this.progressDialog != null) {
return;
}
AlertDialog alertDialog = new AlertDialog(getParentActivity(), 3);
this.progressDialog = alertDialog;
alertDialog.setCanCancel(false);
this.progressDialog.show();
}
public void needHideProgress() {
AlertDialog alertDialog = this.progressDialog;
if (alertDialog == null) {
return;
}
try {
alertDialog.dismiss();
} catch (Exception e) {
FileLog.e(e);
}
this.progressDialog = null;
}
public void setPage(int page, boolean animated, Bundle params, boolean back) {
if (page != 3 && page != 0) {
this.doneButton.setVisibility(0);
} else {
this.doneButton.setVisibility(8);
}
SlideView[] slideViewArr = this.views;
final SlideView outView = slideViewArr[this.currentViewNum];
final SlideView newView = slideViewArr[page];
this.currentViewNum = page;
newView.setParams(params, false);
this.actionBar.setTitle(newView.getHeaderName());
newView.onShow();
int i = AndroidUtilities.displaySize.x;
if (back) {
i = -i;
}
newView.setX(i);
AnimatorSet animatorSet = new AnimatorSet();
animatorSet.setInterpolator(new AccelerateDecelerateInterpolator());
animatorSet.setDuration(300L);
Animator[] animatorArr = new Animator[2];
float[] fArr = new float[1];
int i2 = AndroidUtilities.displaySize.x;
if (!back) {
i2 = -i2;
}
fArr[0] = i2;
animatorArr[0] = ObjectAnimator.ofFloat(outView, "translationX", fArr);
animatorArr[1] = ObjectAnimator.ofFloat(newView, "translationX", 0.0f);
animatorSet.playTogether(animatorArr);
animatorSet.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animation) {
newView.setVisibility(0);
}
@Override
public void onAnimationEnd(Animator animation) {
outView.setVisibility(8);
outView.setX(0.0f);
}
});
animatorSet.start();
}
public void fillNextCodeParams(Bundle params, TLRPC.TL_auth_sentCode res) {
params.putString(NPStringFog.decode("41595E5F5479504259"), res.phone_code_hash);
boolean z = res.next_type instanceof TLRPC.TL_auth_codeTypeCall;
String decode = NPStringFog.decode("5F54494565484154");
if (z) {
params.putInt(decode, 4);
} else if (res.next_type instanceof TLRPC.TL_auth_codeTypeFlashCall) {
params.putInt(decode, 3);
} else if (res.next_type instanceof TLRPC.TL_auth_codeTypeSms) {
params.putInt(decode, 2);
}
boolean z2 = res.type instanceof TLRPC.TL_auth_sentCodeTypeApp;
String decode2 = NPStringFog.decode("5D545F564559");
if (z2) {
params.putInt("type", 1);
params.putInt(decode2, res.type.length);
setPage(1, true, params, false);
return;
}
if (res.timeout == 0) {
res.timeout = 60;
}
params.putInt("timeout", res.timeout * 1000);
if (res.type instanceof TLRPC.TL_auth_sentCodeTypeCall) {
params.putInt("type", 4);
params.putInt(decode2, res.type.length);
setPage(4, true, params, false);
} else {
if (res.type instanceof TLRPC.TL_auth_sentCodeTypeFlashCall) {
params.putInt("type", 3);
params.putString(NPStringFog.decode("4150454554435F"), res.type.pattern);
setPage(3, true, params, false);
return;
}
if (res.type instanceof TLRPC.TL_auth_sentCodeTypeSms) {
params.putInt("type", 2);
params.putInt(decode2, res.type.length);
setPage(2, true, params, false);
}
}
}
public class PhoneView extends SlideView {
private boolean nextPressed;
private RadialProgressView progressBar;
public PhoneView(Context context) {
super(context);
this.nextPressed = false;
setOrientation(1);
FrameLayout frameLayout = new FrameLayout(context);
addView(frameLayout, LayoutHelper.createLinear(-1, ItemTouchHelper.Callback.DEFAULT_DRAG_ANIMATION_DURATION));
RadialProgressView radialProgressView = new RadialProgressView(context);
this.progressBar = radialProgressView;
frameLayout.addView(radialProgressView, LayoutHelper.createFrame(-2, -2, 17));
}
@Override
public void onNextPressed() {
if (CancelAccountDeletionActivity.this.getParentActivity() == null || this.nextPressed) {
return;
}
Context context = ApplicationLoader.applicationContext;
String decode = NPStringFog.decode("41595E5F54");
TelephonyManager tm = (TelephonyManager) context.getSystemService(decode);
if (tm.getSimState() == 1 || tm.getPhoneType() == 0) {
}
int i = Build.VERSION.SDK_INT;
final TLRPC.TL_account_sendConfirmPhoneCode req = new TLRPC.TL_account_sendConfirmPhoneCode();
req.hash = CancelAccountDeletionActivity.this.hash;
req.settings = new TLRPC.TL_codeSettings();
req.settings.allow_flashcall = false;
req.settings.allow_app_hash = ApplicationLoader.hasPlayServices;
SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences(NPStringFog.decode("5C50585F525E5F575856"), 0);
if (req.settings.allow_app_hash) {
preferences.edit().putString("sms_hash", BuildVars.SMS_HASH).commit();
} else {
preferences.edit().remove("sms_hash").commit();
}
if (req.settings.allow_flashcall) {
try {
String number = tm.getLine1Number();
if (!TextUtils.isEmpty(number)) {
req.settings.current_number = PhoneNumberUtils.compare(CancelAccountDeletionActivity.this.phone, number);
if (!req.settings.current_number) {
req.settings.allow_flashcall = false;
}
} else {
req.settings.current_number = false;
}
} catch (Exception e) {
req.settings.allow_flashcall = false;
FileLog.e(e);
}
}
final Bundle params = new Bundle();
params.putString(decode, CancelAccountDeletionActivity.this.phone);
this.nextPressed = true;
ConnectionsManager.getInstance(CancelAccountDeletionActivity.this.currentAccount).sendRequest(req, new RequestDelegate() {
@Override
public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
CancelAccountDeletionActivity.PhoneView.this.lambda$onNextPressed$1$CancelAccountDeletionActivity$PhoneView(params, req, tLObject, tL_error);
}
}, 2);
}
public void lambda$onNextPressed$1$CancelAccountDeletionActivity$PhoneView(final Bundle params, final TLRPC.TL_account_sendConfirmPhoneCode req, final TLObject response, final TLRPC.TL_error error) {
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
CancelAccountDeletionActivity.PhoneView.this.lambda$null$0$CancelAccountDeletionActivity$PhoneView(error, params, response, req);
}
});
}
public void lambda$null$0$CancelAccountDeletionActivity$PhoneView(TLRPC.TL_error error, Bundle params, TLObject response, TLRPC.TL_account_sendConfirmPhoneCode req) {
this.nextPressed = false;
if (error == null) {
CancelAccountDeletionActivity.this.fillNextCodeParams(params, (TLRPC.TL_auth_sentCode) response);
} else {
CancelAccountDeletionActivity cancelAccountDeletionActivity = CancelAccountDeletionActivity.this;
cancelAccountDeletionActivity.errorDialog = AlertsCreator.processError(cancelAccountDeletionActivity.currentAccount, error, CancelAccountDeletionActivity.this, req, new Object[0]);
}
}
@Override
public String getHeaderName() {
return LocaleController.getString(NPStringFog.decode("72505F52545D7052525E445F456354425445"), R.string.CancelAccountReset);
}
@Override
public void onShow() {
super.onShow();
onNextPressed();
}
}
public class LoginActivitySmsView extends SlideView implements NotificationCenter.NotificationCenterDelegate {
private ImageView blackImageView;
private ImageView blueImageView;
private EditTextBoldCursor[] codeField;
private LinearLayout codeFieldContainer;
private int codeTime;
private Timer codeTimer;
private TextView confirmTextView;
private Bundle currentParams;
private int currentType;
private boolean ignoreOnTextChange;
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 TextView problemText;
private ProgressView progressView;
private int time;
private TextView timeText;
private Timer timeTimer;
private int timeout;
private final Object timerSync;
private TextView titleTextView;
private boolean waitingForEvent;
public LoginActivitySmsView(Context context, int type) {
super(context);
this.timerSync = new Object();
this.time = TimeConstants.MIN;
this.codeTime = 15000;
this.lastError = NPStringFog.decode("");
this.pattern = NPStringFog.decode("1B");
this.currentType = type;
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(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(NPStringFog.decode("575E5F45421E435C545558445C1F454557")));
this.titleTextView.setGravity(LocaleController.isRTL ? 5 : 3);
this.titleTextView.setLineSpacing(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));
int i = this.currentType;
String decode = NPStringFog.decode("52595045426E505245585E5F7350525A56435E445F55");
if (i == 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(decode), 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(NPStringFog.decode("62545F45704141725E55546558455D54"), 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(decode), 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(NPStringFog.decode("62545F45625C42725E55546558455D54"), 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);
}
TextView textView3 = new TextView(context) {
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, View.MeasureSpec.makeMeasureSpec(AndroidUtilities.dp(100.0f), Integer.MIN_VALUE));
}
};
this.timeText = textView3;
textView3.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteGrayText6));
this.timeText.setLineSpacing(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));
}
TextView textView4 = new TextView(context) {
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, View.MeasureSpec.makeMeasureSpec(AndroidUtilities.dp(100.0f), Integer.MIN_VALUE));
}
};
this.problemText = textView4;
textView4.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteBlueText4));
this.problemText.setLineSpacing(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(NPStringFog.decode("7558557F5E45765445655954725E5554625C42"), R.string.DidNotGetTheCodeSms));
} else {
this.problemText.setText(LocaleController.getString(NPStringFog.decode("7558557F5E45765445655954725E5554"), R.string.DidNotGetTheCode));
}
addView(this.problemText, LayoutHelper.createLinear(-2, -2, 49));
this.problemText.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
CancelAccountDeletionActivity.LoginActivitySmsView.this.lambda$new$0$CancelAccountDeletionActivity$LoginActivitySmsView(view);
}
});
}
public void lambda$new$0$CancelAccountDeletionActivity$LoginActivitySmsView(View v) {
if (this.nextPressed) {
return;
}
boolean email = (this.nextType == 4 && this.currentType == 2) || this.nextType == 0;
if (!email) {
resendCode();
return;
}
try {
PackageInfo pInfo = ApplicationLoader.applicationContext.getPackageManager().getPackageInfo(ApplicationLoader.applicationContext.getPackageName(), 0);
String version = String.format(Locale.US, NPStringFog.decode("14421119145518"), pInfo.versionName, Integer.valueOf(pInfo.versionCode));
Intent mailer = new Intent(NPStringFog.decode("505F55435E58551F585F45545F451F505245585E5F1F62747F75"));
mailer.setType(NPStringFog.decode("5C5442425056541E435752090303"));
mailer.putExtra(NPStringFog.decode("505F55435E58551F585F45545F451F54494543501F747C70787D"), new String[]{"sms@stel.com"});
mailer.putExtra(NPStringFog.decode("505F55435E58551F585F45545F451F54494543501F6264737B747265"), NPStringFog.decode("705F55435E58551152505F52545D115052525E445F451155545D5445585E5F11584242445411") + version + NPStringFog.decode("11") + this.phone);
mailer.putExtra(NPStringFog.decode("505F55435E58551F585F45545F451F54494543501F65746965"), NPStringFog.decode("61595E5F540B11") + this.phone + NPStringFog.decode("3B7041411147544342585E5F0B11") + version + NPStringFog.decode("3B7E621147544342585E5F0B1162757A11") + Build.VERSION.SDK_INT + NPStringFog.decode("3B755447585254117F505C540B11") + Build.MANUFACTURER + Build.MODEL + NPStringFog.decode("3B7D5E52505D540B11") + Locale.getDefault() + NPStringFog.decode("3B7443435E430B11") + this.lastError);
getContext().startActivity(Intent.createChooser(mailer, NPStringFog.decode("62545F5511545C50585D1F1F1F")));
} catch (Exception e) {
AlertsCreator.showSimpleAlert(CancelAccountDeletionActivity.this, LocaleController.getString(NPStringFog.decode("7F5E7C50585D785F4245505D5D5455"), R.string.NoMailInstalled));
}
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
ImageView imageView;
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
if (this.currentType != 3 && (imageView = this.blueImageView) != null) {
int innerHeight = imageView.getMeasuredHeight() + this.titleTextView.getMeasuredHeight() + this.confirmTextView.getMeasuredHeight() + AndroidUtilities.dp(35.0f);
int requiredHeight = AndroidUtilities.dp(80.0f);
int maxHeight = AndroidUtilities.dp(291.0f);
if (CancelAccountDeletionActivity.this.scrollHeight - innerHeight >= requiredHeight) {
if (CancelAccountDeletionActivity.this.scrollHeight <= maxHeight) {
setMeasuredDimension(getMeasuredWidth(), CancelAccountDeletionActivity.this.scrollHeight);
return;
} else {
setMeasuredDimension(getMeasuredWidth(), maxHeight);
return;
}
}
setMeasuredDimension(getMeasuredWidth(), innerHeight + requiredHeight);
}
}
@Override
protected void onLayout(boolean changed, int l, int t, int r, int b) {
int t2;
super.onLayout(changed, l, t, r, b);
if (this.currentType != 3 && this.blueImageView != null) {
int bottom = this.confirmTextView.getBottom();
int height = getMeasuredHeight() - bottom;
if (this.problemText.getVisibility() == 0) {
int h = this.problemText.getMeasuredHeight();
t2 = (bottom + height) - h;
TextView textView = this.problemText;
textView.layout(textView.getLeft(), t2, this.problemText.getRight(), t2 + h);
} else if (this.timeText.getVisibility() == 0) {
int h2 = this.timeText.getMeasuredHeight();
t2 = (bottom + height) - h2;
TextView textView2 = this.timeText;
textView2.layout(textView2.getLeft(), t2, this.timeText.getRight(), t2 + h2);
} else {
t2 = bottom + height;
}
int h3 = this.codeFieldContainer.getMeasuredHeight();
int t3 = (((t2 - bottom) - h3) / 2) + bottom;
LinearLayout linearLayout = this.codeFieldContainer;
linearLayout.layout(linearLayout.getLeft(), t3, this.codeFieldContainer.getRight(), t3 + h3);
}
}
public void resendCode() {
final Bundle params = new Bundle();
params.putString(NPStringFog.decode("41595E5F54"), this.phone);
this.nextPressed = true;
CancelAccountDeletionActivity.this.needShowProgress();
final TLRPC.TL_auth_resendCode req = new TLRPC.TL_auth_resendCode();
req.phone_number = this.phone;
req.phone_code_hash = this.phoneHash;
ConnectionsManager.getInstance(CancelAccountDeletionActivity.this.currentAccount).sendRequest(req, new RequestDelegate() {
@Override
public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
CancelAccountDeletionActivity.LoginActivitySmsView.this.lambda$resendCode$3$CancelAccountDeletionActivity$LoginActivitySmsView(params, req, tLObject, tL_error);
}
}, 2);
}
public void lambda$resendCode$3$CancelAccountDeletionActivity$LoginActivitySmsView(final Bundle params, final TLRPC.TL_auth_resendCode req, final TLObject response, final TLRPC.TL_error error) {
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
CancelAccountDeletionActivity.LoginActivitySmsView.this.lambda$null$2$CancelAccountDeletionActivity$LoginActivitySmsView(error, params, response, req);
}
});
}
public void lambda$null$2$CancelAccountDeletionActivity$LoginActivitySmsView(TLRPC.TL_error error, Bundle params, TLObject response, TLRPC.TL_auth_resendCode req) {
AlertDialog dialog;
this.nextPressed = false;
if (error == null) {
CancelAccountDeletionActivity.this.fillNextCodeParams(params, (TLRPC.TL_auth_sentCode) response);
} else if (error.text != null && (dialog = (AlertDialog) AlertsCreator.processError(CancelAccountDeletionActivity.this.currentAccount, error, CancelAccountDeletionActivity.this, req, new Object[0])) != null && error.text.contains(NPStringFog.decode("61797E7F746E727E75746E74696178637475"))) {
dialog.setPositiveButtonListener(new DialogInterface.OnClickListener() {
@Override
public final void onClick(DialogInterface dialogInterface, int i) {
CancelAccountDeletionActivity.LoginActivitySmsView.this.lambda$null$1$CancelAccountDeletionActivity$LoginActivitySmsView(dialogInterface, i);
}
});
}
CancelAccountDeletionActivity.this.needHideProgress();
}
public void lambda$null$1$CancelAccountDeletionActivity$LoginActivitySmsView(DialogInterface dialog1, int which) {
onBackPressed(true);
CancelAccountDeletionActivity.this.finishFragment();
}
@Override
public String getHeaderName() {
if (this.currentType == 1) {
return this.phone;
}
return LocaleController.getString(NPStringFog.decode("72505F52545D7052525E445F456354425445"), R.string.CancelAccountReset);
}
@Override
public boolean needBackButton() {
return true;
}
@Override
public void setParams(Bundle params, boolean restore) {
int i;
int i2;
if (params != null) {
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 = params;
this.phone = params.getString(NPStringFog.decode("41595E5F54"));
this.phoneHash = params.getString(NPStringFog.decode("41595E5F5479504259"));
int i4 = params.getInt("timeout");
this.time = i4;
this.timeout = i4;
this.openTime = (int) (System.currentTimeMillis() / 1000);
this.nextType = params.getInt(NPStringFog.decode("5F54494565484154"));
this.pattern = params.getString(NPStringFog.decode("4150454554435F"));
int i5 = params.getInt(NPStringFog.decode("5D545F564559"));
this.length = i5;
if (i5 == 0) {
this.length = 5;
}
EditTextBoldCursor[] editTextBoldCursorArr = this.codeField;
if (editTextBoldCursorArr == null || editTextBoldCursorArr.length != this.length) {
int a = this.length;
this.codeField = new EditTextBoldCursor[a];
int a2 = 0;
while (a2 < this.length) {
final int num = a2;
this.codeField[a2] = new EditTextBoldCursor(getContext());
this.codeField[a2].setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteBlackText));
this.codeField[a2].setCursorColor(Theme.getColor(Theme.key_windowBackgroundWhiteBlackText));
this.codeField[a2].setCursorSize(AndroidUtilities.dp(20.0f));
this.codeField[a2].setCursorWidth(1.5f);
Drawable pressedDrawable = getResources().getDrawable(R.drawable.search_dark_activated).mutate();
pressedDrawable.setColorFilter(new PorterDuffColorFilter(Theme.getColor(Theme.key_windowBackgroundWhiteInputFieldActivated), PorterDuff.Mode.MULTIPLY));
this.codeField[a2].setBackgroundDrawable(pressedDrawable);
this.codeField[a2].setImeOptions(268435461);
this.codeField[a2].setTextSize(1, 20.0f);
this.codeField[a2].setMaxLines(1);
this.codeField[a2].setTypeface(AndroidUtilities.getTypeface(NPStringFog.decode("575E5F45421E435C545558445C1F454557")));
this.codeField[a2].setPadding(0, 0, 0, 0);
this.codeField[a2].setGravity(49);
if (this.currentType == 3) {
this.codeField[a2].setEnabled(false);
this.codeField[a2].setInputType(0);
this.codeField[a2].setVisibility(8);
} else {
this.codeField[a2].setInputType(3);
}
this.codeFieldContainer.addView(this.codeField[a2], LayoutHelper.createLinear(34, 36, 1, 0, 0, a2 != this.length - 1 ? 7 : 0, 0));
this.codeField[a2].addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
@Override
public void afterTextChanged(Editable s) {
int len;
if (!LoginActivitySmsView.this.ignoreOnTextChange && (len = s.length()) >= 1) {
if (len > 1) {
String text = s.toString();
LoginActivitySmsView.this.ignoreOnTextChange = true;
for (int a3 = 0; a3 < Math.min(LoginActivitySmsView.this.length - num, len); a3++) {
if (a3 != 0) {
LoginActivitySmsView.this.codeField[num + a3].setText(text.substring(a3, a3 + 1));
} else {
s.replace(0, len, text.substring(a3, a3 + 1));
}
}
LoginActivitySmsView.this.ignoreOnTextChange = false;
}
if (num != LoginActivitySmsView.this.length - 1) {
LoginActivitySmsView.this.codeField[num + 1].setSelection(LoginActivitySmsView.this.codeField[num + 1].length());
LoginActivitySmsView.this.codeField[num + 1].requestFocus();
}
if ((num == LoginActivitySmsView.this.length - 1 || (num == LoginActivitySmsView.this.length - 2 && len >= 2)) && LoginActivitySmsView.this.getCode().length() == LoginActivitySmsView.this.length) {
LoginActivitySmsView.this.onNextPressed();
}
}
}
});
this.codeField[a2].setOnKeyListener(new View.OnKeyListener() {
@Override
public final boolean onKey(View view, int i6, KeyEvent keyEvent) {
return CancelAccountDeletionActivity.LoginActivitySmsView.this.lambda$setParams$4$CancelAccountDeletionActivity$LoginActivitySmsView(num, view, i6, keyEvent);
}
});
this.codeField[a2].setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public final boolean onEditorAction(TextView textView, int i6, KeyEvent keyEvent) {
return CancelAccountDeletionActivity.LoginActivitySmsView.this.lambda$setParams$5$CancelAccountDeletionActivity$LoginActivitySmsView(textView, i6, keyEvent);
}
});
a2++;
}
} else {
int a3 = 0;
while (true) {
EditTextBoldCursor[] editTextBoldCursorArr2 = this.codeField;
if (a3 >= editTextBoldCursorArr2.length) {
break;
}
editTextBoldCursorArr2[a3].setText(NPStringFog.decode(""));
a3++;
}
}
ProgressView progressView = this.progressView;
if (progressView != null) {
progressView.setVisibility(this.nextType != 0 ? 0 : 8);
}
if (this.phone != null) {
String number = PhoneFormat.getInstance().format(this.phone);
CharSequence str = AndroidUtilities.replaceTags(LocaleController.formatString(NPStringFog.decode("72505F52545D7052525E445F456354425445785F575E"), R.string.CancelAccountResetInfo, PhoneFormat.getInstance().format(NPStringFog.decode("1A") + number)));
this.confirmTextView.setText(str);
if (this.currentType != 3) {
AndroidUtilities.showKeyboard(this.codeField[0]);
this.codeField[0].requestFocus();
} else {
AndroidUtilities.hideKeyboard(this.codeField[0]);
}
destroyTimer();
destroyCodeTimer();
this.lastCurrentTime = System.currentTimeMillis();
int i6 = this.currentType;
if (i6 == 1) {
this.problemText.setVisibility(0);
this.timeText.setVisibility(8);
return;
}
String decode = NPStringFog.decode("625C4265544945");
String decode2 = NPStringFog.decode("72505D5D65544945");
if (i6 == 3 && ((i2 = this.nextType) == 4 || i2 == 2)) {
this.problemText.setVisibility(8);
this.timeText.setVisibility(0);
int i7 = this.nextType;
if (i7 == 4) {
this.timeText.setText(LocaleController.formatString(decode2, R.string.CallText, 1, 0));
} else if (i7 == 2) {
this.timeText.setText(LocaleController.formatString(decode, R.string.SmsText, 1, 0));
}
createTimer();
return;
}
if (this.currentType == 2 && ((i = this.nextType) == 4 || i == 3)) {
this.timeText.setText(LocaleController.formatString(decode2, R.string.CallText, 2, 0));
this.problemText.setVisibility(this.time < 1000 ? 0 : 8);
this.timeText.setVisibility(this.time >= 1000 ? 0 : 8);
createTimer();
return;
}
if (this.currentType == 4 && this.nextType == 2) {
this.timeText.setText(LocaleController.formatString(decode, R.string.SmsText, 2, 0));
this.problemText.setVisibility(this.time < 1000 ? 0 : 8);
this.timeText.setVisibility(this.time >= 1000 ? 0 : 8);
createTimer();
return;
}
this.timeText.setVisibility(8);
this.problemText.setVisibility(8);
createCodeTimer();
}
}
}
public boolean lambda$setParams$4$CancelAccountDeletionActivity$LoginActivitySmsView(int num, View v, int keyCode, KeyEvent event) {
if (keyCode == 67 && this.codeField[num].length() == 0 && num > 0) {
EditTextBoldCursor[] editTextBoldCursorArr = this.codeField;
editTextBoldCursorArr[num - 1].setSelection(editTextBoldCursorArr[num - 1].length());
this.codeField[num - 1].requestFocus();
this.codeField[num - 1].dispatchKeyEvent(event);
return true;
}
return false;
}
public boolean lambda$setParams$5$CancelAccountDeletionActivity$LoginActivitySmsView(TextView textView, int i, KeyEvent keyEvent) {
if (i == 5) {
onNextPressed();
return true;
}
return false;
}
public void createCodeTimer() {
if (this.codeTimer != null) {
return;
}
this.codeTime = 15000;
this.codeTimer = new Timer();
this.lastCodeTime = System.currentTimeMillis();
this.codeTimer.schedule(new AnonymousClass4(), 0L, 1000L);
}
public class AnonymousClass4 extends TimerTask {
AnonymousClass4() {
}
@Override
public void run() {
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
CancelAccountDeletionActivity.LoginActivitySmsView.AnonymousClass4.this.lambda$run$0$CancelAccountDeletionActivity$LoginActivitySmsView$4();
}
});
}
public void lambda$run$0$CancelAccountDeletionActivity$LoginActivitySmsView$4() {
double currentTime = System.currentTimeMillis();
double diff = currentTime - LoginActivitySmsView.this.lastCodeTime;
LoginActivitySmsView.this.lastCodeTime = currentTime;
LoginActivitySmsView.this.codeTime = (int) (r4.codeTime - diff);
if (LoginActivitySmsView.this.codeTime <= 1000) {
LoginActivitySmsView.this.problemText.setVisibility(0);
LoginActivitySmsView.this.timeText.setVisibility(8);
LoginActivitySmsView.this.destroyCodeTimer();
}
}
}
public 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) {
return;
}
Timer timer = new Timer();
this.timeTimer = timer;
timer.schedule(new TimerTask() {
@Override
public void run() {
if (LoginActivitySmsView.this.timeTimer == null) {
return;
}
AndroidUtilities.runOnUIThread(new AnonymousClass1());
}
public class AnonymousClass1 implements Runnable {
AnonymousClass1() {
}
@Override
public void run() {
double currentTime = System.currentTimeMillis();
double diff = currentTime - LoginActivitySmsView.this.lastCurrentTime;
LoginActivitySmsView.this.time = (int) (LoginActivitySmsView.this.time - diff);
LoginActivitySmsView.this.lastCurrentTime = currentTime;
if (LoginActivitySmsView.this.time >= 1000) {
int minutes = (LoginActivitySmsView.this.time / 1000) / 60;
int seconds = (LoginActivitySmsView.this.time / 1000) - (minutes * 60);
if (LoginActivitySmsView.this.nextType == 4 || LoginActivitySmsView.this.nextType == 3) {
LoginActivitySmsView.this.timeText.setText(LocaleController.formatString(NPStringFog.decode("72505D5D65544945"), R.string.CallText, Integer.valueOf(minutes), Integer.valueOf(seconds)));
} else if (LoginActivitySmsView.this.nextType == 2) {
LoginActivitySmsView.this.timeText.setText(LocaleController.formatString(NPStringFog.decode("625C4265544945"), R.string.SmsText, Integer.valueOf(minutes), Integer.valueOf(seconds)));
}
if (LoginActivitySmsView.this.progressView != null) {
LoginActivitySmsView.this.progressView.setProgress(1.0f - (LoginActivitySmsView.this.time / LoginActivitySmsView.this.timeout));
return;
}
return;
}
if (LoginActivitySmsView.this.progressView != null) {
LoginActivitySmsView.this.progressView.setProgress(1.0f);
}
LoginActivitySmsView.this.destroyTimer();
if (LoginActivitySmsView.this.currentType != 3) {
if (LoginActivitySmsView.this.currentType == 2 || LoginActivitySmsView.this.currentType == 4) {
if (LoginActivitySmsView.this.nextType == 4 || LoginActivitySmsView.this.nextType == 2) {
if (LoginActivitySmsView.this.nextType == 4) {
LoginActivitySmsView.this.timeText.setText(LocaleController.getString(NPStringFog.decode("72505D5D585F56"), R.string.Calling));
} else {
LoginActivitySmsView.this.timeText.setText(LocaleController.getString(NPStringFog.decode("62545F55585F56625C42"), R.string.SendingSms));
}
LoginActivitySmsView.this.createCodeTimer();
TLRPC.TL_auth_resendCode req = new TLRPC.TL_auth_resendCode();
req.phone_number = LoginActivitySmsView.this.phone;
req.phone_code_hash = LoginActivitySmsView.this.phoneHash;
ConnectionsManager.getInstance(CancelAccountDeletionActivity.this.currentAccount).sendRequest(req, new RequestDelegate() {
@Override
public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
CancelAccountDeletionActivity.LoginActivitySmsView.AnonymousClass5.AnonymousClass1.this.lambda$run$1$CancelAccountDeletionActivity$LoginActivitySmsView$5$1(tLObject, tL_error);
}
}, 2);
return;
}
if (LoginActivitySmsView.this.nextType == 3) {
AndroidUtilities.setWaitingForSms(false);
NotificationCenter.getGlobalInstance().removeObserver(this, NotificationCenter.didReceiveSmsCode);
LoginActivitySmsView.this.waitingForEvent = false;
LoginActivitySmsView.this.destroyCodeTimer();
LoginActivitySmsView.this.resendCode();
return;
}
return;
}
return;
}
AndroidUtilities.setWaitingForCall(false);
NotificationCenter.getGlobalInstance().removeObserver(this, NotificationCenter.didReceiveCall);
LoginActivitySmsView.this.waitingForEvent = false;
LoginActivitySmsView.this.destroyCodeTimer();
LoginActivitySmsView.this.resendCode();
}
public void lambda$run$1$CancelAccountDeletionActivity$LoginActivitySmsView$5$1(TLObject response, final TLRPC.TL_error error) {
if (error != null && error.text != null) {
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
CancelAccountDeletionActivity.LoginActivitySmsView.AnonymousClass5.AnonymousClass1.this.lambda$null$0$CancelAccountDeletionActivity$LoginActivitySmsView$5$1(error);
}
});
}
}
public void lambda$null$0$CancelAccountDeletionActivity$LoginActivitySmsView$5$1(TLRPC.TL_error error) {
LoginActivitySmsView.this.lastError = error.text;
}
}
}, 0L, 1000L);
}
public void destroyTimer() {
try {
synchronized (this.timerSync) {
if (this.timeTimer != null) {
this.timeTimer.cancel();
this.timeTimer = null;
}
}
} catch (Exception e) {
FileLog.e(e);
}
}
public String getCode() {
if (this.codeField == null) {
return NPStringFog.decode("");
}
StringBuilder codeBuilder = new StringBuilder();
int a = 0;
while (true) {
EditTextBoldCursor[] editTextBoldCursorArr = this.codeField;
if (a < editTextBoldCursorArr.length) {
codeBuilder.append(PhoneFormat.stripExceptNumbers(editTextBoldCursorArr[a].getText().toString()));
a++;
} else {
return codeBuilder.toString();
}
}
}
@Override
public void onNextPressed() {
if (this.nextPressed) {
return;
}
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;
final TLRPC.TL_account_confirmPhone req = new TLRPC.TL_account_confirmPhone();
req.phone_code = code;
req.phone_code_hash = this.phoneHash;
destroyTimer();
CancelAccountDeletionActivity.this.needShowProgress();
ConnectionsManager.getInstance(CancelAccountDeletionActivity.this.currentAccount).sendRequest(req, new RequestDelegate() {
@Override
public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
CancelAccountDeletionActivity.LoginActivitySmsView.this.lambda$onNextPressed$7$CancelAccountDeletionActivity$LoginActivitySmsView(req, tLObject, tL_error);
}
}, 2);
}
public void lambda$onNextPressed$7$CancelAccountDeletionActivity$LoginActivitySmsView(final TLRPC.TL_account_confirmPhone req, TLObject response, final TLRPC.TL_error error) {
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
CancelAccountDeletionActivity.LoginActivitySmsView.this.lambda$null$6$CancelAccountDeletionActivity$LoginActivitySmsView(error, req);
}
});
}
public void lambda$null$6$CancelAccountDeletionActivity$LoginActivitySmsView(TLRPC.TL_error error, TLRPC.TL_account_confirmPhone req) {
int i;
int i2;
CancelAccountDeletionActivity.this.needHideProgress();
this.nextPressed = false;
if (error == null) {
CancelAccountDeletionActivity cancelAccountDeletionActivity = CancelAccountDeletionActivity.this;
cancelAccountDeletionActivity.errorDialog = AlertsCreator.showSimpleAlert(cancelAccountDeletionActivity, LocaleController.formatString(NPStringFog.decode("72505F52545D7D585F5A62445252544242"), R.string.CancelLinkSuccess, PhoneFormat.getInstance().format(NPStringFog.decode("1A") + this.phone)));
return;
}
this.lastError = error.text;
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;
if (this.currentType != 3) {
AlertsCreator.processError(CancelAccountDeletionActivity.this.currentAccount, error, CancelAccountDeletionActivity.this, req, new Object[0]);
}
if (error.text.contains(NPStringFog.decode("61797E7F746E727E75746E747C616568")) || error.text.contains(NPStringFog.decode("61797E7F746E727E75746E787F67707D7875"))) {
int a = 0;
while (true) {
EditTextBoldCursor[] editTextBoldCursorArr = this.codeField;
if (a < editTextBoldCursorArr.length) {
editTextBoldCursorArr[a].setText(NPStringFog.decode(""));
a++;
} else {
editTextBoldCursorArr[0].requestFocus();
return;
}
}
} else if (error.text.contains(NPStringFog.decode("61797E7F746E727E75746E74696178637475"))) {
onBackPressed(true);
CancelAccountDeletionActivity.this.setPage(0, true, null, true);
}
}
@Override
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
public void onShow() {
super.onShow();
if (this.currentType == 3) {
return;
}
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
CancelAccountDeletionActivity.LoginActivitySmsView.this.lambda$onShow$8$CancelAccountDeletionActivity$LoginActivitySmsView();
}
}, 100L);
}
public void lambda$onShow$8$CancelAccountDeletionActivity$LoginActivitySmsView() {
EditTextBoldCursor[] editTextBoldCursorArr = this.codeField;
if (editTextBoldCursorArr != null) {
for (int a = editTextBoldCursorArr.length - 1; a >= 0; a--) {
if (a == 0 || this.codeField[a].length() != 0) {
this.codeField[a].requestFocus();
EditTextBoldCursor[] editTextBoldCursorArr2 = this.codeField;
editTextBoldCursorArr2[a].setSelection(editTextBoldCursorArr2[a].length());
AndroidUtilities.showKeyboard(this.codeField[a]);
return;
}
}
}
}
@Override
public void didReceivedNotification(int id, int account, Object... args) {
if (!this.waitingForEvent || this.codeField == null) {
return;
}
int i = NotificationCenter.didReceiveSmsCode;
String decode = NPStringFog.decode("");
if (id == i) {
this.codeField[0].setText(decode + args[0]);
onNextPressed();
return;
}
if (id == NotificationCenter.didReceiveCall) {
String num = decode + args[0];
if (!AndroidUtilities.checkPhonePattern(this.pattern, num)) {
return;
}
this.ignoreOnTextChange = true;
this.codeField[0].setText(num);
this.ignoreOnTextChange = false;
onNextPressed();
}
}
}
@Override
public ThemeDescription[] getThemeDescriptions() {
SlideView[] slideViewArr = this.views;
PhoneView phoneView = (PhoneView) slideViewArr[0];
LoginActivitySmsView smsView1 = (LoginActivitySmsView) slideViewArr[1];
LoginActivitySmsView smsView2 = (LoginActivitySmsView) slideViewArr[2];
LoginActivitySmsView smsView3 = (LoginActivitySmsView) slideViewArr[3];
LoginActivitySmsView smsView4 = (LoginActivitySmsView) slideViewArr[4];
ArrayList<ThemeDescription> 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, NPStringFog.decode("505245585E5F73504375545750445D45")));
arrayList.add(new ThemeDescription(this.fragmentView, ThemeDescription.FLAG_LISTGLOWCOLOR, null, null, null, null, NPStringFog.decode("505245585E5F73504375545750445D45")));
arrayList.add(new ThemeDescription(this.actionBar, ThemeDescription.FLAG_AB_ITEMSCOLOR, null, null, null, null, NPStringFog.decode("505245585E5F73504375545750445D4578525E5F")));
arrayList.add(new ThemeDescription(this.actionBar, ThemeDescription.FLAG_AB_TITLECOLOR, null, null, null, null, NPStringFog.decode("505245585E5F73504375545750445D456558455D54")));
arrayList.add(new ThemeDescription(this.actionBar, ThemeDescription.FLAG_AB_SELECTORCOLOR, null, null, null, null, NPStringFog.decode("505245585E5F73504375545750445D4562545D5452455E43")));
arrayList.add(new ThemeDescription(phoneView.progressBar, ThemeDescription.FLAG_PROGRESSBAR, null, null, null, null, NPStringFog.decode("41435E5643544242725843525D54")));
arrayList.add(new ThemeDescription(smsView1.confirmTextView, ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteGrayText6));
arrayList.add(new ThemeDescription(smsView1.titleTextView, ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteBlackText));
if (smsView1.codeField != null) {
for (int a = 0; a < smsView1.codeField.length; a++) {
arrayList.add(new ThemeDescription(smsView1.codeField[a], ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteBlackText));
arrayList.add(new ThemeDescription(smsView1.codeField[a], ThemeDescription.FLAG_BACKGROUNDFILTER, null, null, null, null, Theme.key_windowBackgroundWhiteInputFieldActivated));
}
}
arrayList.add(new ThemeDescription(smsView1.timeText, ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteGrayText6));
arrayList.add(new ThemeDescription(smsView1.problemText, ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteBlueText4));
String decode = NPStringFog.decode("4150585F45");
arrayList.add(new ThemeDescription(smsView1.progressView, 0, new Class[]{ProgressView.class}, new String[]{decode}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, NPStringFog.decode("5D5E56585F6E41435E5643544242785F5F5443")));
arrayList.add(new ThemeDescription(smsView1.progressView, 0, new Class[]{ProgressView.class}, new String[]{decode}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, NPStringFog.decode("5D5E56585F6E41435E56435442427E44455443")));
arrayList.add(new ThemeDescription(smsView1.blackImageView, ThemeDescription.FLAG_IMAGECOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteBlackText));
arrayList.add(new ThemeDescription(smsView1.blueImageView, ThemeDescription.FLAG_IMAGECOLOR, null, null, null, null, NPStringFog.decode("52595045426E505245585E5F7350525A56435E445F55")));
arrayList.add(new ThemeDescription(smsView2.confirmTextView, ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteGrayText6));
arrayList.add(new ThemeDescription(smsView2.titleTextView, ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteBlackText));
if (smsView2.codeField != null) {
for (int a2 = 0; a2 < smsView2.codeField.length; a2++) {
arrayList.add(new ThemeDescription(smsView2.codeField[a2], ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteBlackText));
arrayList.add(new ThemeDescription(smsView2.codeField[a2], ThemeDescription.FLAG_BACKGROUNDFILTER, null, null, null, null, Theme.key_windowBackgroundWhiteInputFieldActivated));
}
}
arrayList.add(new ThemeDescription(smsView2.timeText, ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteGrayText6));
arrayList.add(new ThemeDescription(smsView2.problemText, ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteBlueText4));
arrayList.add(new ThemeDescription(smsView2.progressView, 0, new Class[]{ProgressView.class}, new String[]{decode}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, NPStringFog.decode("5D5E56585F6E41435E5643544242785F5F5443")));
arrayList.add(new ThemeDescription(smsView2.progressView, 0, new Class[]{ProgressView.class}, new String[]{decode}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, NPStringFog.decode("5D5E56585F6E41435E56435442427E44455443")));
arrayList.add(new ThemeDescription(smsView2.blackImageView, ThemeDescription.FLAG_IMAGECOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteBlackText));
arrayList.add(new ThemeDescription(smsView2.blueImageView, ThemeDescription.FLAG_IMAGECOLOR, null, null, null, null, NPStringFog.decode("52595045426E505245585E5F7350525A56435E445F55")));
arrayList.add(new ThemeDescription(smsView3.confirmTextView, ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteGrayText6));
arrayList.add(new ThemeDescription(smsView3.titleTextView, ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteBlackText));
if (smsView3.codeField != null) {
for (int a3 = 0; a3 < smsView3.codeField.length; a3++) {
arrayList.add(new ThemeDescription(smsView3.codeField[a3], ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteBlackText));
arrayList.add(new ThemeDescription(smsView3.codeField[a3], ThemeDescription.FLAG_BACKGROUNDFILTER, null, null, null, null, Theme.key_windowBackgroundWhiteInputFieldActivated));
}
}
arrayList.add(new ThemeDescription(smsView3.timeText, ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteGrayText6));
arrayList.add(new ThemeDescription(smsView3.problemText, ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteBlueText4));
arrayList.add(new ThemeDescription(smsView3.progressView, 0, new Class[]{ProgressView.class}, new String[]{decode}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, NPStringFog.decode("5D5E56585F6E41435E5643544242785F5F5443")));
arrayList.add(new ThemeDescription(smsView3.progressView, 0, new Class[]{ProgressView.class}, new String[]{decode}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, NPStringFog.decode("5D5E56585F6E41435E56435442427E44455443")));
arrayList.add(new ThemeDescription(smsView3.blackImageView, ThemeDescription.FLAG_IMAGECOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteBlackText));
arrayList.add(new ThemeDescription(smsView3.blueImageView, ThemeDescription.FLAG_IMAGECOLOR, null, null, null, null, NPStringFog.decode("52595045426E505245585E5F7350525A56435E445F55")));
arrayList.add(new ThemeDescription(smsView4.confirmTextView, ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteGrayText6));
arrayList.add(new ThemeDescription(smsView4.titleTextView, ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteBlackText));
if (smsView4.codeField != null) {
for (int a4 = 0; a4 < smsView4.codeField.length; a4++) {
arrayList.add(new ThemeDescription(smsView4.codeField[a4], ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteBlackText));
arrayList.add(new ThemeDescription(smsView4.codeField[a4], ThemeDescription.FLAG_BACKGROUNDFILTER, null, null, null, null, Theme.key_windowBackgroundWhiteInputFieldActivated));
}
}
arrayList.add(new ThemeDescription(smsView4.timeText, ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteGrayText6));
arrayList.add(new ThemeDescription(smsView4.problemText, ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteBlueText4));
arrayList.add(new ThemeDescription(smsView4.progressView, 0, new Class[]{ProgressView.class}, new String[]{decode}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, NPStringFog.decode("5D5E56585F6E41435E5643544242785F5F5443")));
arrayList.add(new ThemeDescription(smsView4.progressView, 0, new Class[]{ProgressView.class}, new String[]{decode}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, NPStringFog.decode("5D5E56585F6E41435E56435442427E44455443")));
arrayList.add(new ThemeDescription(smsView4.blackImageView, ThemeDescription.FLAG_IMAGECOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteBlackText));
arrayList.add(new ThemeDescription(smsView4.blueImageView, ThemeDescription.FLAG_IMAGECOLOR, null, null, null, null, NPStringFog.decode("52595045426E505245585E5F7350525A56435E445F55")));
return (ThemeDescription[]) arrayList.toArray(new ThemeDescription[0]);
}
}