react-native-keystore-crypto-joe 0.1.2 → 0.1.4
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/build.gradle
CHANGED
|
@@ -7,6 +7,7 @@ import android.security.keystore.KeyProperties
|
|
|
7
7
|
import android.util.Base64
|
|
8
8
|
import androidx.biometric.BiometricPrompt
|
|
9
9
|
import androidx.core.content.ContextCompat
|
|
10
|
+
import androidx.fragment.app.FragmentActivity
|
|
10
11
|
import com.facebook.react.bridge.*
|
|
11
12
|
import java.security.KeyPairGenerator
|
|
12
13
|
import java.security.KeyStore
|
|
@@ -90,6 +91,10 @@ class KeystoreCryptoModule(private val reactContext: ReactApplicationContext) :
|
|
|
90
91
|
val ct = Base64.decode(ciphertextB64, Base64.DEFAULT)
|
|
91
92
|
|
|
92
93
|
val activity: Activity? = currentActivity
|
|
94
|
+
if (activity !is FragmentActivity) {
|
|
95
|
+
promise.reject("NO_ACTIVITY", "Current activity is not a FragmentActivity")
|
|
96
|
+
return
|
|
97
|
+
}
|
|
93
98
|
if (requireBiometric) {
|
|
94
99
|
if (activity == null) {
|
|
95
100
|
promise.reject("NO_ACTIVITY", "No current activity for biometric prompt")
|
package/package.json
CHANGED