expo-device-crypto 1.0.0 → 1.0.1
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,41 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
plugins {
|
|
2
|
+
id 'com.android.library'
|
|
3
|
+
id 'expo-module-gradle-plugin'
|
|
4
|
+
}
|
|
2
5
|
|
|
3
6
|
group = 'expo.modules.devicecrypto'
|
|
4
|
-
version = '1.0.
|
|
5
|
-
|
|
6
|
-
def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
|
|
7
|
-
apply from: expoModulesCorePlugin
|
|
8
|
-
applyKotlinExpoModulesCorePlugin()
|
|
9
|
-
useCoreDependencies()
|
|
10
|
-
useExpoPublishing()
|
|
11
|
-
|
|
12
|
-
// If you want to use the managed Android SDK versions from expo-modules-core, set this to true.
|
|
13
|
-
// The Android SDK versions will be bumped from time to time in SDK releases and may introduce breaking changes in your module code.
|
|
14
|
-
// Most of the time, you may like to manage the Android SDK versions yourself.
|
|
15
|
-
def useManagedAndroidSdkVersions = false
|
|
16
|
-
if (useManagedAndroidSdkVersions) {
|
|
17
|
-
useDefaultAndroidSdkVersions()
|
|
18
|
-
} else {
|
|
19
|
-
buildscript {
|
|
20
|
-
// Simple helper that allows the root project to override versions declared by this library.
|
|
21
|
-
ext.safeExtGet = { prop, fallback ->
|
|
22
|
-
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
project.android {
|
|
26
|
-
compileSdkVersion safeExtGet("compileSdkVersion", 36)
|
|
27
|
-
defaultConfig {
|
|
28
|
-
minSdkVersion safeExtGet("minSdkVersion", 24)
|
|
29
|
-
targetSdkVersion safeExtGet("targetSdkVersion", 36)
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
7
|
+
version = '1.0.1'
|
|
33
8
|
|
|
34
9
|
android {
|
|
35
10
|
namespace "expo.modules.devicecrypto"
|
|
36
11
|
defaultConfig {
|
|
37
12
|
versionCode 1
|
|
38
|
-
versionName "1.0.
|
|
13
|
+
versionName "1.0.1"
|
|
39
14
|
}
|
|
40
15
|
lintOptions {
|
|
41
16
|
abortOnError false
|
|
@@ -29,6 +29,7 @@ import androidx.fragment.app.FragmentActivity
|
|
|
29
29
|
import expo.modules.kotlin.Promise
|
|
30
30
|
import expo.modules.kotlin.modules.Module
|
|
31
31
|
import expo.modules.kotlin.modules.ModuleDefinition
|
|
32
|
+
import expo.modules.kotlin.types.Enumerable
|
|
32
33
|
import java.security.KeyFactory
|
|
33
34
|
import java.security.KeyPairGenerator
|
|
34
35
|
import java.security.KeyStore
|
|
@@ -45,16 +46,16 @@ import javax.crypto.spec.PSource
|
|
|
45
46
|
import javax.crypto.spec.SecretKeySpec
|
|
46
47
|
|
|
47
48
|
|
|
48
|
-
enum class GenerateKeyPairResult {
|
|
49
|
-
KEY_PAIR_GENERATED,
|
|
50
|
-
KEY_PAIR_ALREADY_EXISTS,
|
|
51
|
-
NOT_AVAILABLE,
|
|
49
|
+
enum class GenerateKeyPairResult(val value: String) : Enumerable {
|
|
50
|
+
KEY_PAIR_GENERATED("KEY_PAIR_GENERATED"),
|
|
51
|
+
KEY_PAIR_ALREADY_EXISTS("KEY_PAIR_ALREADY_EXISTS"),
|
|
52
|
+
NOT_AVAILABLE("NOT_AVAILABLE"),
|
|
52
53
|
}
|
|
53
54
|
|
|
54
|
-
enum class AuthCheckResult {
|
|
55
|
-
AVAILABLE,
|
|
56
|
-
UNAVAILABLE,
|
|
57
|
-
NO_HARDWARE,
|
|
55
|
+
enum class AuthCheckResult(val value: String) : Enumerable {
|
|
56
|
+
AVAILABLE("AVAILABLE"),
|
|
57
|
+
UNAVAILABLE("UNAVAILABLE"),
|
|
58
|
+
NO_HARDWARE("NO_HARDWARE"),
|
|
58
59
|
}
|
|
59
60
|
|
|
60
61
|
enum class AuthMethod {
|
|
@@ -628,7 +629,7 @@ class DeviceCryptoModule : Module() {
|
|
|
628
629
|
Name("DeviceCrypto")
|
|
629
630
|
|
|
630
631
|
Function("isAuthCheckAvailable") { ->
|
|
631
|
-
|
|
632
|
+
isAuthCheckAvailable().name
|
|
632
633
|
}
|
|
633
634
|
|
|
634
635
|
Function("isStrongBoxAvailable") { ->
|
|
@@ -636,7 +637,7 @@ class DeviceCryptoModule : Module() {
|
|
|
636
637
|
}
|
|
637
638
|
|
|
638
639
|
Function("generateKeyPair") { alias: String, o: Map<String, Any?> ->
|
|
639
|
-
|
|
640
|
+
generateKeyPair(alias, o).name
|
|
640
641
|
}
|
|
641
642
|
|
|
642
643
|
Function("removeKeyPair") { alias: String ->
|
package/ios/DeviceCrypto.podspec
CHANGED