@dynamic-labs-sdk/client 0.26.5 → 0.26.9
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/dist/{InvalidParamError-DjffLRcU.esm.js → InvalidParamError-0lP4zZBe.esm.js} +2 -2
- package/dist/{InvalidParamError-DjffLRcU.esm.js.map → InvalidParamError-0lP4zZBe.esm.js.map} +1 -1
- package/dist/{InvalidParamError-6NDGyDbY.native.esm.js → InvalidParamError-CY4JGkjq.native.esm.js} +2 -2
- package/dist/{InvalidParamError-6NDGyDbY.native.esm.js.map → InvalidParamError-CY4JGkjq.native.esm.js.map} +1 -1
- package/dist/{InvalidParamError-BsseV_Zk.cjs → InvalidParamError-Cu4kK02f.cjs} +3 -3
- package/dist/{InvalidParamError-BsseV_Zk.cjs.map → InvalidParamError-Cu4kK02f.cjs.map} +1 -1
- package/dist/{NotWaasWalletAccountError-ByggOJR8.esm.js → NotWaasWalletAccountError-BAD01hkG.esm.js} +3 -3
- package/dist/{NotWaasWalletAccountError-ByggOJR8.esm.js.map → NotWaasWalletAccountError-BAD01hkG.esm.js.map} +1 -1
- package/dist/{NotWaasWalletAccountError-BrlK_aAH.cjs → NotWaasWalletAccountError-CWKsiVqV.cjs} +3 -3
- package/dist/{NotWaasWalletAccountError-BrlK_aAH.cjs.map → NotWaasWalletAccountError-CWKsiVqV.cjs.map} +1 -1
- package/dist/{NotWaasWalletAccountError-BExDEnhZ.native.esm.js → NotWaasWalletAccountError-DYuQuYeI.native.esm.js} +3 -3
- package/dist/{NotWaasWalletAccountError-BExDEnhZ.native.esm.js.map → NotWaasWalletAccountError-DYuQuYeI.native.esm.js.map} +1 -1
- package/dist/core.cjs +5 -5
- package/dist/core.esm.js +5 -5
- package/dist/core.native.esm.js +5 -5
- package/dist/core.native.esm.js.map +1 -1
- package/dist/{getNetworkProviderFromNetworkId-BTQVv09-.native.esm.js → getNetworkProviderFromNetworkId-Cjj23n1Y.native.esm.js} +3 -3
- package/dist/getNetworkProviderFromNetworkId-Cjj23n1Y.native.esm.js.map +1 -0
- package/dist/{getNetworkProviderFromNetworkId-CoQSi5f0.esm.js → getNetworkProviderFromNetworkId-D1mT7AfE.esm.js} +3 -3
- package/dist/{getNetworkProviderFromNetworkId-CoQSi5f0.esm.js.map → getNetworkProviderFromNetworkId-D1mT7AfE.esm.js.map} +1 -1
- package/dist/{getNetworkProviderFromNetworkId-BxxJTau9.cjs → getNetworkProviderFromNetworkId-VDuMPEtz.cjs} +3 -3
- package/dist/{getNetworkProviderFromNetworkId-BxxJTau9.cjs.map → getNetworkProviderFromNetworkId-VDuMPEtz.cjs.map} +1 -1
- package/dist/{getSignedSessionId-DbWUoAQI.native.esm.js → getSignedSessionId-BGFoe3gh.native.esm.js} +3 -3
- package/dist/{getSignedSessionId-DbWUoAQI.native.esm.js.map → getSignedSessionId-BGFoe3gh.native.esm.js.map} +1 -1
- package/dist/{getSignedSessionId-CrVjzaMP.esm.js → getSignedSessionId-DQr-WJ3a.esm.js} +3 -3
- package/dist/{getSignedSessionId-CrVjzaMP.esm.js.map → getSignedSessionId-DQr-WJ3a.esm.js.map} +1 -1
- package/dist/{getSignedSessionId-CjofN_Ws.cjs → getSignedSessionId-qeRsJErq.cjs} +3 -3
- package/dist/{getSignedSessionId-CjofN_Ws.cjs.map → getSignedSessionId-qeRsJErq.cjs.map} +1 -1
- package/dist/{getVerifiedCredentialForWalletAccount-2cVZS9xt.native.esm.js → getVerifiedCredentialForWalletAccount-BCPvaJ1V.native.esm.js} +2 -2
- package/dist/{getVerifiedCredentialForWalletAccount-2cVZS9xt.native.esm.js.map → getVerifiedCredentialForWalletAccount-BCPvaJ1V.native.esm.js.map} +1 -1
- package/dist/{getVerifiedCredentialForWalletAccount-CRb66CKE.cjs → getVerifiedCredentialForWalletAccount-CjPzTFHz.cjs} +3 -3
- package/dist/{getVerifiedCredentialForWalletAccount-CRb66CKE.cjs.map → getVerifiedCredentialForWalletAccount-CjPzTFHz.cjs.map} +1 -1
- package/dist/{getVerifiedCredentialForWalletAccount-BYqUP-6t.esm.js → getVerifiedCredentialForWalletAccount-DEkVcH8j.esm.js} +2 -2
- package/dist/{getVerifiedCredentialForWalletAccount-BYqUP-6t.esm.js.map → getVerifiedCredentialForWalletAccount-DEkVcH8j.esm.js.map} +1 -1
- package/dist/index.cjs +5 -5
- package/dist/index.esm.js +5 -5
- package/dist/index.native.esm.js +5 -5
- package/dist/index.native.esm.js.map +1 -1
- package/dist/{isMfaRequiredForAction-BDRZ-SOH.esm.js → isMfaRequiredForAction-CTghrtq8.esm.js} +2 -2
- package/dist/{isMfaRequiredForAction-BDRZ-SOH.esm.js.map → isMfaRequiredForAction-CTghrtq8.esm.js.map} +1 -1
- package/dist/{isMfaRequiredForAction-DjYiqElV.native.esm.js → isMfaRequiredForAction-DaZoGOB-.native.esm.js} +2 -2
- package/dist/{isMfaRequiredForAction-DjYiqElV.native.esm.js.map → isMfaRequiredForAction-DaZoGOB-.native.esm.js.map} +1 -1
- package/dist/{isMfaRequiredForAction-l1ORnIAj.cjs → isMfaRequiredForAction-qSv2yrfd.cjs} +2 -2
- package/dist/{isMfaRequiredForAction-l1ORnIAj.cjs.map → isMfaRequiredForAction-qSv2yrfd.cjs.map} +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/waas.cjs +4 -4
- package/dist/waas.esm.js +3 -3
- package/dist/waas.native.esm.js +3 -3
- package/dist/waasCore.cjs +4 -4
- package/dist/waasCore.esm.js +3 -3
- package/dist/waasCore.native.esm.js +3 -3
- package/package.json +3 -42
- package/android/build.gradle +0 -71
- package/android/src/main/java/xyz/dynamic/client/DynamicClientPackage.kt +0 -42
- package/android/src/main/java/xyz/dynamic/client/keychain/KeyStoreKeyManager.kt +0 -147
- package/android/src/main/java/xyz/dynamic/client/keychain/KeychainModule.kt +0 -85
- package/android/src/main/java/xyz/dynamic/client/manifest/ReactNativeManifestModule.kt +0 -25
- package/dist/getNetworkProviderFromNetworkId-BTQVv09-.native.esm.js.map +0 -1
- package/dynamic-labs-sdk-client.podspec +0 -27
- package/ios/Keychain.h +0 -4
- package/ios/Keychain.mm +0 -101
- package/ios/ReactNativeManifest.h +0 -4
- package/ios/ReactNativeManifest.mm +0 -45
- package/ios/ReactNativeManifestImpl.swift +0 -20
- package/ios/SecureEnclaveKeyManager.swift +0 -180
- package/react-native.config.cjs +0 -14
package/dist/waas.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const require_getNetworkProviderFromNetworkId = require('./getNetworkProviderFromNetworkId-
|
|
2
|
-
const require_InvalidParamError = require('./InvalidParamError-
|
|
3
|
-
const require_getVerifiedCredentialForWalletAccount = require('./getVerifiedCredentialForWalletAccount-
|
|
4
|
-
const require_NotWaasWalletAccountError = require('./NotWaasWalletAccountError-
|
|
1
|
+
const require_getNetworkProviderFromNetworkId = require('./getNetworkProviderFromNetworkId-VDuMPEtz.cjs');
|
|
2
|
+
const require_InvalidParamError = require('./InvalidParamError-Cu4kK02f.cjs');
|
|
3
|
+
const require_getVerifiedCredentialForWalletAccount = require('./getVerifiedCredentialForWalletAccount-CjPzTFHz.cjs');
|
|
4
|
+
const require_NotWaasWalletAccountError = require('./NotWaasWalletAccountError-CWKsiVqV.cjs');
|
|
5
5
|
let _dynamic_labs_sdk_assert_package_version = require("@dynamic-labs-sdk/assert-package-version");
|
|
6
6
|
let _dynamic_labs_sdk_api_core = require("@dynamic-labs/sdk-api-core");
|
|
7
7
|
|
package/dist/waas.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { B as name, F as getDefaultClient, R as BaseError, V as version, i as DYNAMIC_WAAS_METADATA, s as __getChainFromVerifiedCredentialChain_wrapped, w as assertDefined } from "./InvalidParamError-
|
|
2
|
-
import { c as findWaasWalletProviderByChain, h as __getWalletProviderFromWalletAccount_wrapped, l as isWaasWalletProvider, n as getWalletProviderByKey, s as isWaasWalletAccount, t as __getVerifiedCredentialForWalletAccount_wrapped, x as formatWalletProviderKey, y as NoWalletProviderFoundError } from "./getVerifiedCredentialForWalletAccount-
|
|
3
|
-
import { n as __refreshAuth_wrapped, t as NotWaasWalletAccountError } from "./NotWaasWalletAccountError-
|
|
1
|
+
import { B as name, F as getDefaultClient, R as BaseError, V as version, i as DYNAMIC_WAAS_METADATA, s as __getChainFromVerifiedCredentialChain_wrapped, w as assertDefined } from "./InvalidParamError-0lP4zZBe.esm.js";
|
|
2
|
+
import { c as findWaasWalletProviderByChain, h as __getWalletProviderFromWalletAccount_wrapped, l as isWaasWalletProvider, n as getWalletProviderByKey, s as isWaasWalletAccount, t as __getVerifiedCredentialForWalletAccount_wrapped, x as formatWalletProviderKey, y as NoWalletProviderFoundError } from "./getVerifiedCredentialForWalletAccount-DEkVcH8j.esm.js";
|
|
3
|
+
import { n as __refreshAuth_wrapped, t as NotWaasWalletAccountError } from "./NotWaasWalletAccountError-BAD01hkG.esm.js";
|
|
4
4
|
import { assertPackageVersion } from "@dynamic-labs-sdk/assert-package-version";
|
|
5
5
|
import { EmbeddedWalletVersionEnum, JwtVerifiedCredentialFormatEnum, WalletProviderEnum } from "@dynamic-labs/sdk-api-core";
|
|
6
6
|
|
package/dist/waas.native.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { B as name, F as getDefaultClient, R as BaseError, V as version, i as DYNAMIC_WAAS_METADATA, s as __getChainFromVerifiedCredentialChain_wrapped, w as assertDefined } from "./InvalidParamError-
|
|
2
|
-
import { c as findWaasWalletProviderByChain, h as __getWalletProviderFromWalletAccount_wrapped, l as isWaasWalletProvider, n as getWalletProviderByKey, s as isWaasWalletAccount, t as __getVerifiedCredentialForWalletAccount_wrapped, x as formatWalletProviderKey, y as NoWalletProviderFoundError } from "./getVerifiedCredentialForWalletAccount-
|
|
3
|
-
import { n as __refreshAuth_wrapped, t as NotWaasWalletAccountError } from "./NotWaasWalletAccountError-
|
|
1
|
+
import { B as name, F as getDefaultClient, R as BaseError, V as version, i as DYNAMIC_WAAS_METADATA, s as __getChainFromVerifiedCredentialChain_wrapped, w as assertDefined } from "./InvalidParamError-CY4JGkjq.native.esm.js";
|
|
2
|
+
import { c as findWaasWalletProviderByChain, h as __getWalletProviderFromWalletAccount_wrapped, l as isWaasWalletProvider, n as getWalletProviderByKey, s as isWaasWalletAccount, t as __getVerifiedCredentialForWalletAccount_wrapped, x as formatWalletProviderKey, y as NoWalletProviderFoundError } from "./getVerifiedCredentialForWalletAccount-BCPvaJ1V.native.esm.js";
|
|
3
|
+
import { n as __refreshAuth_wrapped, t as NotWaasWalletAccountError } from "./NotWaasWalletAccountError-DYuQuYeI.native.esm.js";
|
|
4
4
|
import { assertPackageVersion } from "@dynamic-labs-sdk/assert-package-version";
|
|
5
5
|
import { EmbeddedWalletVersionEnum, JwtVerifiedCredentialFormatEnum, WalletProviderEnum } from "@dynamic-labs/sdk-api-core";
|
|
6
6
|
|
package/dist/waasCore.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const require_getNetworkProviderFromNetworkId = require('./getNetworkProviderFromNetworkId-
|
|
2
|
-
const require_InvalidParamError = require('./InvalidParamError-
|
|
3
|
-
require('./isMfaRequiredForAction-
|
|
4
|
-
const require_getSignedSessionId = require('./getSignedSessionId-
|
|
1
|
+
const require_getNetworkProviderFromNetworkId = require('./getNetworkProviderFromNetworkId-VDuMPEtz.cjs');
|
|
2
|
+
const require_InvalidParamError = require('./InvalidParamError-Cu4kK02f.cjs');
|
|
3
|
+
require('./isMfaRequiredForAction-qSv2yrfd.cjs');
|
|
4
|
+
const require_getSignedSessionId = require('./getSignedSessionId-qeRsJErq.cjs');
|
|
5
5
|
let _dynamic_labs_sdk_assert_package_version = require("@dynamic-labs-sdk/assert-package-version");
|
|
6
6
|
let _dynamic_labs_sdk_api_core = require("@dynamic-labs/sdk-api-core");
|
|
7
7
|
let _dynamic_labs_wallet_browser_wallet_client = require("@dynamic-labs-wallet/browser-wallet-client");
|
package/dist/waasCore.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { B as name, C as isCookieEnabled, M as CLIENT_SDK_NAME, V as version, c as CHAINS_INFO_MAP, i as DYNAMIC_WAAS_METADATA, n as DEFAULT_WAAS_BASE_API_URL, r as DEFAULT_WAAS_BASE_MPC_RELAY_API_URL, s as __getChainFromVerifiedCredentialChain_wrapped, t as InvalidParamError, z as getCore } from "./InvalidParamError-
|
|
2
|
-
import "./isMfaRequiredForAction-
|
|
3
|
-
import { n as __consumeMfaTokenIfRequiredForAction_wrapped, t as __getSignedSessionId_wrapped } from "./getSignedSessionId-
|
|
1
|
+
import { B as name, C as isCookieEnabled, M as CLIENT_SDK_NAME, V as version, c as CHAINS_INFO_MAP, i as DYNAMIC_WAAS_METADATA, n as DEFAULT_WAAS_BASE_API_URL, r as DEFAULT_WAAS_BASE_MPC_RELAY_API_URL, s as __getChainFromVerifiedCredentialChain_wrapped, t as InvalidParamError, z as getCore } from "./InvalidParamError-0lP4zZBe.esm.js";
|
|
2
|
+
import "./isMfaRequiredForAction-CTghrtq8.esm.js";
|
|
3
|
+
import { n as __consumeMfaTokenIfRequiredForAction_wrapped, t as __getSignedSessionId_wrapped } from "./getSignedSessionId-DQr-WJ3a.esm.js";
|
|
4
4
|
import { assertPackageVersion } from "@dynamic-labs-sdk/assert-package-version";
|
|
5
5
|
import { MFAAction, WalletProviderEnum } from "@dynamic-labs/sdk-api-core";
|
|
6
6
|
import { DynamicWalletClient, ThresholdSignatureScheme, WalletOperation } from "@dynamic-labs-wallet/browser-wallet-client";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { B as name, C as isCookieEnabled, M as CLIENT_SDK_NAME, V as version, c as CHAINS_INFO_MAP, i as DYNAMIC_WAAS_METADATA, n as DEFAULT_WAAS_BASE_API_URL, r as DEFAULT_WAAS_BASE_MPC_RELAY_API_URL, s as __getChainFromVerifiedCredentialChain_wrapped, t as InvalidParamError, z as getCore } from "./InvalidParamError-
|
|
2
|
-
import "./isMfaRequiredForAction-
|
|
3
|
-
import { n as __consumeMfaTokenIfRequiredForAction_wrapped, t as __getSignedSessionId_wrapped } from "./getSignedSessionId-
|
|
1
|
+
import { B as name, C as isCookieEnabled, M as CLIENT_SDK_NAME, V as version, c as CHAINS_INFO_MAP, i as DYNAMIC_WAAS_METADATA, n as DEFAULT_WAAS_BASE_API_URL, r as DEFAULT_WAAS_BASE_MPC_RELAY_API_URL, s as __getChainFromVerifiedCredentialChain_wrapped, t as InvalidParamError, z as getCore } from "./InvalidParamError-CY4JGkjq.native.esm.js";
|
|
2
|
+
import "./isMfaRequiredForAction-DaZoGOB-.native.esm.js";
|
|
3
|
+
import { n as __consumeMfaTokenIfRequiredForAction_wrapped, t as __getSignedSessionId_wrapped } from "./getSignedSessionId-BGFoe3gh.native.esm.js";
|
|
4
4
|
import { assertPackageVersion } from "@dynamic-labs-sdk/assert-package-version";
|
|
5
5
|
import { MFAAction, WalletProviderEnum } from "@dynamic-labs/sdk-api-core";
|
|
6
6
|
import { DynamicWalletClient, ThresholdSignatureScheme, WalletOperation } from "@dynamic-labs-wallet/browser-wallet-client";
|
package/package.json
CHANGED
|
@@ -1,39 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs-sdk/client",
|
|
3
|
-
"version": "0.26.
|
|
3
|
+
"version": "0.26.9",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.esm.js",
|
|
7
7
|
"types": "./dist/exports/index.d.ts",
|
|
8
8
|
"files": [
|
|
9
|
-
"dist"
|
|
10
|
-
"ios",
|
|
11
|
-
"android",
|
|
12
|
-
"dynamic-labs-sdk-client.podspec",
|
|
13
|
-
"react-native.config.cjs"
|
|
9
|
+
"dist"
|
|
14
10
|
],
|
|
15
11
|
"exports": {
|
|
16
12
|
"./package.json": "./package.json",
|
|
17
13
|
".": {
|
|
18
|
-
"react-native": "./dist/index.native.esm.js",
|
|
19
14
|
"types": "./dist/exports/index.d.ts",
|
|
20
15
|
"import": "./dist/index.esm.js",
|
|
21
16
|
"default": "./dist/index.cjs"
|
|
22
17
|
},
|
|
23
18
|
"./core": {
|
|
24
|
-
"react-native": "./dist/core.native.esm.js",
|
|
25
19
|
"types": "./dist/exports/core.d.ts",
|
|
26
20
|
"import": "./dist/core.esm.js",
|
|
27
21
|
"default": "./dist/core.cjs"
|
|
28
22
|
},
|
|
29
23
|
"./waas": {
|
|
30
|
-
"react-native": "./dist/waas.native.esm.js",
|
|
31
24
|
"types": "./dist/exports/waas.d.ts",
|
|
32
25
|
"import": "./dist/waas.esm.js",
|
|
33
26
|
"default": "./dist/waas.cjs"
|
|
34
27
|
},
|
|
35
28
|
"./waas/core": {
|
|
36
|
-
"react-native": "./dist/waasCore.native.esm.js",
|
|
37
29
|
"types": "./dist/exports/waasCore.d.ts",
|
|
38
30
|
"import": "./dist/waasCore.esm.js",
|
|
39
31
|
"default": "./dist/waasCore.cjs"
|
|
@@ -47,43 +39,12 @@
|
|
|
47
39
|
"buffer": "6.0.3",
|
|
48
40
|
"eventemitter3": "5.0.1",
|
|
49
41
|
"zod": "4.0.5",
|
|
50
|
-
"@dynamic-labs-sdk/assert-package-version": "0.26.
|
|
42
|
+
"@dynamic-labs-sdk/assert-package-version": "0.26.9"
|
|
51
43
|
},
|
|
52
44
|
"devDependencies": {
|
|
53
45
|
"@inrupt/jest-jsdom-polyfills": "4.0.5",
|
|
54
|
-
"@react-native-async-storage/async-storage": "2.2.0",
|
|
55
|
-
"react-native-keychain": "10.0.0",
|
|
56
|
-
"react-native-passkey": "3.3.2",
|
|
57
46
|
"vitest": "1.6.1"
|
|
58
47
|
},
|
|
59
|
-
"codegenConfig": {
|
|
60
|
-
"name": "DynamicClientSpec",
|
|
61
|
-
"type": "modules",
|
|
62
|
-
"jsSrcsDir": "src/turboModules",
|
|
63
|
-
"android": {
|
|
64
|
-
"javaPackageName": "xyz.dynamic.client"
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
"peerDependencies": {
|
|
68
|
-
"@react-native-async-storage/async-storage": "^2.2.0",
|
|
69
|
-
"react-native": ">=0.73.6",
|
|
70
|
-
"react-native-keychain": "^10.0.0",
|
|
71
|
-
"react-native-passkey": ">=3.3.2"
|
|
72
|
-
},
|
|
73
|
-
"peerDependenciesMeta": {
|
|
74
|
-
"@react-native-async-storage/async-storage": {
|
|
75
|
-
"optional": true
|
|
76
|
-
},
|
|
77
|
-
"react-native-keychain": {
|
|
78
|
-
"optional": true
|
|
79
|
-
},
|
|
80
|
-
"react-native": {
|
|
81
|
-
"optional": true
|
|
82
|
-
},
|
|
83
|
-
"react-native-passkey": {
|
|
84
|
-
"optional": true
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
48
|
"scripts": {
|
|
88
49
|
"build": "rm -rf dist && tsdown && pnpm exec tsc --emitDeclarationOnly -p ./tsconfig.lib.json && pnpm exec tsc --noEmit -p ./tsconfig.lib.native.json",
|
|
89
50
|
"lint": "eslint .",
|
package/android/build.gradle
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
buildscript {
|
|
2
|
-
repositories {
|
|
3
|
-
google()
|
|
4
|
-
mavenCentral()
|
|
5
|
-
}
|
|
6
|
-
dependencies {
|
|
7
|
-
classpath "com.android.tools.build:gradle:8.7.2"
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
apply plugin: "com.android.library"
|
|
12
|
-
apply plugin: "com.facebook.react"
|
|
13
|
-
apply plugin: "org.jetbrains.kotlin.android"
|
|
14
|
-
|
|
15
|
-
import groovy.json.JsonSlurper
|
|
16
|
-
|
|
17
|
-
def packageJson = new JsonSlurper().parseText(file("../package.json").text)
|
|
18
|
-
def sdkVersion = packageJson.version
|
|
19
|
-
|
|
20
|
-
def safeExtGet(prop, fallback) {
|
|
21
|
-
return rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
android {
|
|
25
|
-
namespace "xyz.dynamic.client"
|
|
26
|
-
|
|
27
|
-
compileSdkVersion safeExtGet("compileSdkVersion", 35)
|
|
28
|
-
|
|
29
|
-
defaultConfig {
|
|
30
|
-
minSdkVersion safeExtGet("minSdkVersion", 24)
|
|
31
|
-
targetSdkVersion safeExtGet("targetSdkVersion", 35)
|
|
32
|
-
buildConfigField "String", "DYNAMIC_SDK_VERSION", "\"${sdkVersion}\""
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
buildFeatures {
|
|
36
|
-
buildConfig true
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
buildTypes {
|
|
40
|
-
release {
|
|
41
|
-
minifyEnabled false
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
compileOptions {
|
|
46
|
-
sourceCompatibility JavaVersion.VERSION_17
|
|
47
|
-
targetCompatibility JavaVersion.VERSION_17
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
kotlinOptions {
|
|
51
|
-
jvmTarget = "17"
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
sourceSets {
|
|
55
|
-
main {
|
|
56
|
-
java.srcDirs += [
|
|
57
|
-
"generated/java",
|
|
58
|
-
"generated/jni"
|
|
59
|
-
]
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
repositories {
|
|
65
|
-
mavenCentral()
|
|
66
|
-
google()
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
dependencies {
|
|
70
|
-
implementation "com.facebook.react:react-android"
|
|
71
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
package xyz.dynamic.client
|
|
2
|
-
|
|
3
|
-
import com.facebook.react.BaseReactPackage
|
|
4
|
-
import com.facebook.react.bridge.NativeModule
|
|
5
|
-
import com.facebook.react.bridge.ReactApplicationContext
|
|
6
|
-
import com.facebook.react.module.model.ReactModuleInfo
|
|
7
|
-
import com.facebook.react.module.model.ReactModuleInfoProvider
|
|
8
|
-
import xyz.dynamic.client.keychain.KeychainModule
|
|
9
|
-
import xyz.dynamic.client.manifest.ReactNativeManifestModule
|
|
10
|
-
|
|
11
|
-
class DynamicClientPackage : BaseReactPackage() {
|
|
12
|
-
override fun getModule(name: String, reactContext: ReactApplicationContext): NativeModule? {
|
|
13
|
-
return when (name) {
|
|
14
|
-
KeychainModule.NAME -> KeychainModule(reactContext)
|
|
15
|
-
ReactNativeManifestModule.NAME -> ReactNativeManifestModule(reactContext)
|
|
16
|
-
else -> null
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
override fun getReactModuleInfoProvider(): ReactModuleInfoProvider {
|
|
21
|
-
return ReactModuleInfoProvider {
|
|
22
|
-
mapOf(
|
|
23
|
-
KeychainModule.NAME to ReactModuleInfo(
|
|
24
|
-
KeychainModule.NAME,
|
|
25
|
-
KeychainModule.NAME,
|
|
26
|
-
false,
|
|
27
|
-
false,
|
|
28
|
-
false,
|
|
29
|
-
true
|
|
30
|
-
),
|
|
31
|
-
ReactNativeManifestModule.NAME to ReactModuleInfo(
|
|
32
|
-
ReactNativeManifestModule.NAME,
|
|
33
|
-
ReactNativeManifestModule.NAME,
|
|
34
|
-
false,
|
|
35
|
-
false,
|
|
36
|
-
false,
|
|
37
|
-
true
|
|
38
|
-
)
|
|
39
|
-
)
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
package xyz.dynamic.client.keychain
|
|
2
|
-
|
|
3
|
-
import android.content.Context
|
|
4
|
-
import android.content.pm.PackageManager
|
|
5
|
-
import android.os.Build
|
|
6
|
-
import android.security.keystore.KeyGenParameterSpec
|
|
7
|
-
import android.security.keystore.KeyProperties
|
|
8
|
-
import android.security.keystore.StrongBoxUnavailableException
|
|
9
|
-
import java.security.KeyPairGenerator
|
|
10
|
-
import java.security.KeyStore
|
|
11
|
-
import java.security.Signature
|
|
12
|
-
import java.security.spec.ECGenParameterSpec
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Android KeyStore key manager backed by hardware TEE/StrongBox.
|
|
16
|
-
* Provides P-256 key generation, signing, and management.
|
|
17
|
-
* All public keys are returned in uncompressed SEC1 format (65 bytes: 04 || x || y).
|
|
18
|
-
* All binary data uses base64url encoding (RFC 4648 S5, no padding).
|
|
19
|
-
*/
|
|
20
|
-
class KeyStoreKeyManager {
|
|
21
|
-
|
|
22
|
-
fun isAvailable(context: Context?): Boolean {
|
|
23
|
-
return try {
|
|
24
|
-
val keyStore = KeyStore.getInstance(ANDROID_KEYSTORE)
|
|
25
|
-
keyStore.load(null)
|
|
26
|
-
val hasStrongBox = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P && context != null) {
|
|
27
|
-
context.packageManager.hasSystemFeature(PackageManager.FEATURE_STRONGBOX_KEYSTORE)
|
|
28
|
-
} else {
|
|
29
|
-
false
|
|
30
|
-
}
|
|
31
|
-
// Even without StrongBox, Android KeyStore provides TEE-backed keys on most devices
|
|
32
|
-
hasStrongBox || Build.VERSION.SDK_INT >= Build.VERSION_CODES.M
|
|
33
|
-
} catch (e: Exception) {
|
|
34
|
-
false
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
fun hasKey(alias: String): Boolean {
|
|
39
|
-
val keyStore = loadKeyStore()
|
|
40
|
-
return keyStore.containsAlias(alias)
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
fun generateKeyPair(alias: String): String {
|
|
44
|
-
require(!hasKey(alias)) { "Key already exists for alias: $alias" }
|
|
45
|
-
|
|
46
|
-
val specBuilder = KeyGenParameterSpec.Builder(
|
|
47
|
-
alias,
|
|
48
|
-
KeyProperties.PURPOSE_SIGN or KeyProperties.PURPOSE_VERIFY
|
|
49
|
-
)
|
|
50
|
-
.setAlgorithmParameterSpec(ECGenParameterSpec("secp256r1"))
|
|
51
|
-
.setDigests(KeyProperties.DIGEST_SHA256)
|
|
52
|
-
|
|
53
|
-
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
|
54
|
-
specBuilder.setIsStrongBoxBacked(true)
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
val keyPair = try {
|
|
58
|
-
val kpg = KeyPairGenerator.getInstance(KeyProperties.KEY_ALGORITHM_EC, ANDROID_KEYSTORE)
|
|
59
|
-
kpg.initialize(specBuilder.build())
|
|
60
|
-
kpg.generateKeyPair()
|
|
61
|
-
} catch (e: Exception) {
|
|
62
|
-
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P && e is StrongBoxUnavailableException) {
|
|
63
|
-
// Fallback: retry without StrongBox on TEE
|
|
64
|
-
specBuilder.setIsStrongBoxBacked(false)
|
|
65
|
-
val kpg = KeyPairGenerator.getInstance(KeyProperties.KEY_ALGORITHM_EC, ANDROID_KEYSTORE)
|
|
66
|
-
kpg.initialize(specBuilder.build())
|
|
67
|
-
kpg.generateKeyPair()
|
|
68
|
-
} else {
|
|
69
|
-
throw e
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
val publicKeyBytes = extractUncompressedPublicKey(keyPair.public.encoded)
|
|
74
|
-
return base64urlEncode(publicKeyBytes)
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
fun getPublicKey(alias: String): String? {
|
|
78
|
-
val keyStore = loadKeyStore()
|
|
79
|
-
val entry = keyStore.getEntry(alias, null)
|
|
80
|
-
|
|
81
|
-
if (entry == null || entry !is KeyStore.PrivateKeyEntry) {
|
|
82
|
-
return null
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
val publicKeyBytes = extractUncompressedPublicKey(entry.certificate.publicKey.encoded)
|
|
86
|
-
return base64urlEncode(publicKeyBytes)
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
fun sign(alias: String, payload: ByteArray): String {
|
|
90
|
-
val keyStore = loadKeyStore()
|
|
91
|
-
val entry = keyStore.getEntry(alias, null)
|
|
92
|
-
|
|
93
|
-
require(entry != null && entry is KeyStore.PrivateKeyEntry) { "Key not found: $alias" }
|
|
94
|
-
|
|
95
|
-
val signature = Signature.getInstance("SHA256withECDSA")
|
|
96
|
-
signature.initSign(entry.privateKey)
|
|
97
|
-
signature.update(payload)
|
|
98
|
-
val signatureBytes = signature.sign()
|
|
99
|
-
|
|
100
|
-
return base64urlEncode(signatureBytes)
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
fun deleteKey(alias: String) {
|
|
104
|
-
val keyStore = loadKeyStore()
|
|
105
|
-
keyStore.deleteEntry(alias)
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
// region Private helpers
|
|
109
|
-
|
|
110
|
-
private fun loadKeyStore(): KeyStore {
|
|
111
|
-
val keyStore = KeyStore.getInstance(ANDROID_KEYSTORE)
|
|
112
|
-
keyStore.load(null)
|
|
113
|
-
return keyStore
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* Extract uncompressed SEC1 public key (65 bytes: 04 || x || y)
|
|
118
|
-
* from X.509 SubjectPublicKeyInfo DER encoding.
|
|
119
|
-
*/
|
|
120
|
-
private fun extractUncompressedPublicKey(x509Encoded: ByteArray): ByteArray {
|
|
121
|
-
val uncompressedPointLength = 65
|
|
122
|
-
return x509Encoded.copyOfRange(
|
|
123
|
-
x509Encoded.size - uncompressedPointLength,
|
|
124
|
-
x509Encoded.size
|
|
125
|
-
)
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
private fun base64urlEncode(data: ByteArray): String {
|
|
129
|
-
return android.util.Base64.encodeToString(
|
|
130
|
-
data,
|
|
131
|
-
android.util.Base64.URL_SAFE or android.util.Base64.NO_WRAP or android.util.Base64.NO_PADDING
|
|
132
|
-
)
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
companion object {
|
|
136
|
-
private const val ANDROID_KEYSTORE = "AndroidKeyStore"
|
|
137
|
-
|
|
138
|
-
fun base64urlDecode(input: String): ByteArray {
|
|
139
|
-
return android.util.Base64.decode(
|
|
140
|
-
input,
|
|
141
|
-
android.util.Base64.URL_SAFE or android.util.Base64.NO_WRAP or android.util.Base64.NO_PADDING
|
|
142
|
-
)
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
// endregion
|
|
147
|
-
}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
package xyz.dynamic.client.keychain
|
|
2
|
-
|
|
3
|
-
import com.facebook.react.bridge.Arguments
|
|
4
|
-
import com.facebook.react.bridge.Promise
|
|
5
|
-
import com.facebook.react.bridge.ReactApplicationContext
|
|
6
|
-
import com.facebook.react.bridge.WritableMap
|
|
7
|
-
import com.facebook.react.module.annotations.ReactModule
|
|
8
|
-
import xyz.dynamic.client.NativeKeychainSpec
|
|
9
|
-
|
|
10
|
-
@ReactModule(name = KeychainModule.NAME)
|
|
11
|
-
class KeychainModule(reactContext: ReactApplicationContext) :
|
|
12
|
-
NativeKeychainSpec(reactContext) {
|
|
13
|
-
|
|
14
|
-
private val keyManager = KeyStoreKeyManager()
|
|
15
|
-
|
|
16
|
-
companion object {
|
|
17
|
-
const val NAME = "Keychain"
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
override fun getName(): String = NAME
|
|
21
|
-
|
|
22
|
-
override fun isAvailable(promise: Promise) {
|
|
23
|
-
try {
|
|
24
|
-
val context = reactApplicationContext
|
|
25
|
-
promise.resolve(keyManager.isAvailable(context))
|
|
26
|
-
} catch (e: Exception) {
|
|
27
|
-
promise.resolve(false)
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
override fun hasKey(key: String, promise: Promise) {
|
|
32
|
-
try {
|
|
33
|
-
promise.resolve(keyManager.hasKey(key))
|
|
34
|
-
} catch (e: Exception) {
|
|
35
|
-
promise.reject("ERR_KEYCHAIN", "Failed to check key: ${e.message}", e)
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
override fun generateKeyPair(key: String, promise: Promise) {
|
|
40
|
-
try {
|
|
41
|
-
val publicKey = keyManager.generateKeyPair(key)
|
|
42
|
-
val result: WritableMap = Arguments.createMap()
|
|
43
|
-
result.putString("publicKey", publicKey)
|
|
44
|
-
promise.resolve(result)
|
|
45
|
-
} catch (e: Exception) {
|
|
46
|
-
promise.reject("ERR_KEYCHAIN", "Failed to generate key pair: ${e.message}", e)
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
override fun getPublicKey(key: String, promise: Promise) {
|
|
51
|
-
try {
|
|
52
|
-
val publicKey = keyManager.getPublicKey(key)
|
|
53
|
-
if (publicKey == null) {
|
|
54
|
-
promise.resolve(null)
|
|
55
|
-
} else {
|
|
56
|
-
val result: WritableMap = Arguments.createMap()
|
|
57
|
-
result.putString("publicKey", publicKey)
|
|
58
|
-
promise.resolve(result)
|
|
59
|
-
}
|
|
60
|
-
} catch (e: Exception) {
|
|
61
|
-
promise.reject("ERR_KEYCHAIN", "Failed to get public key: ${e.message}", e)
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
override fun sign(key: String, payload: String, promise: Promise) {
|
|
66
|
-
try {
|
|
67
|
-
val payloadData = KeyStoreKeyManager.base64urlDecode(payload)
|
|
68
|
-
val signature = keyManager.sign(key, payloadData)
|
|
69
|
-
val result: WritableMap = Arguments.createMap()
|
|
70
|
-
result.putString("signature", signature)
|
|
71
|
-
promise.resolve(result)
|
|
72
|
-
} catch (e: Exception) {
|
|
73
|
-
promise.reject("ERR_KEYCHAIN", "Failed to sign: ${e.message}", e)
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
override fun deleteKey(key: String, promise: Promise) {
|
|
78
|
-
try {
|
|
79
|
-
keyManager.deleteKey(key)
|
|
80
|
-
promise.resolve(null)
|
|
81
|
-
} catch (e: Exception) {
|
|
82
|
-
promise.reject("ERR_KEYCHAIN", "Failed to delete key: ${e.message}", e)
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
package xyz.dynamic.client.manifest
|
|
2
|
-
|
|
3
|
-
import com.facebook.react.bridge.Arguments
|
|
4
|
-
import com.facebook.react.bridge.ReactApplicationContext
|
|
5
|
-
import com.facebook.react.bridge.WritableMap
|
|
6
|
-
import com.facebook.react.module.annotations.ReactModule
|
|
7
|
-
import xyz.dynamic.client.BuildConfig
|
|
8
|
-
import xyz.dynamic.client.NativeReactNativeManifestSpec
|
|
9
|
-
|
|
10
|
-
@ReactModule(name = ReactNativeManifestModule.NAME)
|
|
11
|
-
class ReactNativeManifestModule(reactContext: ReactApplicationContext) :
|
|
12
|
-
NativeReactNativeManifestSpec(reactContext) {
|
|
13
|
-
|
|
14
|
-
companion object {
|
|
15
|
-
const val NAME = "ReactNativeManifest"
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
override fun getName(): String = NAME
|
|
19
|
-
|
|
20
|
-
override fun getManifest(): WritableMap {
|
|
21
|
-
val manifest = Arguments.createMap()
|
|
22
|
-
manifest.putString("sdkVersion", BuildConfig.DYNAMIC_SDK_VERSION)
|
|
23
|
-
return manifest
|
|
24
|
-
}
|
|
25
|
-
}
|