Skip to content

Commit

Permalink
Increment to version 3.8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
angelix committed May 19, 2022
1 parent c296f0e commit cd612f8
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 16 deletions.
2 changes: 1 addition & 1 deletion BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ completely from source, you can compile
[gdk](https://github.com/Blockstream/gdk)
from its source code yourself.

This requires the "Android NDK" (version r19b recommended) from Android
This requires the "Android NDK" (version r23b recommended) from Android
developer tools, as well as [SWIG](http://www.swig.org/). Most Linux
distributions have SWIG available, on debian for example you can install it
using:
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,19 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [3.8.2] - 2022-05-18
### Added
- Archive accounts if they're no longer needed, then unarchive them from the archived list
- Support multiple hardware wallet devices on multiple networks concurrently

### Changed
- Updated GDK to 0.0.54
- Updated project dependencies

### Fixed
- Crash on Liquid transactions with unblinded amounts
- Crash when resuming the application after prolonged period of inactivity

## [3.8.0] - 2022-04-13
### Added
- Add Bitcoin Singlesig hardware wallet support
Expand Down
6 changes: 3 additions & 3 deletions green/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ android {
defaultConfig {
minSdkVersion 23
targetSdkVersion 31
versionCode 380
versionName "3.8.0"
versionCode 382
versionName "3.8.2"
setProperty("archivesBaseName", "BlockstreamGreen" + "-v" + versionName)

// Export schemas
Expand Down Expand Up @@ -274,7 +274,7 @@ dependencies {
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}

def appendGdkCommitHash(Boolean enableGitSubmodule) {
static def appendGdkCommitHash(Boolean enableGitSubmodule) {
def gdkCommit = System.getenv('GDK_COMMIT')
def hash = false

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -470,22 +470,29 @@ class WalletSettingsFragment :


private fun handleWatchOnly(): Boolean {
val dialogBinding =
SettingsWatchOnlyDialogBinding.inflate(requireActivity().layoutInflater)
val dialogBinding = SettingsWatchOnlyDialogBinding.inflate(requireActivity().layoutInflater)

viewModel.watchOnlyUsernameLiveData.value?.let {
dialogBinding.username = it
}

// dialogBinding.usernameTextInputLayout.helperText = "At least 8 characters long"
// dialogBinding.passwordTextInputLayout.helperText = "At least 8 characters long"

MaterialAlertDialogBuilder(
requireContext(),
R.style.ThemeOverlay_Green_MaterialAlertDialog
)
.setTitle(R.string.id_watchonly_login)
.setView(dialogBinding.root)
.setPositiveButton(android.R.string.ok) { _, _ ->
if (dialogBinding.username.isNullOrBlank() || dialogBinding.password.isNullOrBlank()) {
snackbar(R.string.id_the_password_cant_be_empty)
if (dialogBinding.username.isNullOrBlank()) {
errorDialog(getString(R.string.id_the_username_cant_be_empty))
return@setPositiveButton
}

if (dialogBinding.password.isNullOrBlank()) {
errorDialog(getString(R.string.id_the_password_cant_be_empty))
return@setPositiveButton
}

Expand All @@ -495,6 +502,13 @@ class WalletSettingsFragment :
)
}
.setNegativeButton(android.R.string.cancel, null)
.also {
if(!viewModel.watchOnlyUsernameLiveData.value.isNullOrBlank()){
it.setNeutralButton(R.string.id_delete) { _, _ ->
viewModel.setWatchOnly("", "")
}
}
}
.show()

return true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import com.blockstream.gdk.data.TwoFactorMethodConfig
import com.blockstream.gdk.data.TwoFactorReset
import com.blockstream.gdk.params.Limits
import com.blockstream.green.ApplicationScope
import com.blockstream.green.R
import com.blockstream.green.data.Countly
import com.blockstream.green.data.GdkEvent
import com.blockstream.green.data.TwoFactorMethod
Expand Down Expand Up @@ -41,9 +40,6 @@ open class WalletSettingsViewModel @AssistedInject constructor(
val applicationScope: ApplicationScope,
@Assisted wallet: Wallet
) : AbstractWalletViewModel(sessionManager, walletRepository, countly, wallet) {

val onErrorStringRes = MutableLiveData<ConsumableEvent<Int>>()

val settingsLiveData = MutableLiveData<Settings>()
val twoFactorConfigLiveData = MutableLiveData<TwoFactorConfig>()
val watchOnlyUsernameLiveData = MutableLiveData("")
Expand Down Expand Up @@ -83,13 +79,13 @@ open class WalletSettingsViewModel @AssistedInject constructor(
}
}

fun updateWatchOnlyUsername(){
private fun updateWatchOnlyUsername(){
if(!session.isWatchOnly) {
session.observable {
it.getWatchOnlyUsername()
}.subscribeBy(
onError = {
onError.postValue(ConsumableEvent(it))
onError.postValue(ConsumableEvent(Exception("id_username_not_available")))
},
onSuccess = {
watchOnlyUsernameLiveData.value = it
Expand All @@ -106,7 +102,7 @@ open class WalletSettingsViewModel @AssistedInject constructor(
)
}.subscribeBy(
onError = {
onErrorStringRes.value = ConsumableEvent(R.string.id_username_not_available)
onError.value = ConsumableEvent(it)
},
onSuccess = {
updateWatchOnlyUsername()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class TransactionDetailsViewModel @AssistedInject constructor(
// update
session.updateTransactionsAndBalance(isReset = false, isLoadMore = false)
}else{
onError.postValue(ConsumableEvent(Exception("Couldn't save note")))
onError.postValue(ConsumableEvent(Exception("id_error")))
}
}

Expand Down
1 change: 1 addition & 0 deletions green/src/main/res/layout/recovery_check_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
android:textSize="20sp" />

<TextView
android:id="@+id/wordPointer"
textAsNumber="@{vm.pointer}"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
Expand Down
3 changes: 3 additions & 0 deletions green/src/main/res/layout/settings_watch_only_dialog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
android:padding="24dp">

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/usernameTextInputLayout"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
app:endIconMode="clear_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/id_username">
Expand All @@ -39,6 +41,7 @@
</com.google.android.material.textfield.TextInputLayout>

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/passwordTextInputLayout"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand Down
1 change: 1 addition & 0 deletions green/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1101,4 +1101,5 @@
<string name="id_hide_details">Hide details</string>

<string name="id_hardware_wallets">Hardware Wallets</string>
<string name="id_the_username_cant_be_empty">The username can\'t be empty</string>
</resources>

0 comments on commit cd612f8

Please sign in to comment.