From 1d955ebb47a47e57b3e9f721a89560dbf427d60b Mon Sep 17 00:00:00 2001
From: vivabelarus <74508922+vivabelarus@users.noreply.github.com>
Date: Fri, 23 Dec 2022 11:20:57 +0300
Subject: [PATCH] remove returnToSettings from TwoStepVerificationSetupActivity
---
.../src/main/assets/strings/strings_be.xml | 1 -
.../src/main/assets/strings/strings_es.xml | 1 -
.../src/main/assets/strings/strings_fa.xml | 1 -
.../src/main/assets/strings/strings_pl.xml | 1 -
.../src/main/assets/strings/strings_ru.xml | 1 -
.../src/main/assets/strings/strings_uk.xml | 1 -
.../ui/TwoStepVerificationSetupActivity.java | 66 +++++++------------
TMessagesProj/src/main/res/values/strings.xml | 1 -
8 files changed, 23 insertions(+), 50 deletions(-)
diff --git a/TMessagesProj/src/main/assets/strings/strings_be.xml b/TMessagesProj/src/main/assets/strings/strings_be.xml
index 58ba87d16..dfa0b8ce1 100644
--- a/TMessagesProj/src/main/assets/strings/strings_be.xml
+++ b/TMessagesProj/src/main/assets/strings/strings_be.xml
@@ -41,7 +41,6 @@
Увага!
У вашым акаўнце не ўсталявана двухэтапная аутэнтыфікацыя. Настойліва прапануецца наладзіць пароль для акаўнта. У іншым выпадку, узровень бяспекі акаўнта будзе невялікім.
Выдаляць стыкеры
- Вяртацца
Паведамленне-актыватар
Дзеянні з несапраўдным кодам блакіроўкі будуць выкананы пры атрыманні паведамлення-актыватара ў любым чаце.
адключана
diff --git a/TMessagesProj/src/main/assets/strings/strings_es.xml b/TMessagesProj/src/main/assets/strings/strings_es.xml
index 904032882..4cb79edb7 100644
--- a/TMessagesProj/src/main/assets/strings/strings_es.xml
+++ b/TMessagesProj/src/main/assets/strings/strings_es.xml
@@ -40,7 +40,6 @@
¡atención!
Su cuenta no tiene verificación en 2 pasos. Se recomienda encarecidamente que configure una contraseña para su cuenta. De lo contrario, el nivel de seguridad de la cuenta será bajo.
Eliminar pegatinas
- devolución
Mensaje de activación
Las acciones de código de bloqueo falso se ejecutarán al recibir el mensaje de activación en cualquier chat.
Deshabilitado
diff --git a/TMessagesProj/src/main/assets/strings/strings_fa.xml b/TMessagesProj/src/main/assets/strings/strings_fa.xml
index 080baf66b..99b15bac4 100644
--- a/TMessagesProj/src/main/assets/strings/strings_fa.xml
+++ b/TMessagesProj/src/main/assets/strings/strings_fa.xml
@@ -41,7 +41,6 @@
توجه!
اکانت شما تایید دو مرحله ای ندارد. شدیدا توصیه می شود که شما یک رمزعبور برای اکانت خود تعیین کنید. درغیر این صورت سطح محافظت از این اکانت پایین خواهد بود.
حذف استیکر ها
- بازگشت
پیام فعالسازی
اقدامات رمزعبور قلابی پس از دریافت پیام فعال سازی در هر چت انجام می شود.
غیرفعال شده
diff --git a/TMessagesProj/src/main/assets/strings/strings_pl.xml b/TMessagesProj/src/main/assets/strings/strings_pl.xml
index 3bf72d0f0..4868d02c0 100644
--- a/TMessagesProj/src/main/assets/strings/strings_pl.xml
+++ b/TMessagesProj/src/main/assets/strings/strings_pl.xml
@@ -41,7 +41,6 @@
Uwaga!
Twoje konto nie ma zainstalowanego uwierzytelniania dwuetapowego. Zdecydowanie zaleca się ustawienie hasła do swojego konta. W przeciwnym razie poziom bezpieczeństwa konta będzie niski.
Usuń naklejki
- Wróć
Wiadomość aktywatora
Akcje z fałszywym hasłem zostaną wykonane po otrzymaniu wiadomości aktywatora na dowolnym czacie.
wyłączone
diff --git a/TMessagesProj/src/main/assets/strings/strings_ru.xml b/TMessagesProj/src/main/assets/strings/strings_ru.xml
index 632b36361..af49d8362 100644
--- a/TMessagesProj/src/main/assets/strings/strings_ru.xml
+++ b/TMessagesProj/src/main/assets/strings/strings_ru.xml
@@ -41,7 +41,6 @@
Внимание!
В вашем аккаунте не установлена двухэтапная аутентификация. Настоятельно рекомендуется настроить пароль для аккаунта. В противном случае уровень безопасности аккаунта будет низким.
Удалять стикеры
- Вернуться
Сообщение-активатор
Действия с ложным паролем будут выполнены при получении сообщения активатора в любом чате.
отключено
diff --git a/TMessagesProj/src/main/assets/strings/strings_uk.xml b/TMessagesProj/src/main/assets/strings/strings_uk.xml
index 0c2bdf9b0..e860aef7c 100644
--- a/TMessagesProj/src/main/assets/strings/strings_uk.xml
+++ b/TMessagesProj/src/main/assets/strings/strings_uk.xml
@@ -41,7 +41,6 @@
Увага!
У вашому обліковому записі не встановлена двофакторна автентифікація. Наполегливо рекомендуємо налаштувати пароль для облікового запису. В іншому випадку рівень безпеки облікового запису буде низьким.
Видаляти наліпки
- Повернутися
Повідомлення-активатор
Дії з фальшивим кодом блокування будуть виконані отримуючи повідомлення-активатор у будь-якому чаті.
вимкнено
diff --git a/TMessagesProj/src/main/java/org/telegram/ui/TwoStepVerificationSetupActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/TwoStepVerificationSetupActivity.java
index 323deda48..84be6b38f 100644
--- a/TMessagesProj/src/main/java/org/telegram/ui/TwoStepVerificationSetupActivity.java
+++ b/TMessagesProj/src/main/java/org/telegram/ui/TwoStepVerificationSetupActivity.java
@@ -142,7 +142,6 @@ public class TwoStepVerificationSetupActivity extends BaseFragment {
private RadialProgressView floatingProgressView;
private CustomPhoneKeyboardView keyboardView;
- public boolean returnToSettings = true;
private RLottieDrawable[] animationDrawables;
private Runnable setAnimationRunnable;
@@ -463,6 +462,7 @@ public class TwoStepVerificationSetupActivity extends BaseFragment {
titleTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 18);
break;
}
+
switch (currentType) {
case TYPE_INTRO:
case TYPE_PASSWORD_SET:
@@ -983,10 +983,8 @@ public class TwoStepVerificationSetupActivity extends BaseFragment {
buttonTextView.setText(LocaleController.getString("TwoStepVerificationPasswordReturnPassport", R.string.TwoStepVerificationPasswordReturnPassport));
} else if (fromRegistration) {
buttonTextView.setText(LocaleController.getString(R.string.Continue));
- } else if (returnToSettings) {
- buttonTextView.setText(LocaleController.getString("TwoStepVerificationPasswordReturnSettings", R.string.TwoStepVerificationPasswordReturnSettings));
} else {
- buttonTextView.setText(LocaleController.getString("TwoStepVerificationPasswordReturn", R.string.TwoStepVerificationPasswordReturn));
+ buttonTextView.setText(LocaleController.getString("TwoStepVerificationPasswordReturnSettings", R.string.TwoStepVerificationPasswordReturnSettings));
}
descriptionText.setVisibility(View.VISIBLE);
@@ -1326,13 +1324,12 @@ public class TwoStepVerificationSetupActivity extends BaseFragment {
TwoStepVerificationSetupActivity fragment = new TwoStepVerificationSetupActivity(currentAccount, TYPE_CREATE_PASSWORD_STEP_1, currentPassword);
fragment.fromRegistration = fromRegistration;
fragment.closeAfterSet = closeAfterSet;
- fragment.returnToSettings = returnToSettings;
fragment.setBlockingAlert(otherwiseReloginDays);
presentFragment(fragment, true);
break;
}
case TYPE_PASSWORD_SET: {
- if (closeAfterSet || !returnToSettings) {
+ if (closeAfterSet) {
finishFragment();
} else if (fromRegistration) {
Bundle args = new Bundle();
@@ -1466,7 +1463,6 @@ public class TwoStepVerificationSetupActivity extends BaseFragment {
fragment.fragmentsToClose.addAll(fragmentsToClose);
fragment.fragmentsToClose.add(this);
fragment.closeAfterSet = closeAfterSet;
- fragment.returnToSettings = returnToSettings;
fragment.setBlockingAlert(otherwiseReloginDays);
presentFragment(fragment);
@@ -1546,17 +1542,13 @@ public class TwoStepVerificationSetupActivity extends BaseFragment {
fragmentsToClose.get(a).removeSelfFromStack();
}
NotificationCenter.getInstance(currentAccount).postNotificationName(NotificationCenter.twoStepPasswordChanged, currentPasswordHash, currentPassword.new_algo, currentPassword.new_secure_algo, currentPassword.secure_random, email, hint, null, firstPassword);
- if (returnToSettings) {
- TwoStepVerificationActivity fragment = new TwoStepVerificationActivity();
- currentPassword.has_password = true;
- currentPassword.has_recovery = true;
- currentPassword.email_unconfirmed_pattern = "";
- fragment.setCurrentPasswordParams(currentPassword, currentPasswordHash, currentSecretId, currentSecret);
- fragment.setBlockingAlert(otherwiseReloginDays);
- presentFragment(fragment, true);
- } else {
- finishFragment();
- }
+ TwoStepVerificationActivity fragment = new TwoStepVerificationActivity();
+ currentPassword.has_password = true;
+ currentPassword.has_recovery = true;
+ currentPassword.email_unconfirmed_pattern = "";
+ fragment.setCurrentPasswordParams(currentPassword, currentPasswordHash, currentSecretId, currentSecret);
+ fragment.setBlockingAlert(otherwiseReloginDays);
+ presentFragment(fragment, true);
NotificationCenter.getInstance(currentAccount).postNotificationName(NotificationCenter.didSetOrRemoveTwoStepPassword, currentPassword);
});
if (currentPassword.has_recovery) {
@@ -1582,7 +1574,6 @@ public class TwoStepVerificationSetupActivity extends BaseFragment {
fragment.setCurrentPasswordParams(currentPasswordHash, currentSecretId, currentSecret, emailOnly);
fragment.fragmentsToClose.addAll(fragmentsToClose);
fragment.closeAfterSet = closeAfterSet;
- fragment.returnToSettings = returnToSettings;
fragment.setBlockingAlert(otherwiseReloginDays);
presentFragment(fragment, true);
NotificationCenter.getInstance(currentAccount).postNotificationName(NotificationCenter.twoStepPasswordChanged, currentPasswordHash, currentPassword.new_algo, currentPassword.new_secure_algo, currentPassword.secure_random, email, hint, null, firstPassword);
@@ -1644,7 +1635,6 @@ public class TwoStepVerificationSetupActivity extends BaseFragment {
fragment.fragmentsToClose.add(this);
fragment.closeAfterSet = closeAfterSet;
fragment.setBlockingAlert(otherwiseReloginDays);
- fragment.returnToSettings = returnToSettings;
presentFragment(fragment);
} else {
email = "";
@@ -1862,16 +1852,12 @@ public class TwoStepVerificationSetupActivity extends BaseFragment {
ConnectionsManager.getInstance(currentAccount).sendRequest(req, (response, error) -> AndroidUtilities.runOnUIThread(() -> {
needHideProgress();
if (error == null) {
- if (returnToSettings) {
- TwoStepVerificationActivity fragment = new TwoStepVerificationActivity();
- currentPassword.has_recovery = false;
- currentPassword.email_unconfirmed_pattern = "";
- fragment.setCurrentPasswordParams(currentPassword, currentPasswordHash, currentSecretId, currentSecret);
- fragment.setBlockingAlert(otherwiseReloginDays);
- presentFragment(fragment, true);
- } else {
- finishFragment();
- }
+ TwoStepVerificationActivity fragment = new TwoStepVerificationActivity();
+ currentPassword.has_recovery = false;
+ currentPassword.email_unconfirmed_pattern = "";
+ fragment.setCurrentPasswordParams(currentPassword, currentPasswordHash, currentSecretId, currentSecret);
+ fragment.setBlockingAlert(otherwiseReloginDays);
+ presentFragment(fragment, true);
NotificationCenter.getInstance(currentAccount).postNotificationName(NotificationCenter.didRemoveTwoStepPassword);
}
}));
@@ -1984,18 +1970,14 @@ public class TwoStepVerificationSetupActivity extends BaseFragment {
for (int a = 0, N = fragmentsToClose.size(); a < N; a++) {
fragmentsToClose.get(a).removeSelfFromStack();
}
- if (returnToSettings) {
- TwoStepVerificationActivity fragment = new TwoStepVerificationActivity();
- currentPassword.has_password = true;
- if (!currentPassword.has_recovery) {
- currentPassword.has_recovery = !TextUtils.isEmpty(currentPassword.email_unconfirmed_pattern);
- }
- fragment.setCurrentPasswordParams(currentPassword, newPasswordHash != null ? newPasswordHash : currentPasswordHash, currentSecretId, currentSecret);
- fragment.setBlockingAlert(otherwiseReloginDays);
- presentFragment(fragment, true);
- } else {
- finishFragment();
+ TwoStepVerificationActivity fragment = new TwoStepVerificationActivity();
+ currentPassword.has_password = true;
+ if (!currentPassword.has_recovery) {
+ currentPassword.has_recovery = !TextUtils.isEmpty(currentPassword.email_unconfirmed_pattern);
}
+ fragment.setCurrentPasswordParams(currentPassword, newPasswordHash != null ? newPasswordHash : currentPasswordHash, currentSecretId, currentSecret);
+ fragment.setBlockingAlert(otherwiseReloginDays);
+ presentFragment(fragment, true);
NotificationCenter.getInstance(currentAccount).postNotificationName(NotificationCenter.didSetOrRemoveTwoStepPassword, currentPassword);
});
if (password == null && currentPassword != null && currentPassword.has_password) {
@@ -2024,7 +2006,6 @@ public class TwoStepVerificationSetupActivity extends BaseFragment {
fragment.fromRegistration = fromRegistration;
fragment.setCurrentPasswordParams(newPasswordHash != null ? newPasswordHash : currentPasswordHash, currentSecretId, currentSecret, emailOnly);
fragment.closeAfterSet = closeAfterSet;
- fragment.returnToSettings = returnToSettings;
fragment.setBlockingAlert(otherwiseReloginDays);
presentFragment(fragment, true);
NotificationCenter.getInstance(currentAccount).postNotificationName(NotificationCenter.didSetOrRemoveTwoStepPassword, currentPassword);
@@ -2042,7 +2023,6 @@ public class TwoStepVerificationSetupActivity extends BaseFragment {
fragment.fromRegistration = fromRegistration;
fragment.setCurrentPasswordParams(newPasswordHash != null ? newPasswordHash : currentPasswordHash, currentSecretId, currentSecret, emailOnly);
fragment.closeAfterSet = closeAfterSet;
- fragment.returnToSettings = returnToSettings;
fragment.setBlockingAlert(otherwiseReloginDays);
presentFragment(fragment, true);
} else {
diff --git a/TMessagesProj/src/main/res/values/strings.xml b/TMessagesProj/src/main/res/values/strings.xml
index d05935fe5..5f160a168 100644
--- a/TMessagesProj/src/main/res/values/strings.xml
+++ b/TMessagesProj/src/main/res/values/strings.xml
@@ -5956,7 +5956,6 @@
Attention!
Your account does not have 2-Step Verification. It is highly recommended that you set up a password for your account. Otherwise, the security level of the account will be low.
Delete Stickers
- Return
Activation Message
Fake passcode actions will be executed upon receipt of the activation message in any chat.
disabled