Feature v0.18.2.2 (#900)

* add Ledger Stax

* update block heights

* reestimate restore height only for mainnet

* upgrade to gradle 8.0.1

* upgrade dependencies
This commit is contained in:
m2049r 2023-05-29 17:01:07 +02:00 committed by GitHub
parent 3f09e73df7
commit bc4aa0f772
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 42 additions and 18 deletions

View File

@ -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"

View File

@ -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?

View File

@ -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

View File

@ -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) {

View File

@ -16,4 +16,8 @@
product-id="5"
vendor-id="11415" />
<!-- Ledger Stax HID: VID=0x2C97 PID=0x0006 -->
<usb-device
product-id="6"
vendor-id="11415" />
</resources>

View File

@ -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'
}
}

View File

@ -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

View File

@ -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

View File

@ -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