From 36be2a6613c84256360b709d1168de3fff4088e3 Mon Sep 17 00:00:00 2001 From: pokkst Date: Sun, 4 Dec 2022 12:48:31 -0600 Subject: [PATCH] Fix offset issue with new wallets, create 0.4.0.1 --- app/build.gradle | 4 ++-- .../wallet/fragment/onboarding/OnboardingFragment.java | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 322a2c0..8a604fd 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -9,8 +9,8 @@ android { applicationId "net.mynero.wallet" minSdkVersion 21 targetSdkVersion 33 - versionCode 400 - versionName "0.4.0 'Fluorine Fermi'" + versionCode 40001 + versionName "0.4.0.1 'Fluorine Fermi'" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" externalNativeBuild { cmake { diff --git a/app/src/main/java/net/mynero/wallet/fragment/onboarding/OnboardingFragment.java b/app/src/main/java/net/mynero/wallet/fragment/onboarding/OnboardingFragment.java index efd8157..e5119bd 100644 --- a/app/src/main/java/net/mynero/wallet/fragment/onboarding/OnboardingFragment.java +++ b/app/src/main/java/net/mynero/wallet/fragment/onboarding/OnboardingFragment.java @@ -225,6 +225,10 @@ public class OnboardingFragment extends Fragment { long restoreHeight = getNewRestoreHeight(); File walletFile = new File(mainActivity.getApplicationInfo().dataDir, Constants.WALLET_NAME); Wallet wallet = null; + if(!offset.isEmpty()) { + PrefService.getInstance().edit().putBoolean(Constants.PREF_USES_OFFSET, true).apply(); + } + if (walletSeed.isEmpty()) { Wallet tmpWallet = createTempWallet(mainActivity.getApplicationInfo().dataDir); //we do this to get seed, then recover wallet so we can use seed offset wallet = WalletManager.getInstance().recoveryWallet(walletFile, walletPassword, tmpWallet.getSeed(""), offset, restoreHeight); @@ -236,9 +240,6 @@ public class OnboardingFragment extends Fragment { if (!restoreHeightText.isEmpty()) { restoreHeight = Long.parseLong(restoreHeightText); } - if(!offset.isEmpty()) { - PrefService.getInstance().edit().putBoolean(Constants.PREF_USES_OFFSET, true).apply(); - } wallet = WalletManager.getInstance().recoveryWallet(walletFile, walletPassword, walletSeed, offset, restoreHeight); } Wallet.Status walletStatus = wallet.getStatus();