Skip to content

Commit 991b2f1

Browse files
committed
Update to work with the new explore.sia.tech
1 parent 320c84d commit 991b2f1

File tree

4 files changed

+11
-23
lines changed

4 files changed

+11
-23
lines changed

app/build.gradle

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,13 @@ android {
1515
applicationId "vandyke.siamobile"
1616
minSdkVersion 21
1717
targetSdkVersion 26
18-
versionCode 20306
19-
versionName "2.3.6"
18+
versionCode 20308
19+
versionName "2.3.8"
2020
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
2121
}
22+
lintOptions {
23+
checkReleaseBuilds false
24+
}
2225
buildTypes {
2326
release {
2427
minifyEnabled false

app/src/main/java/vandyke/siamobile/backend/networking/SiaError.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class SiaError {
4949
errorMessage.contains("unsupported on cold storage wallet") -> Reason.UNSUPPORTED_ON_COLD_WALLET
5050
errorMessage.contains("word not found in dictionary for given language") -> Reason.INVALID_WORD_IN_SEED
5151
errorMessage.contains("seed failed checksum verification") -> Reason.INVALID_SEED
52-
errorMessage.contains("unrecognized hash used as input to /explorer/hash") -> Reason.UNRECOGNIZED_HASH
52+
errorMessage.contains("hash not found") -> Reason.HASH_NOT_FOUND
5353
errorMessage.contains("Cloudflare") -> Reason.ERROR_REACHING_SIATECH
5454
else -> {
5555
println("unaccounted for error message: $errorMessage")
@@ -92,7 +92,7 @@ class SiaError {
9292
CANNOT_INIT_FROM_SEED_UNTIL_SYNCED("Cannot create wallet from seed until fully synced"),
9393
UNSUPPORTED_ON_COLD_WALLET("Unsupported on cold storage wallet"),
9494
UNEXPECTED_END_OF_STREAM("Unexpected end of stream"),
95-
UNRECOGNIZED_HASH("Unrecognized hash"),
95+
HASH_NOT_FOUND("Hash not found"),
9696
ERROR_REACHING_SIATECH("Unable to reach explore.sia.tech/explorer to estimate wallet balance")
9797
}
9898

app/src/main/java/vandyke/siamobile/ui/wallet/model/WalletModelColdStorage.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class WalletModelColdStorage : IWalletModel {
2626
private var addresses: List<String> = prefs.coldStorageAddresses.toList()
2727
private var password: String = prefs.coldStoragePassword
2828
private var exists: Boolean = prefs.coldStorageExists
29-
private var unlocked: Boolean = false
29+
private var unlocked: Boolean = true
3030

3131
override fun getWallet(callback: SiaCallback<WalletData>) {
3232
val counter = AtomicInteger(addresses.size)
@@ -41,7 +41,7 @@ class WalletModelColdStorage : IWalletModel {
4141
if (counter.decrementAndGet() == 0)
4242
callback.onSuccess?.invoke(WalletData(exists, unlocked, false, balance))
4343
}, {
44-
if (it.reason == SiaError.Reason.UNRECOGNIZED_HASH) {
44+
if (it.reason == SiaError.Reason.HASH_NOT_FOUND) {
4545
if (counter.decrementAndGet() == 0)
4646
callback.onSuccess?.invoke(WalletData(exists, unlocked, false, balance))
4747
} else {
@@ -76,7 +76,7 @@ class WalletModelColdStorage : IWalletModel {
7676
if (counter.decrementAndGet() == 0)
7777
callback.onSuccess?.invoke(TransactionsData(txs.sortedBy { it.confirmationtimestamp }))
7878
}, {
79-
if (it.reason == SiaError.Reason.UNRECOGNIZED_HASH) {
79+
if (it.reason == SiaError.Reason.HASH_NOT_FOUND) {
8080
if (counter.decrementAndGet() == 0)
8181
callback.onSuccess?.invoke(TransactionsData(txs.sortedBy { it.confirmationtimestamp }))
8282
} else {
@@ -143,7 +143,7 @@ class WalletModelColdStorage : IWalletModel {
143143

144144
this.password = password
145145
exists = true
146-
unlocked = false
146+
unlocked = true
147147
prefs.coldStorageSeed = this.seed
148148
prefs.coldStorageAddresses = HashSet(addresses)
149149
prefs.coldStoragePassword = password

app/src/main/java/vandyke/siamobile/ui/wallet/view/WalletFragment.kt

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ package vandyke.siamobile.ui.wallet.view
99
import android.app.Fragment
1010
import android.os.Bundle
1111
import android.support.design.widget.Snackbar
12-
import android.support.v7.app.AlertDialog
1312
import android.support.v7.widget.DividerItemDecoration
1413
import android.support.v7.widget.LinearLayoutManager
1514
import android.view.*
@@ -85,20 +84,6 @@ class WalletFragment : Fragment(), IWalletView, SiadService.SiadListener {
8584

8685
/* listen to siad output, so that we can refresh the presenter at appropriate times */
8786
SiadService.addListener(this)
88-
89-
AlertDialog.Builder(activity!!)
90-
.setTitle("Notice")
91-
.setMessage("The Sia team has recently updated their website, explore.sia.tech, which Sia Mobile" +
92-
" previously used to estimate your balance and transactions. They haven't yet added the" +
93-
" necessary API endpoints to it that Sia Mobile uses, which is why you'll see errors" +
94-
" and your balance and transactions won't load. Rest assured that your coins are still safe and still belong" +
95-
" to your wallet seed - Sia Mobile just can't estimate them currently." +
96-
" You can also still safely receive coins at any of your receive addresses. Remember that" +
97-
" you can load your wallet seed on Sia UI on your desktop to access and spend your coins." +
98-
" I have temporarily unpublished Sia Mobile from the Play Store until the Sia team adds the" +
99-
" necessary features, at which point I will update it. Sorry for the inconvenience.")
100-
.setPositiveButton(getString(android.R.string.ok), null)
101-
.show()
10287
}
10388

10489
override fun onSuccess() {

0 commit comments

Comments
 (0)