Fix release signing and unify "+" upload with the share-intent path
Build APK / build (push) Successful in 5m21s
Build APK / build (push) Successful in 5m21s
- Release builds now sign with a dedicated keystore (local android/key.properties or CI secrets, both gitignored) instead of each machine's own debug key, so a downloaded release APK can actually update a previous install instead of failing with "App not installed" (mismatched signature). - The Files tab's "+" -> "Upload File" now goes through the same ShareUploadView destination picker and background foreground-service upload as receiving a file via Android's "Share to..." sheet, instead of a separate blocking in-app-only upload path. Removed the now-unused ServerProvider/NextcloudService.uploadFileFromPath. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1103,44 +1103,6 @@ class NextcloudService {
|
||||
return [];
|
||||
}
|
||||
|
||||
/// Uploads a file from disk, streaming it so large files don't need to be
|
||||
/// buffered fully in memory, with progress reporting.
|
||||
Future<bool> uploadFileFromPath(
|
||||
String folderPath,
|
||||
String fileName,
|
||||
String localFilePath, {
|
||||
void Function(int sent, int total)? onProgress,
|
||||
}) async {
|
||||
var cleanPath = folderPath.trim();
|
||||
if (!cleanPath.startsWith('/')) cleanPath = '/$cleanPath';
|
||||
if (!cleanPath.endsWith('/')) cleanPath = '$cleanPath/';
|
||||
|
||||
final url =
|
||||
'$_cleanServerUrl/remote.php/dav/files/$username$cleanPath$fileName';
|
||||
debugPrint('[Nextcloud DAV] Streaming upload to $url');
|
||||
|
||||
final file = File(localFilePath);
|
||||
final length = await file.length();
|
||||
final dio = Dio();
|
||||
|
||||
final response = await dio.put<void>(
|
||||
url,
|
||||
data: file.openRead(),
|
||||
options: Options(
|
||||
headers: {..._headers, Headers.contentLengthHeader: length},
|
||||
contentType: 'application/octet-stream',
|
||||
),
|
||||
onSendProgress: onProgress,
|
||||
);
|
||||
|
||||
debugPrint(
|
||||
'[Nextcloud DAV] Streaming upload status: ${response.statusCode}',
|
||||
);
|
||||
return response.statusCode == 201 ||
|
||||
response.statusCode == 204 ||
|
||||
response.statusCode == 200;
|
||||
}
|
||||
|
||||
Future<bool> deleteItem(String itemPath) async {
|
||||
var cleanPath = itemPath.trim();
|
||||
if (!cleanPath.startsWith('/')) cleanPath = '/$cleanPath';
|
||||
|
||||
Reference in New Issue
Block a user