@metarouter/react-native-sdk 0.1.14 → 0.1.15

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 (209) hide show
  1. package/android/build/generated/ksp/debug/java/com/reactnativecommunity/asyncstorage/next/StorageDao_Impl.java +244 -0
  2. package/android/build/generated/ksp/debug/java/com/reactnativecommunity/asyncstorage/next/StorageDb_Impl.java +165 -0
  3. package/android/build/generated/source/buildConfig/debug/com/metarouter/reactnativesdk/BuildConfig.java +10 -0
  4. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +7 -0
  5. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json +18 -0
  6. package/android/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties +6 -0
  7. package/android/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json +1 -0
  8. package/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
  9. package/android/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar +0 -0
  10. package/android/build/intermediates/compile_symbol_list/debug/generateDebugRFile/R.txt +0 -0
  11. package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +1 -0
  12. package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +2 -0
  13. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/metarouter/reactnativesdk/BuildConfig.class +0 -0
  14. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/metarouter/reactnativesdk/MetaRouterReactNativeSDKPackage.class +0 -0
  15. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/AsyncLocalStorageUtil.class +0 -0
  16. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/AsyncStorageErrorUtil.class +0 -0
  17. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/AsyncStorageExpoMigration.class +0 -0
  18. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/AsyncStorageModule$1.class +0 -0
  19. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/AsyncStorageModule$2.class +0 -0
  20. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/AsyncStorageModule$3.class +0 -0
  21. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/AsyncStorageModule$4.class +0 -0
  22. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/AsyncStorageModule$5.class +0 -0
  23. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/AsyncStorageModule$6.class +0 -0
  24. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/AsyncStorageModule.class +0 -0
  25. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/AsyncStoragePackage$1.class +0 -0
  26. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/AsyncStoragePackage.class +0 -0
  27. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/BuildConfig.class +0 -0
  28. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/NativeAsyncStorageModuleSpec.class +0 -0
  29. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/ReactDatabaseSupplier.class +0 -0
  30. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/SerialExecutor$1.class +0 -0
  31. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/SerialExecutor.class +0 -0
  32. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/next/StorageDao_Impl$1.class +0 -0
  33. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/next/StorageDao_Impl$2.class +0 -0
  34. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/next/StorageDao_Impl$3.class +0 -0
  35. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/next/StorageDao_Impl$4.class +0 -0
  36. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/next/StorageDao_Impl$5.class +0 -0
  37. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/next/StorageDao_Impl$6.class +0 -0
  38. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/next/StorageDao_Impl$7.class +0 -0
  39. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/next/StorageDao_Impl.class +0 -0
  40. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/next/StorageDb_Impl$1.class +0 -0
  41. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/next/StorageDb_Impl.class +0 -0
  42. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/org/linusu/RNGetRandomValuesModule.class +0 -0
  43. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/org/linusu/RNGetRandomValuesPackage.class +0 -0
  44. package/android/build/intermediates/local_only_symbol_list/debug/parseDebugLocalResources/R-def.txt +2 -0
  45. package/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +7 -0
  46. package/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +7 -0
  47. package/android/build/intermediates/navigation_json/debug/extractDeepLinksDebug/navigation.json +1 -0
  48. package/android/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt +1 -0
  49. package/android/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt +1 -0
  50. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab +0 -0
  51. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream +0 -0
  52. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream.len +0 -0
  53. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.len +0 -0
  54. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
  55. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i +0 -0
  56. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i.len +0 -0
  57. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
  58. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream +0 -0
  59. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len +0 -0
  60. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.len +0 -0
  61. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at +0 -0
  62. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i +0 -0
  63. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i.len +0 -0
  64. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
  65. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream +0 -0
  66. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len +0 -0
  67. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len +0 -0
  68. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
  69. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i +0 -0
  70. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i.len +0 -0
  71. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab +0 -0
  72. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream +0 -0
  73. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream.len +0 -0
  74. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.len +0 -0
  75. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.values.at +0 -0
  76. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i +0 -0
  77. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i.len +0 -0
  78. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
  79. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
  80. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
  81. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len +0 -0
  82. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
  83. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
  84. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len +0 -0
  85. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab +0 -0
  86. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab.keystream +0 -0
  87. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab.keystream.len +0 -0
  88. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab.len +0 -0
  89. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab.values.at +0 -0
  90. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab_i +0 -0
  91. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab_i.len +0 -0
  92. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab +0 -0
  93. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.keystream +0 -0
  94. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.keystream.len +0 -0
  95. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.len +0 -0
  96. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.values.at +0 -0
  97. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab_i +0 -0
  98. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab_i.len +0 -0
  99. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab +0 -0
  100. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream +0 -0
  101. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len +0 -0
  102. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.len +0 -0
  103. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
  104. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i +0 -0
  105. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i.len +0 -0
  106. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
  107. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream +0 -0
  108. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len +0 -0
  109. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.len +0 -0
  110. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
  111. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i +0 -0
  112. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len +0 -0
  113. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
  114. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream +0 -0
  115. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len +0 -0
  116. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.len +0 -0
  117. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
  118. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i +0 -0
  119. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i.len +0 -0
  120. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
  121. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream +0 -0
  122. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len +0 -0
  123. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.len +0 -0
  124. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
  125. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i +0 -0
  126. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i.len +0 -0
  127. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/counters.tab +2 -0
  128. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab +0 -0
  129. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream +0 -0
  130. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream.len +0 -0
  131. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.len +0 -0
  132. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
  133. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i +0 -0
  134. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i.len +0 -0
  135. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab +0 -0
  136. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream +0 -0
  137. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
  138. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len +0 -0
  139. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
  140. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i +0 -0
  141. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i.len +0 -0
  142. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab +0 -0
  143. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream +0 -0
  144. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
  145. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.len +0 -0
  146. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at +0 -0
  147. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i +0 -0
  148. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i.len +0 -0
  149. package/android/build/kotlin/compileDebugKotlin/cacheable/last-build.bin +0 -0
  150. package/android/build/kotlin/compileDebugKotlin/classpath-snapshot/shrunk-classpath-snapshot.bin +0 -0
  151. package/android/build/outputs/logs/manifest-merger-debug-report.txt +16 -0
  152. package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
  153. package/android/build/tmp/kotlin-classes/debug/META-INF/metarouter_react-native-sdk_debug.kotlin_module +0 -0
  154. package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/ArgumentHelpersKt.class +0 -0
  155. package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/AsyncStorageAccess.class +0 -0
  156. package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/AsyncStorageError$Companion.class +0 -0
  157. package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/AsyncStorageError.class +0 -0
  158. package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/Entry.class +0 -0
  159. package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/ErrorHelpersKt$createExceptionHandler$$inlined$CoroutineExceptionHandler$1.class +0 -0
  160. package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/ErrorHelpersKt.class +0 -0
  161. package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/MIGRATION_TO_NEXT.class +0 -0
  162. package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/StorageDao$DefaultImpls.class +0 -0
  163. package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/StorageDao$mergeValues$1.class +0 -0
  164. package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/StorageDao.class +0 -0
  165. package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/StorageDb$Companion.class +0 -0
  166. package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/StorageDb.class +0 -0
  167. package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/StorageModule$Companion.class +0 -0
  168. package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/StorageModule$clear$1.class +0 -0
  169. package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/StorageModule$getAllKeys$1.class +0 -0
  170. package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/StorageModule$multiGet$1.class +0 -0
  171. package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/StorageModule$multiMerge$1.class +0 -0
  172. package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/StorageModule$multiRemove$1.class +0 -0
  173. package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/StorageModule$multiSet$1.class +0 -0
  174. package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/StorageModule.class +0 -0
  175. package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/StorageSupplier$Companion.class +0 -0
  176. package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/StorageSupplier.class +0 -0
  177. package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/StorageSupplierKt.class +0 -0
  178. package/android/build/tmp/kotlin-classes/debug/com/segmentanalyticsreactnative/AnalyticsReactNativeModule$onInitialized$1.class +0 -0
  179. package/android/build/tmp/kotlin-classes/debug/com/segmentanalyticsreactnative/AnalyticsReactNativeModule$toHexString$1.class +0 -0
  180. package/android/build/tmp/kotlin-classes/debug/com/segmentanalyticsreactnative/AnalyticsReactNativeModule.class +0 -0
  181. package/android/build/tmp/kotlin-classes/debug/com/segmentanalyticsreactnative/AnalyticsReactNativePackage$createNativeModules$1.class +0 -0
  182. package/android/build/tmp/kotlin-classes/debug/com/segmentanalyticsreactnative/AnalyticsReactNativePackage.class +0 -0
  183. package/android/build/tmp/kotlin-classes/debug/com/segmentanalyticsreactnative/ConnectionType.class +0 -0
  184. package/android/build/tmp/kotlin-classes/debug/com/sovranreactnative/Sovran$Action.class +0 -0
  185. package/android/build/tmp/kotlin-classes/debug/com/sovranreactnative/Sovran$createNativeModules$1.class +0 -0
  186. package/android/build/tmp/kotlin-classes/debug/com/sovranreactnative/Sovran.class +0 -0
  187. package/android/build/tmp/kotlin-classes/debug/com/sovranreactnative/SovranModule$Companion.class +0 -0
  188. package/android/build/tmp/kotlin-classes/debug/com/sovranreactnative/SovranModule$onInitialized$1.class +0 -0
  189. package/android/build/tmp/kotlin-classes/debug/com/sovranreactnative/SovranModule.class +0 -0
  190. package/android/build.gradle +30 -35
  191. package/android/src/main/java/com/metarouter/reactnativesdk/{MetaRouterReactNativeSdkPackage.java → MetaRouterReactNativeSDKPackage.java} +1 -1
  192. package/android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncLocalStorageUtil.java +178 -0
  193. package/android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncStorageErrorUtil.java +45 -0
  194. package/android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncStorageExpoMigration.java +154 -0
  195. package/android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncStorageModule.java +410 -0
  196. package/android/src/main/java/com/reactnativecommunity/asyncstorage/BuildConfig.java +8 -0
  197. package/android/src/main/java/com/reactnativecommunity/asyncstorage/NativeAsyncStorageModuleSpec.java +47 -0
  198. package/android/src/main/java/com/reactnativecommunity/asyncstorage/ReactDatabaseSupplier.java +163 -0
  199. package/android/src/main/java/com/reactnativecommunity/asyncstorage/SerialExecutor.java +40 -0
  200. package/android/src/main/java/com/reactnativecommunity/asyncstorage/build.gradle +122 -0
  201. package/android/src/main/java/com/reactnativecommunity/asyncstorage/config.gradle +125 -0
  202. package/android/src/main/java/com/reactnativecommunity/asyncstorage/next/ArgumentHelpers.kt +86 -0
  203. package/android/src/main/java/com/reactnativecommunity/asyncstorage/next/ErrorHelpers.kt +39 -0
  204. package/android/src/main/java/com/reactnativecommunity/asyncstorage/next/StorageModule.kt +94 -0
  205. package/android/src/main/java/com/reactnativecommunity/asyncstorage/next/StorageSupplier.kt +161 -0
  206. package/package.json +1 -1
  207. package/react-native.config.js +29 -8
  208. /package/android/src/main/java/com/{reactnativesovran → sovranreactnative}/Sovran.kt +0 -0
  209. /package/android/src/main/java/com/{reactnativesovran → sovranreactnative}/SovranModule.kt +0 -0
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ package com.reactnativecommunity.asyncstorage;
9
+
10
+ import javax.annotation.Nullable;
11
+
12
+ import com.facebook.react.bridge.Arguments;
13
+ import com.facebook.react.bridge.WritableMap;
14
+
15
+ /**
16
+ * Helper class for database errors.
17
+ */
18
+ public class AsyncStorageErrorUtil {
19
+
20
+ /**
21
+ * Create Error object to be passed back to the JS callback.
22
+ */
23
+ /* package */ static WritableMap getError(@Nullable String key, String errorMessage) {
24
+ WritableMap errorMap = Arguments.createMap();
25
+ errorMap.putString("message", errorMessage);
26
+ if (key != null) {
27
+ errorMap.putString("key", key);
28
+ }
29
+ return errorMap;
30
+ }
31
+
32
+ /* package */ static WritableMap getInvalidKeyError(@Nullable String key) {
33
+ return getError(key, "Invalid key");
34
+ }
35
+
36
+ /* package */ static WritableMap getInvalidValueError(@Nullable String key) {
37
+ return getError(key, "Invalid Value");
38
+ }
39
+
40
+ /* package */ static WritableMap getDBError(@Nullable String key) {
41
+ return getError(key, "Database Error");
42
+ }
43
+
44
+
45
+ }
@@ -0,0 +1,154 @@
1
+ package com.reactnativecommunity.asyncstorage;
2
+
3
+ import android.content.Context;
4
+ import android.os.Build;
5
+ import android.util.Log;
6
+
7
+ import androidx.annotation.RequiresApi;
8
+
9
+ import java.io.File;
10
+ import java.io.FileInputStream;
11
+ import java.io.FileOutputStream;
12
+ import java.io.IOException;
13
+ import java.nio.channels.FileChannel;
14
+ import java.nio.file.Files;
15
+ import java.nio.file.attribute.BasicFileAttributes;
16
+ import java.util.ArrayList;
17
+
18
+ // A utility class that migrates a scoped AsyncStorage database to RKStorage.
19
+ // This utility only runs if the RKStorage file has not been created yet.
20
+ public class AsyncStorageExpoMigration {
21
+ static final String LOG_TAG = "AsyncStorageExpoMigration";
22
+
23
+ public static void migrate(Context context) {
24
+ // Only migrate if the default async storage file does not exist.
25
+ if (isAsyncStorageDatabaseCreated(context)) {
26
+ return;
27
+ }
28
+
29
+ ArrayList<File> expoDatabases = getExpoDatabases(context);
30
+
31
+ File expoDatabase = getLastModifiedFile(expoDatabases);
32
+
33
+ if (expoDatabase == null) {
34
+ Log.v(LOG_TAG, "No scoped database found");
35
+ return;
36
+ }
37
+
38
+ try {
39
+ // Create the storage file
40
+ ReactDatabaseSupplier.getInstance(context).get();
41
+ copyFile(new FileInputStream(expoDatabase), new FileOutputStream(context.getDatabasePath(ReactDatabaseSupplier.DATABASE_NAME)));
42
+ Log.v(LOG_TAG, "Migrated most recently modified database " + expoDatabase.getName() + " to RKStorage");
43
+ } catch (Exception e) {
44
+ Log.v(LOG_TAG, "Failed to migrate scoped database " + expoDatabase.getName());
45
+ e.printStackTrace();
46
+ return;
47
+ }
48
+
49
+ try {
50
+ for (File file : expoDatabases) {
51
+ if (file.delete()) {
52
+ Log.v(LOG_TAG, "Deleted scoped database " + file.getName());
53
+ } else {
54
+ Log.v(LOG_TAG, "Failed to delete scoped database " + file.getName());
55
+ }
56
+ }
57
+ } catch (Exception e) {
58
+ e.printStackTrace();
59
+ }
60
+
61
+ Log.v(LOG_TAG, "Completed the scoped AsyncStorage migration");
62
+ }
63
+
64
+ private static boolean isAsyncStorageDatabaseCreated(Context context) {
65
+ return context.getDatabasePath(ReactDatabaseSupplier.DATABASE_NAME).exists();
66
+ }
67
+
68
+ // Find all database files that the user may have created while using Expo.
69
+ private static ArrayList<File> getExpoDatabases(Context context) {
70
+ ArrayList<File> scopedDatabases = new ArrayList<>();
71
+ try {
72
+ File databaseDirectory = context.getDatabasePath("noop").getParentFile();
73
+ File[] directoryListing = databaseDirectory.listFiles();
74
+ if (directoryListing != null) {
75
+ for (File child : directoryListing) {
76
+ // Find all databases matching the Expo scoped key, and skip any database journals.
77
+ if (child.getName().startsWith("RKStorage-scoped-experience-") && !child.getName().endsWith("-journal")) {
78
+ scopedDatabases.add(child);
79
+ }
80
+ }
81
+ }
82
+ } catch (Exception e) {
83
+ // Just in case anything happens catch and print, file system rules can tend to be different across vendors.
84
+ e.printStackTrace();
85
+ }
86
+ return scopedDatabases;
87
+ }
88
+
89
+ // Returns the most recently modified file.
90
+ // If a user publishes an app with Expo, then changes the slug
91
+ // and publishes again, a new database will be created.
92
+ // We want to select the most recent database and migrate it to RKStorage.
93
+ private static File getLastModifiedFile(ArrayList<File> files) {
94
+ if (files.size() == 0) {
95
+ return null;
96
+ }
97
+ long lastMod = -1;
98
+ File lastModFile = null;
99
+ for (File child : files) {
100
+ long modTime = getLastModifiedTimeInMillis(child);
101
+ if (modTime > lastMod) {
102
+ lastMod = modTime;
103
+ lastModFile = child;
104
+ }
105
+ }
106
+ if (lastModFile != null) {
107
+ return lastModFile;
108
+ }
109
+
110
+ return files.get(0);
111
+ }
112
+
113
+ private static long getLastModifiedTimeInMillis(File file) {
114
+ try {
115
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
116
+ return getLastModifiedTimeFromBasicFileAttrs(file);
117
+ } else {
118
+ return file.lastModified();
119
+ }
120
+ } catch (Exception e) {
121
+ e.printStackTrace();
122
+ return -1;
123
+ }
124
+ }
125
+
126
+ @RequiresApi(Build.VERSION_CODES.O)
127
+ private static long getLastModifiedTimeFromBasicFileAttrs(File file) {
128
+ try {
129
+ return Files.readAttributes(file.toPath(), BasicFileAttributes.class).creationTime().toMillis();
130
+ } catch (Exception e) {
131
+ return -1;
132
+ }
133
+ }
134
+
135
+ private static void copyFile(FileInputStream fromFile, FileOutputStream toFile) throws IOException {
136
+ FileChannel fromChannel = null;
137
+ FileChannel toChannel = null;
138
+ try {
139
+ fromChannel = fromFile.getChannel();
140
+ toChannel = toFile.getChannel();
141
+ fromChannel.transferTo(0, fromChannel.size(), toChannel);
142
+ } finally {
143
+ try {
144
+ if (fromChannel != null) {
145
+ fromChannel.close();
146
+ }
147
+ } finally {
148
+ if (toChannel != null) {
149
+ toChannel.close();
150
+ }
151
+ }
152
+ }
153
+ }
154
+ }
@@ -0,0 +1,410 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ package com.reactnativecommunity.asyncstorage;
9
+
10
+ import android.database.Cursor;
11
+ import android.database.sqlite.SQLiteStatement;
12
+ import android.os.AsyncTask;
13
+
14
+ import com.facebook.common.logging.FLog;
15
+ import com.facebook.react.bridge.Arguments;
16
+ import com.facebook.react.bridge.Callback;
17
+ import com.facebook.react.bridge.GuardedAsyncTask;
18
+ import com.facebook.react.bridge.ReactApplicationContext;
19
+ import com.facebook.react.bridge.ReactContextBaseJavaModule;
20
+ import com.facebook.react.bridge.ReactMethod;
21
+ import com.facebook.react.bridge.ReadableArray;
22
+ import com.facebook.react.bridge.WritableArray;
23
+ import com.facebook.react.bridge.WritableMap;
24
+ import com.facebook.react.common.ReactConstants;
25
+ import com.facebook.react.common.annotations.VisibleForTesting;
26
+ import com.facebook.react.module.annotations.ReactModule;
27
+
28
+ import java.util.ArrayDeque;
29
+ import java.util.HashSet;
30
+ import java.util.concurrent.Executor;
31
+ import java.util.concurrent.Executors;
32
+
33
+ @ReactModule(name = AsyncStorageModule.NAME)
34
+ public final class AsyncStorageModule extends NativeAsyncStorageModuleSpec {
35
+
36
+ // changed name to not conflict with AsyncStorage from RN repo
37
+ public static final String NAME = "RNCAsyncStorage";
38
+
39
+ // SQL variable number limit, defined by SQLITE_LIMIT_VARIABLE_NUMBER:
40
+ // https://raw.githubusercontent.com/android/platform_external_sqlite/master/dist/sqlite3.c
41
+ private static final int MAX_SQL_KEYS = 999;
42
+
43
+ private ReactDatabaseSupplier mReactDatabaseSupplier;
44
+ private boolean mShuttingDown = false;
45
+
46
+ private final SerialExecutor executor;
47
+
48
+ public AsyncStorageModule(ReactApplicationContext reactContext) {
49
+ this(
50
+ reactContext,
51
+ BuildConfig.AsyncStorage_useDedicatedExecutor
52
+ ? Executors.newSingleThreadExecutor()
53
+ : AsyncTask.THREAD_POOL_EXECUTOR
54
+ );
55
+ }
56
+
57
+ @VisibleForTesting
58
+ AsyncStorageModule(ReactApplicationContext reactContext, Executor executor) {
59
+ super(reactContext);
60
+
61
+ // The migration MUST run before the AsyncStorage database is created for the first time.
62
+ AsyncStorageExpoMigration.migrate(reactContext);
63
+
64
+ this.executor = new SerialExecutor(executor);
65
+
66
+ // Creating the database MUST happen after the migration.
67
+ mReactDatabaseSupplier = ReactDatabaseSupplier.getInstance(reactContext);
68
+ }
69
+
70
+ @Override
71
+ public String getName() {
72
+ return NAME;
73
+ }
74
+
75
+ @Override
76
+ public void initialize() {
77
+ super.initialize();
78
+ mShuttingDown = false;
79
+ }
80
+
81
+ @Override
82
+ public void invalidate() {
83
+ mShuttingDown = true;
84
+ // ensure we close database when activity is destroyed
85
+ mReactDatabaseSupplier.closeDatabase();
86
+ }
87
+
88
+ /**
89
+ * Given an array of keys, this returns a map of (key, value) pairs for the keys found, and
90
+ * (key, null) for the keys that haven't been found.
91
+ */
92
+ @ReactMethod
93
+ @Override
94
+ public void multiGet(final ReadableArray keys, final Callback callback) {
95
+ if (keys == null) {
96
+ callback.invoke(AsyncStorageErrorUtil.getInvalidKeyError(null), null);
97
+ return;
98
+ }
99
+
100
+ new GuardedAsyncTask<Void, Void>(getReactApplicationContext()) {
101
+ @Override
102
+ protected void doInBackgroundGuarded(Void... params) {
103
+ if (!ensureDatabase()) {
104
+ callback.invoke(AsyncStorageErrorUtil.getDBError(null), null);
105
+ return;
106
+ }
107
+
108
+ String[] columns = {ReactDatabaseSupplier.KEY_COLUMN, ReactDatabaseSupplier.VALUE_COLUMN};
109
+ HashSet<String> keysRemaining = new HashSet<>();
110
+ WritableArray data = Arguments.createArray();
111
+ for (int keyStart = 0; keyStart < keys.size(); keyStart += MAX_SQL_KEYS) {
112
+ int keyCount = Math.min(keys.size() - keyStart, MAX_SQL_KEYS);
113
+ Cursor cursor = mReactDatabaseSupplier.get().query(
114
+ ReactDatabaseSupplier.TABLE_CATALYST,
115
+ columns,
116
+ AsyncLocalStorageUtil.buildKeySelection(keyCount),
117
+ AsyncLocalStorageUtil.buildKeySelectionArgs(keys, keyStart, keyCount),
118
+ null,
119
+ null,
120
+ null);
121
+ keysRemaining.clear();
122
+ try {
123
+ if (cursor.getCount() != keys.size()) {
124
+ // some keys have not been found - insert them with null into the final array
125
+ for (int keyIndex = keyStart; keyIndex < keyStart + keyCount; keyIndex++) {
126
+ keysRemaining.add(keys.getString(keyIndex));
127
+ }
128
+ }
129
+
130
+ if (cursor.moveToFirst()) {
131
+ do {
132
+ WritableArray row = Arguments.createArray();
133
+ row.pushString(cursor.getString(0));
134
+ row.pushString(cursor.getString(1));
135
+ data.pushArray(row);
136
+ keysRemaining.remove(cursor.getString(0));
137
+ } while (cursor.moveToNext());
138
+ }
139
+ } catch (Exception e) {
140
+ FLog.w(ReactConstants.TAG, e.getMessage(), e);
141
+ callback.invoke(AsyncStorageErrorUtil.getError(null, e.getMessage()), null);
142
+ return;
143
+ } finally {
144
+ cursor.close();
145
+ }
146
+
147
+ for (String key : keysRemaining) {
148
+ WritableArray row = Arguments.createArray();
149
+ row.pushString(key);
150
+ row.pushNull();
151
+ data.pushArray(row);
152
+ }
153
+ keysRemaining.clear();
154
+ }
155
+
156
+ callback.invoke(null, data);
157
+ }
158
+ }.executeOnExecutor(executor);
159
+ }
160
+
161
+ /**
162
+ * Inserts multiple (key, value) pairs. If one or more of the pairs cannot be inserted, this will
163
+ * return AsyncLocalStorageFailure, but all other pairs will have been inserted.
164
+ * The insertion will replace conflicting (key, value) pairs.
165
+ */
166
+ @ReactMethod
167
+ @Override
168
+ public void multiSet(final ReadableArray keyValueArray, final Callback callback) {
169
+ if (keyValueArray.size() == 0) {
170
+ callback.invoke();
171
+ return;
172
+ }
173
+
174
+ new GuardedAsyncTask<Void, Void>(getReactApplicationContext()) {
175
+ @Override
176
+ protected void doInBackgroundGuarded(Void... params) {
177
+ if (!ensureDatabase()) {
178
+ callback.invoke(AsyncStorageErrorUtil.getDBError(null));
179
+ return;
180
+ }
181
+
182
+ String sql = "INSERT OR REPLACE INTO " + ReactDatabaseSupplier.TABLE_CATALYST + " VALUES (?, ?);";
183
+ SQLiteStatement statement = mReactDatabaseSupplier.get().compileStatement(sql);
184
+ WritableMap error = null;
185
+ try {
186
+ mReactDatabaseSupplier.get().beginTransaction();
187
+ for (int idx=0; idx < keyValueArray.size(); idx++) {
188
+ if (keyValueArray.getArray(idx).size() != 2) {
189
+ error = AsyncStorageErrorUtil.getInvalidValueError(null);
190
+ return;
191
+ }
192
+ if (keyValueArray.getArray(idx).getString(0) == null) {
193
+ error = AsyncStorageErrorUtil.getInvalidKeyError(null);
194
+ return;
195
+ }
196
+ if (keyValueArray.getArray(idx).getString(1) == null) {
197
+ error = AsyncStorageErrorUtil.getInvalidValueError(null);
198
+ return;
199
+ }
200
+
201
+ statement.clearBindings();
202
+ statement.bindString(1, keyValueArray.getArray(idx).getString(0));
203
+ statement.bindString(2, keyValueArray.getArray(idx).getString(1));
204
+ statement.execute();
205
+ }
206
+ mReactDatabaseSupplier.get().setTransactionSuccessful();
207
+ } catch (Exception e) {
208
+ FLog.w(ReactConstants.TAG, e.getMessage(), e);
209
+ error = AsyncStorageErrorUtil.getError(null, e.getMessage());
210
+ } finally {
211
+ try {
212
+ mReactDatabaseSupplier.get().endTransaction();
213
+ } catch (Exception e) {
214
+ FLog.w(ReactConstants.TAG, e.getMessage(), e);
215
+ if (error == null) {
216
+ error = AsyncStorageErrorUtil.getError(null, e.getMessage());
217
+ }
218
+ }
219
+ }
220
+ if (error != null) {
221
+ callback.invoke(error);
222
+ } else {
223
+ callback.invoke();
224
+ }
225
+ }
226
+ }.executeOnExecutor(executor);
227
+ }
228
+
229
+ /**
230
+ * Removes all rows of the keys given.
231
+ */
232
+ @ReactMethod
233
+ @Override
234
+ public void multiRemove(final ReadableArray keys, final Callback callback) {
235
+ if (keys.size() == 0) {
236
+ callback.invoke();
237
+ return;
238
+ }
239
+
240
+ new GuardedAsyncTask<Void, Void>(getReactApplicationContext()) {
241
+ @Override
242
+ protected void doInBackgroundGuarded(Void... params) {
243
+ if (!ensureDatabase()) {
244
+ callback.invoke(AsyncStorageErrorUtil.getDBError(null));
245
+ return;
246
+ }
247
+
248
+ WritableMap error = null;
249
+ try {
250
+ mReactDatabaseSupplier.get().beginTransaction();
251
+ for (int keyStart = 0; keyStart < keys.size(); keyStart += MAX_SQL_KEYS) {
252
+ int keyCount = Math.min(keys.size() - keyStart, MAX_SQL_KEYS);
253
+ mReactDatabaseSupplier.get().delete(
254
+ ReactDatabaseSupplier.TABLE_CATALYST,
255
+ AsyncLocalStorageUtil.buildKeySelection(keyCount),
256
+ AsyncLocalStorageUtil.buildKeySelectionArgs(keys, keyStart, keyCount));
257
+ }
258
+ mReactDatabaseSupplier.get().setTransactionSuccessful();
259
+ } catch (Exception e) {
260
+ FLog.w(ReactConstants.TAG, e.getMessage(), e);
261
+ error = AsyncStorageErrorUtil.getError(null, e.getMessage());
262
+ } finally {
263
+ try {
264
+ mReactDatabaseSupplier.get().endTransaction();
265
+ } catch (Exception e) {
266
+ FLog.w(ReactConstants.TAG, e.getMessage(), e);
267
+ if (error == null) {
268
+ error = AsyncStorageErrorUtil.getError(null, e.getMessage());
269
+ }
270
+ }
271
+ }
272
+ if (error != null) {
273
+ callback.invoke(error);
274
+ } else {
275
+ callback.invoke();
276
+ }
277
+ }
278
+ }.executeOnExecutor(executor);
279
+ }
280
+
281
+ /**
282
+ * Given an array of (key, value) pairs, this will merge the given values with the stored values
283
+ * of the given keys, if they exist.
284
+ */
285
+ @ReactMethod
286
+ @Override
287
+ public void multiMerge(final ReadableArray keyValueArray, final Callback callback) {
288
+ new GuardedAsyncTask<Void, Void>(getReactApplicationContext()) {
289
+ @Override
290
+ protected void doInBackgroundGuarded(Void... params) {
291
+ if (!ensureDatabase()) {
292
+ callback.invoke(AsyncStorageErrorUtil.getDBError(null));
293
+ return;
294
+ }
295
+ WritableMap error = null;
296
+ try {
297
+ mReactDatabaseSupplier.get().beginTransaction();
298
+ for (int idx = 0; idx < keyValueArray.size(); idx++) {
299
+ if (keyValueArray.getArray(idx).size() != 2) {
300
+ error = AsyncStorageErrorUtil.getInvalidValueError(null);
301
+ return;
302
+ }
303
+
304
+ if (keyValueArray.getArray(idx).getString(0) == null) {
305
+ error = AsyncStorageErrorUtil.getInvalidKeyError(null);
306
+ return;
307
+ }
308
+
309
+ if (keyValueArray.getArray(idx).getString(1) == null) {
310
+ error = AsyncStorageErrorUtil.getInvalidValueError(null);
311
+ return;
312
+ }
313
+
314
+ if (!AsyncLocalStorageUtil.mergeImpl(
315
+ mReactDatabaseSupplier.get(),
316
+ keyValueArray.getArray(idx).getString(0),
317
+ keyValueArray.getArray(idx).getString(1))) {
318
+ error = AsyncStorageErrorUtil.getDBError(null);
319
+ return;
320
+ }
321
+ }
322
+ mReactDatabaseSupplier.get().setTransactionSuccessful();
323
+ } catch (Exception e) {
324
+ FLog.w(ReactConstants.TAG, e.getMessage(), e);
325
+ error = AsyncStorageErrorUtil.getError(null, e.getMessage());
326
+ } finally {
327
+ try {
328
+ mReactDatabaseSupplier.get().endTransaction();
329
+ } catch (Exception e) {
330
+ FLog.w(ReactConstants.TAG, e.getMessage(), e);
331
+ if (error == null) {
332
+ error = AsyncStorageErrorUtil.getError(null, e.getMessage());
333
+ }
334
+ }
335
+ }
336
+ if (error != null) {
337
+ callback.invoke(error);
338
+ } else {
339
+ callback.invoke();
340
+ }
341
+ }
342
+ }.executeOnExecutor(executor);
343
+ }
344
+
345
+ /**
346
+ * Clears the database.
347
+ */
348
+ @ReactMethod
349
+ @Override
350
+ public void clear(final Callback callback) {
351
+ new GuardedAsyncTask<Void, Void>(getReactApplicationContext()) {
352
+ @Override
353
+ protected void doInBackgroundGuarded(Void... params) {
354
+ if (!mReactDatabaseSupplier.ensureDatabase()) {
355
+ callback.invoke(AsyncStorageErrorUtil.getDBError(null));
356
+ return;
357
+ }
358
+ try {
359
+ mReactDatabaseSupplier.clear();
360
+ callback.invoke();
361
+ } catch (Exception e) {
362
+ FLog.w(ReactConstants.TAG, e.getMessage(), e);
363
+ callback.invoke(AsyncStorageErrorUtil.getError(null, e.getMessage()));
364
+ }
365
+ }
366
+ }.executeOnExecutor(executor);
367
+ }
368
+
369
+ /**
370
+ * Returns an array with all keys from the database.
371
+ */
372
+ @ReactMethod
373
+ @Override
374
+ public void getAllKeys(final Callback callback) {
375
+ new GuardedAsyncTask<Void, Void>(getReactApplicationContext()) {
376
+ @Override
377
+ protected void doInBackgroundGuarded(Void... params) {
378
+ if (!ensureDatabase()) {
379
+ callback.invoke(AsyncStorageErrorUtil.getDBError(null), null);
380
+ return;
381
+ }
382
+ WritableArray data = Arguments.createArray();
383
+ String[] columns = {ReactDatabaseSupplier.KEY_COLUMN};
384
+ Cursor cursor = mReactDatabaseSupplier.get()
385
+ .query(ReactDatabaseSupplier.TABLE_CATALYST, columns, null, null, null, null, null);
386
+ try {
387
+ if (cursor.moveToFirst()) {
388
+ do {
389
+ data.pushString(cursor.getString(0));
390
+ } while (cursor.moveToNext());
391
+ }
392
+ } catch (Exception e) {
393
+ FLog.w(ReactConstants.TAG, e.getMessage(), e);
394
+ callback.invoke(AsyncStorageErrorUtil.getError(null, e.getMessage()), null);
395
+ return;
396
+ } finally {
397
+ cursor.close();
398
+ }
399
+ callback.invoke(null, data);
400
+ }
401
+ }.executeOnExecutor(executor);
402
+ }
403
+
404
+ /**
405
+ * Verify the database is open for reads and writes.
406
+ */
407
+ private boolean ensureDatabase() {
408
+ return !mShuttingDown && mReactDatabaseSupplier.ensureDatabase();
409
+ }
410
+ }
@@ -0,0 +1,8 @@
1
+ package com.reactnativecommunity.asyncstorage;
2
+
3
+ public final class BuildConfig {
4
+ public static final long AsyncStorage_db_size = 6L;
5
+ public static final boolean AsyncStorage_useDedicatedExecutor = false;
6
+ public static final boolean AsyncStorage_useNextStorage = false;
7
+ public static final boolean IS_NEW_ARCHITECTURE_ENABLED = false;
8
+ }
@@ -0,0 +1,47 @@
1
+
2
+ /**
3
+ * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
+ *
5
+ * Update this file after changing NativeAsyncStorageModule.ts to match the version generated by codegen.
6
+ */
7
+
8
+ package com.reactnativecommunity.asyncstorage;
9
+
10
+ import com.facebook.proguard.annotations.DoNotStrip;
11
+ import com.facebook.react.bridge.Callback;
12
+ import com.facebook.react.bridge.ReactApplicationContext;
13
+ import com.facebook.react.bridge.ReactContextBaseJavaModule;
14
+ import com.facebook.react.bridge.ReactMethod;
15
+ import com.facebook.react.bridge.ReactModuleWithSpec;
16
+ import com.facebook.react.bridge.ReadableArray;
17
+ import com.facebook.react.turbomodule.core.interfaces.TurboModule;
18
+
19
+ public abstract class NativeAsyncStorageModuleSpec extends ReactContextBaseJavaModule implements ReactModuleWithSpec, TurboModule {
20
+ public NativeAsyncStorageModuleSpec(ReactApplicationContext reactContext) {
21
+ super(reactContext);
22
+ }
23
+
24
+ @ReactMethod
25
+ @DoNotStrip
26
+ public abstract void multiGet(ReadableArray keys, Callback callback);
27
+
28
+ @ReactMethod
29
+ @DoNotStrip
30
+ public abstract void multiSet(ReadableArray kvPairs, Callback callback);
31
+
32
+ @ReactMethod
33
+ @DoNotStrip
34
+ public abstract void multiRemove(ReadableArray keys, Callback callback);
35
+
36
+ @ReactMethod
37
+ @DoNotStrip
38
+ public abstract void multiMerge(ReadableArray kvPairs, Callback callback);
39
+
40
+ @ReactMethod
41
+ @DoNotStrip
42
+ public abstract void getAllKeys(Callback callback);
43
+
44
+ @ReactMethod
45
+ @DoNotStrip
46
+ public abstract void clear(Callback callback);
47
+ }