mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-11-13 09:04:09 +01:00
Xchaha20 poly1305 integration (#569)
* Integration of xchacha20-poly1305 * Remove force unwrap from _exportPreferencesJSON * Deprecate v1 export * Fix for open backup screen after auth
This commit is contained in:
@@ -8,6 +8,7 @@ import 'package:flutter_secure_storage/flutter_secure_storage.dart';
|
||||
import 'package:mobx/mobx.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:cake_wallet/wallet_type_utils.dart';
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
|
||||
part 'backup_view_model.g.dart';
|
||||
|
||||
@@ -71,6 +72,21 @@ abstract class BackupViewModelBase with Store {
|
||||
}
|
||||
}
|
||||
|
||||
Future<String> saveBackupFileLocally(BackupExportFile backup) async {
|
||||
final appDir = await getApplicationDocumentsDirectory();
|
||||
final path = '${appDir.path}/${backup.name}';
|
||||
final backupFile = File(path);
|
||||
await backupFile.writeAsBytes(backup.content);
|
||||
return path;
|
||||
}
|
||||
|
||||
Future<void> removeBackupFileLocally(BackupExportFile backup) async {
|
||||
final appDir = await getApplicationDocumentsDirectory();
|
||||
final path = '${appDir.path}/${backup.name}';
|
||||
final backupFile = File(path);
|
||||
await backupFile.delete();
|
||||
}
|
||||
|
||||
@action
|
||||
void showMasterPassword() => isBackupPasswordVisible = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user