mirror of
https://github.com/revanced/revanced-manager
synced 2024-05-14 13:56:57 +02:00
chore: update cr_file_saver (#668)
Co-authored-by: Ushie <github@ushie.dev>
This commit is contained in:
parent
40888c07f3
commit
8591bc4d01
@ -259,16 +259,8 @@ class PatcherAPI {
|
||||
try {
|
||||
if (_outFile != null) {
|
||||
String newName = _getFileName(appName, version);
|
||||
|
||||
// This is temporary workaround to populate initial file name
|
||||
// ref: https://github.com/Cleveroad/cr_file_saver/issues/7
|
||||
int lastSeparator = _outFile!.path.lastIndexOf('/');
|
||||
String newSourcePath =
|
||||
_outFile!.path.substring(0, lastSeparator + 1) + newName;
|
||||
_outFile!.copySync(newSourcePath);
|
||||
|
||||
CRFileSaver.saveFileWithDialog(SaveFileDialogParams(
|
||||
sourceFilePath: newSourcePath, destinationFileName: newName));
|
||||
sourceFilePath: _outFile!.path, destinationFileName: newName));
|
||||
}
|
||||
} on Exception catch (e, s) {
|
||||
Sentry.captureException(e, stackTrace: s);
|
||||
|
@ -74,12 +74,8 @@ class SettingsViewModel extends BaseViewModel {
|
||||
if (outFile.existsSync()) {
|
||||
String dateTime =
|
||||
DateTime.now().toString().replaceAll(' ', '_').split('.').first;
|
||||
String tempFilePath =
|
||||
'${outFile.path.substring(0, outFile.path.lastIndexOf('/') + 1)}selected_patches_$dateTime.json';
|
||||
outFile.copySync(tempFilePath);
|
||||
await CRFileSaver.saveFileWithDialog(SaveFileDialogParams(
|
||||
sourceFilePath: tempFilePath, destinationFileName: ''));
|
||||
File(tempFilePath).delete();
|
||||
sourceFilePath: outFile.path, destinationFileName: 'selected_patches_$dateTime.json'));
|
||||
_toast.showBottom('settingsView.exportedPatches');
|
||||
} else {
|
||||
_toast.showBottom('settingsView.noExportFileFound');
|
||||
|
@ -15,7 +15,7 @@ dependencies:
|
||||
app_installer: ^1.1.0
|
||||
collection: ^1.16.0
|
||||
cross_connectivity: ^3.0.5
|
||||
cr_file_saver: ^0.0.1+2
|
||||
cr_file_saver: ^0.0.2
|
||||
device_apps:
|
||||
git:
|
||||
url: https://github.com/ponces/flutter_plugin_device_apps
|
||||
|
Loading…
Reference in New Issue
Block a user