mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-17 05:41:29 +02:00
Fix db getting deleted on iOS (#2736)
* Fix db getting deleted on iOS * Fix db getting deleted on iOS and add a patch for users who updated * remove prints [skip ci]
This commit is contained in:
@@ -1,3 +1 @@
|
||||
Fix QR scanning
|
||||
UI enhancements
|
||||
Bug fixes
|
||||
@@ -1,3 +1 @@
|
||||
Fix QR scanning
|
||||
UI enhancements
|
||||
Bug fixes
|
||||
@@ -224,6 +224,15 @@ abstract class BitcoinWalletBase extends ElectrumWallet with Store {
|
||||
snp?.derivationPath ?? electrum_path;
|
||||
derivationInfo.derivationType ??=
|
||||
snp?.derivationType ?? DerivationType.electrum;
|
||||
if (derivationInfo.derivationType == DerivationType.unknown) {
|
||||
if (snp?.derivationPath == electrum_path || snp?.derivationType == DerivationType.electrum) {
|
||||
derivationInfo.derivationPath = electrum_path;
|
||||
derivationInfo.derivationType = DerivationType.electrum;
|
||||
} else {
|
||||
derivationInfo.derivationPath = segwit_path;
|
||||
derivationInfo.derivationType = DerivationType.bip39;
|
||||
}
|
||||
}
|
||||
await derivationInfo.save();
|
||||
|
||||
Uint8List? seedBytes = null;
|
||||
|
||||
@@ -115,3 +115,4 @@ Map<DerivationType, List<DerivationInfo>> electrum_derivations = {
|
||||
};
|
||||
|
||||
String electrum_path = electrum_derivations[DerivationType.electrum]!.first.derivationPath!;
|
||||
String segwit_path = "m/84'/0'/0'";
|
||||
|
||||
@@ -283,6 +283,15 @@ abstract class LitecoinWalletBase extends ElectrumWallet with Store {
|
||||
// set the default if not present:
|
||||
derivationInfo.derivationPath ??= snp?.derivationPath ?? electrum_path;
|
||||
derivationInfo.derivationType ??= snp?.derivationType ?? DerivationType.electrum;
|
||||
if (derivationInfo.derivationType == DerivationType.unknown) {
|
||||
if (snp?.derivationPath == electrum_path || snp?.derivationType == DerivationType.electrum) {
|
||||
derivationInfo.derivationPath = electrum_path;
|
||||
derivationInfo.derivationType = DerivationType.electrum;
|
||||
} else {
|
||||
derivationInfo.derivationPath = segwit_path;
|
||||
derivationInfo.derivationType = DerivationType.bip39;
|
||||
}
|
||||
}
|
||||
|
||||
Uint8List? seedBytes = null;
|
||||
final mnemonic = keysData.mnemonic;
|
||||
|
||||
@@ -15,7 +15,7 @@ Future<void> initDb({String? pathOverride}) async {
|
||||
final dbFileOld = File("${await getDatabasesPath()}/cake.db");
|
||||
final dbFile = File("${(await getAppDir()).path}/cake.db");
|
||||
|
||||
if (dbFileOld.existsSync()) {
|
||||
if (Platform.isAndroid && dbFileOld.existsSync() && dbFileOld.path != dbFile.path) {
|
||||
final copied = dbFileOld.copySync(dbFile.path);
|
||||
if (copied.existsSync()) {
|
||||
dbFileOld.deleteSync();
|
||||
|
||||
@@ -436,6 +436,13 @@ abstract class NanoWalletBase
|
||||
|
||||
final derivationInfo = await walletInfo.getDerivationInfo();
|
||||
derivationInfo.derivationType ??= derivationType;
|
||||
if (derivationInfo.derivationType == DerivationType.unknown) {
|
||||
if (data?['derivationType'] != null) {
|
||||
derivationInfo.derivationType = derivationType;
|
||||
} else {
|
||||
derivationInfo.derivationType = DerivationType.bip39;
|
||||
}
|
||||
}
|
||||
derivationInfo.save();
|
||||
|
||||
return NanoWallet(
|
||||
|
||||
@@ -360,7 +360,7 @@ class _WalletNameFormState extends State<WalletNameForm> {
|
||||
alertContent: S.of(context).wallet_name_exists,
|
||||
buttonText: S.of(context).ok,
|
||||
buttonAction: () {
|
||||
if (Navigator.of(context).canPop()) {
|
||||
if (mounted && Navigator.of(context).canPop()) {
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -17,7 +17,6 @@ class WalletRestoreChooseDerivationPage extends BasePage {
|
||||
);
|
||||
|
||||
final WalletRestoreChooseDerivationViewModel walletRestoreChooseDerivationViewModel;
|
||||
DerivationType derivationType = DerivationType.unknown;
|
||||
|
||||
@override
|
||||
Widget body(BuildContext context) {
|
||||
|
||||
@@ -14,15 +14,15 @@ TYPES=($MONERO_COM $CAKEWALLET)
|
||||
APP_ANDROID_TYPE=$1
|
||||
|
||||
MONERO_COM_NAME="Monero.com"
|
||||
MONERO_COM_VERSION="5.6.3"
|
||||
MONERO_COM_BUILD_NUMBER=4148
|
||||
MONERO_COM_VERSION="5.6.4"
|
||||
MONERO_COM_BUILD_NUMBER=4149
|
||||
MONERO_COM_BUNDLE_ID="com.monero.app"
|
||||
MONERO_COM_PACKAGE="com.monero.app"
|
||||
MONERO_COM_SCHEME="monero.com"
|
||||
|
||||
CAKEWALLET_NAME="Cake Wallet"
|
||||
CAKEWALLET_VERSION="5.6.3"
|
||||
CAKEWALLET_BUILD_NUMBER=4294
|
||||
CAKEWALLET_VERSION="5.6.4"
|
||||
CAKEWALLET_BUILD_NUMBER=4295
|
||||
CAKEWALLET_BUNDLE_ID="com.cakewallet.cake_wallet"
|
||||
CAKEWALLET_PACKAGE="com.cakewallet.cake_wallet"
|
||||
CAKEWALLET_SCHEME="cakewallet"
|
||||
|
||||
@@ -12,13 +12,13 @@ TYPES=($MONERO_COM $CAKEWALLET)
|
||||
APP_IOS_TYPE=$1
|
||||
|
||||
MONERO_COM_NAME="Monero.com"
|
||||
MONERO_COM_VERSION="5.6.3"
|
||||
MONERO_COM_BUILD_NUMBER=151
|
||||
MONERO_COM_VERSION="5.6.4"
|
||||
MONERO_COM_BUILD_NUMBER=152
|
||||
MONERO_COM_BUNDLE_ID="com.cakewallet.monero"
|
||||
|
||||
CAKEWALLET_NAME="Cake Wallet"
|
||||
CAKEWALLET_VERSION="5.6.3"
|
||||
CAKEWALLET_BUILD_NUMBER=357
|
||||
CAKEWALLET_VERSION="5.6.4"
|
||||
CAKEWALLET_BUILD_NUMBER=359
|
||||
CAKEWALLET_BUNDLE_ID="com.fotolockr.cakewallet"
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user