@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/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.len
ADDED
|
Binary file
|
|
Binary file
|
package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i
ADDED
|
Binary file
|
package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i.len
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at
ADDED
|
Binary file
|
|
Binary file
|
package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i.len
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.len
ADDED
|
Binary file
|
|
Binary file
|
package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i
ADDED
|
Binary file
|
package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i.len
ADDED
|
Binary file
|
package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.len
ADDED
|
Binary file
|
|
Binary file
|
package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i
ADDED
|
Binary file
|
package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i.len
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.len
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i.len
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i.len
ADDED
|
Binary file
|
|
Binary file
|
package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at
ADDED
|
Binary file
|
|
Binary file
|
package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i.len
ADDED
|
Binary file
|
|
Binary file
|
package/android/build/kotlin/compileDebugKotlin/classpath-snapshot/shrunk-classpath-snapshot.bin
ADDED
|
Binary file
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
-- Merging decision tree log ---
|
|
2
|
+
manifest
|
|
3
|
+
ADDED from /Users/sajadghiasvand/WebstormProjects/yarinoapp/node_modules/ota-updater/android/src/main/AndroidManifest.xml:1:1-21:12
|
|
4
|
+
INJECTED from /Users/sajadghiasvand/WebstormProjects/yarinoapp/node_modules/ota-updater/android/src/main/AndroidManifest.xml:1:1-21:12
|
|
5
|
+
package
|
|
6
|
+
INJECTED from /Users/sajadghiasvand/WebstormProjects/yarinoapp/node_modules/ota-updater/android/src/main/AndroidManifest.xml
|
|
7
|
+
xmlns:android
|
|
8
|
+
ADDED from /Users/sajadghiasvand/WebstormProjects/yarinoapp/node_modules/ota-updater/android/src/main/AndroidManifest.xml:1:11-69
|
|
9
|
+
uses-permission#android.permission.REQUEST_INSTALL_PACKAGES
|
|
10
|
+
ADDED from /Users/sajadghiasvand/WebstormProjects/yarinoapp/node_modules/ota-updater/android/src/main/AndroidManifest.xml:2:3-81
|
|
11
|
+
android:name
|
|
12
|
+
ADDED from /Users/sajadghiasvand/WebstormProjects/yarinoapp/node_modules/ota-updater/android/src/main/AndroidManifest.xml:2:20-78
|
|
13
|
+
application
|
|
14
|
+
ADDED from /Users/sajadghiasvand/WebstormProjects/yarinoapp/node_modules/ota-updater/android/src/main/AndroidManifest.xml:4:3-20:17
|
|
15
|
+
activity#com.otaupdater.OTARestartActivity
|
|
16
|
+
ADDED from /Users/sajadghiasvand/WebstormProjects/yarinoapp/node_modules/ota-updater/android/src/main/AndroidManifest.xml:5:5-9:69
|
|
17
|
+
android:process
|
|
18
|
+
ADDED from /Users/sajadghiasvand/WebstormProjects/yarinoapp/node_modules/ota-updater/android/src/main/AndroidManifest.xml:8:7-37
|
|
19
|
+
android:exported
|
|
20
|
+
ADDED from /Users/sajadghiasvand/WebstormProjects/yarinoapp/node_modules/ota-updater/android/src/main/AndroidManifest.xml:7:7-31
|
|
21
|
+
android:theme
|
|
22
|
+
ADDED from /Users/sajadghiasvand/WebstormProjects/yarinoapp/node_modules/ota-updater/android/src/main/AndroidManifest.xml:9:7-66
|
|
23
|
+
android:name
|
|
24
|
+
ADDED from /Users/sajadghiasvand/WebstormProjects/yarinoapp/node_modules/ota-updater/android/src/main/AndroidManifest.xml:6:7-41
|
|
25
|
+
provider#androidx.core.content.FileProvider
|
|
26
|
+
ADDED from /Users/sajadghiasvand/WebstormProjects/yarinoapp/node_modules/ota-updater/android/src/main/AndroidManifest.xml:11:5-19:16
|
|
27
|
+
android:grantUriPermissions
|
|
28
|
+
ADDED from /Users/sajadghiasvand/WebstormProjects/yarinoapp/node_modules/ota-updater/android/src/main/AndroidManifest.xml:15:7-41
|
|
29
|
+
android:authorities
|
|
30
|
+
ADDED from /Users/sajadghiasvand/WebstormProjects/yarinoapp/node_modules/ota-updater/android/src/main/AndroidManifest.xml:13:7-69
|
|
31
|
+
android:exported
|
|
32
|
+
ADDED from /Users/sajadghiasvand/WebstormProjects/yarinoapp/node_modules/ota-updater/android/src/main/AndroidManifest.xml:14:7-31
|
|
33
|
+
android:name
|
|
34
|
+
ADDED from /Users/sajadghiasvand/WebstormProjects/yarinoapp/node_modules/ota-updater/android/src/main/AndroidManifest.xml:12:7-56
|
|
35
|
+
meta-data#android.support.FILE_PROVIDER_PATHS
|
|
36
|
+
ADDED from /Users/sajadghiasvand/WebstormProjects/yarinoapp/node_modules/ota-updater/android/src/main/AndroidManifest.xml:16:7-18:50
|
|
37
|
+
android:resource
|
|
38
|
+
ADDED from /Users/sajadghiasvand/WebstormProjects/yarinoapp/node_modules/ota-updater/android/src/main/AndroidManifest.xml:18:9-47
|
|
39
|
+
android:name
|
|
40
|
+
ADDED from /Users/sajadghiasvand/WebstormProjects/yarinoapp/node_modules/ota-updater/android/src/main/AndroidManifest.xml:17:9-59
|
|
41
|
+
uses-sdk
|
|
42
|
+
INJECTED from /Users/sajadghiasvand/WebstormProjects/yarinoapp/node_modules/ota-updater/android/src/main/AndroidManifest.xml reason: use-sdk injection requested
|
|
43
|
+
INJECTED from /Users/sajadghiasvand/WebstormProjects/yarinoapp/node_modules/ota-updater/android/src/main/AndroidManifest.xml
|
|
44
|
+
INJECTED from /Users/sajadghiasvand/WebstormProjects/yarinoapp/node_modules/ota-updater/android/src/main/AndroidManifest.xml
|
|
45
|
+
android:targetSdkVersion
|
|
46
|
+
INJECTED from /Users/sajadghiasvand/WebstormProjects/yarinoapp/node_modules/ota-updater/android/src/main/AndroidManifest.xml
|
|
47
|
+
android:minSdkVersion
|
|
48
|
+
INJECTED from /Users/sajadghiasvand/WebstormProjects/yarinoapp/node_modules/ota-updater/android/src/main/AndroidManifest.xml
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/android/build/tmp/kotlin-classes/debug/com/otaupdater/OTAUpdaterModule$Companion.class
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/android/build/tmp/kotlin-classes/debug/com/otaupdater/OTAUpdaterStorage$NativeInfo.class
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
def safeExtGet(prop, fallback) {
|
|
2
|
+
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
def detectReactNativeVersion() {
|
|
6
|
+
def candidates = [
|
|
7
|
+
file("../../../react-native/package.json"),
|
|
8
|
+
file("../../react-native/package.json"),
|
|
9
|
+
file("../../../../react-native/package.json"),
|
|
10
|
+
]
|
|
11
|
+
for (def pkg : candidates) {
|
|
12
|
+
if (pkg.exists()) {
|
|
13
|
+
def json = new groovy.json.JsonSlurper().parseText(pkg.text)
|
|
14
|
+
def version = json.version as String
|
|
15
|
+
if (version != null && !version.trim().isEmpty()) {
|
|
16
|
+
return version.trim()
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return null
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
def isReactNative76OrNewer() {
|
|
24
|
+
def version = detectReactNativeVersion()
|
|
25
|
+
if (version == null) {
|
|
26
|
+
// Unknown RN version — exclude 0.76-only sources (safer for 0.74/0.75).
|
|
27
|
+
return false
|
|
28
|
+
}
|
|
29
|
+
def parts = version.tokenize('.').collect { part ->
|
|
30
|
+
(part =~ /^\d+/)[0]?.toInteger() ?: 0
|
|
31
|
+
}
|
|
32
|
+
def major = parts.size() > 0 ? parts[0] : 0
|
|
33
|
+
def minor = parts.size() > 1 ? parts[1] : 0
|
|
34
|
+
return major > 0 || minor >= 76
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Expose for host apps / debugging Gradle issues.
|
|
38
|
+
ext.otaUpdaterReactNativeVersion = detectReactNativeVersion()
|
|
39
|
+
ext.otaUpdaterIncludesReactHost76 = isReactNative76OrNewer()
|
|
40
|
+
|
|
41
|
+
apply plugin: "com.android.library"
|
|
42
|
+
apply plugin: "org.jetbrains.kotlin.android"
|
|
43
|
+
apply plugin: "com.facebook.react"
|
|
44
|
+
|
|
45
|
+
android {
|
|
46
|
+
namespace "com.otaupdater"
|
|
47
|
+
compileSdkVersion safeExtGet("compileSdkVersion", 36)
|
|
48
|
+
|
|
49
|
+
defaultConfig {
|
|
50
|
+
minSdkVersion safeExtGet("minSdkVersion", 24)
|
|
51
|
+
targetSdkVersion safeExtGet("targetSdkVersion", 36)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
sourceSets {
|
|
55
|
+
main {
|
|
56
|
+
java.srcDirs += ["src/main/java"]
|
|
57
|
+
if (isReactNative76OrNewer()) {
|
|
58
|
+
java.srcDirs += ["src/reacthost76/java"]
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
dependencies {
|
|
65
|
+
implementation "com.facebook.react:react-android"
|
|
66
|
+
implementation "org.jetbrains.kotlin:kotlin-stdlib"
|
|
67
|
+
implementation "androidx.core:core:1.13.1"
|
|
68
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
|
2
|
+
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
|
3
|
+
|
|
4
|
+
<application>
|
|
5
|
+
<activity
|
|
6
|
+
android:name=".OTARestartActivity"
|
|
7
|
+
android:exported="false"
|
|
8
|
+
android:process=":ota_restart"
|
|
9
|
+
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
|
|
10
|
+
|
|
11
|
+
<provider
|
|
12
|
+
android:name="androidx.core.content.FileProvider"
|
|
13
|
+
android:authorities="${applicationId}.otaupdater.fileprovider"
|
|
14
|
+
android:exported="false"
|
|
15
|
+
android:grantUriPermissions="true">
|
|
16
|
+
<meta-data
|
|
17
|
+
android:name="android.support.FILE_PROVIDER_PATHS"
|
|
18
|
+
android:resource="@xml/ota_file_paths" />
|
|
19
|
+
</provider>
|
|
20
|
+
</application>
|
|
21
|
+
</manifest>
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
package com.otaupdater
|
|
2
|
+
|
|
3
|
+
import android.content.Context
|
|
4
|
+
import android.content.Intent
|
|
5
|
+
import android.net.Uri
|
|
6
|
+
import android.os.Build
|
|
7
|
+
import android.provider.Settings
|
|
8
|
+
import androidx.core.content.FileProvider
|
|
9
|
+
import com.facebook.react.bridge.ReactApplicationContext
|
|
10
|
+
import java.io.File
|
|
11
|
+
|
|
12
|
+
object OTAApkInstallHelper {
|
|
13
|
+
private const val MIN_APK_BYTES = 1024L * 100
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @return "started" when the system install screen opens, "permission_required" when settings were opened
|
|
17
|
+
*/
|
|
18
|
+
fun install(reactContext: ReactApplicationContext, path: String): String {
|
|
19
|
+
val file = File(normalizePath(path))
|
|
20
|
+
if (!file.exists() || file.length() < MIN_APK_BYTES) {
|
|
21
|
+
throw IllegalArgumentException("APK file is missing or invalid: ${file.absolutePath}")
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (needsInstallPermission(reactContext) &&
|
|
25
|
+
!reactContext.packageManager.canRequestPackageInstalls()) {
|
|
26
|
+
OTAUpdaterStorage.setPendingApkPath(reactContext, file.absolutePath)
|
|
27
|
+
openUnknownSourcesSettings(reactContext)
|
|
28
|
+
return "permission_required"
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
launchInstallIntent(reactContext, file)
|
|
32
|
+
OTAUpdaterStorage.clearPendingApkPath(reactContext)
|
|
33
|
+
return "started"
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** Called when the app returns to foreground — resumes install after user grants permission. */
|
|
37
|
+
fun retryPendingInstall(reactContext: ReactApplicationContext) {
|
|
38
|
+
val path = OTAUpdaterStorage.getPendingApkPath(reactContext) ?: return
|
|
39
|
+
|
|
40
|
+
if (needsInstallPermission(reactContext) &&
|
|
41
|
+
!reactContext.packageManager.canRequestPackageInstalls()) {
|
|
42
|
+
return
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
val file = File(path)
|
|
46
|
+
if (!file.exists() || file.length() < MIN_APK_BYTES) {
|
|
47
|
+
OTAUpdaterStorage.clearPendingApkPath(reactContext)
|
|
48
|
+
return
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
launchInstallIntent(reactContext, file)
|
|
52
|
+
OTAUpdaterStorage.clearPendingApkPath(reactContext)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
private fun needsInstallPermission(context: Context): Boolean =
|
|
56
|
+
Build.VERSION.SDK_INT >= Build.VERSION_CODES.O
|
|
57
|
+
|
|
58
|
+
private fun launchInstallIntent(context: Context, file: File) {
|
|
59
|
+
val authority = "${context.packageName}.otaupdater.fileprovider"
|
|
60
|
+
val uri = FileProvider.getUriForFile(context, authority, file)
|
|
61
|
+
|
|
62
|
+
val installIntent =
|
|
63
|
+
Intent(Intent.ACTION_VIEW).apply {
|
|
64
|
+
setDataAndType(uri, "application/vnd.android.package-archive")
|
|
65
|
+
addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
|
|
66
|
+
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
context.startActivity(installIntent)
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
private fun openUnknownSourcesSettings(reactContext: ReactApplicationContext) {
|
|
73
|
+
val intent =
|
|
74
|
+
Intent(Settings.ACTION_MANAGE_UNKNOWN_APP_SOURCES).apply {
|
|
75
|
+
data = Uri.parse("package:${reactContext.packageName}")
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
val activity = reactContext.currentActivity
|
|
79
|
+
if (activity != null) {
|
|
80
|
+
activity.startActivity(intent)
|
|
81
|
+
} else {
|
|
82
|
+
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
|
83
|
+
reactContext.startActivity(intent)
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
private fun normalizePath(path: String): String = path.removePrefix("file://")
|
|
88
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
package com.otaupdater
|
|
2
|
+
|
|
3
|
+
import android.app.Activity
|
|
4
|
+
import android.content.Intent
|
|
5
|
+
import android.os.Build
|
|
6
|
+
import android.os.Bundle
|
|
7
|
+
import android.os.Process
|
|
8
|
+
import android.os.StrictMode
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* ProcessPhoenix-style trampoline: runs in a separate process, kills the main app process,
|
|
12
|
+
* then starts the launcher activity so Application/ReactHost are recreated with the OTA bundle.
|
|
13
|
+
*/
|
|
14
|
+
class OTARestartActivity : Activity() {
|
|
15
|
+
override fun onCreate(savedInstanceState: Bundle?) {
|
|
16
|
+
super.onCreate(savedInstanceState)
|
|
17
|
+
|
|
18
|
+
Process.killProcess(intent.getIntExtra(OTARestartHelper.KEY_MAIN_PROCESS_PID, -1))
|
|
19
|
+
|
|
20
|
+
val restartIntents =
|
|
21
|
+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
|
22
|
+
intent.getParcelableArrayListExtra(
|
|
23
|
+
OTARestartHelper.KEY_RESTART_INTENTS,
|
|
24
|
+
Intent::class.java,
|
|
25
|
+
)
|
|
26
|
+
} else {
|
|
27
|
+
@Suppress("DEPRECATION")
|
|
28
|
+
intent.getParcelableArrayListExtra(OTARestartHelper.KEY_RESTART_INTENTS)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if (restartIntents.isNullOrEmpty()) {
|
|
32
|
+
finish()
|
|
33
|
+
Runtime.getRuntime().exit(0)
|
|
34
|
+
return
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
|
|
38
|
+
StrictMode.setVmPolicy(
|
|
39
|
+
StrictMode.VmPolicy.Builder(StrictMode.getVmPolicy())
|
|
40
|
+
.permitUnsafeIntentLaunch()
|
|
41
|
+
.build(),
|
|
42
|
+
)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
startActivities(restartIntents.toTypedArray())
|
|
46
|
+
finish()
|
|
47
|
+
Runtime.getRuntime().exit(0)
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
package com.otaupdater
|
|
2
|
+
|
|
3
|
+
import android.app.ActivityManager
|
|
4
|
+
import android.content.Context
|
|
5
|
+
import android.content.Intent
|
|
6
|
+
import android.os.Process
|
|
7
|
+
|
|
8
|
+
object OTARestartHelper {
|
|
9
|
+
const val KEY_RESTART_INTENTS = "ota_restart_intents"
|
|
10
|
+
const val KEY_MAIN_PROCESS_PID = "ota_main_process_pid"
|
|
11
|
+
|
|
12
|
+
fun triggerRebirth(context: Context) {
|
|
13
|
+
val launchIntent =
|
|
14
|
+
context.packageManager.getLaunchIntentForPackage(context.packageName)
|
|
15
|
+
?: throw IllegalStateException("Unable to determine launch intent for ${context.packageName}")
|
|
16
|
+
|
|
17
|
+
triggerRebirth(context, launchIntent)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
fun triggerRebirth(context: Context, nextIntent: Intent) {
|
|
21
|
+
nextIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK)
|
|
22
|
+
|
|
23
|
+
val intent =
|
|
24
|
+
Intent(context, OTARestartActivity::class.java).apply {
|
|
25
|
+
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
|
26
|
+
putParcelableArrayListExtra(KEY_RESTART_INTENTS, arrayListOf(nextIntent))
|
|
27
|
+
putExtra(KEY_MAIN_PROCESS_PID, Process.myPid())
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
context.startActivity(intent)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
fun isRestartProcess(context: Context): Boolean {
|
|
34
|
+
val pid = Process.myPid()
|
|
35
|
+
val manager = context.getSystemService(Context.ACTIVITY_SERVICE) as ActivityManager
|
|
36
|
+
val processes = manager.runningAppProcesses ?: return false
|
|
37
|
+
|
|
38
|
+
for (info in processes) {
|
|
39
|
+
if (info.pid == pid && info.processName.endsWith(":ota_restart")) {
|
|
40
|
+
return true
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return false
|
|
44
|
+
}
|
|
45
|
+
}
|