QR-Codes can now be displayed after scanning.
- 2FA also supported
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
package com.github.mondei1.offpass
|
||||
|
||||
import android.content.Intent
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import android.os.Bundle
|
||||
import android.text.Editable
|
||||
import kotlinx.android.synthetic.main.activity_passphrase.*
|
||||
import kotlinx.coroutines.GlobalScope
|
||||
import kotlinx.coroutines.runBlocking
|
||||
|
||||
class PassphraseActivity : AppCompatActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_passphrase)
|
||||
|
||||
val raw: String = intent.getStringExtra("raw")!!
|
||||
val qrSchema: QRSchema = QRSchema(this)
|
||||
|
||||
back.setOnClickListener {
|
||||
finish()
|
||||
}
|
||||
|
||||
decrypt_button.setOnClickListener {
|
||||
decrypt_button.text = "Decrypting ..."
|
||||
runBlocking {
|
||||
qrSchema.decrypt(raw, passphrase_input.text.toString())
|
||||
}
|
||||
|
||||
val intent: Intent = Intent(this, ViewActivity::class.java)
|
||||
intent.putExtra("decrypted_raw",qrSchema.decrypted_raw)
|
||||
startActivity(intent)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user