Skip to content

Commit

Permalink
Feature v0.18.2.2 (#900)
Browse files Browse the repository at this point in the history
* add Ledger Stax

* update block heights

* reestimate restore height only for mainnet

* upgrade to gradle 8.0.1

* upgrade dependencies
  • Loading branch information
m2049r authored May 29, 2023
1 parent 3f09e73 commit bc4aa0f
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 18 deletions.
8 changes: 4 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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'
Expand All @@ -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"
Expand Down
23 changes: 13 additions & 10 deletions app/src/main/java/com/m2049r/xmrwallet/GenerateFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
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;
Expand Down Expand Up @@ -344,21 +345,23 @@ private long getHeight() {

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?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public Wallet createWallet(File aFile, String password, String language, long he
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
Expand Down
14 changes: 14 additions & 0 deletions app/src/main/java/com/m2049r/xmrwallet/util/RestoreHeight.java
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,20 @@ static public RestoreHeight getInstance() {
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) {
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/res/xml/usb_device_filter.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
}

Expand Down
2 changes: 1 addition & 1 deletion external-libs/VERSION
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit bc4aa0f

Please sign in to comment.