Skip to content

Commit

Permalink
version 1.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Wheatley committed Jan 25, 2018
1 parent b4c3187 commit da87502
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ function isAvailableError(message) {
| disableBackup | boolean | false | Set to true to remove the "USE BACKUP" button |
| maxAttempts | number | 5 | The device max is 5 attempts. Set this parameter if you want to allow fewer than 5 attempts. |
| locale | String | "en_US" | Change the language displayed on the authentication dialog.<br/><ul><li>English: "en_US"</li><li>Italian: "it"</li><li>Spanish: "es"</li><li>Russian: "ru"</li><li>French: "fr"</li><li>Chinese (Simplified): <ul><li>"zh_CN"</li><li>"zh_SG"</li></ul></li><li>Chinese (Traditional): <ul><li>"zh"</li><li>"zh_HK"</li><li>"zh_TW"</li><li>"zh_MO"</li></ul></li><li>Norwegian: "no"</li><li>Portuguese: "pt"</li><li>Japanese: "ja"</li><li>German: "de"</li></ul> |
| userAuthRequired | boolean | false | Require the user to authenticate with a fingerprint to authorize every use of the key. New fingerprint enrollment will invalidate key and require backup authenticate to re-enable the fingerprint authentication dialog. |
| encryptNoAuth | boolean | undefined | Bypass authentication and just encrypt input. If `true` this option will not display the authentication dialog for fingerprint or backup credentials. It will just encrypt the input and return a token. |
| dialogTitle | String | undefined | Set the title of the fingerprint authentication dialog. |
| dialogMessage | String | undefined | Set the message of the fingerprint authentication dialog. |
Expand Down
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Version 1.4.2
### What's New
* Feature request for issue #100
* added back the `userAuthRequired` param but set default to `false`

# Version 1.4.1
### What's New
* **Bug fix** for issue #98
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cordova-plugin-android-fingerprint-auth",
"version": "1.4.1",
"version": "1.4.2",
"description": "Cordova plugin to use Android fingerprint authentication API",
"cordova": {
"id": "cordova-plugin-android-fingerprint-auth",
Expand Down
2 changes: 1 addition & 1 deletion plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android"
id="cordova-plugin-android-fingerprint-auth"
version="1.4.1">
version="1.4.2">
<name>FingerprintAuth</name>
<description>Cordova plugin to use Android fingerprint authentication API</description>
<license>Apache 2.0</license>
Expand Down
6 changes: 5 additions & 1 deletion src/android/FingerprintAuth.java
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ public enum PluginError {
public static boolean mDisableBackup = false;
public static int mMaxAttempts = 6; // one more than the device default to prevent a 2nd callback
private String mLangCode = "en_US";
private static boolean mUserAuthRequired = false;
public static String mDialogTitle;
public static String mDialogMessage;
public static String mDialogHint;
Expand Down Expand Up @@ -287,6 +288,9 @@ public boolean execute(final String action, JSONArray args, CallbackContext call
mMaxAttempts = maxAttempts;
}
}
if (arg_object.has("userAuthRequired")) {
mUserAuthRequired = arg_object.getBoolean("userAuthRequired");
}
if (arg_object.has("dialogTitle")) {
mDialogTitle = arg_object.getString("dialogTitle");
}
Expand Down Expand Up @@ -548,7 +552,7 @@ public static boolean createKey() {
mKeyGenerator.init(new KeyGenParameterSpec.Builder(mClientId,
KeyProperties.PURPOSE_ENCRYPT | KeyProperties.PURPOSE_DECRYPT)
.setBlockModes(KeyProperties.BLOCK_MODE_CBC)
.setUserAuthenticationRequired(false)
.setUserAuthenticationRequired(mUserAuthRequired)
.setEncryptionPaddings(KeyProperties.ENCRYPTION_PADDING_PKCS7)
.build());
mKeyGenerator.generateKey();
Expand Down

0 comments on commit da87502

Please sign in to comment.