Skip to content

Commit 9f04472

Browse files
committed
Adjust the warning message
1 parent cc471ed commit 9f04472

1 file changed

Lines changed: 14 additions & 19 deletions

File tree

lib/src/utils/solid_file_operations_download.dart

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ class SolidFileDownloadOperations {
103103
/// Returns `true` if the user chooses to proceed with the download.
104104
/// Returns `false` if the user cancels.
105105
106-
static Future<bool> _showCrossAppDecryptionWarning(
106+
static Future<bool> _showCrossAppDownloadWarning(
107107
BuildContext context,
108108
) async {
109109
final result = await showDialog<bool>(
@@ -114,16 +114,15 @@ class SolidFileDownloadOperations {
114114
children: [
115115
Icon(Icons.warning_amber_rounded, color: Colors.orange, size: 28),
116116
SizedBox(width: 12),
117-
Expanded(child: Text('Decryption Warning')),
117+
Expanded(child: Text('Cross-App Download Warning')),
118118
],
119119
),
120120
content: const Column(
121121
mainAxisSize: MainAxisSize.min,
122122
crossAxisAlignment: CrossAxisAlignment.start,
123123
children: [
124124
Text(
125-
'This encrypted file belongs to another application\'s data '
126-
'folder.',
125+
'This file belongs to another application\'s data folder.',
127126
style: TextStyle(fontWeight: FontWeight.w500),
128127
),
129128
SizedBox(height: 12),
@@ -134,9 +133,9 @@ class SolidFileDownloadOperations {
134133
),
135134
SizedBox(height: 12),
136135
Text(
137-
'Since this file was encrypted by a different application, '
138-
'the security key required to decrypt it is not available. '
139-
'The downloaded file will likely be unreadable or corrupted.',
136+
'The file content may be encrypted by the other application. '
137+
'If so, the security key required to decrypt it is not '
138+
'available, and the downloaded file might be unreadable.',
140139
),
141140
SizedBox(height: 16),
142141
Text(
@@ -173,22 +172,18 @@ class SolidFileDownloadOperations {
173172
String filePath,
174173
) async {
175174
try {
176-
// Check if the file is an encrypted file from another app's folder.
177-
// If so, warn the user that decryption may not be possible.
175+
// Check if the file belongs to another app's folder. If so, warn the
176+
// user that the file content may be encrypted.
178177

179-
final isEncryptedFile = fileName.endsWith('.enc.ttl');
178+
final isInCurrentAppFolder = await _isFileInCurrentAppFolder(filePath);
180179

181-
if (isEncryptedFile) {
182-
final isInCurrentAppFolder = await _isFileInCurrentAppFolder(filePath);
183-
184-
if (!isInCurrentAppFolder) {
185-
if (!context.mounted) return;
180+
if (!isInCurrentAppFolder) {
181+
if (!context.mounted) return;
186182

187-
final shouldProceed = await _showCrossAppDecryptionWarning(context);
183+
final shouldProceed = await _showCrossAppDownloadWarning(context);
188184

189-
if (!shouldProceed) {
190-
return;
191-
}
185+
if (!shouldProceed) {
186+
return;
192187
}
193188
}
194189

0 commit comments

Comments
 (0)