diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index e74d4df..5b32813 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -17,7 +17,8 @@ android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme"> - + + diff --git a/app/src/main/java/im/status/keycard/connect/card/LoadKeyCommand.kt b/app/src/main/java/im/status/keycard/connect/card/LoadKeyCommand.kt index eabb07b..847ce89 100644 --- a/app/src/main/java/im/status/keycard/connect/card/LoadKeyCommand.kt +++ b/app/src/main/java/im/status/keycard/connect/card/LoadKeyCommand.kt @@ -6,6 +6,7 @@ import im.status.keycard.applet.KeycardCommandSet import im.status.keycard.applet.Mnemonic import im.status.keycard.connect.data.* import im.status.keycard.connect.ui.LoadKeyActivity +import im.status.keycard.connect.ui.ShowMnemonicActivity import java.io.IOException import java.lang.Exception @@ -17,8 +18,9 @@ class LoadKeyCommand(private var loadType: Int = LOAD_NONE, private var mnemonic } private fun showMnemonic(activity: Activity, m: Mnemonic) { - //TODO: implement show mnemonic screen - println(m.toMnemonicPhrase()) + val intent = Intent(activity, ShowMnemonicActivity::class.java) + intent.putExtra(MNEMONIC_PHRASE, m.words) + activity.startActivity(intent) } private fun generateKey(cmdSet: KeycardCommandSet): CardCommand.Result { diff --git a/app/src/main/java/im/status/keycard/connect/data/Constants.kt b/app/src/main/java/im/status/keycard/connect/data/Constants.kt index 895e670..b82c587 100644 --- a/app/src/main/java/im/status/keycard/connect/data/Constants.kt +++ b/app/src/main/java/im/status/keycard/connect/data/Constants.kt @@ -25,6 +25,7 @@ const val LOAD_GENERATE_BIP39 = 1 const val LOAD_GENERATE = 2 const val LOAD_MNEMONIC = "loadKeyMnemonic" +const val MNEMONIC_PHRASE = "mnemonicPhrase" const val REQ_INTERACTIVE_SCRIPT = 0x01 const val REQ_WALLETCONNECT = 0x02 diff --git a/app/src/main/java/im/status/keycard/connect/ui/ShowMnemonicActivity.kt b/app/src/main/java/im/status/keycard/connect/ui/ShowMnemonicActivity.kt new file mode 100644 index 0000000..d22b8e4 --- /dev/null +++ b/app/src/main/java/im/status/keycard/connect/ui/ShowMnemonicActivity.kt @@ -0,0 +1,23 @@ +package im.status.keycard.connect.ui + +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import android.view.View +import android.widget.TextView +import im.status.keycard.connect.R +import im.status.keycard.connect.data.MNEMONIC_PHRASE + +class ShowMnemonicActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_show_mnemonic) + + val mnemonic = intent.getStringArrayExtra(MNEMONIC_PHRASE) + val mnemonicView = findViewById(R.id.mnemonicView) + mnemonicView.text = mnemonic?.joinToString() + } + + fun ok(@Suppress("UNUSED_PARAMETER") view: View) { + finish() + } +} diff --git a/app/src/main/res/layout/activity_show_mnemonic.xml b/app/src/main/res/layout/activity_show_mnemonic.xml new file mode 100644 index 0000000..f1e9190 --- /dev/null +++ b/app/src/main/res/layout/activity_show_mnemonic.xml @@ -0,0 +1,43 @@ + + + + + +