diff --git a/app/build.gradle b/app/build.gradle index fa8cb0c0..f03c323f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -8,8 +8,8 @@ android { applicationId "com.m2049r.xmrwallet" minSdkVersion 21 targetSdkVersion 31 - versionCode 3130 - versionName "3.1.3 'Fluorine Fermi'" + versionCode 3200 + versionName "3.2.0 'Decoy Selection'" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" externalNativeBuild { cmake { @@ -123,7 +123,7 @@ static def getId(name) { dependencies { implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.8.0")) - implementation 'androidx.core:core:1.10.0' + implementation 'androidx.core:core:1.10.1' implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.legacy:legacy-support-v4:1.0.0' implementation 'androidx.recyclerview:recyclerview:1.3.0' @@ -132,7 +132,7 @@ dependencies { implementation 'androidx.constraintlayout:constraintlayout:2.1.4' implementation 'androidx.preference:preference:1.2.0' - implementation 'com.google.android.material:material:1.8.0' + implementation 'com.google.android.material:material:1.9.0' implementation 'me.dm7.barcodescanner:zxing:1.9.8' implementation "com.squareup.okhttp3:okhttp:4.9.3" diff --git a/app/src/main/java/com/m2049r/xmrwallet/GenerateFragment.java b/app/src/main/java/com/m2049r/xmrwallet/GenerateFragment.java index 46215829..57df4b1a 100644 --- a/app/src/main/java/com/m2049r/xmrwallet/GenerateFragment.java +++ b/app/src/main/java/com/m2049r/xmrwallet/GenerateFragment.java @@ -43,6 +43,7 @@ import androidx.fragment.app.Fragment; import com.google.android.material.dialog.MaterialAlertDialogBuilder; import com.google.android.material.switchmaterial.SwitchMaterial; import com.google.android.material.textfield.TextInputLayout; +import com.m2049r.xmrwallet.model.NetworkType; import com.m2049r.xmrwallet.model.Wallet; import com.m2049r.xmrwallet.model.WalletManager; import com.m2049r.xmrwallet.util.FingerprintHelper; @@ -344,21 +345,23 @@ public class GenerateFragment extends Fragment { String restoreHeight = etWalletRestoreHeight.getEditText().getText().toString().trim(); if (restoreHeight.isEmpty()) return -1; - try { - // is it a date? - SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); - parser.setLenient(false); - height = RestoreHeight.getInstance().getHeight(parser.parse(restoreHeight)); - } catch (ParseException ignored) { - } - if ((height < 0) && (restoreHeight.length() == 8)) + if (WalletManager.getInstance().getNetworkType() == NetworkType.NetworkType_Mainnet) { try { - // is it a date without dashes? - SimpleDateFormat parser = new SimpleDateFormat("yyyyMMdd"); + // is it a date? + SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setLenient(false); height = RestoreHeight.getInstance().getHeight(parser.parse(restoreHeight)); } catch (ParseException ignored) { } + if ((height < 0) && (restoreHeight.length() == 8)) + try { + // is it a date without dashes? + SimpleDateFormat parser = new SimpleDateFormat("yyyyMMdd"); + parser.setLenient(false); + height = RestoreHeight.getInstance().getHeight(parser.parse(restoreHeight)); + } catch (ParseException ignored) { + } + } if (height < 0) try { // or is it a height? diff --git a/app/src/main/java/com/m2049r/xmrwallet/model/WalletManager.java b/app/src/main/java/com/m2049r/xmrwallet/model/WalletManager.java index 97ed886b..71f3e124 100644 --- a/app/src/main/java/com/m2049r/xmrwallet/model/WalletManager.java +++ b/app/src/main/java/com/m2049r/xmrwallet/model/WalletManager.java @@ -93,7 +93,7 @@ public class WalletManager { long walletHandle = createWalletJ(aFile.getAbsolutePath(), password, language, getNetworkType().getValue()); Wallet wallet = new Wallet(walletHandle); manageWallet(wallet); - if (wallet.getStatus().isOk()) { + if (wallet.getStatus().isOk() && (wallet.getNetworkType() == NetworkType.NetworkType_Mainnet)) { // (Re-)Estimate restore height based on what we know final long oldHeight = wallet.getRestoreHeight(); // Go back 4 days if we don't have a precise restore height diff --git a/app/src/main/java/com/m2049r/xmrwallet/util/RestoreHeight.java b/app/src/main/java/com/m2049r/xmrwallet/util/RestoreHeight.java index 00e59521..7f03cc14 100644 --- a/app/src/main/java/com/m2049r/xmrwallet/util/RestoreHeight.java +++ b/app/src/main/java/com/m2049r/xmrwallet/util/RestoreHeight.java @@ -139,6 +139,20 @@ public class RestoreHeight { blockheight.put("2022-01-01", 2527316L); blockheight.put("2022-02-01", 2549605L); blockheight.put("2022-03-01", 2569711L); + blockheight.put("2022-04-01", 2591995L); + blockheight.put("2022-05-01", 2613603L); + blockheight.put("2022-06-01", 2635840L); + blockheight.put("2022-07-01", 2657395L); + blockheight.put("2022-08-01", 2679705L); + blockheight.put("2022-09-01", 2701991L); + blockheight.put("2022-10-01", 2723607L); + blockheight.put("2022-11-01", 2745899L); + blockheight.put("2022-12-01", 2767427L); + blockheight.put("2023-01-01", 2789763L); + blockheight.put("2023-02-01", 2811996L); + blockheight.put("2023-03-01", 2832118L); + blockheight.put("2023-04-01", 2854365L); + blockheight.put("2023-05-01", 2875972L); } public long getHeight(String date) { diff --git a/app/src/main/res/xml/usb_device_filter.xml b/app/src/main/res/xml/usb_device_filter.xml index cc448ce1..f6e935d3 100644 --- a/app/src/main/res/xml/usb_device_filter.xml +++ b/app/src/main/res/xml/usb_device_filter.xml @@ -16,4 +16,8 @@ product-id="5" vendor-id="11415" /> + + \ No newline at end of file diff --git a/build.gradle b/build.gradle index e7ec15b1..5c6eb2fc 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ buildscript { google() } dependencies { - classpath 'com.android.tools.build:gradle:7.2.2' + classpath 'com.android.tools.build:gradle:8.0.1' } } diff --git a/external-libs/VERSION b/external-libs/VERSION index 442ed87b..20a30d37 100644 --- a/external-libs/VERSION +++ b/external-libs/VERSION @@ -1 +1 @@ -MONERUJO_monero master with monero release-v0.18.1.0-monerujo +MONERUJO_monero feature_v0.18.2.2 with monero release-v0.18.2.2-monerujo diff --git a/gradle.properties b/gradle.properties index bfa2b697..17726b9e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -18,3 +18,6 @@ org.gradle.jvmargs=-Xmx2048m android.useAndroidX=true android.enableJetifier=true +android.defaults.buildfeatures.buildconfig=true +android.nonTransitiveRClass=false +android.nonFinalResIds=false diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 669386b8..3a029079 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists