@appsonair.ir/react-native 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/build/.transforms/200c703f56cba8293fae35d5b35891b9/results.bin +1 -0
- package/android/build/.transforms/200c703f56cba8293fae35d5b35891b9/transformed/classes/classes_dex/classes.dex +0 -0
- package/android/build/.transforms/258459e9c210bd80984731dbf1be5d94/results.bin +1 -0
- package/android/build/.transforms/258459e9c210bd80984731dbf1be5d94/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/otaupdater/BuildConfig.dex +0 -0
- package/android/build/.transforms/258459e9c210bd80984731dbf1be5d94/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/otaupdater/OTAApkInstallHelper.dex +0 -0
- package/android/build/.transforms/258459e9c210bd80984731dbf1be5d94/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/otaupdater/OTAReactHostFactory.dex +0 -0
- package/android/build/.transforms/258459e9c210bd80984731dbf1be5d94/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/otaupdater/OTARestartActivity.dex +0 -0
- package/android/build/.transforms/258459e9c210bd80984731dbf1be5d94/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/otaupdater/OTARestartHelper.dex +0 -0
- package/android/build/.transforms/258459e9c210bd80984731dbf1be5d94/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/otaupdater/OTAUpdaterModule$1.dex +0 -0
- package/android/build/.transforms/258459e9c210bd80984731dbf1be5d94/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/otaupdater/OTAUpdaterModule$Companion.dex +0 -0
- package/android/build/.transforms/258459e9c210bd80984731dbf1be5d94/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/otaupdater/OTAUpdaterModule.dex +0 -0
- package/android/build/.transforms/258459e9c210bd80984731dbf1be5d94/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/otaupdater/OTAUpdaterPackage.dex +0 -0
- package/android/build/.transforms/258459e9c210bd80984731dbf1be5d94/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/otaupdater/OTAUpdaterStorage$NativeInfo.dex +0 -0
- package/android/build/.transforms/258459e9c210bd80984731dbf1be5d94/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/otaupdater/OTAUpdaterStorage.dex +0 -0
- package/android/build/.transforms/258459e9c210bd80984731dbf1be5d94/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/otaupdater/OTAZipExtractHelper.dex +0 -0
- package/android/build/.transforms/258459e9c210bd80984731dbf1be5d94/transformed/bundleLibRuntimeToDirDebug/desugar_graph.bin +0 -0
- package/android/build/generated/source/buildConfig/debug/com/otaupdater/BuildConfig.java +10 -0
- package/android/build/generated/source/codegen/jni/CMakeLists.txt +28 -0
- package/android/build/generated/source/codegen/jni/OtaUpdaterSpec-generated.cpp +22 -0
- package/android/build/generated/source/codegen/jni/OtaUpdaterSpec.h +24 -0
- package/android/build/generated/source/codegen/jni/react/renderer/components/OtaUpdaterSpec/ComponentDescriptors.cpp +22 -0
- package/android/build/generated/source/codegen/jni/react/renderer/components/OtaUpdaterSpec/ComponentDescriptors.h +24 -0
- package/android/build/generated/source/codegen/jni/react/renderer/components/OtaUpdaterSpec/EventEmitters.cpp +16 -0
- package/android/build/generated/source/codegen/jni/react/renderer/components/OtaUpdaterSpec/EventEmitters.h +17 -0
- package/android/build/generated/source/codegen/jni/react/renderer/components/OtaUpdaterSpec/OtaUpdaterSpecJSI.h +19 -0
- package/android/build/generated/source/codegen/jni/react/renderer/components/OtaUpdaterSpec/Props.cpp +19 -0
- package/android/build/generated/source/codegen/jni/react/renderer/components/OtaUpdaterSpec/Props.h +18 -0
- package/android/build/generated/source/codegen/jni/react/renderer/components/OtaUpdaterSpec/ShadowNodes.cpp +17 -0
- package/android/build/generated/source/codegen/jni/react/renderer/components/OtaUpdaterSpec/ShadowNodes.h +23 -0
- package/android/build/generated/source/codegen/jni/react/renderer/components/OtaUpdaterSpec/States.cpp +16 -0
- package/android/build/generated/source/codegen/jni/react/renderer/components/OtaUpdaterSpec/States.h +20 -0
- package/android/build/generated/source/codegen/schema.json +1 -0
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +27 -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 +1 -0
- package/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/xml_ota_file_paths.xml.flat +0 -0
- package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +2 -0
- package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +2 -0
- package/android/build/intermediates/incremental/mergeDebugAssets/merger.xml +2 -0
- package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +2 -0
- package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +2 -0
- package/android/build/intermediates/java_res/debug/processDebugJavaRes/out/META-INF/ota-updater_debug.kotlin_module +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/otaupdater/BuildConfig.class +0 -0
- package/android/build/intermediates/local_only_symbol_list/debug/parseDebugLocalResources/R-def.txt +3 -0
- package/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +43 -0
- package/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +27 -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/packaged_res/debug/packageDebugResources/xml/ota_file_paths.xml +6 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/META-INF/ota-updater_debug.kotlin_module +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/otaupdater/BuildConfig.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/otaupdater/OTAApkInstallHelper.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/otaupdater/OTAReactHostFactory.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/otaupdater/OTARestartActivity.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/otaupdater/OTARestartHelper.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/otaupdater/OTAUpdaterModule$1.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/otaupdater/OTAUpdaterModule$Companion.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/otaupdater/OTAUpdaterModule.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/otaupdater/OTAUpdaterPackage.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/otaupdater/OTAUpdaterStorage$NativeInfo.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/otaupdater/OTAUpdaterStorage.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/otaupdater/OTAZipExtractHelper.class +0 -0
- package/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
- package/android/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt +2 -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/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/kotlin/compileDebugKotlin/local-state/build-history.bin +0 -0
- package/android/build/outputs/logs/manifest-merger-debug-report.txt +48 -0
- package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
- package/android/build/tmp/kotlin-classes/debug/META-INF/ota-updater_debug.kotlin_module +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/otaupdater/OTAApkInstallHelper.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/otaupdater/OTAReactHostFactory.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/otaupdater/OTARestartActivity.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/otaupdater/OTARestartHelper.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/otaupdater/OTAUpdaterModule$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/otaupdater/OTAUpdaterModule$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/otaupdater/OTAUpdaterModule.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/otaupdater/OTAUpdaterPackage.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/otaupdater/OTAUpdaterStorage$NativeInfo.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/otaupdater/OTAUpdaterStorage.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/otaupdater/OTAZipExtractHelper.class +0 -0
- package/android/build.gradle +68 -0
- package/android/src/main/AndroidManifest.xml +21 -0
- package/android/src/main/java/com/otaupdater/OTAApkInstallHelper.kt +88 -0
- package/android/src/main/java/com/otaupdater/OTARestartActivity.kt +49 -0
- package/android/src/main/java/com/otaupdater/OTARestartHelper.kt +45 -0
- package/android/src/main/java/com/otaupdater/OTAUpdaterModule.kt +159 -0
- package/android/src/main/java/com/otaupdater/OTAUpdaterPackage.kt +16 -0
- package/android/src/main/java/com/otaupdater/OTAUpdaterStorage.kt +196 -0
- package/android/src/main/java/com/otaupdater/OTAZipExtractHelper.kt +62 -0
- package/android/src/main/res/xml/ota_file_paths.xml +6 -0
- package/android/src/reacthost76/java/com/otaupdater/OTAReactHostFactory.kt +84 -0
- package/ios/OTAUpdaterNative.h +4 -0
- package/ios/OTAUpdaterNative.m +110 -0
- package/lib/api.d.ts +1 -0
- package/lib/api.js +8 -0
- package/lib/config.d.ts +3 -0
- package/lib/config.js +11 -0
- package/lib/debug.d.ts +4 -0
- package/lib/debug.js +23 -0
- package/lib/index.d.ts +26 -0
- package/lib/index.js +74 -0
- package/lib/progress.d.ts +2 -0
- package/lib/progress.js +11 -0
- package/lib/projectConfig.d.ts +6 -0
- package/lib/projectConfig.js +47 -0
- package/lib/storage.d.ts +1 -0
- package/lib/storage.js +10 -0
- package/lib/sync.d.ts +50 -0
- package/lib/sync.js +728 -0
- package/lib/types.d.ts +97 -0
- package/lib/types.js +15 -0
- package/lib/ui/OTAUpdateModal.d.ts +8 -0
- package/lib/ui/OTAUpdateModal.js +138 -0
- package/lib/ui/OTAUpdateProvider.d.ts +3 -0
- package/lib/ui/OTAUpdateProvider.js +102 -0
- package/lib/zipExtract.d.ts +1 -0
- package/lib/zipExtract.js +113 -0
- package/package.json +46 -0
- package/react-native.config.js +12 -0
package/lib/types.d.ts
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface ProjectOtaConfig {
|
|
3
|
+
serverUrl: string;
|
|
4
|
+
entryFile?: string;
|
|
5
|
+
installMode?: OTAUpdaterConfig['installMode'];
|
|
6
|
+
deployments: {
|
|
7
|
+
staging: string;
|
|
8
|
+
production: string;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export interface OTAUpdaterConfig {
|
|
12
|
+
/** Base URL of your OTA server, e.g. https://ota.example.com */
|
|
13
|
+
serverUrl: string;
|
|
14
|
+
/** Deployment key from the OTA server (Staging or Production) */
|
|
15
|
+
deploymentKey: string;
|
|
16
|
+
/** When to apply downloaded updates (default: immediate) */
|
|
17
|
+
installMode?: 'immediate' | 'on-next-restart' | 'on-next-resume';
|
|
18
|
+
/** Check interval in milliseconds when using auto-check (default: disabled) */
|
|
19
|
+
checkFrequency?: number;
|
|
20
|
+
/** Show built-in progress popup during sync (default: false, enabled by OTAUpdateProvider) */
|
|
21
|
+
showProgressUI?: boolean;
|
|
22
|
+
/** Check for and offer native APK updates on Android (default: true) */
|
|
23
|
+
enableApkUpdates?: boolean;
|
|
24
|
+
}
|
|
25
|
+
export interface OTAProgressMessages {
|
|
26
|
+
title?: string;
|
|
27
|
+
checking?: string;
|
|
28
|
+
downloading?: string;
|
|
29
|
+
installing?: string;
|
|
30
|
+
restarting?: string;
|
|
31
|
+
error?: string;
|
|
32
|
+
upToDate?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface OTAUpdateProviderProps {
|
|
35
|
+
children: ReactNode;
|
|
36
|
+
/** Project config from ota-updater.config.ts — auto-configures the SDK on mount */
|
|
37
|
+
projectConfig?: ProjectOtaConfig;
|
|
38
|
+
/** Automatically check and install updates on mount (default: true) */
|
|
39
|
+
autoSync?: boolean;
|
|
40
|
+
/** Skip auto sync in dev mode (default: true) */
|
|
41
|
+
skipInDev?: boolean;
|
|
42
|
+
/** Custom status messages */
|
|
43
|
+
messages?: OTAProgressMessages;
|
|
44
|
+
/** Modal title font (must be linked in the host app, e.g. Shabnam-FD) */
|
|
45
|
+
fontFamily?: string;
|
|
46
|
+
/** Passed to sync() */
|
|
47
|
+
syncOptions?: SyncOptions;
|
|
48
|
+
}
|
|
49
|
+
export interface UpdateCheckResult {
|
|
50
|
+
updateAvailable: boolean;
|
|
51
|
+
updateType?: 'bundle' | 'apk';
|
|
52
|
+
reason?: 'NATIVE_VERSION_MISMATCH' | 'ALREADY_INSTALLED' | 'ROLLOUT';
|
|
53
|
+
clientAppVersion?: string;
|
|
54
|
+
targetAppVersion?: string;
|
|
55
|
+
downloadUrl?: string;
|
|
56
|
+
label?: string;
|
|
57
|
+
description?: string;
|
|
58
|
+
isMandatory?: boolean;
|
|
59
|
+
appVersion?: string;
|
|
60
|
+
packageHash?: string;
|
|
61
|
+
buildNumber?: number;
|
|
62
|
+
deviceAbi?: string;
|
|
63
|
+
packageFormat?: 'bundle' | 'zip';
|
|
64
|
+
size?: number;
|
|
65
|
+
}
|
|
66
|
+
export interface SyncOptions {
|
|
67
|
+
/** When to apply the update (default: immediate, or value from configure()) */
|
|
68
|
+
installMode?: 'immediate' | 'on-next-restart' | 'on-next-resume';
|
|
69
|
+
/** Minimum background duration before checking on resume (ms) */
|
|
70
|
+
minimumBackgroundDuration?: number;
|
|
71
|
+
/** Show built-in progress popup (default: from configure() or false) */
|
|
72
|
+
showProgressUI?: boolean;
|
|
73
|
+
/** Check for native APK updates on Android (default: from configure() or true) */
|
|
74
|
+
enableApkUpdates?: boolean;
|
|
75
|
+
}
|
|
76
|
+
export declare enum SyncStatus {
|
|
77
|
+
UP_TO_DATE = "UP_TO_DATE",
|
|
78
|
+
UPDATE_INSTALLED = "UPDATE_INSTALLED",
|
|
79
|
+
UPDATE_IGNORED = "UPDATE_IGNORED",
|
|
80
|
+
APK_INSTALL_PENDING = "APK_INSTALL_PENDING",
|
|
81
|
+
ERROR = "ERROR",
|
|
82
|
+
CHECKING = "CHECKING",
|
|
83
|
+
DOWNLOADING = "DOWNLOADING",
|
|
84
|
+
INSTALLING = "INSTALLING",
|
|
85
|
+
RESTARTING = "RESTARTING"
|
|
86
|
+
}
|
|
87
|
+
export interface SyncResult {
|
|
88
|
+
status: SyncStatus;
|
|
89
|
+
label?: string;
|
|
90
|
+
description?: string;
|
|
91
|
+
error?: Error;
|
|
92
|
+
}
|
|
93
|
+
export interface StoredBundleMeta {
|
|
94
|
+
label: string;
|
|
95
|
+
packageHash: string;
|
|
96
|
+
installedAt: string;
|
|
97
|
+
}
|
package/lib/types.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SyncStatus = void 0;
|
|
4
|
+
var SyncStatus;
|
|
5
|
+
(function (SyncStatus) {
|
|
6
|
+
SyncStatus["UP_TO_DATE"] = "UP_TO_DATE";
|
|
7
|
+
SyncStatus["UPDATE_INSTALLED"] = "UPDATE_INSTALLED";
|
|
8
|
+
SyncStatus["UPDATE_IGNORED"] = "UPDATE_IGNORED";
|
|
9
|
+
SyncStatus["APK_INSTALL_PENDING"] = "APK_INSTALL_PENDING";
|
|
10
|
+
SyncStatus["ERROR"] = "ERROR";
|
|
11
|
+
SyncStatus["CHECKING"] = "CHECKING";
|
|
12
|
+
SyncStatus["DOWNLOADING"] = "DOWNLOADING";
|
|
13
|
+
SyncStatus["INSTALLING"] = "INSTALLING";
|
|
14
|
+
SyncStatus["RESTARTING"] = "RESTARTING";
|
|
15
|
+
})(SyncStatus || (exports.SyncStatus = SyncStatus = {}));
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { OTAProgressState } from '../progress';
|
|
3
|
+
interface OTAUpdateModalProps extends OTAProgressState {
|
|
4
|
+
title?: string;
|
|
5
|
+
fontFamily?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function OTAUpdateModal({ visible, status, progress, message, description, error, title, fontFamily, }: OTAUpdateModalProps): React.JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.OTAUpdateModal = OTAUpdateModal;
|
|
37
|
+
const react_1 = __importStar(require("react"));
|
|
38
|
+
const react_native_1 = require("react-native");
|
|
39
|
+
const progress_1 = require("../progress");
|
|
40
|
+
const types_1 = require("../types");
|
|
41
|
+
function OTAUpdateModal({ visible, status, progress, message, description, error, title = progress_1.defaultMessages.title, fontFamily, }) {
|
|
42
|
+
const customFontStyle = (0, react_1.useMemo)(() => fontFamily
|
|
43
|
+
? {
|
|
44
|
+
fontFamily,
|
|
45
|
+
fontWeight: 'normal',
|
|
46
|
+
}
|
|
47
|
+
: null, [fontFamily]);
|
|
48
|
+
const textStyle = (0, react_1.useMemo)(() => ({
|
|
49
|
+
...(customFontStyle ?? null),
|
|
50
|
+
writingDirection: 'rtl',
|
|
51
|
+
}), [customFontStyle]);
|
|
52
|
+
if (!visible)
|
|
53
|
+
return null;
|
|
54
|
+
const progressPercent = Math.round(Math.min(Math.max(progress, 0), 1) * 100);
|
|
55
|
+
const showProgressBar = status === types_1.SyncStatus.DOWNLOADING;
|
|
56
|
+
return (<react_native_1.Modal visible transparent animationType="fade" statusBarTranslucent>
|
|
57
|
+
<react_native_1.View style={styles.overlay}>
|
|
58
|
+
<react_native_1.View style={styles.card}>
|
|
59
|
+
<react_native_1.Text style={[styles.title, !fontFamily && styles.titleBold, textStyle]}>
|
|
60
|
+
{title}
|
|
61
|
+
</react_native_1.Text>
|
|
62
|
+
<react_native_1.Text style={[styles.message, textStyle]}>{error ?? message}</react_native_1.Text>
|
|
63
|
+
{description && !error ? (<react_native_1.Text style={[styles.description, textStyle]}>{description}</react_native_1.Text>) : null}
|
|
64
|
+
|
|
65
|
+
{showProgressBar ? (<react_native_1.View style={styles.progressTrack}>
|
|
66
|
+
<react_native_1.View style={[styles.progressFill, { width: `${progressPercent}%` }]}/>
|
|
67
|
+
</react_native_1.View>) : (<react_native_1.ActivityIndicator size="large" color="#2563eb" style={styles.spinner}/>)}
|
|
68
|
+
|
|
69
|
+
{showProgressBar ? (<react_native_1.Text style={[styles.percent, !fontFamily && styles.percentBold, textStyle]}>
|
|
70
|
+
{progressPercent}٪
|
|
71
|
+
</react_native_1.Text>) : null}
|
|
72
|
+
</react_native_1.View>
|
|
73
|
+
</react_native_1.View>
|
|
74
|
+
</react_native_1.Modal>);
|
|
75
|
+
}
|
|
76
|
+
const styles = react_native_1.StyleSheet.create({
|
|
77
|
+
overlay: {
|
|
78
|
+
flex: 1,
|
|
79
|
+
backgroundColor: 'rgba(0, 0, 0, 0.55)',
|
|
80
|
+
alignItems: 'center',
|
|
81
|
+
justifyContent: 'center',
|
|
82
|
+
padding: 24,
|
|
83
|
+
},
|
|
84
|
+
card: {
|
|
85
|
+
width: '100%',
|
|
86
|
+
maxWidth: 320,
|
|
87
|
+
backgroundColor: '#fff',
|
|
88
|
+
borderRadius: 16,
|
|
89
|
+
padding: 24,
|
|
90
|
+
alignItems: 'center',
|
|
91
|
+
},
|
|
92
|
+
title: {
|
|
93
|
+
fontSize: 18,
|
|
94
|
+
color: '#111827',
|
|
95
|
+
marginBottom: 8,
|
|
96
|
+
textAlign: 'center',
|
|
97
|
+
},
|
|
98
|
+
titleBold: {
|
|
99
|
+
fontWeight: '700',
|
|
100
|
+
},
|
|
101
|
+
message: {
|
|
102
|
+
fontSize: 15,
|
|
103
|
+
color: '#374151',
|
|
104
|
+
textAlign: 'center',
|
|
105
|
+
marginBottom: 8,
|
|
106
|
+
},
|
|
107
|
+
description: {
|
|
108
|
+
fontSize: 13,
|
|
109
|
+
color: '#6b7280',
|
|
110
|
+
textAlign: 'center',
|
|
111
|
+
marginBottom: 16,
|
|
112
|
+
},
|
|
113
|
+
progressTrack: {
|
|
114
|
+
width: '100%',
|
|
115
|
+
height: 8,
|
|
116
|
+
backgroundColor: '#e5e7eb',
|
|
117
|
+
borderRadius: 999,
|
|
118
|
+
overflow: 'hidden',
|
|
119
|
+
marginTop: 8,
|
|
120
|
+
},
|
|
121
|
+
progressFill: {
|
|
122
|
+
height: '100%',
|
|
123
|
+
backgroundColor: '#2563eb',
|
|
124
|
+
borderRadius: 999,
|
|
125
|
+
},
|
|
126
|
+
percent: {
|
|
127
|
+
marginTop: 8,
|
|
128
|
+
fontSize: 13,
|
|
129
|
+
color: '#6b7280',
|
|
130
|
+
textAlign: 'center',
|
|
131
|
+
},
|
|
132
|
+
percentBold: {
|
|
133
|
+
fontWeight: '600',
|
|
134
|
+
},
|
|
135
|
+
spinner: {
|
|
136
|
+
marginTop: 12,
|
|
137
|
+
},
|
|
138
|
+
});
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.OTAUpdateProvider = OTAUpdateProvider;
|
|
37
|
+
const react_1 = __importStar(require("react"));
|
|
38
|
+
const react_native_1 = require("react-native");
|
|
39
|
+
const projectConfig_1 = require("../projectConfig");
|
|
40
|
+
const progress_1 = require("../progress");
|
|
41
|
+
const sync_1 = require("../sync");
|
|
42
|
+
const OTAUpdateModal_1 = require("./OTAUpdateModal");
|
|
43
|
+
const SYNC_DELAY_MS = 2500;
|
|
44
|
+
const FOREGROUND_SYNC_DEBOUNCE_MS = 30000;
|
|
45
|
+
function OTAUpdateProvider({ children, projectConfig, autoSync = true, skipInDev = true, messages, fontFamily, syncOptions, }) {
|
|
46
|
+
const [progress, setProgress] = (0, react_1.useState)((0, progress_1.getProgressState)());
|
|
47
|
+
const lastSyncAtRef = (0, react_1.useRef)(0);
|
|
48
|
+
const foregroundTimerRef = (0, react_1.useRef)(null);
|
|
49
|
+
const hasMountedSyncRef = (0, react_1.useRef)(false);
|
|
50
|
+
const modalTitle = (0, progress_1.getModalTitle)(messages);
|
|
51
|
+
(0, react_1.useEffect)(() => {
|
|
52
|
+
if (projectConfig) {
|
|
53
|
+
(0, projectConfig_1.configureFromProject)(projectConfig);
|
|
54
|
+
}
|
|
55
|
+
}, [projectConfig]);
|
|
56
|
+
(0, react_1.useEffect)(() => (0, progress_1.subscribeProgress)(setProgress), []);
|
|
57
|
+
(0, react_1.useEffect)(() => {
|
|
58
|
+
if (!autoSync)
|
|
59
|
+
return;
|
|
60
|
+
if (skipInDev && __DEV__)
|
|
61
|
+
return;
|
|
62
|
+
const runSync = () => {
|
|
63
|
+
if ((0, sync_1.isSyncInProgress)())
|
|
64
|
+
return;
|
|
65
|
+
lastSyncAtRef.current = Date.now();
|
|
66
|
+
(0, sync_1.sync)({ ...syncOptions, showProgressUI: true }, undefined, messages);
|
|
67
|
+
};
|
|
68
|
+
const mountTimer = setTimeout(() => {
|
|
69
|
+
hasMountedSyncRef.current = true;
|
|
70
|
+
runSync();
|
|
71
|
+
}, SYNC_DELAY_MS);
|
|
72
|
+
const onAppStateChange = (nextState) => {
|
|
73
|
+
if (nextState !== 'active')
|
|
74
|
+
return;
|
|
75
|
+
if (!hasMountedSyncRef.current)
|
|
76
|
+
return;
|
|
77
|
+
(0, sync_1.resumePendingApkInstall)().catch(() => {
|
|
78
|
+
// Native module may be unavailable on iOS — ignore.
|
|
79
|
+
});
|
|
80
|
+
const elapsed = Date.now() - lastSyncAtRef.current;
|
|
81
|
+
if (elapsed < FOREGROUND_SYNC_DEBOUNCE_MS)
|
|
82
|
+
return;
|
|
83
|
+
if (foregroundTimerRef.current) {
|
|
84
|
+
clearTimeout(foregroundTimerRef.current);
|
|
85
|
+
}
|
|
86
|
+
foregroundTimerRef.current = setTimeout(runSync, SYNC_DELAY_MS);
|
|
87
|
+
};
|
|
88
|
+
const subscription = react_native_1.AppState.addEventListener('change', onAppStateChange);
|
|
89
|
+
return () => {
|
|
90
|
+
clearTimeout(mountTimer);
|
|
91
|
+
if (foregroundTimerRef.current) {
|
|
92
|
+
clearTimeout(foregroundTimerRef.current);
|
|
93
|
+
}
|
|
94
|
+
subscription.remove();
|
|
95
|
+
};
|
|
96
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
97
|
+
}, []);
|
|
98
|
+
return (<>
|
|
99
|
+
{children}
|
|
100
|
+
<OTAUpdateModal_1.OTAUpdateModal {...progress} title={modalTitle} fontFamily={fontFamily}/>
|
|
101
|
+
</>);
|
|
102
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function extractZipToDirectory(zipPath: string, destDir: string): Promise<void>;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.extractZipToDirectory = extractZipToDirectory;
|
|
4
|
+
const react_native_1 = require("react-native");
|
|
5
|
+
const fflate_1 = require("fflate");
|
|
6
|
+
const { OTAUpdaterNative } = react_native_1.NativeModules;
|
|
7
|
+
function normalizePath(path) {
|
|
8
|
+
return path.replace(/^file:\/\//, '');
|
|
9
|
+
}
|
|
10
|
+
function uint8ArrayToBase64(bytes) {
|
|
11
|
+
const ReactNativeBlobUtil = require('react-native-blob-util').default;
|
|
12
|
+
if (typeof ReactNativeBlobUtil.base64?.encode === 'function') {
|
|
13
|
+
let binary = '';
|
|
14
|
+
const chunkSize = 0x8000;
|
|
15
|
+
for (let i = 0; i < bytes.length; i += chunkSize) {
|
|
16
|
+
binary += String.fromCharCode(...bytes.subarray(i, i + chunkSize));
|
|
17
|
+
}
|
|
18
|
+
return ReactNativeBlobUtil.base64.encode(binary);
|
|
19
|
+
}
|
|
20
|
+
let binary = '';
|
|
21
|
+
const chunkSize = 0x8000;
|
|
22
|
+
for (let i = 0; i < bytes.length; i += chunkSize) {
|
|
23
|
+
binary += String.fromCharCode(...bytes.subarray(i, i + chunkSize));
|
|
24
|
+
}
|
|
25
|
+
return globalThis.btoa(binary);
|
|
26
|
+
}
|
|
27
|
+
function base64ToUint8Array(base64) {
|
|
28
|
+
const ReactNativeBlobUtil = require('react-native-blob-util').default;
|
|
29
|
+
const binary = typeof ReactNativeBlobUtil.base64?.decode === 'function'
|
|
30
|
+
? ReactNativeBlobUtil.base64.decode(base64)
|
|
31
|
+
: globalThis.atob(base64);
|
|
32
|
+
const bytes = new Uint8Array(binary.length);
|
|
33
|
+
for (let i = 0; i < binary.length; i++) {
|
|
34
|
+
bytes[i] = binary.charCodeAt(i);
|
|
35
|
+
}
|
|
36
|
+
return bytes;
|
|
37
|
+
}
|
|
38
|
+
async function readFileAsBase64(path) {
|
|
39
|
+
const ReactNativeBlobUtil = require('react-native-blob-util').default;
|
|
40
|
+
const data = await ReactNativeBlobUtil.fs.readFile(path, 'base64');
|
|
41
|
+
if (typeof data === 'string') {
|
|
42
|
+
return data;
|
|
43
|
+
}
|
|
44
|
+
throw new Error(`readFile returned unexpected type: ${typeof data}`);
|
|
45
|
+
}
|
|
46
|
+
async function mkdirRecursive(dirPath) {
|
|
47
|
+
const ReactNativeBlobUtil = require('react-native-blob-util').default;
|
|
48
|
+
if (await ReactNativeBlobUtil.fs.exists(dirPath)) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
const parent = dirPath.substring(0, dirPath.lastIndexOf('/'));
|
|
52
|
+
if (parent.length > 0) {
|
|
53
|
+
await mkdirRecursive(parent);
|
|
54
|
+
}
|
|
55
|
+
await ReactNativeBlobUtil.fs.mkdir(dirPath);
|
|
56
|
+
}
|
|
57
|
+
async function writeBinaryFile(outPath, content) {
|
|
58
|
+
const ReactNativeBlobUtil = require('react-native-blob-util').default;
|
|
59
|
+
const base64 = uint8ArrayToBase64(content);
|
|
60
|
+
const stream = await ReactNativeBlobUtil.fs.writeStream(outPath, 'base64', false);
|
|
61
|
+
await stream.write(base64);
|
|
62
|
+
await stream.close();
|
|
63
|
+
}
|
|
64
|
+
async function extractZipToDirectoryNative(zipPath, destDir) {
|
|
65
|
+
if (OTAUpdaterNative?.extractZipArchive) {
|
|
66
|
+
await OTAUpdaterNative.extractZipArchive(zipPath, destDir);
|
|
67
|
+
return true;
|
|
68
|
+
}
|
|
69
|
+
try {
|
|
70
|
+
const { unzip } = require('react-native-zip-archive');
|
|
71
|
+
if (typeof unzip === 'function') {
|
|
72
|
+
await unzip(zipPath, destDir);
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
catch {
|
|
77
|
+
// Optional peer dependency not installed.
|
|
78
|
+
}
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
async function extractZipToDirectoryJs(zipPath, destDir) {
|
|
82
|
+
const base64 = await readFileAsBase64(zipPath);
|
|
83
|
+
const entries = (0, fflate_1.unzipSync)(base64ToUint8Array(base64));
|
|
84
|
+
await mkdirRecursive(destDir);
|
|
85
|
+
for (const [relativePath, rawContent] of Object.entries(entries)) {
|
|
86
|
+
const normalized = relativePath.replace(/\\/g, '/');
|
|
87
|
+
if (normalized.endsWith('/')) {
|
|
88
|
+
await mkdirRecursive(`${destDir}/${normalized.slice(0, -1)}`);
|
|
89
|
+
continue;
|
|
90
|
+
}
|
|
91
|
+
const content = rawContent instanceof Uint8Array
|
|
92
|
+
? rawContent
|
|
93
|
+
: new Uint8Array(rawContent);
|
|
94
|
+
const outPath = `${destDir}/${normalized}`;
|
|
95
|
+
const parent = outPath.substring(0, outPath.lastIndexOf('/'));
|
|
96
|
+
if (parent.length > 0) {
|
|
97
|
+
await mkdirRecursive(parent);
|
|
98
|
+
}
|
|
99
|
+
await writeBinaryFile(outPath, content);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
async function extractZipToDirectory(zipPath, destDir) {
|
|
103
|
+
const normalizedZip = normalizePath(zipPath);
|
|
104
|
+
const normalizedDest = normalizePath(destDir);
|
|
105
|
+
const extractedNatively = await extractZipToDirectoryNative(normalizedZip, normalizedDest);
|
|
106
|
+
if (extractedNatively) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
if (react_native_1.Platform.OS === 'android') {
|
|
110
|
+
throw new Error('OTA zip extraction requires rebuilding the Android app with the latest @appsonair.ir/react-native native module. Run: cd android && ./gradlew clean && cd .. && npx react-native run-android');
|
|
111
|
+
}
|
|
112
|
+
await extractZipToDirectoryJs(normalizedZip, normalizedDest);
|
|
113
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@appsonair.ir/react-native",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "React Native client SDK for self-hosted OTA updates",
|
|
5
|
+
"main": "lib/index.js",
|
|
6
|
+
"types": "lib/index.d.ts",
|
|
7
|
+
"react-native": "lib/index.js",
|
|
8
|
+
"files": [
|
|
9
|
+
"lib",
|
|
10
|
+
"android",
|
|
11
|
+
"ios",
|
|
12
|
+
"react-native.config.js"
|
|
13
|
+
],
|
|
14
|
+
"scripts": {
|
|
15
|
+
"build": "tsc",
|
|
16
|
+
"prepublishOnly": "yarn build"
|
|
17
|
+
},
|
|
18
|
+
"publishConfig": {
|
|
19
|
+
"access": "public"
|
|
20
|
+
},
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"fflate": "^0.8.2"
|
|
23
|
+
},
|
|
24
|
+
"peerDependencies": {
|
|
25
|
+
"@react-native-async-storage/async-storage": ">=1.17.0",
|
|
26
|
+
"react": ">=18.0.0",
|
|
27
|
+
"react-native": ">=0.71.0",
|
|
28
|
+
"react-native-blob-util": ">=0.19.0",
|
|
29
|
+
"react-native-device-info": ">=10.0.0"
|
|
30
|
+
},
|
|
31
|
+
"peerDependenciesMeta": {
|
|
32
|
+
"react-native-blob-util": {
|
|
33
|
+
"optional": true
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@react-native-async-storage/async-storage": "^2.1.0",
|
|
38
|
+
"@types/node": "^22.10.2",
|
|
39
|
+
"@types/react": "^18.3.12",
|
|
40
|
+
"react": "^18.3.1",
|
|
41
|
+
"react-native": "^0.76.3",
|
|
42
|
+
"react-native-blob-util": "^0.21.2",
|
|
43
|
+
"react-native-device-info": "^14.0.1",
|
|
44
|
+
"typescript": "^5.7.2"
|
|
45
|
+
}
|
|
46
|
+
}
|