diff --git a/lib/l10n/arb/app_de.arb b/lib/l10n/arb/app_de.arb index d524f3b70..64d55f313 100644 --- a/lib/l10n/arb/app_de.arb +++ b/lib/l10n/arb/app_de.arb @@ -267,5 +267,8 @@ "thisWillLogYouOutOfTheFollowingDevice": "Dadurch wirst du von folgendem Gerät abgemeldet:", "terminateSession": "Sitzungen beenden?", "terminate": "Beenden", - "thisDevice": "Dieses Gerät" + "thisDevice": "Dieses Gerät", + "editCodeAuthMessage": "Authentifizieren, um Code zu bearbeiten", + "deleteCodeAuthMessage": "Authentifizieren, um Code zu löschen", + "showQRAuthMessage": "Authentifizieren, um QR-Code anzuzeigen" } \ No newline at end of file diff --git a/lib/l10n/arb/app_en.arb b/lib/l10n/arb/app_en.arb index b572856ed..cc275032d 100644 --- a/lib/l10n/arb/app_en.arb +++ b/lib/l10n/arb/app_en.arb @@ -333,5 +333,8 @@ "shouldHideCode": "Hide codes", "focusOnSearchBar": "Focus search on app start", "confirmUpdatingkey": "Are you sure you want to update the secret key?", - "minimizeAppOnCopy": "Minimize app on copy" + "minimizeAppOnCopy": "Minimize app on copy", + "editCodeAuthMessage": "Authenticate to edit code", + "deleteCodeAuthMessage": "Authenticate to delete code", + "showQRAuthMessage": "Authenticate to show QR code" } diff --git a/lib/l10n/arb/app_es.arb b/lib/l10n/arb/app_es.arb index 932a3b835..5eba49110 100644 --- a/lib/l10n/arb/app_es.arb +++ b/lib/l10n/arb/app_es.arb @@ -226,5 +226,8 @@ "authToExportCodes": "Por favor, autentifíquese para exportar sus códigos", "sorry": "Lo sentimos", "importFailureDesc": "No se pudo analizar el archivo seleccionado.\n¡Por favor escriba a support@ente.io si necesita ayuda!", - "pendingSyncs": "Atención" + "pendingSyncs": "Atención", + "editCodeAuthMessage": "Autenticar para editar código", + "deleteCodeAuthMessage": "Autenticar para borrar código", + "showQRAuthMessage": "Autenticar para mostrar código QR" } \ No newline at end of file diff --git a/lib/l10n/arb/app_fa.arb b/lib/l10n/arb/app_fa.arb index 3767567bb..1e4fa377e 100644 --- a/lib/l10n/arb/app_fa.arb +++ b/lib/l10n/arb/app_fa.arb @@ -231,5 +231,8 @@ "importFailureDesc": "نتوانستیم فایل انتخابی را تجزیه و تحلیل کنیم.\nاگر به کمک نیاز دارید، لطفا به support@ente.io ایمیل بزنید!", "pendingSyncs": "اخطار", "pendingSyncsWarningBody": "برخی از کدهای شما پشتیبان گیری نشده اند.\n\nلطفا قبل از خروج، مطمئن شوید که یک نسخه پشتیبان برای این کدها دارید.", - "thisDevice": "این دستگاه" + "thisDevice": "این دستگاه", + "editCodeAuthMessage": "احراز هویت برای ویرایش کد", + "deleteCodeAuthMessage": "احراز هویت برای حذف کد", + "showQRAuthMessage": "احراز هویت برای نمایش کد QR" } \ No newline at end of file diff --git a/lib/l10n/arb/app_fi.arb b/lib/l10n/arb/app_fi.arb index bfa415d67..c1ffa3883 100644 --- a/lib/l10n/arb/app_fi.arb +++ b/lib/l10n/arb/app_fi.arb @@ -119,5 +119,8 @@ "moderateStrength": "Kohtalainen salasana", "confirmPassword": "Vahvista salasana", "close": "Sulje", - "oopsSomethingWentWrong": "Hupsista! Jotakin meni nyt pieleen." + "oopsSomethingWentWrong": "Hupsista! Jotakin meni nyt pieleen.", + "editCodeAuthMessage": "Autentikoidu muokataksesi koodia", + "deleteCodeAuthMessage": "Autentikoidu poistaaksesi koodin", + "showQRAuthMessage": "Autentikoidu näyttääksesi QR-koodin" } \ No newline at end of file diff --git a/lib/l10n/arb/app_fr.arb b/lib/l10n/arb/app_fr.arb index 552dada67..b9c8dc840 100644 --- a/lib/l10n/arb/app_fr.arb +++ b/lib/l10n/arb/app_fr.arb @@ -330,5 +330,8 @@ "offlineModeWarning": "Vous avez choisi de procéder sans sauvegarde. Veuillez prendre des sauvegardes manuelles pour vous assurer que vos codes sont sûrs.", "showLargeIcons": "Afficher les grandes icônes", "shouldHideCode": "Cacher les codes", - "focusOnSearchBar": "Cibler le champ de recherche au démarrage de l'application" + "focusOnSearchBar": "Cibler le champ de recherche au démarrage de l'application", + "editCodeAuthMessage": "Authentification requise pour modifier le code", + "deleteCodeAuthMessage": "Authentification requise pour supprimer le code", + "showQRAuthMessage": "Authentification requise pour afficher le code QR" } \ No newline at end of file diff --git a/lib/l10n/arb/app_it.arb b/lib/l10n/arb/app_it.arb index ea7197bd4..bce97481a 100644 --- a/lib/l10n/arb/app_it.arb +++ b/lib/l10n/arb/app_it.arb @@ -333,5 +333,8 @@ "shouldHideCode": "Nascondi i codici", "focusOnSearchBar": "Apri ricerca all'avvio dell'app", "confirmUpdatingkey": "Sei sicuro di voler aggiornare la chiave segreta?", - "minimizeAppOnCopy": "Riduci a icona l'app dopo la copia" + "minimizeAppOnCopy": "Riduci a icona l'app dopo la copia", + "editCodeAuthMessage": "Autenticarsi per modificare il codice", + "deleteCodeAuthMessage": "Autenticarsi per cancellare il codice", + "showQRAuthMessage": "Autenticarsi per mostrare il codice QR" } \ No newline at end of file diff --git a/lib/l10n/arb/app_ja.arb b/lib/l10n/arb/app_ja.arb index 4957e82e7..689cc46a1 100644 --- a/lib/l10n/arb/app_ja.arb +++ b/lib/l10n/arb/app_ja.arb @@ -263,5 +263,8 @@ "thisWillLogYouOutOfTheFollowingDevice": "以下のデバイスからログアウトします:", "terminateSession": "セッションを終了しますか?", "terminate": "終了", - "thisDevice": "このデバイス" + "thisDevice": "このデバイス", + "editCodeAuthMessage": "コードを編集するには認証が必要です", + "deleteCodeAuthMessage": "コードを削除するには認証が必要です", + "showQRAuthMessage": "QRコードを表示するには認証が必要です" } \ No newline at end of file diff --git a/lib/l10n/arb/app_nl.arb b/lib/l10n/arb/app_nl.arb index d2d3b8e82..5f26eac1c 100644 --- a/lib/l10n/arb/app_nl.arb +++ b/lib/l10n/arb/app_nl.arb @@ -329,5 +329,8 @@ "sigInBackupReminder": "Exporteer de codes zodat je een back-up hebt waarvandaan je kan herstellen.", "offlineModeWarning": "Je hebt ervoor gekozen om verder te gaan zonder back-ups. Neem handmatige back-ups om ervoor te zorgen dat jouw codes veilig zijn.", "showLargeIcons": "Grote iconen", - "focusOnSearchBar": "Focus zoekveld na starten app" + "focusOnSearchBar": "Focus zoekveld na starten app", + "editCodeAuthMessage": "Authenticeren om code te bewerken", + "deleteCodeAuthMessage": "Authenticeren om code te verwijderen", + "showQRAuthMessage": "Authenticeren om QR-code te tonen" } \ No newline at end of file diff --git a/lib/l10n/arb/app_pl.arb b/lib/l10n/arb/app_pl.arb index b31e8a3e2..bf9bbe7e5 100644 --- a/lib/l10n/arb/app_pl.arb +++ b/lib/l10n/arb/app_pl.arb @@ -263,5 +263,8 @@ "thisWillLogYouOutOfTheFollowingDevice": "To wyloguje Cię z tego urządzenia:", "terminateSession": "Zakończyć sesję?", "terminate": "Zakończ", - "thisDevice": "To urządzenie" + "thisDevice": "To urządzenie", + "editCodeAuthMessage": "Uwierzytelnij, aby edytować kod", + "deleteCodeAuthMessage": "Uwierzytelnij, aby usunąć kod", + "showQRAuthMessage": "Uwierzytelnij, aby pokazać kod QR" } \ No newline at end of file diff --git a/lib/l10n/arb/app_pt.arb b/lib/l10n/arb/app_pt.arb index 5e7865f74..aaa25d9d7 100644 --- a/lib/l10n/arb/app_pt.arb +++ b/lib/l10n/arb/app_pt.arb @@ -223,5 +223,8 @@ "sorry": "Desculpe", "importFailureDesc": "Não foi possível analisar o arquivo selecionado.\nPor favor, escreva para support@ente.io se precisar de ajuda!", "pendingSyncs": "Atenção", - "pendingSyncsWarningBody": "Alguns de seus códigos não foram salvos.\n\nPor favor, certifique-se que você possui um backup para esses códigos antes de sair." + "pendingSyncsWarningBody": "Alguns de seus códigos não foram salvos.\n\nPor favor, certifique-se que você possui um backup para esses códigos antes de sair.", + "editCodeAuthMessage": "Autenticar para editar o código", + "deleteCodeAuthMessage": "Autenticar para excluir o código", + "showQRAuthMessage": "Autenticar para mostrar o QR Code" } \ No newline at end of file diff --git a/lib/l10n/arb/app_ru.arb b/lib/l10n/arb/app_ru.arb index 71c44de9c..fb67158d4 100644 --- a/lib/l10n/arb/app_ru.arb +++ b/lib/l10n/arb/app_ru.arb @@ -316,5 +316,8 @@ "encrypted": "Зашифрованный", "plainText": "Обычный текст", "passwordToEncryptExport": "Пароль для шифрования экспорта", - "export": "Экспорт" + "export": "Экспорт", + "editCodeAuthMessage": "Аутентификация для редактирования кода", + "deleteCodeAuthMessage": "Аутентификация для удаления кода", + "showQRAuthMessage": "Аутентификация для отображения QR-кода" } \ No newline at end of file diff --git a/lib/l10n/arb/app_tr.arb b/lib/l10n/arb/app_tr.arb index 4bfc5ce79..290b9711f 100644 --- a/lib/l10n/arb/app_tr.arb +++ b/lib/l10n/arb/app_tr.arb @@ -314,5 +314,8 @@ "encrypted": "Şifreli", "plainText": "Düz metin", "passwordToEncryptExport": "Dışa aktarımı şifrelemek için parola", - "export": "Dışa aktar" + "export": "Dışa aktar", + "editCodeAuthMessage": "Kodu düzenlemek için doğrulama yapın", + "deleteCodeAuthMessage": "Kodu silmek için doğrulama yapın", + "showQRAuthMessage": "QR kodunu göstermek için doğrulama yapın" } \ No newline at end of file diff --git a/lib/l10n/arb/app_vi.arb b/lib/l10n/arb/app_vi.arb index 4a14ab1a2..762d136cd 100644 --- a/lib/l10n/arb/app_vi.arb +++ b/lib/l10n/arb/app_vi.arb @@ -267,5 +267,8 @@ "thisWillLogYouOutOfTheFollowingDevice": "Thao tác này sẽ đăng xuất bạn khỏi thiết bị sau:", "terminateSession": "Chấm dứt phiên?", "terminate": "Dừng lại", - "thisDevice": "Thiết bị này" + "thisDevice": "Thiết bị này", + "editCodeAuthMessage": "Xác minh để chỉnh sửa mã", + "deleteCodeAuthMessage": "Xác minh để xóa mã", + "showQRAuthMessage": "Xác minh để hiển thị mã QR" } \ No newline at end of file diff --git a/lib/l10n/arb/app_zh.arb b/lib/l10n/arb/app_zh.arb index 98028a032..cd996fab5 100644 --- a/lib/l10n/arb/app_zh.arb +++ b/lib/l10n/arb/app_zh.arb @@ -333,5 +333,8 @@ "shouldHideCode": "隐藏代码", "focusOnSearchBar": "应用启动后聚焦搜索", "confirmUpdatingkey": "您确定要更新此密钥吗?", - "minimizeAppOnCopy": "复制时最小化应用" + "minimizeAppOnCopy": "复制时最小化应用", + "editCodeAuthMessage": "编辑代码需要身份验证", + "deleteCodeAuthMessage": "删除代码需要身份验证", + "showQRAuthMessage": "显示QR码需要身份验证" } \ No newline at end of file diff --git a/lib/ui/code_widget.dart b/lib/ui/code_widget.dart index a26cc20b2..1fe339eac 100644 --- a/lib/ui/code_widget.dart +++ b/lib/ui/code_widget.dart @@ -12,6 +12,7 @@ import 'package:ente_auth/services/preference_service.dart'; import 'package:ente_auth/store/code_store.dart'; import 'package:ente_auth/ui/code_timer_progress.dart'; import 'package:ente_auth/ui/utils/icon_utils.dart'; +import 'package:ente_auth/utils/auth_util.dart'; import 'package:ente_auth/utils/dialog_util.dart'; import 'package:ente_auth/utils/toast_util.dart'; import 'package:ente_auth/utils/totp_util.dart'; @@ -370,6 +371,10 @@ class _CodeWidgetState extends State { } Future _onEditPressed(_) async { + bool _isAuthSuccessful = await requestAuthentication(context.l10n.editCodeAuthMessage); + if(!_isAuthSuccessful) { + return; + } final Code? code = await Navigator.of(context).push( MaterialPageRoute( builder: (BuildContext context) { @@ -383,6 +388,10 @@ class _CodeWidgetState extends State { } Future _onShowQrPressed(_) async { + bool _isAuthSuccessful = await requestAuthentication(context.l10n.showQRAuthMessage); + if(!_isAuthSuccessful) { + return; + } // ignore: unused_local_variable final Code? code = await Navigator.of(context).push( MaterialPageRoute( @@ -394,6 +403,10 @@ class _CodeWidgetState extends State { } void _onDeletePressed(_) async { + bool _isAuthSuccessful = await requestAuthentication(context.l10n.deleteCodeAuthMessage); + if(!_isAuthSuccessful) { + return; + } final l10n = context.l10n; await showChoiceActionSheet( context, diff --git a/pubspec.lock b/pubspec.lock index f290a3e0c..cd02845d1 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -755,10 +755,10 @@ packages: dependency: "direct main" description: name: local_auth - sha256: "0cf238be2bfa51a6c9e7e9cfc11c05ea39f2a3a4d3e5bb255d0ebc917da24401" + sha256: "7e6c63082e399b61e4af71266b012e767a5d4525dd6e9ba41e174fd42d76e115" url: "https://pub.dev" source: hosted - version: "2.1.6" + version: "2.1.7" local_auth_android: dependency: transitive description: @@ -1654,4 +1654,4 @@ packages: version: "3.1.2" sdks: dart: ">=3.1.0-185.0.dev <4.0.0" - flutter: ">=3.7.0" + flutter: ">=3.10.0" diff --git a/pubspec.yaml b/pubspec.yaml index ca5437518..81aea0ad0 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -51,7 +51,7 @@ dependencies: http: ^0.13.4 intl: ^0.18.0 json_annotation: ^4.5.0 - local_auth: ^2.1.3 + local_auth: ^2.1.7 logging: ^1.0.1 modal_bottom_sheet: ^3.0.0-pre move_to_background: ^1.0.2