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.
@@ -25,6 +25,7 @@ repositories {
25
25
  }
26
26
 
27
27
  dependencies {
28
+ implementation "com.facebook.react:react-android"
28
29
  implementation "org.jetbrains.kotlin:kotlin-stdlib"
29
30
  implementation "androidx.biometric:biometric:1.1.0" // use stable unless you need alpha
30
31
  }
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-keystore-crypto-joe",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "RSA OAEP decrypt via Android Keystore / iOS Keychain + biometric gating for React Native",
5
5
  "main": "src/index.ts",
6
6
  "module": "src/index.ts",