34 lines
1.1 KiB
Kotlin
34 lines
1.1 KiB
Kotlin
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)
|
|
}
|
|
}
|
|
} |