v1.0.24: harmonious icon, recursive file watching, download-then-open, security fixes
Icon: three identical parallel arcing arrows (same bezier curve, same blue-to-teal gradient #64C8FF→#32EDBB, same arrowhead geometry) — visually cohesive and clearly visible against the near-black background. FileWatchService: FileObserver is now recursive — watchDirRecursive() creates an observer for each subdirectory at startup, and adds new watchers when CREATE events produce new directories. Fixes files added to subdirectories not being detected. FilesViewModel: openFile/shareFile now fall back to download-then-open when the file is absent locally. AccountRepository + ProviderFactory injected; downloads to context.cacheDir/syncflow_open/ with isDownloading state. Path traversal guard added (reject relativePath containing ".."). file_paths.xml gains cache-path entry. WebDavProvider: path-traversal guard in parsePropfind — skip any server-returned filename containing "..", "/" or "\". Replace android.util.Log with Timber so debug logs are stripped from release builds. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -33,6 +33,7 @@ fun FilesScreen(
|
||||
val pairs by vm.pairs.collectAsState()
|
||||
val selectedPair by vm.selectedPair.collectAsState()
|
||||
val files by vm.files.collectAsState()
|
||||
val isDownloading by vm.isDownloading.collectAsState()
|
||||
val context = LocalContext.current
|
||||
val snackbarHostState = remember { SnackbarHostState() }
|
||||
val scope = rememberCoroutineScope()
|
||||
@@ -182,6 +183,31 @@ fun FilesScreen(
|
||||
}
|
||||
}
|
||||
|
||||
if (isDownloading) {
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.align(Alignment.BottomCenter),
|
||||
) {
|
||||
Surface(
|
||||
color = MaterialTheme.colorScheme.surfaceVariant,
|
||||
tonalElevation = 4.dp,
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
) {
|
||||
Row(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(horizontal = 16.dp, vertical = 10.dp),
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
horizontalArrangement = Arrangement.spacedBy(12.dp),
|
||||
) {
|
||||
CircularProgressIndicator(modifier = Modifier.size(18.dp), strokeWidth = 2.dp)
|
||||
Text("Downloading for preview…", style = MaterialTheme.typography.bodySmall)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SnackbarHost(
|
||||
hostState = snackbarHostState,
|
||||
modifier = Modifier.align(Alignment.BottomCenter),
|
||||
|
||||
Reference in New Issue
Block a user