diff options
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateKeyActivity.java')
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateKeyActivity.java | 33 |
1 files changed, 13 insertions, 20 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateKeyActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateKeyActivity.java index 579a001cb..94b5f4e4b 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateKeyActivity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateKeyActivity.java @@ -30,7 +30,6 @@ import org.sufficientlysecure.keychain.provider.KeychainContract.KeyRings; import org.sufficientlysecure.keychain.provider.ProviderHelper; import org.sufficientlysecure.keychain.ui.base.BaseNfcActivity; import org.sufficientlysecure.keychain.ui.util.KeyFormattingUtils; -import org.sufficientlysecure.keychain.ui.util.Notify; import org.sufficientlysecure.keychain.util.Passphrase; import org.sufficientlysecure.keychain.util.Preferences; @@ -120,13 +119,9 @@ public class CreateKeyActivity extends BaseNfcActivity { setTitle(R.string.title_import_keys); } else { -// Fragment frag = CreateYubiKeyBlankFragment.newInstance(); -// loadFragment(frag, FragAction.START); -// setTitle(R.string.title_manage_my_keys); - Notify.create(this, - "YubiKey key creation is currently not supported. Please follow our FAQ.", - Notify.Style.ERROR - ).show(); + Fragment frag = CreateYubiKeyBlankFragment.newInstance(); + loadFragment(frag, FragAction.START); + setTitle(R.string.title_manage_my_keys); } // done @@ -160,7 +155,7 @@ public class CreateKeyActivity extends BaseNfcActivity { } @Override - protected void onNfcPostExecute() throws IOException { + protected void onNfcPostExecute() { if (mCurrentFragment instanceof NfcListenerFragment) { ((NfcListenerFragment) mCurrentFragment).onNfcPostExecute(); return; @@ -186,25 +181,23 @@ public class CreateKeyActivity extends BaseNfcActivity { loadFragment(frag, FragAction.TO_RIGHT); } } else { -// Fragment frag = CreateYubiKeyBlankFragment.newInstance(); -// loadFragment(frag, FragAction.TO_RIGHT); - Notify.create(this, - "YubiKey key creation is currently not supported. Please follow our FAQ.", - Notify.Style.ERROR - ).show(); + Fragment frag = CreateYubiKeyBlankFragment.newInstance(); + loadFragment(frag, FragAction.TO_RIGHT); } } private boolean containsKeys(byte[] scannedFingerprints) { + if (scannedFingerprints == null) { + return false; + } + // If all fingerprint bytes are 0, the card contains no keys. - boolean cardContainsKeys = false; for (byte b : scannedFingerprints) { if (b != 0) { - cardContainsKeys = true; - break; + return true; } } - return cardContainsKeys; + return false; } @Override @@ -264,7 +257,7 @@ public class CreateKeyActivity extends BaseNfcActivity { interface NfcListenerFragment { void doNfcInBackground() throws IOException; - void onNfcPostExecute() throws IOException; + void onNfcPostExecute(); } @Override |