@capacitor-community/sqlite 3.4.1-2 → 3.4.1-3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/android/src/main/java/com/getcapacitor/community/database/sqlite/CapacitorSQLite.java
CHANGED
|
@@ -29,6 +29,7 @@ import java.io.IOException;
|
|
|
29
29
|
import java.nio.charset.Charset;
|
|
30
30
|
import java.nio.charset.StandardCharsets;
|
|
31
31
|
import java.security.GeneralSecurityException;
|
|
32
|
+
import java.security.KeyStore;
|
|
32
33
|
import java.util.ArrayList;
|
|
33
34
|
import java.util.Arrays;
|
|
34
35
|
import java.util.Collections;
|
|
@@ -63,7 +64,7 @@ public class CapacitorSQLite {
|
|
|
63
64
|
private Boolean biometricAuth = false;
|
|
64
65
|
private String biometricTitle;
|
|
65
66
|
private String biometricSubTitle;
|
|
66
|
-
private int VALIDITY_DURATION =
|
|
67
|
+
private int VALIDITY_DURATION = 5;
|
|
67
68
|
private RetHandler rHandler = new RetHandler();
|
|
68
69
|
private PluginCall call;
|
|
69
70
|
|
|
@@ -86,11 +87,18 @@ public class CapacitorSQLite {
|
|
|
86
87
|
@Override
|
|
87
88
|
public void onSuccess(BiometricPrompt.AuthenticationResult result) {
|
|
88
89
|
try {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
90
|
+
KeyStore ks = KeyStore.getInstance("AndroidKeyStore");
|
|
91
|
+
ks.load(null);
|
|
92
|
+
Enumeration<String> aliases = ks.aliases();
|
|
93
|
+
if (aliases.hasMoreElements()) {
|
|
94
|
+
masterKeyAlias =
|
|
95
|
+
new MasterKey.Builder(context)
|
|
96
|
+
.setKeyScheme(MasterKey.KeyScheme.AES256_GCM)
|
|
97
|
+
.setUserAuthenticationRequired(true, VALIDITY_DURATION)
|
|
98
|
+
.build();
|
|
99
|
+
} else {
|
|
100
|
+
masterKeyAlias = new MasterKey.Builder(context).setKeyScheme(MasterKey.KeyScheme.AES256_GCM).build();
|
|
101
|
+
}
|
|
94
102
|
setSharedPreferences();
|
|
95
103
|
notifyBiometricEvent(true, null);
|
|
96
104
|
return;
|