From 2de7692375de08e3db8e6097188699e41b7ef7de Mon Sep 17 00:00:00 2001 From: Marco Date: Tue, 4 Oct 2022 12:29:50 -0600 Subject: [PATCH] organize linux monero saves --- crypto_plugins/flutter_libmonero | 2 +- lib/main.dart | 4 ++++ lib/services/coins/epiccash/epiccash_wallet.dart | 6 ++++++ lib/services/coins/monero/monero_wallet.dart | 4 ++++ lib/services/coins/wownero/wownero_wallet.dart | 3 +++ 5 files changed, 18 insertions(+), 1 deletion(-) diff --git a/crypto_plugins/flutter_libmonero b/crypto_plugins/flutter_libmonero index 2c4e102f1..bffdb9688 160000 --- a/crypto_plugins/flutter_libmonero +++ b/crypto_plugins/flutter_libmonero @@ -1 +1 @@ -Subproject commit 2c4e102f107305e1df50246f8ddf35da9a13d154 +Subproject commit bffdb9688a93d8b88940a332dc52243f3ab8169d diff --git a/lib/main.dart b/lib/main.dart index 0be26c39e..112661b41 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -84,6 +84,10 @@ void main() async { if (Platform.isIOS) { appDirectory = (await getLibraryDirectory()); } + if (Platform.isLinux || Logging.isArmLinux) { + appDirectory = Directory("${appDirectory.path}/stackwallet"); + await appDirectory.create(); + } // FlutterNativeSplash.preserve(widgetsBinding: widgetsBinding); if (!(Logging.isArmLinux || Logging.isTestEnv)) { final isar = await Isar.open( diff --git a/lib/services/coins/epiccash/epiccash_wallet.dart b/lib/services/coins/epiccash/epiccash_wallet.dart index e33428319..d3cfb8e74 100644 --- a/lib/services/coins/epiccash/epiccash_wallet.dart +++ b/lib/services/coins/epiccash/epiccash_wallet.dart @@ -259,6 +259,9 @@ Future deleteEpicWallet({ if (Platform.isIOS) { appDir = (await getLibraryDirectory()); } + if (Platform.isLinux) { + appDir = Directory("${appDir.path}/stackwallet"); + } final path = "${appDir.path}/epiccash"; final String name = walletId; @@ -1232,6 +1235,9 @@ class EpicCashWallet extends CoinServiceAPI { if (Platform.isIOS) { appDir = (await getLibraryDirectory()); } + if (Platform.isLinux) { + appDir = Directory("${appDir.path}/stackwallet"); + } final path = "${appDir.path}/epiccash"; final String name = _walletId.trim(); return '$path/$name'; diff --git a/lib/services/coins/monero/monero_wallet.dart b/lib/services/coins/monero/monero_wallet.dart index b63e711a4..f8ea675b4 100644 --- a/lib/services/coins/monero/monero_wallet.dart +++ b/lib/services/coins/monero/monero_wallet.dart @@ -910,6 +910,10 @@ class MoneroWallet extends CoinServiceAPI { if (Platform.isIOS) { root = (await getLibraryDirectory()); } + // + if (Platform.isLinux) { + root = Directory("${root.path}/stackwallet"); + } final prefix = walletTypeToString(type).toLowerCase(); final walletsDir = Directory('${root.path}/wallets'); final walletDire = Directory('${walletsDir.path}/$prefix/$name'); diff --git a/lib/services/coins/wownero/wownero_wallet.dart b/lib/services/coins/wownero/wownero_wallet.dart index 4f7cf9706..657b2a864 100644 --- a/lib/services/coins/wownero/wownero_wallet.dart +++ b/lib/services/coins/wownero/wownero_wallet.dart @@ -913,6 +913,9 @@ class WowneroWallet extends CoinServiceAPI { if (Platform.isIOS) { root = (await getLibraryDirectory()); } + if (Platform.isLinux) { + root = Directory("${root.path}/stackwallet"); + } final prefix = walletTypeToString(type).toLowerCase(); final walletsDir = Directory('${root.path}/wallets'); final walletDire = Directory('${walletsDir.path}/$prefix/$name');