@metarouter/react-native-sdk 0.1.13 → 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.
- package/android/build/generated/ksp/debug/java/com/reactnativecommunity/asyncstorage/next/StorageDao_Impl.java +244 -0
- package/android/build/generated/ksp/debug/java/com/reactnativecommunity/asyncstorage/next/StorageDb_Impl.java +165 -0
- package/android/build/generated/source/buildConfig/debug/com/metarouter/reactnativesdk/BuildConfig.java +10 -0
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +7 -0
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json +18 -0
- package/android/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties +6 -0
- package/android/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json +1 -0
- package/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
- package/android/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar +0 -0
- package/android/build/intermediates/compile_symbol_list/debug/generateDebugRFile/R.txt +0 -0
- package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +1 -0
- package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +2 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/metarouter/reactnativesdk/BuildConfig.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/metarouter/reactnativesdk/MetaRouterReactNativeSDKPackage.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/AsyncLocalStorageUtil.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/AsyncStorageErrorUtil.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/AsyncStorageExpoMigration.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/AsyncStorageModule$1.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/AsyncStorageModule$2.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/AsyncStorageModule$3.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/AsyncStorageModule$4.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/AsyncStorageModule$5.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/AsyncStorageModule$6.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/AsyncStorageModule.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/AsyncStoragePackage$1.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/AsyncStoragePackage.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/BuildConfig.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/NativeAsyncStorageModuleSpec.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/ReactDatabaseSupplier.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/SerialExecutor$1.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/SerialExecutor.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/next/StorageDao_Impl$1.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/next/StorageDao_Impl$2.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/next/StorageDao_Impl$3.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/next/StorageDao_Impl$4.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/next/StorageDao_Impl$5.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/next/StorageDao_Impl$6.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/next/StorageDao_Impl$7.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/next/StorageDao_Impl.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/next/StorageDb_Impl$1.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/next/StorageDb_Impl.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/org/linusu/RNGetRandomValuesModule.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/org/linusu/RNGetRandomValuesPackage.class +0 -0
- package/android/build/intermediates/local_only_symbol_list/debug/parseDebugLocalResources/R-def.txt +2 -0
- package/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +7 -0
- package/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +7 -0
- package/android/build/intermediates/navigation_json/debug/extractDeepLinksDebug/navigation.json +1 -0
- package/android/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt +1 -0
- package/android/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt +1 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/counters.tab +2 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/last-build.bin +0 -0
- package/android/build/kotlin/compileDebugKotlin/classpath-snapshot/shrunk-classpath-snapshot.bin +0 -0
- package/android/build/outputs/logs/manifest-merger-debug-report.txt +16 -0
- package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
- package/android/build/tmp/kotlin-classes/debug/META-INF/metarouter_react-native-sdk_debug.kotlin_module +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/ArgumentHelpersKt.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/AsyncStorageAccess.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/AsyncStorageError$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/AsyncStorageError.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/Entry.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/ErrorHelpersKt$createExceptionHandler$$inlined$CoroutineExceptionHandler$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/ErrorHelpersKt.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/MIGRATION_TO_NEXT.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/StorageDao$DefaultImpls.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/StorageDao$mergeValues$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/StorageDao.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/StorageDb$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/StorageDb.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/StorageModule$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/StorageModule$clear$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/StorageModule$getAllKeys$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/StorageModule$multiGet$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/StorageModule$multiMerge$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/StorageModule$multiRemove$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/StorageModule$multiSet$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/StorageModule.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/StorageSupplier$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/StorageSupplier.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/StorageSupplierKt.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/segmentanalyticsreactnative/AnalyticsReactNativeModule$onInitialized$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/segmentanalyticsreactnative/AnalyticsReactNativeModule$toHexString$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/segmentanalyticsreactnative/AnalyticsReactNativeModule.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/segmentanalyticsreactnative/AnalyticsReactNativePackage$createNativeModules$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/segmentanalyticsreactnative/AnalyticsReactNativePackage.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/segmentanalyticsreactnative/ConnectionType.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/sovranreactnative/Sovran$Action.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/sovranreactnative/Sovran$createNativeModules$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/sovranreactnative/Sovran.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/sovranreactnative/SovranModule$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/sovranreactnative/SovranModule$onInitialized$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/sovranreactnative/SovranModule.class +0 -0
- package/android/build.gradle +33 -17
- package/android/src/main/java/com/metarouter/reactnativesdk/MetaRouterReactNativeSDKPackage.java +54 -0
- package/android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncLocalStorageUtil.java +178 -0
- package/android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncStorageErrorUtil.java +45 -0
- package/android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncStorageExpoMigration.java +154 -0
- package/android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncStorageModule.java +410 -0
- package/android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncStoragePackage.java +93 -0
- package/android/src/main/java/com/reactnativecommunity/asyncstorage/BuildConfig.java +8 -0
- package/android/src/main/java/com/reactnativecommunity/asyncstorage/NativeAsyncStorageModuleSpec.java +47 -0
- package/android/src/main/java/com/reactnativecommunity/asyncstorage/ReactDatabaseSupplier.java +163 -0
- package/android/src/main/java/com/reactnativecommunity/asyncstorage/SerialExecutor.java +40 -0
- package/android/src/main/java/com/reactnativecommunity/asyncstorage/build.gradle +122 -0
- package/android/src/main/java/com/reactnativecommunity/asyncstorage/config.gradle +125 -0
- package/android/src/main/java/com/reactnativecommunity/asyncstorage/next/ArgumentHelpers.kt +86 -0
- package/android/src/main/java/com/reactnativecommunity/asyncstorage/next/ErrorHelpers.kt +39 -0
- package/android/src/main/java/com/reactnativecommunity/asyncstorage/next/StorageModule.kt +94 -0
- package/android/src/main/java/com/reactnativecommunity/asyncstorage/next/StorageSupplier.kt +161 -0
- package/android/src/main/java/com/segmentanalyticsreactnative/AnalyticsReactNativeModule.kt +267 -0
- package/android/src/main/java/com/segmentanalyticsreactnative/AnalyticsReactNativePackage.kt +43 -0
- package/android/src/main/java/com/sovranreactnative/Sovran.kt +45 -0
- package/android/src/main/java/com/sovranreactnative/SovranModule.kt +55 -0
- package/android/src/main/java/org/linusu/RNGetRandomValuesModule.java +36 -0
- package/android/src/main/java/org/linusu/RNGetRandomValuesPackage.java +28 -0
- package/package.json +1 -1
- package/react-native.config.js +29 -8
|
@@ -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,93 @@
|
|
|
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 com.facebook.react.TurboReactPackage;
|
|
11
|
+
import com.facebook.react.bridge.ModuleSpec;
|
|
12
|
+
import com.facebook.react.bridge.JavaScriptModule;
|
|
13
|
+
import com.facebook.react.bridge.NativeModule;
|
|
14
|
+
import com.facebook.react.bridge.ReactApplicationContext;
|
|
15
|
+
import com.facebook.react.module.annotations.ReactModule;
|
|
16
|
+
import com.facebook.react.module.annotations.ReactModuleList;
|
|
17
|
+
import com.facebook.react.module.model.ReactModuleInfo;
|
|
18
|
+
import com.facebook.react.module.model.ReactModuleInfoProvider;
|
|
19
|
+
import com.facebook.react.uimanager.ViewManager;
|
|
20
|
+
import java.util.Collections;
|
|
21
|
+
import java.util.HashMap;
|
|
22
|
+
import java.util.List;
|
|
23
|
+
import java.util.Map;
|
|
24
|
+
|
|
25
|
+
import javax.annotation.Nonnull;
|
|
26
|
+
|
|
27
|
+
@ReactModuleList(
|
|
28
|
+
nativeModules = {
|
|
29
|
+
AsyncStorageModule.class,
|
|
30
|
+
}
|
|
31
|
+
)
|
|
32
|
+
public class AsyncStoragePackage extends TurboReactPackage {
|
|
33
|
+
|
|
34
|
+
@Override
|
|
35
|
+
public NativeModule getModule(String name, @Nonnull ReactApplicationContext reactContext) {
|
|
36
|
+
switch (name) {
|
|
37
|
+
case AsyncStorageModule.NAME:
|
|
38
|
+
return new AsyncStorageModule(reactContext);
|
|
39
|
+
default:
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
@Override
|
|
45
|
+
public ReactModuleInfoProvider getReactModuleInfoProvider() {
|
|
46
|
+
try {
|
|
47
|
+
Class<?> reactModuleInfoProviderClass =
|
|
48
|
+
Class.forName("com.reactnativecommunity.asyncstorage.AsyncStoragePackage$$ReactModuleInfoProvider");
|
|
49
|
+
return (ReactModuleInfoProvider) reactModuleInfoProviderClass.newInstance();
|
|
50
|
+
} catch (ClassNotFoundException e) {
|
|
51
|
+
// ReactModuleSpecProcessor does not run at build-time. Create this ReactModuleInfoProvider by
|
|
52
|
+
// hand.
|
|
53
|
+
return new ReactModuleInfoProvider() {
|
|
54
|
+
@Override
|
|
55
|
+
public Map<String, ReactModuleInfo> getReactModuleInfos() {
|
|
56
|
+
final Map<String, ReactModuleInfo> reactModuleInfoMap = new HashMap<>();
|
|
57
|
+
boolean isTurboModule = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;
|
|
58
|
+
|
|
59
|
+
Class<? extends NativeModule>[] moduleList =
|
|
60
|
+
new Class[] {
|
|
61
|
+
AsyncStorageModule.class,
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
for (Class<? extends NativeModule> moduleClass : moduleList) {
|
|
65
|
+
ReactModule reactModule = moduleClass.getAnnotation(ReactModule.class);
|
|
66
|
+
|
|
67
|
+
reactModuleInfoMap.put(
|
|
68
|
+
reactModule.name(),
|
|
69
|
+
new ReactModuleInfo(
|
|
70
|
+
reactModule.name(),
|
|
71
|
+
moduleClass.getName(),
|
|
72
|
+
reactModule.canOverrideExistingModule(),
|
|
73
|
+
reactModule.needsEagerInit(),
|
|
74
|
+
reactModule.hasConstants(),
|
|
75
|
+
reactModule.isCxxModule(),
|
|
76
|
+
isTurboModule));
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return reactModuleInfoMap;
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
} catch (InstantiationException | IllegalAccessException e) {
|
|
83
|
+
throw new RuntimeException(
|
|
84
|
+
"No ReactModuleInfoProvider for com.reactnativecommunity.asyncstorage.AsyncStoragePackage$$ReactModuleInfoProvider", e);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
@Override
|
|
89
|
+
@SuppressWarnings("rawtypes")
|
|
90
|
+
public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
|
|
91
|
+
return Collections.emptyList();
|
|
92
|
+
}
|
|
93
|
+
}
|
|
@@ -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
|
+
}
|