0.5.6: More bug fixes for built-in Tor stuff.

This commit is contained in:
pokkst 2023-12-09 12:23:20 -06:00
parent 19544c1b3d
commit ae4e7cb65c
No known key found for this signature in database
GPG Key ID: EC4FAAA66859FAA4
4 changed files with 9 additions and 16 deletions

View File

@ -10,8 +10,8 @@ android {
applicationId "net.mynero.wallet" applicationId "net.mynero.wallet"
minSdkVersion 21 minSdkVersion 21
targetSdkVersion 34 targetSdkVersion 34
versionCode 50500 versionCode 50600
versionName "0.5.5 'Fluorine Fermi'" versionName "0.5.6 'Fluorine Fermi'"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
externalNativeBuild { externalNativeBuild {
cmake { cmake {

View File

@ -26,6 +26,7 @@ import net.mynero.wallet.adapter.TransactionInfoAdapter
import net.mynero.wallet.adapter.TransactionInfoAdapter.TxInfoAdapterListener import net.mynero.wallet.adapter.TransactionInfoAdapter.TxInfoAdapterListener
import net.mynero.wallet.model.EnumTorState import net.mynero.wallet.model.EnumTorState
import net.mynero.wallet.model.TransactionInfo import net.mynero.wallet.model.TransactionInfo
import net.mynero.wallet.model.Wallet
import net.mynero.wallet.model.WalletManager import net.mynero.wallet.model.WalletManager
import net.mynero.wallet.service.BalanceService import net.mynero.wallet.service.BalanceService
import net.mynero.wallet.service.BlockchainService import net.mynero.wallet.service.BlockchainService
@ -181,6 +182,8 @@ class HomeFragment : Fragment(), TxInfoAdapterListener {
val proxyString = socketAddress.toString().substring(1) val proxyString = socketAddress.toString().substring(1)
val address = proxyString.split(":")[0] val address = proxyString.split(":")[0]
val port = proxyString.split(":")[1] val port = proxyString.split(":")[1]
if(WalletManager.instance?.proxy != proxyString)
refreshProxy(address, port) refreshProxy(address, port)
} }
} }

View File

@ -157,13 +157,6 @@ class SettingsFragment : Fragment(), PasswordListener, NodeSelectionDialogListen
torSwitch?.setOnCheckedChangeListener { _: CompoundButton?, b: Boolean -> torSwitch?.setOnCheckedChangeListener { _: CompoundButton?, b: Boolean ->
mViewModel?.setUseProxy(b) mViewModel?.setUseProxy(b)
} }
walletProxyPortEditText?.addTextChangedListener {
mViewModel?.edited = true
}
walletProxyAddressEditText?.addTextChangedListener {
mViewModel?.edited = true
}
} }
private fun bindObservers() { private fun bindObservers() {
@ -228,8 +221,10 @@ class SettingsFragment : Fragment(), PasswordListener, NodeSelectionDialogListen
private fun refreshProxy() { private fun refreshProxy() {
val proxyAddress = walletProxyAddressEditText?.text.toString() val proxyAddress = walletProxyAddressEditText?.text.toString()
val proxyPort = walletProxyPortEditText?.text.toString() val proxyPort = walletProxyPortEditText?.text.toString()
val savedProxyAddress = ProxyService.instance?.proxyAddress
val savedProxyPort = ProxyService.instance?.proxyPort
if(mViewModel?.edited == true) if(proxyAddress != savedProxyAddress || proxyPort != savedProxyPort)
ProxyService.instance?.updateProxy(proxyAddress, proxyPort) ProxyService.instance?.updateProxy(proxyAddress, proxyPort)
} }

View File

@ -15,7 +15,6 @@ class SettingsViewModel : ViewModel() {
val useProxy: LiveData<Boolean> = _useProxy val useProxy: LiveData<Boolean> = _useProxy
private val _useBundledTor = MutableLiveData(false) private val _useBundledTor = MutableLiveData(false)
val useBundledTor: LiveData<Boolean> = _useBundledTor val useBundledTor: LiveData<Boolean> = _useBundledTor
var edited = false
init { init {
_useProxy.value = ProxyService.instance?.usingProxy _useProxy.value = ProxyService.instance?.usingProxy
@ -32,8 +31,6 @@ class SettingsViewModel : ViewModel() {
} else { } else {
samouraiTorManager?.stop() samouraiTorManager?.stop()
} }
edited = true
} }
fun setUseBundledTor(use: Boolean) { fun setUseBundledTor(use: Boolean) {
@ -46,7 +43,5 @@ class SettingsViewModel : ViewModel() {
} else { } else {
samouraiTorManager?.stop() samouraiTorManager?.stop()
} }
edited = true
} }
} }