Skip to content

Commit

Permalink
Preventive measure for an issue that causes a crash while migrating t…
Browse files Browse the repository at this point in the history
…he Tor identity from shared prefs to secure prefs. Bump build number.
  • Loading branch information
kukabi committed Jan 20, 2021
1 parent e61a05e commit 80baeef
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ package com.tari.android.wallet.application

import android.annotation.SuppressLint
import android.content.Context
import android.os.Handler
import android.os.Looper
import com.orhanobut.logger.Logger
import com.tari.android.wallet.BuildConfig
import com.tari.android.wallet.R
Expand Down Expand Up @@ -238,7 +240,9 @@ internal class WalletManager(
walletLogFilePath
)
FFIWallet.instance = wallet
sharedPrefsWrapper.torIdentity = wallet.getTorIdentity()
Handler(Looper.getMainLooper()).post {
sharedPrefsWrapper.torIdentity = wallet.getTorIdentity()
}
if (isNewInstallation) {
sharedPrefsWrapper.network = Constants.Wallet.network
FFIWallet.instance?.setKeyValue(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,12 @@ class SharedPrefsWrapper(
}
return identity.toPreservedByteArray
}
return SecurePreferences.getStringValue(
val torIdentity = SecurePreferences.getStringValue(
context,
Key.torIdentity,
null
)?.toPreservedByteArray
)
return torIdentity?.toPreservedByteArray
}
set(value) {
if (value != null) {
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
ext.kotlin_version = '1.4.10'

// build & version
ext.buildNumber = 147
ext.buildNumber = 148
ext.versionNumber = "0.5.4"

// JNI libs
Expand Down

0 comments on commit 80baeef

Please sign in to comment.