Skip to content

Commit

Permalink
chore: Move Disable Flag Secure to Na-settings
Browse files Browse the repository at this point in the history
  • Loading branch information
omg-xtao committed Feb 13, 2024
1 parent 3ad1be7 commit 1607520
Show file tree
Hide file tree
Showing 25 changed files with 35 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import cn.hutool.core.util.ArrayUtil;
import cn.hutool.core.util.StrUtil;
import tw.nekomimi.nekogram.database.NitritesKt;
import xyz.nextalone.nagram.NaConfig;

public class NekoXConfig {

Expand Down Expand Up @@ -66,7 +67,7 @@ public class NekoXConfig {

public static boolean developerMode = preferences.getBoolean("developer_mode", true);

public static boolean disableFlagSecure = preferences.getBoolean("disable_flag_secure", true);
public static boolean disableFlagSecure = NaConfig.INSTANCE.getDisableFlagSecure().Bool();
public static boolean disableScreenshotDetection = preferences.getBoolean("disable_screenshot_detection", false);

public static boolean disableStatusUpdate = preferences.getBoolean("disable_status_update", false);
Expand All @@ -92,7 +93,10 @@ public static void toggleDeveloperMode() {
}

public static void toggleDisableFlagSecure() {
preferences.edit().putBoolean("disable_flag_secure", disableFlagSecure = !disableFlagSecure).apply();
// preferences.edit().putBoolean("disable_flag_secure", disableFlagSecure = !disableFlagSecure).apply();

disableFlagSecure = !disableFlagSecure;
NaConfig.INSTANCE.getDisableFlagSecure().toggleConfigBool();
}

public static void toggleDisableScreenshotDetection() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ public class NekoExperimentalSettingsActivity extends BaseNekoXSettingsActivity

private final AbstractConfigCell header2 = cellGroup.appendCell(new ConfigCellHeader(LocaleController.getString("N_Config")));
private final AbstractConfigCell forceCopyRow = cellGroup.appendCell(new ConfigCellTextCheck(NaConfig.INSTANCE.getForceCopy()));
private final AbstractConfigCell disableFlagSecureRow = cellGroup.appendCell(new ConfigCellTextCheck(NaConfig.INSTANCE.getDisableFlagSecure()));
private final AbstractConfigCell audioEnhanceRow = cellGroup.appendCell(new ConfigCellTextCheck(NaConfig.INSTANCE.getNoiseSuppressAndVoiceEnhance()));
private final AbstractConfigCell showRPCErrorRow = cellGroup.appendCell(new ConfigCellTextCheck(NaConfig.INSTANCE.getShowRPCError()));
private final AbstractConfigCell customArtworkApiRow = cellGroup.appendCell(new ConfigCellTextInput(null, NaConfig.INSTANCE.getCustomArtworkApi(), "", null));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,12 @@ object NaConfig {
ConfigItem.configTypeBool,
false
)
val disableFlagSecure =
addConfig(
"DisableFlagSecure",
ConfigItem.configTypeBool,
true
)

private fun addConfig(
k: String,
Expand Down
1 change: 1 addition & 0 deletions TMessagesProj/src/main/res/values-ar-rSA/strings_na.xml
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,5 @@
<string name="DisableClickCommandToSend">تعطيل نص أمر النقر لإرساله</string>
<string name="DisableClickCommandToSendHint">لمنع اللمس العرضي</string>
<string name="DisableDialogsFloatingButton">تعطيل مربعات الحوار الزر العائم</string>
<string name="DisableFlagSecure">تعطيل العلم الآمن</string>
</resources>
1 change: 1 addition & 0 deletions TMessagesProj/src/main/res/values-cs-rCZ/strings_na.xml
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,5 @@
<string name="DisableClickCommandToSend">Zakázat kliknutí na text příkazu pro odeslání</string>
<string name="DisableClickCommandToSendHint">Aby se zabránilo náhodnému dotyku</string>
<string name="DisableDialogsFloatingButton">Zakázat plovoucí tlačítko dialogů</string>
<string name="DisableFlagSecure">Zakázat zabezpečení vlajky</string>
</resources>
1 change: 1 addition & 0 deletions TMessagesProj/src/main/res/values-da-rDK/strings_na.xml
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,5 @@
<string name="DisableClickCommandToSend">Deaktivér klikkommandotekst for at sende</string>
<string name="DisableClickCommandToSendHint">For at forhindre utilsigtet berøring</string>
<string name="DisableDialogsFloatingButton">Deaktivér Dialoger Flydende Knap</string>
<string name="DisableFlagSecure">Deaktivér Flag Sikker</string>
</resources>
1 change: 1 addition & 0 deletions TMessagesProj/src/main/res/values-de-rDE/strings_na.xml
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,5 @@
<string name="DisableClickCommandToSend">Deaktiviere Befehlstext zum Senden</string>
<string name="DisableClickCommandToSendHint">Um zufällige Berührung zu verhindern</string>
<string name="DisableDialogsFloatingButton">Schwebende Dialoge deaktivieren</string>
<string name="DisableFlagSecure">Sichere Flagge deaktivieren</string>
</resources>
1 change: 1 addition & 0 deletions TMessagesProj/src/main/res/values-el-rGR/strings_na.xml
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,5 @@
<string name="DisableClickCommandToSend">Απενεργοποιήστε το κλικ στην εντολή κειμένου για αποστολή</string>
<string name="DisableClickCommandToSendHint">Για την πρόληψη ακούσιας αφής</string>
<string name="DisableDialogsFloatingButton">Απενεργοποίηση Πλωτού Κουμπιού Dialogs</string>
<string name="DisableFlagSecure">Απενεργοποίηση Flag Secure</string>
</resources>
1 change: 1 addition & 0 deletions TMessagesProj/src/main/res/values-es-rES/strings_na.xml
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,5 @@
<string name="DisableClickCommandToSend">Deshabilitar comando de clic para enviar</string>
<string name="DisableClickCommandToSendHint">Para prevenir toques accidentales</string>
<string name="DisableDialogsFloatingButton">Desactivar el botón flotante de diálogos</string>
<string name="DisableFlagSecure">Desactivar Bandera Segura</string>
</resources>
1 change: 1 addition & 0 deletions TMessagesProj/src/main/res/values-fi-rFI/strings_na.xml
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,5 @@
<string name="DisableClickCommandToSend">Poista komennon teksti käytöstä lähettääksesi</string>
<string name="DisableClickCommandToSendHint">Estä vahingossa kosketus</string>
<string name="DisableDialogsFloatingButton">Poista Dialogien Kelluva Painike Käytöstä</string>
<string name="DisableFlagSecure">Poista Lipun Turvallisuus Käytöstä</string>
</resources>
1 change: 1 addition & 0 deletions TMessagesProj/src/main/res/values-fr-rFR/strings_na.xml
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,5 @@
<string name="DisableClickCommandToSend">Désactiver le texte de la commande pour envoyer</string>
<string name="DisableClickCommandToSendHint">Pour éviter un toucher accidentel</string>
<string name="DisableDialogsFloatingButton">Désactiver le bouton flottant des boîtes de dialogue</string>
<string name="DisableFlagSecure">Désactiver Flag Secure</string>
</resources>
1 change: 1 addition & 0 deletions TMessagesProj/src/main/res/values-it-rIT/strings_na.xml
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,5 @@
<string name="DisableClickCommandToSend">Disabilita il clic sul testo del comando da inviare</string>
<string name="DisableClickCommandToSendHint">Per evitare tocchi accidentali</string>
<string name="DisableDialogsFloatingButton">Disabilita Le Finestre Pulsante Fluttuante</string>
<string name="DisableFlagSecure">Disabilita Flag Secure</string>
</resources>
1 change: 1 addition & 0 deletions TMessagesProj/src/main/res/values-ja-rJP/strings_na.xml
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,5 @@
<string name="DisableClickCommandToSend">送信するコマンドテキストをクリックしない</string>
<string name="DisableClickCommandToSendHint">偶発的なタッチを防ぐため</string>
<string name="DisableDialogsFloatingButton">ダイアログのフローティングボタンを無効化</string>
<string name="DisableFlagSecure">安全フラグを無効にする</string>
</resources>
1 change: 1 addition & 0 deletions TMessagesProj/src/main/res/values-nl-rNL/strings_na.xml
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,5 @@
<string name="DisableClickCommandToSend">Schakel klik op opdracht tekst uit om te verzenden</string>
<string name="DisableClickCommandToSendHint">Ongewenste aanraking voorkomen</string>
<string name="DisableDialogsFloatingButton">Zwevende knop dialoogknop uitschakelen</string>
<string name="DisableFlagSecure">Vlaggenbeveiliging uitschakelen</string>
</resources>
1 change: 1 addition & 0 deletions TMessagesProj/src/main/res/values-no-rNO/strings_na.xml
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,5 @@
<string name="DisableClickCommandToSend">Deaktiver komprimeringstekst for å sende</string>
<string name="DisableClickCommandToSendHint">Å forhindre utilsiktet berøring</string>
<string name="DisableDialogsFloatingButton">Deaktiver dialoger med flytende knapp</string>
<string name="DisableFlagSecure">Deaktiver Flag sikker</string>
</resources>
1 change: 1 addition & 0 deletions TMessagesProj/src/main/res/values-pl-rPL/strings_na.xml
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,5 @@
<string name="DisableClickCommandToSend">Wyłącz tekst polecenia, aby wysłać</string>
<string name="DisableClickCommandToSendHint">Aby zapobiec przypadkowemu dotknięciu</string>
<string name="DisableDialogsFloatingButton">Wyłącz pływający przycisk dialogów</string>
<string name="DisableFlagSecure">Wyłącz bezpieczne flagi</string>
</resources>
1 change: 1 addition & 0 deletions TMessagesProj/src/main/res/values-pt-rBR/strings_na.xml
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,5 @@
<string name="DisableClickCommandToSend">Desative clique no texto de comando para enviar</string>
<string name="DisableClickCommandToSendHint">Para prevenir toques acidentais</string>
<string name="DisableDialogsFloatingButton">Desativar Botão de Diálogos Flutuantes</string>
<string name="DisableFlagSecure">Desativar Sinalização Segura</string>
</resources>
1 change: 1 addition & 0 deletions TMessagesProj/src/main/res/values-pt-rPT/strings_na.xml
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,5 @@
<string name="DisableClickCommandToSend">Desative clique no texto de comando para enviar</string>
<string name="DisableClickCommandToSendHint">Para prevenir toques acidentais</string>
<string name="DisableDialogsFloatingButton">Desativar Botão de Diálogos Flutuantes</string>
<string name="DisableFlagSecure">Desativar Sinalização Segura</string>
</resources>
1 change: 1 addition & 0 deletions TMessagesProj/src/main/res/values-ro-rRO/strings_na.xml
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,5 @@
<string name="DisableClickCommandToSend">Dezactivează clic pe textul de comandă pentru a trimite</string>
<string name="DisableClickCommandToSendHint">Pentru a preveni atingerea accidentală</string>
<string name="DisableDialogsFloatingButton">Dezactivează dialogul cu butonul plutitor</string>
<string name="DisableFlagSecure">Dezactivează Steagul Securizat</string>
</resources>
1 change: 1 addition & 0 deletions TMessagesProj/src/main/res/values-ru-rRU/strings_na.xml
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,5 @@
<string name="DisableClickCommandToSend">Отключите команду клика для отправки</string>
<string name="DisableClickCommandToSendHint">Во избежание случайного касания</string>
<string name="DisableDialogsFloatingButton">Отключить плавающую кнопку диалогов</string>
<string name="DisableFlagSecure">Отключить защиту флага</string>
</resources>
1 change: 1 addition & 0 deletions TMessagesProj/src/main/res/values-sv-rSE/strings_na.xml
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,5 @@
<string name="DisableClickCommandToSend">Inaktivera klickkommandotext för att skicka</string>
<string name="DisableClickCommandToSendHint">För att förhindra oavsiktligt tryck</string>
<string name="DisableDialogsFloatingButton">Inaktivera dialoger flytande knapp</string>
<string name="DisableFlagSecure">Inaktivera flagga säkert</string>
</resources>
1 change: 1 addition & 0 deletions TMessagesProj/src/main/res/values-uk-rUA/strings_na.xml
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,5 @@
<string name="DisableClickCommandToSend">Вимкнути командний текст, щоб відправити</string>
<string name="DisableClickCommandToSendHint">Щоб запобігти випадковому дотику</string>
<string name="DisableDialogsFloatingButton">Вимкнути плаваючу кнопку діалогу</string>
<string name="DisableFlagSecure">Вимкнути захист прапора</string>
</resources>
1 change: 1 addition & 0 deletions TMessagesProj/src/main/res/values-zh-rCN/strings_na.xml
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,5 @@
<string name="DisableClickCommandToSend">禁用点击指令文本发送</string>
<string name="DisableClickCommandToSendHint">妈妈再也不用担心我会误触啦</string>
<string name="DisableDialogsFloatingButton">禁用主页浮动按钮</string>
<string name="DisableFlagSecure">Disable Flag Secure</string>
</resources>
1 change: 1 addition & 0 deletions TMessagesProj/src/main/res/values-zh-rTW/strings_na.xml
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,5 @@
<string name="DisableClickCommandToSend">Disable click command text to send</string>
<string name="DisableClickCommandToSendHint">To prevent accidental touch</string>
<string name="DisableDialogsFloatingButton">Disable Dialogs Floating Button</string>
<string name="DisableFlagSecure">Disable Flag Secure</string>
</resources>
1 change: 1 addition & 0 deletions TMessagesProj/src/main/res/values/strings_na.xml
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,5 @@
<string name="DisableClickCommandToSend">Disable click command text to send</string>
<string name="DisableClickCommandToSendHint">To prevent accidental touch</string>
<string name="DisableDialogsFloatingButton">Disable Dialogs Floating Button</string>
<string name="DisableFlagSecure">Disable Flag Secure</string>
</resources>

0 comments on commit 1607520

Please sign in to comment.