add installation without init

This commit is contained in:
Michele Balistreri 2019-01-11 13:56:26 +03:00
parent 5ea1a2397b
commit 086cc77f67
3 changed files with 7 additions and 5 deletions

View File

@ -6,8 +6,8 @@ android {
applicationId "im.status.keycard_installer.installer"
minSdkVersion 19
targetSdkVersion 27
versionCode 201
versionName "2.0.1"
versionCode 202
versionName "2.0.2"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {

View File

@ -55,14 +55,16 @@ public class Installer {
Logger.i("installing Keycard applet...");
cmdSet.installKeycardApplet().checkOK();
this.personalizeApplet();
if (testSecrets) {
this.personalizeApplet();
}
long duration = System.currentTimeMillis() - startTime;
Logger.i(String.format("\n\ninstallation completed in %d seconds", duration / 1000));
}
private void personalizeApplet() throws NoSuchAlgorithmException, InvalidKeySpecException, APDUException, IOException {
Secrets secrets = testSecrets ? Secrets.testSecrets() : Secrets.generate();
Secrets secrets = Secrets.testSecrets();
KeycardCommandSet cmdSet = new KeycardCommandSet(this.plainChannel);
cmdSet.select().checkOK();

View File

@ -27,7 +27,7 @@
android:id="@+id/buttonInstall"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Install Secure"/>
android:text="Install w/o INIT"/>
<Button
android:id="@+id/buttonInstallTest"