Skip to content

Commit 71f7940

Browse files
committed
bug fix
1 parent 8da7d5c commit 71f7940

36 files changed

+51
-78
lines changed

app/build.gradle

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,12 @@ apply plugin: 'kotlin-android'
33
apply plugin: 'kotlin-android-extensions'
44
apply plugin: 'kotlin-kapt'
55

6-
def computeVersionCode() {
7-
def cmd = 'git rev-list HEAD --first-parent --count'
8-
def trim = cmd.execute().text.trim()
9-
if (trim == null || trim.length() == 0) {
10-
trim = 1
11-
}
12-
trim.toInteger()
13-
103
14-
}
15-
16-
def gitVersionTag() {
17-
def cmd = 'git describe --tags'
18-
def version = cmd.execute().text.trim()
19-
20-
def pattern = "-(\\d+)-g"
21-
def matcher = version =~ pattern
22-
23-
if (matcher) {
24-
version = version.substring(0, matcher.start()) + "." + matcher[0][1]
25-
} else {
26-
version = version + ".0"
27-
}
28-
29-
return version
6+
static def computeVersionCode() {
7+
105
308
}
319

32-
def computeVersionName() {
33-
return "1.0.3"
10+
static def computeVersionName() {
11+
return "1.0.5"
3412
}
3513

3614
android {
@@ -70,7 +48,7 @@ android {
7048
variant.outputs.all { output ->
7149
def abiName = output.getFilter(com.android.build.OutputFile.ABI)
7250
if (abiName == null) abiName = "universal"
73-
outputFileName = "wookey-${variant.versionName}-${variant.versionCode}-${abiName}.apk"
51+
outputFileName = "monero-${variant.versionName}-${variant.versionCode}-${abiName}.apk"
7452
}
7553
}
7654
}

app/src/main/AndroidManifest.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
android:icon="@mipmap/ic_launcher"
1313
android:label="@string/app_name"
1414
android:networkSecurityConfig="@xml/network_security_config"
15-
android:roundIcon="@mipmap/ic_launcher_round"
1615
android:supportsRtl="false"
1716
android:theme="@style/AppTheme"
1817
tools:ignore="GoogleAppIndexingWarning">

app/src/main/ic_launcher-web.png

-739 Bytes
Loading

app/src/main/java/io/wookey/wallet/App.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class App : Application() {
2121
companion object {
2222
var SYSTEM_DEFAULT_LOCALE: Locale by DelegatesExt.notNullSingleValue()
2323
var instance: App by DelegatesExt.notNullSingleValue()
24-
var newVersion = true
24+
var newVersion = false
2525
}
2626

2727
override fun attachBaseContext(base: Context?) {

app/src/main/java/io/wookey/wallet/base/BaseActivity.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,13 @@ open class BaseActivity : AppCompatActivity() {
1717
override fun onCreate(savedInstanceState: Bundle?) {
1818
super.onCreate(savedInstanceState)
1919
// 禁止截图
20-
window.setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE)
20+
if (hide()) {
21+
window.setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE)
22+
}
2123
}
2224

25+
open fun hide(): Boolean = true
26+
2327
var loadingDialog: LoadingDialog? = null
2428

2529
open fun showLoading() {

app/src/main/java/io/wookey/wallet/feature/asset/AssetDetailViewModel.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ class AssetDetailViewModel : BaseViewModel() {
146146
private fun refresh(firstBlock: Long): Long {
147147
var firstBlockHeight = firstBlock
148148
if (XMRWalletController.isSynchronized()) {
149+
receiveEnabled.postValue(true)
149150
sendEnabled.postValue(true)
150151
synchronized.postValue(R.string.block_synchronized)
151152
synchronizeProgress.postValue(100)
@@ -167,6 +168,7 @@ class AssetDetailViewModel : BaseViewModel() {
167168
synchronizeProgress.postValue(x)
168169
synchronizing.postValue(n)
169170
} else {
171+
receiveEnabled.postValue(true)
170172
sendEnabled.postValue(true)
171173
synchronized.postValue(R.string.block_synchronized)
172174
synchronizeProgress.postValue(100)
@@ -215,7 +217,6 @@ class AssetDetailViewModel : BaseViewModel() {
215217

216218
private fun switchNode(node: Node) {
217219

218-
val activeWallet = AppDatabase.getInstance().walletDao().getActiveWallet() ?: return
219220
val wallet = XMRWalletController.getWallet()
220221
// 异常处理
221222
if (wallet == null) {
@@ -234,6 +235,7 @@ class AssetDetailViewModel : BaseViewModel() {
234235
uiScope.launch {
235236
try {
236237
withContext(Dispatchers.IO) {
238+
val activeWallet = AppDatabase.getInstance().walletDao().getActiveWallet() ?: throw IllegalStateException()
237239
XMRWalletController.stopRefresh()
238240
indeterminate.postValue(null)
239241
connecting.postValue(R.string.block_connecting)

app/src/main/java/io/wookey/wallet/feature/asset/AssetFragment.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ class AssetFragment : BaseFragment() {
9797
adapter.notifyVisibilityChanged(false)
9898
})
9999

100+
viewModel.initVisible()
101+
100102
AppDatabase.getInstance().walletDao().loadActiveWallet().observe(this, Observer { wallet ->
101103
wallet?.let {
102104
centerTitle.text = it.symbol

app/src/main/java/io/wookey/wallet/feature/asset/AssetViewModel.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,15 @@ class AssetViewModel : BaseViewModel() {
2020

2121
private var asset: Asset? = null
2222

23+
fun initVisible() {
24+
val visible = sharedPreferences().getBoolean("assetVisible", true)
25+
if (visible) {
26+
assetVisible.call()
27+
} else {
28+
assetInvisible.call()
29+
}
30+
}
31+
2332
fun onItemClick(value: Asset) {
2433
asset = value
2534
showPasswordDialog.call()

app/src/main/java/io/wookey/wallet/feature/asset/ReceiveActivity.kt

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,14 @@ import kotlinx.android.synthetic.main.activity_receive.*
1919
class ReceiveActivity : BaseTitleSecondActivity() {
2020

2121
lateinit var viewModel: ReceiveViewModel
22+
var assetId: Int = -1
2223

2324
override fun onCreate(savedInstanceState: Bundle?) {
2425
super.onCreate(savedInstanceState)
2526
setContentView(R.layout.activity_receive)
2627

2728
val password = intent.getStringExtra("password")
28-
val assetId = intent.getIntExtra("assetId", -1)
29+
assetId = intent.getIntExtra("assetId", -1)
2930

3031
if (password.isNullOrBlank()) {
3132
finish()
@@ -145,8 +146,12 @@ class ReceiveActivity : BaseTitleSecondActivity() {
145146
})
146147
}
147148

148-
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
149-
super.onActivityResult(requestCode, resultCode, data)
150-
viewModel.handleResult(requestCode, resultCode, data)
149+
override fun hide(): Boolean {
150+
return false
151+
}
152+
153+
override fun onResume() {
154+
super.onResume()
155+
viewModel.setAssetId(assetId)
151156
}
152157
}

app/src/main/java/io/wookey/wallet/feature/generate/create/VerifyMnemonicActivity.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ class VerifyMnemonicActivity : BaseTitleSecondActivity() {
115115
if (mnemonic1.text.isNullOrBlank()) {
116116
return@setOnClickListener
117117
}
118+
if (positionList.size != 1) {
119+
return@setOnClickListener
120+
}
118121
mnemonic1.text = ""
119122
positionList.removeAt(0)
120123
adapter.notifyDataSetChanged()
@@ -123,6 +126,9 @@ class VerifyMnemonicActivity : BaseTitleSecondActivity() {
123126
if (mnemonic2.text.isNullOrBlank()) {
124127
return@setOnClickListener
125128
}
129+
if (positionList.size != 2) {
130+
return@setOnClickListener
131+
}
126132
mnemonic2.text = ""
127133
positionList.removeAt(1)
128134
adapter.notifyDataSetChanged()
@@ -131,6 +137,9 @@ class VerifyMnemonicActivity : BaseTitleSecondActivity() {
131137
if (mnemonic3.text.isNullOrBlank()) {
132138
return@setOnClickListener
133139
}
140+
if (positionList.size != 3) {
141+
return@setOnClickListener
142+
}
134143
mnemonic3.text = ""
135144
positionList.removeAt(2)
136145
adapter.notifyDataSetChanged()

0 commit comments

Comments
 (0)