mirror of
https://github.com/oxen-io/session-android.git
synced 2025-01-13 19:43:59 +00:00
Fix QR code
This commit is contained in:
parent
0cc54b7b40
commit
a256a04154
@ -18,19 +18,19 @@ class RecoveryPasswordViewModel @Inject constructor(
|
||||
private val application: Application
|
||||
): AndroidViewModel(application) {
|
||||
|
||||
val qrBitmap: Bitmap? = TextSecurePreferences.getLocalNumber(application)?.let {
|
||||
QRCodeUtilities.encode(
|
||||
data = it,
|
||||
size = toPx(280, application.resources),
|
||||
isInverted = false,
|
||||
hasTransparentBackground = true
|
||||
)
|
||||
}
|
||||
|
||||
val seed by lazy {
|
||||
val hexEncodedSeed = IdentityKeyUtil.retrieve(application, IdentityKeyUtil.LOKI_SEED)
|
||||
?: IdentityKeyUtil.getIdentityKeyPair(application).hexEncodedPrivateKey // Legacy account
|
||||
MnemonicCodec { MnemonicUtilities.loadFileContents(application, it) }
|
||||
.encode(hexEncodedSeed, MnemonicCodec.Language.Configuration.english)
|
||||
}
|
||||
|
||||
val qrBitmap by lazy {
|
||||
QRCodeUtilities.encode(
|
||||
data = seed,
|
||||
size = toPx(280, application.resources),
|
||||
isInverted = false,
|
||||
hasTransparentBackground = true
|
||||
)
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user