react-native-keystore-crypto-joe 0.1.1 → 0.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/build.gradle
CHANGED
|
@@ -1,36 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
mavenCentral()
|
|
5
|
-
}
|
|
6
|
-
dependencies {
|
|
7
|
-
classpath("com.android.tools.build:gradle:8.1.0")
|
|
8
|
-
}
|
|
1
|
+
plugins {
|
|
2
|
+
id 'com.android.library'
|
|
3
|
+
id 'org.jetbrains.kotlin.android'
|
|
9
4
|
}
|
|
10
5
|
|
|
11
|
-
apply plugin: 'com.android.library'
|
|
12
|
-
|
|
13
6
|
android {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
7
|
+
namespace "com.keystorecrypto"
|
|
8
|
+
compileSdk 34
|
|
9
|
+
|
|
10
|
+
defaultConfig {
|
|
11
|
+
minSdk 23
|
|
12
|
+
targetSdk 34
|
|
13
|
+
consumerProguardFiles 'consumer-rules.pro'
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// optional but often helpful
|
|
17
|
+
kotlinOptions {
|
|
18
|
+
jvmTarget = "17"
|
|
19
|
+
}
|
|
27
20
|
}
|
|
28
21
|
|
|
29
22
|
repositories {
|
|
30
|
-
|
|
31
|
-
|
|
23
|
+
google()
|
|
24
|
+
mavenCentral()
|
|
32
25
|
}
|
|
33
26
|
|
|
34
27
|
dependencies {
|
|
35
|
-
|
|
28
|
+
implementation "com.facebook.react:react-android"
|
|
29
|
+
implementation "org.jetbrains.kotlin:kotlin-stdlib"
|
|
30
|
+
implementation "androidx.biometric:biometric:1.1.0" // use stable unless you need alpha
|
|
36
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
|
|
@@ -98,6 +99,11 @@ class KeystoreCryptoModule(private val reactContext: ReactApplicationContext) :
|
|
|
98
99
|
activity.runOnUiThread {
|
|
99
100
|
try {
|
|
100
101
|
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
|
+
}
|
|
101
107
|
val executor = ContextCompat.getMainExecutor(activity)
|
|
102
108
|
val callback = object : BiometricPrompt.AuthenticationCallback() {
|
|
103
109
|
override fun onAuthenticationSucceeded(result: BiometricPrompt.AuthenticationResult) {
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@ Pod::Spec.new do |s|
|
|
|
5
5
|
s.license = { :type => "MIT" }
|
|
6
6
|
s.author = { "Your Name" => "you@example.com" }
|
|
7
7
|
s.homepage = "https://github.com/yourname/react-native-keystore-crypto"
|
|
8
|
-
s.source = { :
|
|
8
|
+
s.source = { :path => "." }
|
|
9
9
|
s.platforms = { :ios => "12.0" }
|
|
10
10
|
s.source_files = "ios/*.{h,m,mm,swift}"
|
|
11
11
|
s.requires_arc = true
|