π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
fixed review changes
a5xwin0a1bcc863b58
diff --git a/mobile/apps/auth/lib/services/local_backup_service.dart b/mobile/apps/auth/lib/services/local_backup_service.dartindex 587ad5f1db..ab496fe172 100644--- a/mobile/apps/auth/lib/services/local_backup_service.dart+++ b/mobile/apps/auth/lib/services/local_backup_service.dart@@ -7,6 +7,7 @@ import 'package:flutter_secure_storage/flutter_secure_storage.dart';import 'package:intl/intl.dart'; //for time based file namingimport 'package:logging/logging.dart';import 'package:shared_preferences/shared_preferences.dart';+//we gonn changeclass LocalBackupService {final _logger = Logger('LocalBackupService');@@ -40,7 +41,28 @@ class LocalBackupService {_logger.info("Change detected, triggering automatic encrypted backup...");- final plainTextContent = await CodeStore.instance.getCodesForExport();++ String rawContent = await CodeStore.instance.getCodesForExport();++ List<String> lines = rawContent.split('\n');+ List<String> cleanedLines = [];++ for (String line in lines) {+ if (line.trim().isEmpty) continue;++ String cleanUrl;+ if (line.startsWith('"') && line.endsWith('"')) {+ cleanUrl = jsonDecode(line);+ }++ else {+ cleanUrl = line;+ }++ cleanedLines.add(cleanUrl);+ }++ final plainTextContent = cleanedLines.join('\n');if (plainTextContent.trim().isEmpty) {return;diff --git a/mobile/apps/auth/lib/ui/settings/data/import/encrypted_ente_import.dart b/mobile/apps/auth/lib/ui/settings/data/import/encrypted_ente_import.dartindex ac26ecc1c7..e86e8b3521 100644--- a/mobile/apps/auth/lib/ui/settings/data/import/encrypted_ente_import.dart+++ b/mobile/apps/auth/lib/ui/settings/data/import/encrypted_ente_import.dart@@ -46,7 +46,7 @@ Future<void> showEncryptedImportInstruction(BuildContext context) async {if (result?.action != null && result!.action != ButtonAction.cancel) {if (result.action == ButtonAction.first) {await _pickEnteJsonFile(context);- }+ } else {}}}@@ -85,6 +85,7 @@ Future<void> _decryptExportData(enteAuthExport.kdfParams.opsLimit,);Uint8List? decryptedContent;+ // Encrypt the key with this derived keytry {decryptedContent = await CryptoUtil.decryptData(CryptoUtil.base642bin(enteAuthExport.encryptedData),@@ -98,6 +99,7 @@ Future<void> _decryptExportData(}if (isPasswordIncorrect) {await progressDialog.hide();+Future.delayed(const Duration(seconds: 0), () {_decryptExportData(context, enteAuthExport, password: password);});@@ -107,28 +109,17 @@ Future<void> _decryptExportData(List<String> splitCodes = content.split("\n");final parsedCodes = [];for (final code in splitCodes) {- if (code.trim().isEmpty) continue;try {- String otpUrl;- if (code.startsWith('"') && code.endsWith('"')) {- otpUrl = jsonDecode(code); // decode json wrapped URL- }- else {- otpUrl = code; // use raw URL directly- }- parsedCodes.add(Code.fromOTPAuthUrl(otpUrl));- }- catch (e) {+ parsedCodes.add(Code.fromOTPAuthUrl(code));+ } catch (e) {Logger('EncryptedText').severe("Could not parse code", e);}- }-+ }for (final code in parsedCodes) {await CodeStore.instance.addCode(code, shouldSync: false);}unawaited(AuthenticatorService.instance.onlineSync());importedCodeCount = parsedCodes.length;-await progressDialog.hide();} catch (e, s) {await progressDialog.hide();