move constants to own file
This commit is contained in:
parent
494126e985
commit
900abe0db5
|
@ -7,8 +7,6 @@ import im.status.keycard.io.CardChannel
|
|||
import im.status.keycard.io.CardListener
|
||||
import java.util.*
|
||||
|
||||
const val REQ_INTERACTIVE_SCRIPT = 0x01
|
||||
|
||||
class CardScriptExecutor(activity: Activity) : CardListener {
|
||||
class Context(val mainActivity: Activity) {
|
||||
var cardChannel: CardChannel? = null
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
package im.status.keycard.connect.data
|
||||
|
||||
const val PAIRING_ACTIVITY_PASSWORD = "pairingPassword"
|
||||
|
||||
const val PIN_ACTIVITY_ATTEMPTS = "remainingAttempts"
|
||||
const val PIN_ACTIVITY_CARD_UID = "cardUID"
|
||||
|
||||
const val INIT_ACTIVITY_PIN = "initPIN"
|
||||
const val INIT_ACTIVITY_PUK = "initPUK"
|
||||
const val INIT_ACTIVITY_PAIRING = "initPairing"
|
||||
|
||||
const val REQ_INTERACTIVE_SCRIPT = 0x01
|
|
@ -9,7 +9,6 @@ import im.status.keycard.applet.Pairing
|
|||
import androidx.security.crypto.EncryptedSharedPreferences
|
||||
import androidx.security.crypto.MasterKeys
|
||||
|
||||
|
||||
object PairingManager {
|
||||
private lateinit var sharedPreferences: SharedPreferences
|
||||
|
||||
|
|
|
@ -11,11 +11,9 @@ import android.util.Base64.NO_PADDING
|
|||
import android.util.Base64.NO_WRAP
|
||||
import android.widget.TextView
|
||||
import im.status.keycard.connect.R
|
||||
|
||||
|
||||
const val INIT_ACTIVITY_PIN = "initPIN"
|
||||
const val INIT_ACTIVITY_PUK = "initPUK"
|
||||
const val INIT_ACTIVITY_PAIRING = "initPairing"
|
||||
import im.status.keycard.connect.data.INIT_ACTIVITY_PAIRING
|
||||
import im.status.keycard.connect.data.INIT_ACTIVITY_PIN
|
||||
import im.status.keycard.connect.data.INIT_ACTIVITY_PUK
|
||||
|
||||
class InitActivity : AppCompatActivity() {
|
||||
private lateinit var pin: String
|
||||
|
|
|
@ -8,6 +8,7 @@ import android.content.Intent
|
|||
import im.status.keycard.connect.R
|
||||
import im.status.keycard.connect.card.*
|
||||
import im.status.keycard.connect.data.PairingManager
|
||||
import im.status.keycard.connect.data.REQ_INTERACTIVE_SCRIPT
|
||||
|
||||
class MainActivity : AppCompatActivity() {
|
||||
private lateinit var cardManager: NFCCardManager
|
||||
|
|
|
@ -8,9 +8,8 @@ import android.widget.EditText
|
|||
import android.widget.TextView
|
||||
import im.status.keycard.connect.R
|
||||
import im.status.keycard.connect.data.PINCache
|
||||
|
||||
const val PIN_ACTIVITY_ATTEMPTS = "remainingAttempts"
|
||||
const val PIN_ACTIVITY_CARD_UID = "cardUID"
|
||||
import im.status.keycard.connect.data.PIN_ACTIVITY_ATTEMPTS
|
||||
import im.status.keycard.connect.data.PIN_ACTIVITY_CARD_UID
|
||||
|
||||
class PINActivity : AppCompatActivity() {
|
||||
private lateinit var cardUID: ByteArray
|
||||
|
|
|
@ -7,8 +7,7 @@ import android.view.View
|
|||
import android.widget.EditText
|
||||
import android.content.Intent
|
||||
import im.status.keycard.connect.R
|
||||
|
||||
const val PAIRING_ACTIVITY_PASSWORD = "pairingPassword"
|
||||
import im.status.keycard.connect.data.PAIRING_ACTIVITY_PASSWORD
|
||||
|
||||
class PairingActivity : AppCompatActivity() {
|
||||
|
||||
|
@ -19,10 +18,7 @@ class PairingActivity : AppCompatActivity() {
|
|||
|
||||
fun ok(view: View) {
|
||||
val intent = Intent()
|
||||
intent.putExtra(
|
||||
PAIRING_ACTIVITY_PASSWORD, findViewById<EditText>(
|
||||
R.id.passwordText
|
||||
).text.toString())
|
||||
intent.putExtra(PAIRING_ACTIVITY_PASSWORD, findViewById<EditText>(R.id.passwordText).text.toString())
|
||||
setResult(Activity.RESULT_OK, intent)
|
||||
finish()
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue