@account-kit/react-native-signer 4.53.2-alpha.0 → 4.53.3-alpha.0

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.
Files changed (164) hide show
  1. package/lib/commonjs/client.js +0 -12
  2. package/lib/commonjs/client.js.map +1 -1
  3. package/lib/module/client.js +0 -12
  4. package/lib/module/client.js.map +1 -1
  5. package/lib/typescript/commonjs/src/client.d.ts +1 -2
  6. package/lib/typescript/commonjs/src/client.d.ts.map +1 -1
  7. package/lib/typescript/module/src/client.d.ts +1 -2
  8. package/lib/typescript/module/src/client.d.ts.map +1 -1
  9. package/package.json +4 -4
  10. package/src/client.ts +0 -16
  11. package/android/bin/build/generated/source/buildConfig/debug/com/accountkit/reactnativesigner/BuildConfig.class +0 -0
  12. package/android/bin/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +0 -7
  13. package/android/bin/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json +0 -18
  14. package/android/bin/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties +0 -6
  15. package/android/bin/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json +0 -1
  16. package/android/bin/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
  17. package/android/bin/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar +0 -0
  18. package/android/bin/build/intermediates/compile_symbol_list/debug/generateDebugRFile/R.txt +0 -0
  19. package/android/bin/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +0 -1
  20. package/android/bin/build/intermediates/incremental/debug/packageDebugResources/merger.xml +0 -2
  21. package/android/bin/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +0 -2
  22. package/android/bin/build/intermediates/incremental/mergeDebugShaders/merger.xml +0 -2
  23. package/android/bin/build/intermediates/incremental/packageDebugAssets/merger.xml +0 -2
  24. package/android/bin/build/intermediates/java_res/debug/processDebugJavaRes/out/META-INF/account-kit_react-native-signer_debug.kotlin_module +0 -0
  25. package/android/bin/build/intermediates/local_only_symbol_list/debug/parseDebugLocalResources/R-def.txt +0 -2
  26. package/android/bin/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +0 -7
  27. package/android/bin/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +0 -7
  28. package/android/bin/build/intermediates/navigation_json/debug/extractDeepLinksDebug/navigation.json +0 -1
  29. package/android/bin/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt +0 -1
  30. package/android/bin/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/META-INF/account-kit_react-native-signer_debug.kotlin_module +0 -0
  31. package/android/bin/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
  32. package/android/bin/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt +0 -1
  33. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab +0 -0
  34. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream +0 -0
  35. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream.len +0 -0
  36. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.len +0 -0
  37. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
  38. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i +0 -0
  39. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i.len +0 -0
  40. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
  41. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream +0 -0
  42. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len +0 -0
  43. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.len +0 -0
  44. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at +0 -0
  45. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i +0 -0
  46. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i.len +0 -0
  47. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
  48. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream +0 -0
  49. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len +0 -0
  50. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len +0 -0
  51. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
  52. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i +0 -0
  53. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i.len +0 -0
  54. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab +0 -0
  55. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream +0 -0
  56. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream.len +0 -0
  57. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.len +0 -0
  58. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.values.at +0 -0
  59. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i +0 -0
  60. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i.len +0 -0
  61. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
  62. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
  63. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
  64. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len +0 -0
  65. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
  66. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
  67. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len +0 -0
  68. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab +0 -0
  69. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab.keystream +0 -0
  70. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab.keystream.len +0 -0
  71. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab.len +0 -0
  72. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab.values.at +0 -0
  73. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab_i +0 -0
  74. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab_i.len +0 -0
  75. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab +0 -0
  76. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.keystream +0 -0
  77. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.keystream.len +0 -0
  78. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.len +0 -0
  79. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.values.at +0 -0
  80. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab_i +0 -0
  81. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab_i.len +0 -0
  82. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab +0 -0
  83. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream +0 -0
  84. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len +0 -0
  85. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.len +0 -0
  86. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
  87. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i +0 -0
  88. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i.len +0 -0
  89. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
  90. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream +0 -0
  91. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len +0 -0
  92. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.len +0 -0
  93. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
  94. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i +0 -0
  95. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len +0 -0
  96. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
  97. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream +0 -0
  98. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len +0 -0
  99. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.len +0 -0
  100. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
  101. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i +0 -0
  102. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i.len +0 -0
  103. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
  104. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream +0 -0
  105. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len +0 -0
  106. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.len +0 -0
  107. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
  108. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i +0 -0
  109. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i.len +0 -0
  110. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/counters.tab +0 -2
  111. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab +0 -0
  112. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream +0 -0
  113. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream.len +0 -0
  114. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.len +0 -0
  115. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
  116. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i +0 -0
  117. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i.len +0 -0
  118. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab +0 -0
  119. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream +0 -0
  120. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
  121. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len +0 -0
  122. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
  123. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i +0 -0
  124. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i.len +0 -0
  125. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab +0 -0
  126. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream +0 -0
  127. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
  128. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.len +0 -0
  129. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at +0 -0
  130. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i +0 -0
  131. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i.len +0 -0
  132. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/last-build.bin +0 -0
  133. package/android/bin/build/kotlin/compileDebugKotlin/classpath-snapshot/shrunk-classpath-snapshot.bin +0 -0
  134. package/android/bin/build/kotlin/compileDebugKotlin/local-state/build-history.bin +0 -0
  135. package/android/bin/build/outputs/logs/manifest-merger-debug-report.txt +0 -16
  136. package/android/bin/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
  137. package/android/bin/build/tmp/kotlin-classes/debug/META-INF/account-kit_react-native-signer_debug.kotlin_module +0 -0
  138. package/android/bin/build.gradle +0 -192
  139. package/android/bin/generated/java/com/accountkit/reactnativesigner/NativeTEKStamperSpec.class +0 -0
  140. package/android/bin/generated/jni/CMakeLists.txt +0 -36
  141. package/android/bin/generated/jni/NativeTEKStamperSpec-generated.cpp +0 -56
  142. package/android/bin/generated/jni/NativeTEKStamperSpec.h +0 -31
  143. package/android/bin/generated/jni/react/renderer/components/NativeTEKStamperSpec/ComponentDescriptors.cpp +0 -22
  144. package/android/bin/generated/jni/react/renderer/components/NativeTEKStamperSpec/ComponentDescriptors.h +0 -24
  145. package/android/bin/generated/jni/react/renderer/components/NativeTEKStamperSpec/EventEmitters.cpp +0 -16
  146. package/android/bin/generated/jni/react/renderer/components/NativeTEKStamperSpec/EventEmitters.h +0 -17
  147. package/android/bin/generated/jni/react/renderer/components/NativeTEKStamperSpec/NativeTEKStamperSpecJSI-generated.cpp +0 -54
  148. package/android/bin/generated/jni/react/renderer/components/NativeTEKStamperSpec/NativeTEKStamperSpecJSI.h +0 -150
  149. package/android/bin/generated/jni/react/renderer/components/NativeTEKStamperSpec/Props.cpp +0 -19
  150. package/android/bin/generated/jni/react/renderer/components/NativeTEKStamperSpec/Props.h +0 -18
  151. package/android/bin/generated/jni/react/renderer/components/NativeTEKStamperSpec/ShadowNodes.cpp +0 -17
  152. package/android/bin/generated/jni/react/renderer/components/NativeTEKStamperSpec/ShadowNodes.h +0 -23
  153. package/android/bin/generated/jni/react/renderer/components/NativeTEKStamperSpec/States.cpp +0 -16
  154. package/android/bin/generated/jni/react/renderer/components/NativeTEKStamperSpec/States.h +0 -19
  155. package/android/bin/gradle.properties +0 -5
  156. package/android/bin/src/main/AndroidManifest.xml +0 -3
  157. package/android/bin/src/main/java/com/accountkit/reactnativesigner/NativeTEKStamperModule.kt +0 -66
  158. package/android/bin/src/main/java/com/accountkit/reactnativesigner/ReactNativeSignerPackage.kt +0 -33
  159. package/android/bin/src/main/java/com/accountkit/reactnativesigner/core/KeyExtensions.kt +0 -77
  160. package/android/bin/src/main/java/com/accountkit/reactnativesigner/core/TEKManager.kt +0 -89
  161. package/android/bin/src/main/java/com/accountkit/reactnativesigner/core/TEKStamper.kt +0 -258
  162. package/android/bin/src/main/java/com/accountkit/reactnativesigner/core/errors/NoInjectedBundleException.kt +0 -3
  163. package/android/bin/src/main/java/com/accountkit/reactnativesigner/core/errors/NoTEKException.kt +0 -3
  164. package/android/bin/src/main/java/com/accountkit/reactnativesigner/core/errors/StamperNotInitialized.kt +0 -3
@@ -1,150 +0,0 @@
1
- /**
2
- * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
3
- *
4
- * Do not edit this file as changes may cause incorrect behavior and will be lost
5
- * once the code is regenerated.
6
- *
7
- * @generated by codegen project: GenerateModuleH.js
8
- */
9
-
10
- #pragma once
11
-
12
- #include <ReactCommon/TurboModule.h>
13
- #include <react/bridging/Bridging.h>
14
-
15
- namespace facebook::react {
16
-
17
-
18
-
19
- #pragma mark - NativeTEKStamperTStamp
20
-
21
- template <typename P0, typename P1>
22
- struct NativeTEKStamperTStamp {
23
- P0 stampHeaderName;
24
- P1 stampHeaderValue;
25
- bool operator==(const NativeTEKStamperTStamp &other) const {
26
- return stampHeaderName == other.stampHeaderName && stampHeaderValue == other.stampHeaderValue;
27
- }
28
- };
29
-
30
- template <typename T>
31
- struct NativeTEKStamperTStampBridging {
32
- static T types;
33
-
34
- static T fromJs(
35
- jsi::Runtime &rt,
36
- const jsi::Object &value,
37
- const std::shared_ptr<CallInvoker> &jsInvoker) {
38
- T result{
39
- bridging::fromJs<decltype(types.stampHeaderName)>(rt, value.getProperty(rt, "stampHeaderName"), jsInvoker),
40
- bridging::fromJs<decltype(types.stampHeaderValue)>(rt, value.getProperty(rt, "stampHeaderValue"), jsInvoker)};
41
- return result;
42
- }
43
-
44
- #ifdef DEBUG
45
- static jsi::String stampHeaderNameToJs(jsi::Runtime &rt, decltype(types.stampHeaderName) value) {
46
- return bridging::toJs(rt, value);
47
- }
48
-
49
- static jsi::String stampHeaderValueToJs(jsi::Runtime &rt, decltype(types.stampHeaderValue) value) {
50
- return bridging::toJs(rt, value);
51
- }
52
- #endif
53
-
54
- static jsi::Object toJs(
55
- jsi::Runtime &rt,
56
- const T &value,
57
- const std::shared_ptr<CallInvoker> &jsInvoker) {
58
- auto result = facebook::jsi::Object(rt);
59
- result.setProperty(rt, "stampHeaderName", bridging::toJs(rt, value.stampHeaderName, jsInvoker));
60
- result.setProperty(rt, "stampHeaderValue", bridging::toJs(rt, value.stampHeaderValue, jsInvoker));
61
- return result;
62
- }
63
- };
64
-
65
- class JSI_EXPORT NativeTEKStamperCxxSpecJSI : public TurboModule {
66
- protected:
67
- NativeTEKStamperCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker);
68
-
69
- public:
70
- virtual jsi::Value init(jsi::Runtime &rt) = 0;
71
- virtual void clear(jsi::Runtime &rt) = 0;
72
- virtual std::optional<jsi::String> publicKey(jsi::Runtime &rt) = 0;
73
- virtual jsi::Value injectCredentialBundle(jsi::Runtime &rt, jsi::String bundle) = 0;
74
- virtual jsi::Value stamp(jsi::Runtime &rt, jsi::String payload) = 0;
75
-
76
- };
77
-
78
- template <typename T>
79
- class JSI_EXPORT NativeTEKStamperCxxSpec : public TurboModule {
80
- public:
81
- jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override {
82
- return delegate_.get(rt, propName);
83
- }
84
-
85
- static constexpr std::string_view kModuleName = "NativeTEKStamper";
86
-
87
- protected:
88
- NativeTEKStamperCxxSpec(std::shared_ptr<CallInvoker> jsInvoker)
89
- : TurboModule(std::string{NativeTEKStamperCxxSpec::kModuleName}, jsInvoker),
90
- delegate_(reinterpret_cast<T*>(this), jsInvoker) {}
91
-
92
-
93
- private:
94
- class Delegate : public NativeTEKStamperCxxSpecJSI {
95
- public:
96
- Delegate(T *instance, std::shared_ptr<CallInvoker> jsInvoker) :
97
- NativeTEKStamperCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {
98
-
99
- }
100
-
101
- jsi::Value init(jsi::Runtime &rt) override {
102
- static_assert(
103
- bridging::getParameterCount(&T::init) == 1,
104
- "Expected init(...) to have 1 parameters");
105
-
106
- return bridging::callFromJs<jsi::Value>(
107
- rt, &T::init, jsInvoker_, instance_);
108
- }
109
- void clear(jsi::Runtime &rt) override {
110
- static_assert(
111
- bridging::getParameterCount(&T::clear) == 1,
112
- "Expected clear(...) to have 1 parameters");
113
-
114
- return bridging::callFromJs<void>(
115
- rt, &T::clear, jsInvoker_, instance_);
116
- }
117
- std::optional<jsi::String> publicKey(jsi::Runtime &rt) override {
118
- static_assert(
119
- bridging::getParameterCount(&T::publicKey) == 1,
120
- "Expected publicKey(...) to have 1 parameters");
121
-
122
- return bridging::callFromJs<std::optional<jsi::String>>(
123
- rt, &T::publicKey, jsInvoker_, instance_);
124
- }
125
- jsi::Value injectCredentialBundle(jsi::Runtime &rt, jsi::String bundle) override {
126
- static_assert(
127
- bridging::getParameterCount(&T::injectCredentialBundle) == 2,
128
- "Expected injectCredentialBundle(...) to have 2 parameters");
129
-
130
- return bridging::callFromJs<jsi::Value>(
131
- rt, &T::injectCredentialBundle, jsInvoker_, instance_, std::move(bundle));
132
- }
133
- jsi::Value stamp(jsi::Runtime &rt, jsi::String payload) override {
134
- static_assert(
135
- bridging::getParameterCount(&T::stamp) == 2,
136
- "Expected stamp(...) to have 2 parameters");
137
-
138
- return bridging::callFromJs<jsi::Value>(
139
- rt, &T::stamp, jsInvoker_, instance_, std::move(payload));
140
- }
141
-
142
- private:
143
- friend class NativeTEKStamperCxxSpec;
144
- T *instance_;
145
- };
146
-
147
- Delegate delegate_;
148
- };
149
-
150
- } // namespace facebook::react
@@ -1,19 +0,0 @@
1
-
2
- /**
3
- * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
- *
5
- * Do not edit this file as changes may cause incorrect behavior and will be lost
6
- * once the code is regenerated.
7
- *
8
- * @generated by codegen project: GeneratePropsCpp.js
9
- */
10
-
11
- #include "Props.h"
12
- #include <react/renderer/core/PropsParserContext.h>
13
- #include <react/renderer/core/propsConversions.h>
14
-
15
- namespace facebook::react {
16
-
17
-
18
-
19
- } // namespace facebook::react
@@ -1,18 +0,0 @@
1
-
2
- /**
3
- * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
- *
5
- * Do not edit this file as changes may cause incorrect behavior and will be lost
6
- * once the code is regenerated.
7
- *
8
- * @generated by codegen project: GeneratePropsH.js
9
- */
10
- #pragma once
11
-
12
-
13
-
14
- namespace facebook::react {
15
-
16
-
17
-
18
- } // namespace facebook::react
@@ -1,17 +0,0 @@
1
-
2
- /**
3
- * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
- *
5
- * Do not edit this file as changes may cause incorrect behavior and will be lost
6
- * once the code is regenerated.
7
- *
8
- * @generated by codegen project: GenerateShadowNodeCpp.js
9
- */
10
-
11
- #include "ShadowNodes.h"
12
-
13
- namespace facebook::react {
14
-
15
-
16
-
17
- } // namespace facebook::react
@@ -1,23 +0,0 @@
1
-
2
- /**
3
- * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
- *
5
- * Do not edit this file as changes may cause incorrect behavior and will be lost
6
- * once the code is regenerated.
7
- *
8
- * @generated by codegen project: GenerateShadowNodeH.js
9
- */
10
-
11
- #pragma once
12
-
13
- #include "EventEmitters.h"
14
- #include "Props.h"
15
- #include "States.h"
16
- #include <react/renderer/components/view/ConcreteViewShadowNode.h>
17
- #include <jsi/jsi.h>
18
-
19
- namespace facebook::react {
20
-
21
-
22
-
23
- } // namespace facebook::react
@@ -1,16 +0,0 @@
1
-
2
- /**
3
- * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
- *
5
- * Do not edit this file as changes may cause incorrect behavior and will be lost
6
- * once the code is regenerated.
7
- *
8
- * @generated by codegen project: GenerateStateCpp.js
9
- */
10
- #include "States.h"
11
-
12
- namespace facebook::react {
13
-
14
-
15
-
16
- } // namespace facebook::react
@@ -1,19 +0,0 @@
1
- /**
2
- * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
3
- *
4
- * Do not edit this file as changes may cause incorrect behavior and will be lost
5
- * once the code is regenerated.
6
- *
7
- * @generated by codegen project: GenerateStateH.js
8
- */
9
- #pragma once
10
-
11
- #ifdef ANDROID
12
- #include <folly/dynamic.h>
13
- #endif
14
-
15
- namespace facebook::react {
16
-
17
-
18
-
19
- } // namespace facebook::react
@@ -1,5 +0,0 @@
1
- ReactNativeSigner_kotlinVersion=1.7.0
2
- ReactNativeSigner_minSdkVersion=21
3
- ReactNativeSigner_targetSdkVersion=31
4
- ReactNativeSigner_compileSdkVersion=31
5
- ReactNativeSigner_ndkversion=21.4.7075529
@@ -1,3 +0,0 @@
1
- <manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
- package="com.accountkit.reactnativesigner">
3
- </manifest>
@@ -1,66 +0,0 @@
1
- package com.accountkit.reactnativesigner
2
-
3
- import com.accountkit.reactnativesigner.core.TEKStamper
4
- import com.facebook.react.bridge.Arguments
5
- import com.facebook.react.bridge.Promise
6
- import com.facebook.react.bridge.ReactApplicationContext
7
- import com.facebook.react.module.annotations.ReactModule
8
-
9
- @ReactModule(name = NativeTEKStamperModule.NAME)
10
- class NativeTEKStamperModule(reactContext: ReactApplicationContext) :
11
- NativeTEKStamperSpec(reactContext) {
12
-
13
- private val stamper = TEKStamper(reactContext.applicationContext)
14
-
15
- override fun getName(): String {
16
- return NAME
17
- }
18
-
19
- override fun init(promise: Promise) {
20
- try {
21
- val tekPublicKey = stamper.init()
22
-
23
- return promise.resolve(tekPublicKey)
24
- } catch (e: Exception) {
25
- promise.reject(e)
26
- }
27
- }
28
-
29
- override fun clear() {
30
- stamper.clear()
31
- }
32
-
33
- override fun publicKey(): String? {
34
- return stamper.publicKey()
35
- }
36
-
37
- override fun injectCredentialBundle(bundle: String, promise: Promise) {
38
- try {
39
- stamper.injectCredentialBundle(bundle)
40
-
41
- return promise.resolve(true)
42
- } catch (e: Exception) {
43
- promise.reject(e)
44
- }
45
- }
46
-
47
- override fun stamp(payload: String, promise: Promise) {
48
- try {
49
- val stamp = stamper.stamp(payload)
50
-
51
- val response = Arguments.createMap()
52
- response.putString("stampHeaderName", stamp.stampHeaderName)
53
- response.putString(
54
- "stampHeaderValue",
55
- stamp.stampHeaderValue
56
- )
57
- return promise.resolve(response)
58
- } catch (e: Exception) {
59
- promise.reject(e)
60
- }
61
- }
62
-
63
- companion object {
64
- const val NAME = "NativeTEKStamper"
65
- }
66
- }
@@ -1,33 +0,0 @@
1
- package com.accountkit.reactnativesigner
2
-
3
- import com.facebook.react.TurboReactPackage
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 java.util.HashMap
9
-
10
- class ReactNativeSignerPackage : TurboReactPackage() {
11
- override fun getModule(name: String, reactContext: ReactApplicationContext): NativeModule? {
12
- return if (name == NativeTEKStamperModule.NAME) {
13
- NativeTEKStamperModule(reactContext)
14
- } else {
15
- null
16
- }
17
- }
18
-
19
- override fun getReactModuleInfoProvider(): ReactModuleInfoProvider {
20
- return ReactModuleInfoProvider {
21
- val moduleInfos: MutableMap<String, ReactModuleInfo> = HashMap()
22
- moduleInfos[NativeTEKStamperModule.NAME] = ReactModuleInfo(
23
- NativeTEKStamperModule.NAME,
24
- NativeTEKStamperModule.NAME,
25
- false, // canOverrideExistingModule
26
- false, // needsEagerInit
27
- false, // isCxxModule
28
- true // isTurboModule
29
- )
30
- moduleInfos
31
- }
32
- }
33
- }
@@ -1,77 +0,0 @@
1
- package com.accountkit.reactnativesigner.core
2
-
3
- import com.google.crypto.tink.CleartextKeysetHandle
4
- import com.google.crypto.tink.InsecureSecretKeyAccess
5
- import com.google.crypto.tink.KeysetHandle
6
- import com.google.crypto.tink.hybrid.HpkeParameters
7
- import com.google.crypto.tink.hybrid.HpkePrivateKey
8
- import com.google.crypto.tink.hybrid.HpkePublicKey
9
- import com.google.crypto.tink.subtle.EllipticCurves
10
- import com.google.crypto.tink.util.Bytes
11
- import com.google.crypto.tink.util.SecretBytes
12
- import java.security.interfaces.ECPublicKey
13
- import javax.xml.bind.DatatypeConverter
14
- import com.google.crypto.tink.proto.HpkePrivateKey as ProtoHpkePrivateKey
15
- import com.google.crypto.tink.proto.HpkePublicKey as ProtoHpkePublicKey
16
-
17
- // Keyset Handle Extensions
18
- fun KeysetHandle.toHpkePublicKey(hpkeParameters: HpkeParameters): HpkePublicKey {
19
- val keySet = CleartextKeysetHandle.getKeyset(this.publicKeysetHandle)
20
- val protoKey = ProtoHpkePublicKey.parseFrom(keySet.keyList[0].keyData.value)
21
-
22
- return HpkePublicKey.create(
23
- hpkeParameters,
24
- Bytes.copyFrom(protoKey.publicKey.toByteArray()),
25
- null
26
- )
27
- }
28
-
29
- fun KeysetHandle.toHpkePrivateKey(hpkeParams: HpkeParameters): HpkePrivateKey {
30
- val publicKey = this.toHpkePublicKey(hpkeParams)
31
- val pkKs = CleartextKeysetHandle.getKeyset(this)
32
- val pkKeyData = pkKs.keyList[0].keyData
33
- check(pkKeyData.typeUrl == "type.googleapis.com/google.crypto.tink.HpkePrivateKey") {
34
- "invalid key type"
35
- }
36
-
37
- return HpkePrivateKey.create(
38
- HpkePublicKey.create(
39
- hpkeParams,
40
- Bytes.copyFrom(publicKey.toByteArray()),
41
- null
42
- ),
43
- SecretBytes.copyFrom(
44
- ProtoHpkePrivateKey.parseFrom(pkKeyData.value).privateKey.toByteArray(),
45
- InsecureSecretKeyAccess.get()
46
- )
47
- )
48
- }
49
-
50
- // HPKE Public Key Extensions
51
- fun HpkePublicKey.toHex(): String {
52
- return this.toByteArray().toHex()
53
- }
54
-
55
- fun HpkePublicKey.toByteArray(): ByteArray {
56
- return this.publicKeyBytes.toByteArray()
57
- }
58
-
59
- // ECPublicKey Extensions
60
- fun ECPublicKey.toBytes(
61
- pfType: EllipticCurves.PointFormatType
62
- ): ByteArray {
63
- return EllipticCurves.pointEncode(
64
- this.params.curve,
65
- pfType,
66
- this.w
67
- )
68
- }
69
-
70
- // Conversions from Hex <-> byte[]
71
- fun String.fromHex(): ByteArray {
72
- return DatatypeConverter.parseHexBinary(this)
73
- }
74
-
75
- fun ByteArray.toHex(): String {
76
- return DatatypeConverter.printHexBinary(this)
77
- }
@@ -1,89 +0,0 @@
1
- package com.accountkit.reactnativesigner.core
2
-
3
- import android.content.SharedPreferences
4
- import com.accountkit.reactnativesigner.core.errors.NoTEKException
5
- import com.google.crypto.tink.InsecureSecretKeyAccess
6
- import com.google.crypto.tink.KeyTemplate
7
- import com.google.crypto.tink.KeysetHandle
8
- import com.google.crypto.tink.TinkJsonProtoKeysetFormat
9
- import com.google.crypto.tink.hybrid.HpkeParameters
10
- import com.google.crypto.tink.hybrid.HpkePublicKey
11
- import com.google.crypto.tink.hybrid.internal.HpkeContext
12
- import com.google.crypto.tink.hybrid.internal.HpkeKemKeyFactory
13
- import com.google.crypto.tink.hybrid.internal.HpkePrimitiveFactory
14
-
15
- private const val TEK_STORAGE_KEY = "TEK_STORAGE_KEY"
16
- private val hpkeParams = HpkeParameters.builder()
17
- .setKemId(HpkeParameters.KemId.DHKEM_P256_HKDF_SHA256)
18
- .setKdfId(HpkeParameters.KdfId.HKDF_SHA256)
19
- .setAeadId(HpkeParameters.AeadId.AES_256_GCM)
20
- .setVariant(HpkeParameters.Variant.NO_PREFIX)
21
- .build()
22
-
23
- class HpkeTEKManager(private val sharedPreferences: SharedPreferences) {
24
- fun hpkeDecrypt(
25
- encapsulatePublicKey: ByteArray,
26
- cipherText: ByteArray,
27
- info: ByteArray,
28
- aad: ByteArray
29
- ): ByteArray {
30
- // Why do we hve to do all this rather than doing:
31
- // val hybridDecrypt = tekHandle.getPrimitive(HybridDecrypt::class.java)
32
- // val decryptedKey = hybridDecrypt.decrypt(ciphertext, "turnkey_hpke".toByteArray())
33
- // the hybridDecrypt.decrypt that google exposes doesn't allow us to pass in
34
- // the aad that's needed to complete decryption
35
- val keyHandle = getKeysetHandle() ?: throw NoTEKException()
36
-
37
- val recipient = HpkeContext.createRecipientContext(
38
- encapsulatePublicKey,
39
- HpkeKemKeyFactory.createPrivate(keyHandle.toHpkePrivateKey(hpkeParams)),
40
- HpkePrimitiveFactory.createKem(hpkeParams.kemId),
41
- HpkePrimitiveFactory.createKdf(hpkeParams.kdfId),
42
- HpkePrimitiveFactory.createAead(hpkeParams.aeadId),
43
- info
44
- )
45
-
46
- return recipient.open(cipherText, aad)
47
- }
48
-
49
- fun createTEK(): HpkePublicKey {
50
- val existingPublicKey = publicKey()
51
- if (existingPublicKey != null) {
52
- return existingPublicKey
53
- }
54
-
55
- val keysetHandle = KeysetHandle.generateNew(KeyTemplate.createFrom(hpkeParams))
56
-
57
- sharedPreferences
58
- .edit()
59
- .putString(
60
- TEK_STORAGE_KEY,
61
- TinkJsonProtoKeysetFormat.serializeKeyset(
62
- keysetHandle,
63
- InsecureSecretKeyAccess.get()
64
- )
65
- )
66
- .apply()
67
-
68
- return keysetHandle.toHpkePublicKey(hpkeParams)
69
- }
70
-
71
- fun publicKey(): HpkePublicKey? {
72
- val ksHandle = getKeysetHandle() ?: return null
73
-
74
- return ksHandle.toHpkePublicKey(hpkeParams)
75
- }
76
-
77
- fun publicKeyHex(): String? {
78
- return publicKey()?.toHex()
79
- }
80
-
81
- private fun getKeysetHandle(): KeysetHandle? {
82
- val storageVal = sharedPreferences.getString(TEK_STORAGE_KEY, null) ?: return null
83
-
84
- return TinkJsonProtoKeysetFormat.parseKeyset(
85
- storageVal,
86
- InsecureSecretKeyAccess.get()
87
- )
88
- }
89
- }