react-native-keystore-crypto-joe 0.1.3 → 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.
@@ -91,6 +91,10 @@ class KeystoreCryptoModule(private val reactContext: ReactApplicationContext) :
91
91
  val ct = Base64.decode(ciphertextB64, Base64.DEFAULT)
92
92
 
93
93
  val activity: Activity? = currentActivity
94
+ if (activity !is FragmentActivity) {
95
+ promise.reject("NO_ACTIVITY", "Current activity is not a FragmentActivity")
96
+ return
97
+ }
94
98
  if (requireBiometric) {
95
99
  if (activity == null) {
96
100
  promise.reject("NO_ACTIVITY", "No current activity for biometric prompt")
@@ -99,11 +103,6 @@ class KeystoreCryptoModule(private val reactContext: ReactApplicationContext) :
99
103
  activity.runOnUiThread {
100
104
  try {
101
105
  val cipher = newOaepCipherForDecrypt(privateKey)
102
- val activity = currentActivity
103
- if (activity !is FragmentActivity) {
104
- promise.reject("NO_ACTIVITY", "Current activity is not a FragmentActivity")
105
- return
106
- }
107
106
  val executor = ContextCompat.getMainExecutor(activity)
108
107
  val callback = object : BiometricPrompt.AuthenticationCallback() {
109
108
  override fun onAuthenticationSucceeded(result: BiometricPrompt.AuthenticationResult) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-keystore-crypto-joe",
3
- "version": "0.1.3",
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",