@getquip/expo-nordic-dfu 0.1.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/.eslintrc.js +2 -0
- package/.github/CODEOWNERS +3 -0
- package/.github/ISSUE_TEMPLATE/bug_report.md +32 -0
- package/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- package/.github/workflows/actionlint.yml +21 -0
- package/.nvmrc +1 -0
- package/CONTRIBUTING.md +17 -0
- package/LICENSE +21 -0
- package/README.md +108 -0
- package/android/.gradle/8.10/checksums/checksums.lock +0 -0
- package/android/.gradle/8.10/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/8.10/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/8.10/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/8.10/fileChanges/last-build.bin +0 -0
- package/android/.gradle/8.10/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/8.10/gc.properties +0 -0
- package/android/.gradle/8.9/checksums/checksums.lock +0 -0
- package/android/.gradle/8.9/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/8.9/fileChanges/last-build.bin +0 -0
- package/android/.gradle/8.9/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/8.9/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
- package/android/.gradle/config.properties +2 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/.idea/AndroidProjectSystem.xml +6 -0
- package/android/.idea/caches/deviceStreaming.xml +607 -0
- package/android/.idea/gradle.xml +12 -0
- package/android/.idea/migrations.xml +10 -0
- package/android/.idea/misc.xml +10 -0
- package/android/.idea/runConfigurations.xml +17 -0
- package/android/.idea/vcs.xml +6 -0
- package/android/build/.transforms/101a0f3c1cbb0bc0a96b13b14ea5674e/results.bin +1 -0
- package/android/build/.transforms/101a0f3c1cbb0bc0a96b13b14ea5674e/transformed/classes/classes_dex/classes.dex +0 -0
- package/android/build/.transforms/10fbbfccaf4a64ec5b26f25e62756ce4/results.bin +1 -0
- package/android/build/.transforms/10fbbfccaf4a64ec5b26f25e62756ce4/transformed/classes/classes_dex/classes.dex +0 -0
- package/android/build/.transforms/24ed67b53a64c100db2f1ab2b51b1aff/results.bin +1 -0
- package/android/build/.transforms/24ed67b53a64c100db2f1ab2b51b1aff/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/getquip/nordic/BuildConfig.dex +0 -0
- package/android/build/.transforms/24ed67b53a64c100db2f1ab2b51b1aff/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/getquip/nordic/DfuService.dex +0 -0
- package/android/build/.transforms/24ed67b53a64c100db2f1ab2b51b1aff/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/getquip/nordic/ExpoNordicDfuModule$definition$1$1.dex +0 -0
- package/android/build/.transforms/24ed67b53a64c100db2f1ab2b51b1aff/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/getquip/nordic/ExpoNordicDfuModule$definition$1$2.dex +0 -0
- package/android/build/.transforms/24ed67b53a64c100db2f1ab2b51b1aff/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/getquip/nordic/ExpoNordicDfuModule$definition$lambda$8$$inlined$AsyncFunction$1.dex +0 -0
- package/android/build/.transforms/24ed67b53a64c100db2f1ab2b51b1aff/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/getquip/nordic/ExpoNordicDfuModule$definition$lambda$8$$inlined$AsyncFunction$2.dex +0 -0
- package/android/build/.transforms/24ed67b53a64c100db2f1ab2b51b1aff/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/getquip/nordic/ExpoNordicDfuModule$definition$lambda$8$$inlined$AsyncFunction$3.dex +0 -0
- package/android/build/.transforms/24ed67b53a64c100db2f1ab2b51b1aff/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/getquip/nordic/ExpoNordicDfuModule$definition$lambda$8$$inlined$AsyncFunctionWithPromise$1.dex +0 -0
- package/android/build/.transforms/24ed67b53a64c100db2f1ab2b51b1aff/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/getquip/nordic/ExpoNordicDfuModule$definition$lambda$8$$inlined$AsyncFunctionWithPromise$2.dex +0 -0
- package/android/build/.transforms/24ed67b53a64c100db2f1ab2b51b1aff/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/getquip/nordic/ExpoNordicDfuModule$definition$lambda$8$$inlined$AsyncFunctionWithPromise$3.dex +0 -0
- package/android/build/.transforms/24ed67b53a64c100db2f1ab2b51b1aff/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/getquip/nordic/ExpoNordicDfuModule$definition$lambda$8$$inlined$AsyncFunctionWithPromise$4.dex +0 -0
- package/android/build/.transforms/24ed67b53a64c100db2f1ab2b51b1aff/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/getquip/nordic/ExpoNordicDfuModule$definition$lambda$8$$inlined$AsyncFunctionWithPromise$5.dex +0 -0
- package/android/build/.transforms/24ed67b53a64c100db2f1ab2b51b1aff/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/getquip/nordic/ExpoNordicDfuModule$definition$lambda$8$$inlined$AsyncFunctionWithPromise$6.dex +0 -0
- package/android/build/.transforms/24ed67b53a64c100db2f1ab2b51b1aff/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/getquip/nordic/ExpoNordicDfuModule$dfuProgressListener$1.dex +0 -0
- package/android/build/.transforms/24ed67b53a64c100db2f1ab2b51b1aff/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/getquip/nordic/ExpoNordicDfuModule.dex +0 -0
- package/android/build/.transforms/24ed67b53a64c100db2f1ab2b51b1aff/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/getquip/nordic/NotificationActivity.dex +0 -0
- package/android/build/.transforms/24ed67b53a64c100db2f1ab2b51b1aff/transformed/bundleLibRuntimeToDirDebug/desugar_graph.bin +0 -0
- package/android/build/.transforms/3f9e9d2e8b81b6aa1c435113a221ed39/results.bin +1 -0
- package/android/build/.transforms/3f9e9d2e8b81b6aa1c435113a221ed39/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/getquip/nordic/BuildConfig.dex +0 -0
- package/android/build/.transforms/3f9e9d2e8b81b6aa1c435113a221ed39/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/getquip/nordic/DfuService.dex +0 -0
- package/android/build/.transforms/3f9e9d2e8b81b6aa1c435113a221ed39/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/getquip/nordic/NordicDfuModule$definition$1$1.dex +0 -0
- package/android/build/.transforms/3f9e9d2e8b81b6aa1c435113a221ed39/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/getquip/nordic/NordicDfuModule$definition$1$2.dex +0 -0
- package/android/build/.transforms/3f9e9d2e8b81b6aa1c435113a221ed39/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/getquip/nordic/NordicDfuModule$definition$lambda$8$$inlined$AsyncFunction$1.dex +0 -0
- package/android/build/.transforms/3f9e9d2e8b81b6aa1c435113a221ed39/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/getquip/nordic/NordicDfuModule$definition$lambda$8$$inlined$AsyncFunction$2.dex +0 -0
- package/android/build/.transforms/3f9e9d2e8b81b6aa1c435113a221ed39/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/getquip/nordic/NordicDfuModule$definition$lambda$8$$inlined$AsyncFunction$3.dex +0 -0
- package/android/build/.transforms/3f9e9d2e8b81b6aa1c435113a221ed39/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/getquip/nordic/NordicDfuModule$definition$lambda$8$$inlined$AsyncFunctionWithPromise$1.dex +0 -0
- package/android/build/.transforms/3f9e9d2e8b81b6aa1c435113a221ed39/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/getquip/nordic/NordicDfuModule$definition$lambda$8$$inlined$AsyncFunctionWithPromise$2.dex +0 -0
- package/android/build/.transforms/3f9e9d2e8b81b6aa1c435113a221ed39/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/getquip/nordic/NordicDfuModule$definition$lambda$8$$inlined$AsyncFunctionWithPromise$3.dex +0 -0
- package/android/build/.transforms/3f9e9d2e8b81b6aa1c435113a221ed39/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/getquip/nordic/NordicDfuModule$definition$lambda$8$$inlined$AsyncFunctionWithPromise$4.dex +0 -0
- package/android/build/.transforms/3f9e9d2e8b81b6aa1c435113a221ed39/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/getquip/nordic/NordicDfuModule$definition$lambda$8$$inlined$AsyncFunctionWithPromise$5.dex +0 -0
- package/android/build/.transforms/3f9e9d2e8b81b6aa1c435113a221ed39/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/getquip/nordic/NordicDfuModule$definition$lambda$8$$inlined$AsyncFunctionWithPromise$6.dex +0 -0
- package/android/build/.transforms/3f9e9d2e8b81b6aa1c435113a221ed39/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/getquip/nordic/NordicDfuModule$dfuProgressListener$1.dex +0 -0
- package/android/build/.transforms/3f9e9d2e8b81b6aa1c435113a221ed39/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/getquip/nordic/NordicDfuModule.dex +0 -0
- package/android/build/.transforms/3f9e9d2e8b81b6aa1c435113a221ed39/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/getquip/nordic/NotificationActivity.dex +0 -0
- package/android/build/.transforms/3f9e9d2e8b81b6aa1c435113a221ed39/transformed/bundleLibRuntimeToDirDebug/desugar_graph.bin +0 -0
- package/android/build/.transforms/412eeb48a8e50f46bc3ba54d3a3d875a/results.bin +1 -0
- package/android/build/.transforms/412eeb48a8e50f46bc3ba54d3a3d875a/transformed/classes/classes_dex/classes.dex +0 -0
- package/android/build/.transforms/842d309fd12a7374119e4f9b4300d4a5/results.bin +1 -0
- package/android/build/.transforms/842d309fd12a7374119e4f9b4300d4a5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/getquip/nordic/BuildConfig.dex +0 -0
- package/android/build/.transforms/842d309fd12a7374119e4f9b4300d4a5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/getquip/nordic/DfuService.dex +0 -0
- package/android/build/.transforms/842d309fd12a7374119e4f9b4300d4a5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/getquip/nordic/ExpoNordicDfuModule$definition$1$1.dex +0 -0
- package/android/build/.transforms/842d309fd12a7374119e4f9b4300d4a5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/getquip/nordic/ExpoNordicDfuModule$definition$1$2.dex +0 -0
- package/android/build/.transforms/842d309fd12a7374119e4f9b4300d4a5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/getquip/nordic/ExpoNordicDfuModule$definition$lambda$10$$inlined$AsyncFunction$1.dex +0 -0
- package/android/build/.transforms/842d309fd12a7374119e4f9b4300d4a5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/getquip/nordic/ExpoNordicDfuModule$definition$lambda$10$$inlined$AsyncFunction$2.dex +0 -0
- package/android/build/.transforms/842d309fd12a7374119e4f9b4300d4a5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/getquip/nordic/ExpoNordicDfuModule$definition$lambda$10$$inlined$AsyncFunction$3.dex +0 -0
- package/android/build/.transforms/842d309fd12a7374119e4f9b4300d4a5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/getquip/nordic/ExpoNordicDfuModule$definition$lambda$10$$inlined$AsyncFunctionWithPromise$1.dex +0 -0
- package/android/build/.transforms/842d309fd12a7374119e4f9b4300d4a5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/getquip/nordic/ExpoNordicDfuModule$definition$lambda$10$$inlined$AsyncFunctionWithPromise$2.dex +0 -0
- package/android/build/.transforms/842d309fd12a7374119e4f9b4300d4a5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/getquip/nordic/ExpoNordicDfuModule$definition$lambda$10$$inlined$AsyncFunctionWithPromise$3.dex +0 -0
- package/android/build/.transforms/842d309fd12a7374119e4f9b4300d4a5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/getquip/nordic/ExpoNordicDfuModule$definition$lambda$10$$inlined$AsyncFunctionWithPromise$4.dex +0 -0
- package/android/build/.transforms/842d309fd12a7374119e4f9b4300d4a5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/getquip/nordic/ExpoNordicDfuModule$definition$lambda$10$$inlined$AsyncFunctionWithPromise$5.dex +0 -0
- package/android/build/.transforms/842d309fd12a7374119e4f9b4300d4a5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/getquip/nordic/ExpoNordicDfuModule$definition$lambda$10$$inlined$AsyncFunctionWithPromise$6.dex +0 -0
- package/android/build/.transforms/842d309fd12a7374119e4f9b4300d4a5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/getquip/nordic/ExpoNordicDfuModule$definition$lambda$10$$inlined$AsyncFunctionWithPromise$7.dex +0 -0
- package/android/build/.transforms/842d309fd12a7374119e4f9b4300d4a5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/getquip/nordic/ExpoNordicDfuModule$definition$lambda$10$$inlined$AsyncFunctionWithPromise$8.dex +0 -0
- package/android/build/.transforms/842d309fd12a7374119e4f9b4300d4a5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/getquip/nordic/ExpoNordicDfuModule$dfuProgressListener$1.dex +0 -0
- package/android/build/.transforms/842d309fd12a7374119e4f9b4300d4a5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/getquip/nordic/ExpoNordicDfuModule.dex +0 -0
- package/android/build/.transforms/842d309fd12a7374119e4f9b4300d4a5/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/getquip/nordic/NotificationActivity.dex +0 -0
- package/android/build/.transforms/842d309fd12a7374119e4f9b4300d4a5/transformed/bundleLibRuntimeToDirDebug/desugar_graph.bin +0 -0
- package/android/build/generated/source/buildConfig/debug/com/getquip/nordic/BuildConfig.java +10 -0
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +14 -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/incremental/mergeDebugJniLibFolders/merger.xml +2 -0
- package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +2 -0
- package/android/build/intermediates/incremental/packageDebugAssets/merger.xml +2 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/getquip/nordic/BuildConfig.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 +19 -0
- package/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +14 -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/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/META-INF/getquip-expo-nordic-dfu_debug.kotlin_module +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/getquip/nordic/BuildConfig.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/getquip/nordic/DfuService.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/getquip/nordic/ExpoNordicDfuModule$definition$1$1.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/getquip/nordic/ExpoNordicDfuModule$definition$1$2.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/getquip/nordic/ExpoNordicDfuModule$definition$lambda$10$$inlined$AsyncFunction$1.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/getquip/nordic/ExpoNordicDfuModule$definition$lambda$10$$inlined$AsyncFunction$2.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/getquip/nordic/ExpoNordicDfuModule$definition$lambda$10$$inlined$AsyncFunction$3.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/getquip/nordic/ExpoNordicDfuModule$definition$lambda$10$$inlined$AsyncFunctionWithPromise$1.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/getquip/nordic/ExpoNordicDfuModule$definition$lambda$10$$inlined$AsyncFunctionWithPromise$2.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/getquip/nordic/ExpoNordicDfuModule$definition$lambda$10$$inlined$AsyncFunctionWithPromise$3.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/getquip/nordic/ExpoNordicDfuModule$definition$lambda$10$$inlined$AsyncFunctionWithPromise$4.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/getquip/nordic/ExpoNordicDfuModule$definition$lambda$10$$inlined$AsyncFunctionWithPromise$5.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/getquip/nordic/ExpoNordicDfuModule$definition$lambda$10$$inlined$AsyncFunctionWithPromise$6.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/getquip/nordic/ExpoNordicDfuModule$definition$lambda$10$$inlined$AsyncFunctionWithPromise$7.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/getquip/nordic/ExpoNordicDfuModule$definition$lambda$10$$inlined$AsyncFunctionWithPromise$8.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/getquip/nordic/ExpoNordicDfuModule$dfuProgressListener$1.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/getquip/nordic/ExpoNordicDfuModule.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/getquip/nordic/NotificationActivity.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 +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/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/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
- package/android/build/tmp/kotlin-classes/debug/META-INF/getquip-expo-nordic-dfu_debug.kotlin_module +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/getquip/nordic/DfuService.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/getquip/nordic/ExpoNordicDfuModule$definition$1$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/getquip/nordic/ExpoNordicDfuModule$definition$1$2.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/getquip/nordic/ExpoNordicDfuModule$definition$lambda$10$$inlined$AsyncFunction$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/getquip/nordic/ExpoNordicDfuModule$definition$lambda$10$$inlined$AsyncFunction$2.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/getquip/nordic/ExpoNordicDfuModule$definition$lambda$10$$inlined$AsyncFunction$3.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/getquip/nordic/ExpoNordicDfuModule$definition$lambda$10$$inlined$AsyncFunctionWithPromise$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/getquip/nordic/ExpoNordicDfuModule$definition$lambda$10$$inlined$AsyncFunctionWithPromise$2.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/getquip/nordic/ExpoNordicDfuModule$definition$lambda$10$$inlined$AsyncFunctionWithPromise$3.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/getquip/nordic/ExpoNordicDfuModule$definition$lambda$10$$inlined$AsyncFunctionWithPromise$4.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/getquip/nordic/ExpoNordicDfuModule$definition$lambda$10$$inlined$AsyncFunctionWithPromise$5.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/getquip/nordic/ExpoNordicDfuModule$definition$lambda$10$$inlined$AsyncFunctionWithPromise$6.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/getquip/nordic/ExpoNordicDfuModule$definition$lambda$10$$inlined$AsyncFunctionWithPromise$7.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/getquip/nordic/ExpoNordicDfuModule$definition$lambda$10$$inlined$AsyncFunctionWithPromise$8.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/getquip/nordic/ExpoNordicDfuModule$dfuProgressListener$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/getquip/nordic/ExpoNordicDfuModule.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/getquip/nordic/NotificationActivity.class +0 -0
- package/android/build.gradle +55 -0
- package/android/src/main/AndroidManifest.xml +11 -0
- package/android/src/main/java/com/getquip/nordic/DfuService.kt +41 -0
- package/android/src/main/java/com/getquip/nordic/ExpoNordicDfuModule.kt +200 -0
- package/android/src/main/java/com/getquip/nordic/NotificationActivity.kt +25 -0
- package/build/ExpoNordicDfu.types.d.ts +32 -0
- package/build/ExpoNordicDfu.types.d.ts.map +1 -0
- package/build/ExpoNordicDfu.types.js +2 -0
- package/build/ExpoNordicDfu.types.js.map +1 -0
- package/build/ExpoNordicDfuModule.d.ts +18 -0
- package/build/ExpoNordicDfuModule.d.ts.map +1 -0
- package/build/ExpoNordicDfuModule.js +31 -0
- package/build/ExpoNordicDfuModule.js.map +1 -0
- package/build/index.d.ts +3 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +6 -0
- package/build/index.js.map +1 -0
- package/example/.env.example +2 -0
- package/example/.nvmrc +1 -0
- package/example/App.tsx +372 -0
- package/example/android/app/build.gradle +176 -0
- package/example/android/app/debug.keystore +0 -0
- package/example/android/app/proguard-rules.pro +14 -0
- package/example/android/app/src/debug/AndroidManifest.xml +7 -0
- package/example/android/app/src/main/AndroidManifest.xml +40 -0
- package/example/android/app/src/main/java/expo/modules/nordicdfu/example/MainActivity.kt +61 -0
- package/example/android/app/src/main/java/expo/modules/nordicdfu/example/MainApplication.kt +57 -0
- package/example/android/app/src/main/res/drawable/ic_launcher_background.xml +6 -0
- package/example/android/app/src/main/res/drawable/rn_edit_text_material.xml +37 -0
- package/example/android/app/src/main/res/drawable-hdpi/splashscreen_logo.png +0 -0
- package/example/android/app/src/main/res/drawable-mdpi/splashscreen_logo.png +0 -0
- package/example/android/app/src/main/res/drawable-xhdpi/splashscreen_logo.png +0 -0
- package/example/android/app/src/main/res/drawable-xxhdpi/splashscreen_logo.png +0 -0
- package/example/android/app/src/main/res/drawable-xxxhdpi/splashscreen_logo.png +0 -0
- package/example/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +5 -0
- package/example/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +5 -0
- package/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.webp +0 -0
- package/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.webp +0 -0
- package/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp +0 -0
- package/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.webp +0 -0
- package/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.webp +0 -0
- package/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp +0 -0
- package/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.webp +0 -0
- package/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.webp +0 -0
- package/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp +0 -0
- package/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp +0 -0
- package/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.webp +0 -0
- package/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp +0 -0
- package/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp +0 -0
- package/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.webp +0 -0
- package/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp +0 -0
- package/example/android/app/src/main/res/values/colors.xml +6 -0
- package/example/android/app/src/main/res/values/strings.xml +5 -0
- package/example/android/app/src/main/res/values/styles.xml +17 -0
- package/example/android/app/src/main/res/values-night/colors.xml +1 -0
- package/example/android/build.gradle +41 -0
- package/example/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/example/android/gradle/wrapper/gradle-wrapper.properties +7 -0
- package/example/android/gradle.properties +56 -0
- package/example/android/gradlew +252 -0
- package/example/android/gradlew.bat +94 -0
- package/example/android/settings.gradle +38 -0
- package/example/app.json +54 -0
- package/example/assets/adaptive-icon.png +0 -0
- package/example/assets/favicon.png +0 -0
- package/example/assets/icon.png +0 -0
- package/example/assets/splash-icon.png +0 -0
- package/example/babel.config.js +6 -0
- package/example/index.ts +8 -0
- package/example/ios/.xcode.env +11 -0
- package/example/ios/Podfile +66 -0
- package/example/ios/Podfile.lock +1944 -0
- package/example/ios/Podfile.properties.json +5 -0
- package/example/ios/exponordicdfuexample/AppDelegate.h +7 -0
- package/example/ios/exponordicdfuexample/AppDelegate.mm +62 -0
- package/example/ios/exponordicdfuexample/Images.xcassets/AppIcon.appiconset/App-Icon-1024x1024@1x.png +0 -0
- package/example/ios/exponordicdfuexample/Images.xcassets/AppIcon.appiconset/Contents.json +14 -0
- package/example/ios/exponordicdfuexample/Images.xcassets/Contents.json +6 -0
- package/example/ios/exponordicdfuexample/Images.xcassets/SplashScreenBackground.colorset/Contents.json +20 -0
- package/example/ios/exponordicdfuexample/Images.xcassets/SplashScreenLogo.imageset/Contents.json +23 -0
- package/example/ios/exponordicdfuexample/Images.xcassets/SplashScreenLogo.imageset/image.png +0 -0
- package/example/ios/exponordicdfuexample/Images.xcassets/SplashScreenLogo.imageset/image@2x.png +0 -0
- package/example/ios/exponordicdfuexample/Images.xcassets/SplashScreenLogo.imageset/image@3x.png +0 -0
- package/example/ios/exponordicdfuexample/Info.plist +76 -0
- package/example/ios/exponordicdfuexample/PrivacyInfo.xcprivacy +48 -0
- package/example/ios/exponordicdfuexample/SplashScreen.storyboard +44 -0
- package/example/ios/exponordicdfuexample/Supporting/Expo.plist +12 -0
- package/example/ios/exponordicdfuexample/exponordicdfuexample-Bridging-Header.h +3 -0
- package/example/ios/exponordicdfuexample/exponordicdfuexample.entitlements +5 -0
- package/example/ios/exponordicdfuexample/main.m +10 -0
- package/example/ios/exponordicdfuexample/noop-file.swift +4 -0
- package/example/ios/exponordicdfuexample.xcodeproj/project.pbxproj +544 -0
- package/example/ios/exponordicdfuexample.xcodeproj/xcshareddata/xcschemes/exponordicdfuexample.xcscheme +88 -0
- package/example/ios/exponordicdfuexample.xcworkspace/contents.xcworkspacedata +10 -0
- package/example/metro.config.js +34 -0
- package/example/package-lock.json +11069 -0
- package/example/package.json +31 -0
- package/example/tsconfig.json +10 -0
- package/example/webpack.config.js +20 -0
- package/expo-module.config.json +16 -0
- package/ios/ExpoNordicDfu.podspec +27 -0
- package/ios/ExpoNordicDfuModule.swift +168 -0
- package/package.json +64 -0
- package/src/ExpoNordicDfu.types.ts +38 -0
- package/src/ExpoNordicDfuModule.ts +73 -0
- package/src/index.ts +5 -0
- package/tsconfig.json +9 -0
package/example/App.tsx
ADDED
|
@@ -0,0 +1,372 @@
|
|
|
1
|
+
import ExpoNordicDfu from 'expo-nordic-dfu';
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import { Alert, KeyboardAvoidingView, PermissionsAndroid, Platform, SafeAreaView, ScrollView, TouchableOpacity, View, ViewStyle } from 'react-native';
|
|
4
|
+
import BleManager, { Peripheral } from 'react-native-ble-manager'
|
|
5
|
+
import { Text, Button } from 'react-native-paper'
|
|
6
|
+
import * as DocumentPicker from 'expo-document-picker';
|
|
7
|
+
import * as FileSystem from 'expo-file-system';
|
|
8
|
+
|
|
9
|
+
const SERVICE_UUIDS = process.env.EXPO_PUBLIC_BLUETOOTH_SERVICE_UUIDS.split(',').map((uuid: string) => uuid.trim())
|
|
10
|
+
const ANDROID_BONDING_ENABLED = process.env.EXPO_PUBLIC_ANDROID_BONDING_ENABLED === 'true'
|
|
11
|
+
const SELECTION_COLORS = {
|
|
12
|
+
none: '#ffffff',
|
|
13
|
+
disabled: '#e0e0e0',
|
|
14
|
+
connected: '#8ec781',
|
|
15
|
+
connecting: '#ede598',
|
|
16
|
+
error: '#ff0000',
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
let bleInitialized = false
|
|
20
|
+
const bleManagerInitialize = async () => {
|
|
21
|
+
if (bleInitialized) {
|
|
22
|
+
return true
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const initializing = (async () => {
|
|
26
|
+
try {
|
|
27
|
+
await BleManager.start({ showAlert: true })
|
|
28
|
+
bleInitialized = true
|
|
29
|
+
console.info('BleManager started')
|
|
30
|
+
return true
|
|
31
|
+
} catch (error) {
|
|
32
|
+
console.error('Unexpected error starting BleManager', error)
|
|
33
|
+
return false
|
|
34
|
+
}
|
|
35
|
+
})()
|
|
36
|
+
|
|
37
|
+
return await initializing
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function sleep(ms: number) {
|
|
41
|
+
return new Promise<void>((resolve) => setTimeout(resolve, ms))
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
type FirmwareFileType = {
|
|
45
|
+
uri: string
|
|
46
|
+
name: string
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
type ProgressType = {
|
|
50
|
+
state?: string
|
|
51
|
+
avgSpeed?: number
|
|
52
|
+
currentPart?: number,
|
|
53
|
+
partsTotal?: number,
|
|
54
|
+
percent?: number,
|
|
55
|
+
speed?: number,
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export default function App() {
|
|
59
|
+
const [peripherals, setPeripherals] = useState<Peripheral[]>([])
|
|
60
|
+
const [peripheral, setPeripheral] = useState<Peripheral>()
|
|
61
|
+
const [firmwareFile, setFirmwareFile] = useState<FirmwareFileType | false>()
|
|
62
|
+
const [selectedColor, setSelectedColor] = useState<string>(SELECTION_COLORS.none)
|
|
63
|
+
const [firmwareProgress, setFirmwareProgress] = useState<ProgressType | undefined>(undefined)
|
|
64
|
+
const [isScanning, setIsScanning] = useState<boolean | undefined>(undefined)
|
|
65
|
+
|
|
66
|
+
const processScanning = (peripheral: Peripheral) => {
|
|
67
|
+
setPeripherals((peripherals) => {
|
|
68
|
+
return !peripherals.find((p) => p.id === peripheral.id) ? [...peripherals, peripheral] : peripherals
|
|
69
|
+
})
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
useEffect(() => {
|
|
73
|
+
void bleManagerInitialize()
|
|
74
|
+
const discoverListener = BleManager.onDiscoverPeripheral(processScanning)
|
|
75
|
+
const onStopScanListener = BleManager.onStopScan(() => setIsScanning(false))
|
|
76
|
+
|
|
77
|
+
return () => {
|
|
78
|
+
discoverListener.remove();
|
|
79
|
+
onStopScanListener.remove();
|
|
80
|
+
};
|
|
81
|
+
}, [])
|
|
82
|
+
|
|
83
|
+
useEffect(() => {
|
|
84
|
+
if(peripheral && selectedColor === SELECTION_COLORS.connecting) {
|
|
85
|
+
void connect()
|
|
86
|
+
}
|
|
87
|
+
}, [selectedColor, peripheral])
|
|
88
|
+
|
|
89
|
+
if (Platform.OS === 'android') {
|
|
90
|
+
PermissionsAndroid.requestMultiple([
|
|
91
|
+
PermissionsAndroid.PERMISSIONS.BLUETOOTH_SCAN,
|
|
92
|
+
PermissionsAndroid.PERMISSIONS.BLUETOOTH_CONNECT,
|
|
93
|
+
PermissionsAndroid.PERMISSIONS.BLUETOOTH_ADVERTISE,
|
|
94
|
+
]).then((result) => {
|
|
95
|
+
if (result) {
|
|
96
|
+
console.debug('User accepts Bluetooth permissions')
|
|
97
|
+
} else {
|
|
98
|
+
console.error('User refuses Bluetooth permissions')
|
|
99
|
+
Alert.alert(
|
|
100
|
+
'Accept Permissions',
|
|
101
|
+
'You have to accept Bluetooth permissions to use this app',
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
})
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
const firmwareDisableButtons = firmwareProgress !== undefined && firmwareProgress.state !== 'DEVICE_DISCONNECTED' && firmwareProgress.state !== 'DFU_FAILED' && firmwareProgress.state !== 'DFU_COMPLETED' && firmwareProgress.state !== 'DFU_ABORTED'
|
|
108
|
+
|
|
109
|
+
const backgroundColor = (selected: Peripheral) => {
|
|
110
|
+
const isSelected = selected.id === peripheral?.id
|
|
111
|
+
const isConnecting = selectedColor === SELECTION_COLORS.connecting
|
|
112
|
+
if (isConnecting && !isSelected) {
|
|
113
|
+
return SELECTION_COLORS.disabled
|
|
114
|
+
} else if (isSelected) {
|
|
115
|
+
return selectedColor
|
|
116
|
+
} else {
|
|
117
|
+
return SELECTION_COLORS.none
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
const reset = async (peripheral: Peripheral | undefined) => {
|
|
122
|
+
if (peripheral) {
|
|
123
|
+
await BleManager.disconnect(peripheral.id)
|
|
124
|
+
}
|
|
125
|
+
setPeripherals([])
|
|
126
|
+
setPeripheral(undefined)
|
|
127
|
+
setFirmwareProgress(undefined)
|
|
128
|
+
setFirmwareFile(undefined)
|
|
129
|
+
setIsScanning(undefined)
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
const scan = async () => {
|
|
133
|
+
await reset(peripheral)
|
|
134
|
+
try {
|
|
135
|
+
await BleManager.scan(SERVICE_UUIDS, 5, false)
|
|
136
|
+
setIsScanning(true)
|
|
137
|
+
} catch (error) {
|
|
138
|
+
await BleManager.stopScan()
|
|
139
|
+
throw error
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
const handleConnect = (peripheral: Peripheral) => {
|
|
144
|
+
setSelectedColor(SELECTION_COLORS.connecting)
|
|
145
|
+
setPeripheral(peripheral)
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
const connect = async () => {
|
|
149
|
+
if (!peripheral) {
|
|
150
|
+
console.error('No peripheral selected')
|
|
151
|
+
return
|
|
152
|
+
}
|
|
153
|
+
try {
|
|
154
|
+
await BleManager.connect(peripheral.id)
|
|
155
|
+
|
|
156
|
+
if (Platform.OS === 'android' && ANDROID_BONDING_ENABLED) {
|
|
157
|
+
console.debug(`${peripheral.id}] createBond`)
|
|
158
|
+
try {
|
|
159
|
+
await BleManager.createBond(peripheral.id)
|
|
160
|
+
console.debug(`${peripheral.id}] createBond success or there is already an existing one`)
|
|
161
|
+
} catch (e) {
|
|
162
|
+
console.warn(`${peripheral.id}] createBond failed:`, e)
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
// before retrieving services, it is often a good idea to let bonding & connection finish properly
|
|
166
|
+
// See https://github.com/innoveit/react-native-ble-manager/blob/d7613a48ff201914f4a91d7167f35d615ce0d24a/example/components/ScanDevicesScreen.tsx#L276 for context
|
|
167
|
+
await sleep(900)
|
|
168
|
+
|
|
169
|
+
await BleManager.retrieveServices(peripheral.id)
|
|
170
|
+
setPeripheral(peripheral)
|
|
171
|
+
setSelectedColor(SELECTION_COLORS.connected)
|
|
172
|
+
console.debug(`${peripheral.id}] Connected to ${peripheral.name}`)
|
|
173
|
+
} catch (error) {
|
|
174
|
+
console.error('Connection error', error)
|
|
175
|
+
setSelectedColor(SELECTION_COLORS.error)
|
|
176
|
+
setPeripheral(undefined)
|
|
177
|
+
throw error
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
const handleFileSelect = async (): Promise<void> => {
|
|
182
|
+
try {
|
|
183
|
+
const result = await DocumentPicker.getDocumentAsync({
|
|
184
|
+
type: [
|
|
185
|
+
'binary/octet-stream',
|
|
186
|
+
'application/octet-stream',
|
|
187
|
+
'application/zip',
|
|
188
|
+
'application/x-zip-compressed',
|
|
189
|
+
],
|
|
190
|
+
copyToCacheDirectory: true,
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
if (!result.canceled && result.assets && result.assets.length > 0) {
|
|
194
|
+
const file = result.assets[0];
|
|
195
|
+
|
|
196
|
+
if (!file.name.toLowerCase().endsWith('.zip')) {
|
|
197
|
+
Alert.alert(
|
|
198
|
+
'Invalid File',
|
|
199
|
+
'Please select a valid firmware (.zip) file',
|
|
200
|
+
);
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
const fileInfo = await FileSystem.getInfoAsync(file.uri);
|
|
205
|
+
if (!fileInfo.exists) {
|
|
206
|
+
throw new Error('File does not exist');
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
console.debug('File selected:', file);
|
|
210
|
+
setFirmwareFile({
|
|
211
|
+
uri: file.uri,
|
|
212
|
+
name: file.name,
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
} catch (err) {
|
|
216
|
+
console.error('File select error', err);
|
|
217
|
+
Alert.alert('Error', 'Check your file and try again');
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
const startDFU = async (peripheral: Peripheral, firmwareFile: FirmwareFileType) => {
|
|
222
|
+
try {
|
|
223
|
+
ExpoNordicDfu.module.addListener('DFUProgress', (progress) => {
|
|
224
|
+
console.info('DFUProgress:', progress)
|
|
225
|
+
setFirmwareProgress({ ...progress, state: 'Updating...' })
|
|
226
|
+
})
|
|
227
|
+
ExpoNordicDfu.module.addListener('DFUStateChanged', ({ state }) => {
|
|
228
|
+
console.info('DFUStateChanged:', state)
|
|
229
|
+
setFirmwareProgress({ state, ...firmwareProgress })
|
|
230
|
+
})
|
|
231
|
+
await ExpoNordicDfu.startDfu({
|
|
232
|
+
deviceAddress: peripheral.id,
|
|
233
|
+
fileUri: firmwareFile.uri,
|
|
234
|
+
// These optional values are set to useful values for quip.
|
|
235
|
+
// Change them to your needs.
|
|
236
|
+
packetReceiptNotificationParameter: 2,
|
|
237
|
+
android: {
|
|
238
|
+
deviceName: peripheral.name,
|
|
239
|
+
},
|
|
240
|
+
})
|
|
241
|
+
} catch (error) {
|
|
242
|
+
console.error(error)
|
|
243
|
+
} finally {
|
|
244
|
+
ExpoNordicDfu.module.removeAllListeners('DFUProgress')
|
|
245
|
+
ExpoNordicDfu.module.removeAllListeners('DFUStateChanged')
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
const abortDFU = async () => {
|
|
250
|
+
try {
|
|
251
|
+
await ExpoNordicDfu.abortDfu()
|
|
252
|
+
setFirmwareProgress({ state: 'DFU_ABORTED' })
|
|
253
|
+
} catch (error) {
|
|
254
|
+
console.error(error)
|
|
255
|
+
} finally {
|
|
256
|
+
ExpoNordicDfu.module.removeAllListeners('DFUProgress')
|
|
257
|
+
ExpoNordicDfu.module.removeAllListeners('DFUStateChanged')
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
return (
|
|
262
|
+
<SafeAreaView style={styles.container} >
|
|
263
|
+
<KeyboardAvoidingView style={styles.container} behavior={Platform.OS === 'ios' ? 'padding' : 'height'}>
|
|
264
|
+
<ScrollView contentContainerStyle={{ minHeight: '100%', width: '100%' }}>
|
|
265
|
+
<View style={styles.view}>
|
|
266
|
+
<Text variant="headlineLarge">Nordic DFU Example App</Text>
|
|
267
|
+
<Button disabled={firmwareDisableButtons || isScanning} mode="contained" onPress={scan}>
|
|
268
|
+
Scan for Devices
|
|
269
|
+
</Button>
|
|
270
|
+
{isScanning === false && peripherals.length === 0 && <Text>No devices found</Text>}
|
|
271
|
+
{peripherals.length > 0 && <Text>Click one of the following devices to connect and pair:</Text>}
|
|
272
|
+
{[...peripherals].map((peripheral) => (
|
|
273
|
+
<TouchableOpacity
|
|
274
|
+
disabled={selectedColor === SELECTION_COLORS.connecting || firmwareDisableButtons}
|
|
275
|
+
style={{ ...styles.touchable, backgroundColor: backgroundColor(peripheral) }}
|
|
276
|
+
key={peripheral.id}
|
|
277
|
+
onPress={() => handleConnect(peripheral)}
|
|
278
|
+
>
|
|
279
|
+
<Text>ID: {peripheral.id}</Text>
|
|
280
|
+
{peripheral.name && (<Text>Name: {peripheral.name}</Text>)}
|
|
281
|
+
<Text>RSSI: {peripheral.rssi}</Text>
|
|
282
|
+
<Text>Advertising Data: {JSON.stringify({
|
|
283
|
+
isConnectable: peripheral.advertising.isConnectable,
|
|
284
|
+
localName: peripheral.advertising.localName,
|
|
285
|
+
serviceData: peripheral.advertising.serviceData,
|
|
286
|
+
serviceUUIDs: peripheral.advertising.serviceUUIDs,
|
|
287
|
+
txPowerLevel: peripheral.advertising.txPowerLevel,
|
|
288
|
+
})}</Text>
|
|
289
|
+
<Text>Manufacturing Data: {JSON.stringify(peripheral.advertising.manufacturerData)}</Text>
|
|
290
|
+
</TouchableOpacity>
|
|
291
|
+
))}
|
|
292
|
+
{peripheral && selectedColor === SELECTION_COLORS.connected && (
|
|
293
|
+
<Button disabled={firmwareDisableButtons} mode="contained" onPress={handleFileSelect}>
|
|
294
|
+
Select Firmware File
|
|
295
|
+
</Button>
|
|
296
|
+
)}
|
|
297
|
+
{firmwareProgress && (
|
|
298
|
+
<View>
|
|
299
|
+
<Text>DFU State: {firmwareProgress.state}</Text>
|
|
300
|
+
<Text>DFU Percent Done: {firmwareProgress.percent}</Text>
|
|
301
|
+
<Text>DFU Current Part: {firmwareProgress.currentPart}</Text>
|
|
302
|
+
<Text>DFU Total Parts: {firmwareProgress.partsTotal}</Text>
|
|
303
|
+
<Text>DFU Current Speed: {firmwareProgress.speed}</Text>
|
|
304
|
+
<Text>DFU Average Speed: {firmwareProgress.avgSpeed}</Text>
|
|
305
|
+
</View>)}
|
|
306
|
+
{peripheral && selectedColor === SELECTION_COLORS.connected && firmwareFile && !firmwareDisableButtons && (
|
|
307
|
+
<Button
|
|
308
|
+
mode="contained"
|
|
309
|
+
onPress={() => {
|
|
310
|
+
startDFU(peripheral, firmwareFile)
|
|
311
|
+
}}
|
|
312
|
+
>
|
|
313
|
+
Start DFU
|
|
314
|
+
</Button>
|
|
315
|
+
)}
|
|
316
|
+
{firmwareDisableButtons && (
|
|
317
|
+
<Button
|
|
318
|
+
mode="contained-tonal"
|
|
319
|
+
onPress={() => {
|
|
320
|
+
abortDFU()
|
|
321
|
+
}}
|
|
322
|
+
>
|
|
323
|
+
Abort DFU
|
|
324
|
+
</Button>
|
|
325
|
+
)}
|
|
326
|
+
{peripheral && selectedColor === SELECTION_COLORS.connected && (
|
|
327
|
+
<Button
|
|
328
|
+
disabled={firmwareDisableButtons}
|
|
329
|
+
mode="contained-tonal"
|
|
330
|
+
onPress={() => {
|
|
331
|
+
reset(peripheral)
|
|
332
|
+
}}
|
|
333
|
+
>
|
|
334
|
+
Disconnect
|
|
335
|
+
</Button>
|
|
336
|
+
)}
|
|
337
|
+
</View>
|
|
338
|
+
</ScrollView>
|
|
339
|
+
</KeyboardAvoidingView>
|
|
340
|
+
</SafeAreaView>
|
|
341
|
+
);
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
const styles: { [key: string]: ViewStyle } = {
|
|
345
|
+
container: {
|
|
346
|
+
backgroundColor: '#eee',
|
|
347
|
+
flex: 1,
|
|
348
|
+
height: '100%',
|
|
349
|
+
width: '100%',
|
|
350
|
+
},
|
|
351
|
+
touchable: {
|
|
352
|
+
borderColor: '#000',
|
|
353
|
+
borderRadius: 5,
|
|
354
|
+
borderWidth: 1,
|
|
355
|
+
flex: 1,
|
|
356
|
+
flexDirection: 'column',
|
|
357
|
+
flexGrow: 0,
|
|
358
|
+
gap: 2,
|
|
359
|
+
justifyContent: 'center',
|
|
360
|
+
padding: 10,
|
|
361
|
+
},
|
|
362
|
+
view: {
|
|
363
|
+
flex: 1,
|
|
364
|
+
flexDirection: 'column',
|
|
365
|
+
gap: 20,
|
|
366
|
+
height: '100%',
|
|
367
|
+
justifyContent: 'center',
|
|
368
|
+
marginBottom: 200,
|
|
369
|
+
padding: 20,
|
|
370
|
+
width: '100%',
|
|
371
|
+
},
|
|
372
|
+
};
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
apply plugin: "com.android.application"
|
|
2
|
+
apply plugin: "org.jetbrains.kotlin.android"
|
|
3
|
+
apply plugin: "com.facebook.react"
|
|
4
|
+
|
|
5
|
+
def projectRoot = rootDir.getAbsoluteFile().getParentFile().getAbsolutePath()
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* This is the configuration block to customize your React Native Android app.
|
|
9
|
+
* By default you don't need to apply any configuration, just uncomment the lines you need.
|
|
10
|
+
*/
|
|
11
|
+
react {
|
|
12
|
+
entryFile = file(["node", "-e", "require('expo/scripts/resolveAppEntry')", projectRoot, "android", "absolute"].execute(null, rootDir).text.trim())
|
|
13
|
+
reactNativeDir = new File(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim()).getParentFile().getAbsoluteFile()
|
|
14
|
+
hermesCommand = new File(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim()).getParentFile().getAbsolutePath() + "/sdks/hermesc/%OS-BIN%/hermesc"
|
|
15
|
+
codegenDir = new File(["node", "--print", "require.resolve('@react-native/codegen/package.json', { paths: [require.resolve('react-native/package.json')] })"].execute(null, rootDir).text.trim()).getParentFile().getAbsoluteFile()
|
|
16
|
+
|
|
17
|
+
// Use Expo CLI to bundle the app, this ensures the Metro config
|
|
18
|
+
// works correctly with Expo projects.
|
|
19
|
+
cliFile = new File(["node", "--print", "require.resolve('@expo/cli', { paths: [require.resolve('expo/package.json')] })"].execute(null, rootDir).text.trim())
|
|
20
|
+
bundleCommand = "export:embed"
|
|
21
|
+
|
|
22
|
+
/* Folders */
|
|
23
|
+
// The root of your project, i.e. where "package.json" lives. Default is '../..'
|
|
24
|
+
// root = file("../../")
|
|
25
|
+
// The folder where the react-native NPM package is. Default is ../../node_modules/react-native
|
|
26
|
+
// reactNativeDir = file("../../node_modules/react-native")
|
|
27
|
+
// The folder where the react-native Codegen package is. Default is ../../node_modules/@react-native/codegen
|
|
28
|
+
// codegenDir = file("../../node_modules/@react-native/codegen")
|
|
29
|
+
|
|
30
|
+
/* Variants */
|
|
31
|
+
// The list of variants to that are debuggable. For those we're going to
|
|
32
|
+
// skip the bundling of the JS bundle and the assets. By default is just 'debug'.
|
|
33
|
+
// If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants.
|
|
34
|
+
// debuggableVariants = ["liteDebug", "prodDebug"]
|
|
35
|
+
|
|
36
|
+
/* Bundling */
|
|
37
|
+
// A list containing the node command and its flags. Default is just 'node'.
|
|
38
|
+
// nodeExecutableAndArgs = ["node"]
|
|
39
|
+
|
|
40
|
+
//
|
|
41
|
+
// The path to the CLI configuration file. Default is empty.
|
|
42
|
+
// bundleConfig = file(../rn-cli.config.js)
|
|
43
|
+
//
|
|
44
|
+
// The name of the generated asset file containing your JS bundle
|
|
45
|
+
// bundleAssetName = "MyApplication.android.bundle"
|
|
46
|
+
//
|
|
47
|
+
// The entry file for bundle generation. Default is 'index.android.js' or 'index.js'
|
|
48
|
+
// entryFile = file("../js/MyApplication.android.js")
|
|
49
|
+
//
|
|
50
|
+
// A list of extra flags to pass to the 'bundle' commands.
|
|
51
|
+
// See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle
|
|
52
|
+
// extraPackagerArgs = []
|
|
53
|
+
|
|
54
|
+
/* Hermes Commands */
|
|
55
|
+
// The hermes compiler command to run. By default it is 'hermesc'
|
|
56
|
+
// hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc"
|
|
57
|
+
//
|
|
58
|
+
// The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
|
|
59
|
+
// hermesFlags = ["-O", "-output-source-map"]
|
|
60
|
+
|
|
61
|
+
/* Autolinking */
|
|
62
|
+
autolinkLibrariesWithApp()
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Set this to true to Run Proguard on Release builds to minify the Java bytecode.
|
|
67
|
+
*/
|
|
68
|
+
def enableProguardInReleaseBuilds = (findProperty('android.enableProguardInReleaseBuilds') ?: false).toBoolean()
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* The preferred build flavor of JavaScriptCore (JSC)
|
|
72
|
+
*
|
|
73
|
+
* For example, to use the international variant, you can use:
|
|
74
|
+
* `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
|
|
75
|
+
*
|
|
76
|
+
* The international variant includes ICU i18n library and necessary data
|
|
77
|
+
* allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
|
|
78
|
+
* give correct results when using with locales other than en-US. Note that
|
|
79
|
+
* this variant is about 6MiB larger per architecture than default.
|
|
80
|
+
*/
|
|
81
|
+
def jscFlavor = 'org.webkit:android-jsc:+'
|
|
82
|
+
|
|
83
|
+
android {
|
|
84
|
+
ndkVersion rootProject.ext.ndkVersion
|
|
85
|
+
|
|
86
|
+
buildToolsVersion rootProject.ext.buildToolsVersion
|
|
87
|
+
compileSdk rootProject.ext.compileSdkVersion
|
|
88
|
+
|
|
89
|
+
namespace 'expo.modules.nordicdfu.example'
|
|
90
|
+
defaultConfig {
|
|
91
|
+
applicationId 'expo.modules.nordicdfu.example'
|
|
92
|
+
minSdkVersion rootProject.ext.minSdkVersion
|
|
93
|
+
targetSdkVersion rootProject.ext.targetSdkVersion
|
|
94
|
+
versionCode 1
|
|
95
|
+
versionName "1.0.0"
|
|
96
|
+
}
|
|
97
|
+
signingConfigs {
|
|
98
|
+
debug {
|
|
99
|
+
storeFile file('debug.keystore')
|
|
100
|
+
storePassword 'android'
|
|
101
|
+
keyAlias 'androiddebugkey'
|
|
102
|
+
keyPassword 'android'
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
buildTypes {
|
|
106
|
+
debug {
|
|
107
|
+
signingConfig signingConfigs.debug
|
|
108
|
+
}
|
|
109
|
+
release {
|
|
110
|
+
// Caution! In production, you need to generate your own keystore file.
|
|
111
|
+
// see https://reactnative.dev/docs/signed-apk-android.
|
|
112
|
+
signingConfig signingConfigs.debug
|
|
113
|
+
shrinkResources (findProperty('android.enableShrinkResourcesInReleaseBuilds')?.toBoolean() ?: false)
|
|
114
|
+
minifyEnabled enableProguardInReleaseBuilds
|
|
115
|
+
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
|
|
116
|
+
crunchPngs (findProperty('android.enablePngCrunchInReleaseBuilds')?.toBoolean() ?: true)
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
packagingOptions {
|
|
120
|
+
jniLibs {
|
|
121
|
+
useLegacyPackaging (findProperty('expo.useLegacyPackaging')?.toBoolean() ?: false)
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
androidResources {
|
|
125
|
+
ignoreAssetsPattern '!.svn:!.git:!.ds_store:!*.scc:!CVS:!thumbs.db:!picasa.ini:!*~'
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// Apply static values from `gradle.properties` to the `android.packagingOptions`
|
|
130
|
+
// Accepts values in comma delimited lists, example:
|
|
131
|
+
// android.packagingOptions.pickFirsts=/LICENSE,**/picasa.ini
|
|
132
|
+
["pickFirsts", "excludes", "merges", "doNotStrip"].each { prop ->
|
|
133
|
+
// Split option: 'foo,bar' -> ['foo', 'bar']
|
|
134
|
+
def options = (findProperty("android.packagingOptions.$prop") ?: "").split(",");
|
|
135
|
+
// Trim all elements in place.
|
|
136
|
+
for (i in 0..<options.size()) options[i] = options[i].trim();
|
|
137
|
+
// `[] - ""` is essentially `[""].filter(Boolean)` removing all empty strings.
|
|
138
|
+
options -= ""
|
|
139
|
+
|
|
140
|
+
if (options.length > 0) {
|
|
141
|
+
println "android.packagingOptions.$prop += $options ($options.length)"
|
|
142
|
+
// Ex: android.packagingOptions.pickFirsts += '**/SCCS/**'
|
|
143
|
+
options.each {
|
|
144
|
+
android.packagingOptions[prop] += it
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
dependencies {
|
|
150
|
+
// The version of react-native is set by the React Native Gradle Plugin
|
|
151
|
+
implementation("com.facebook.react:react-android")
|
|
152
|
+
|
|
153
|
+
def isGifEnabled = (findProperty('expo.gif.enabled') ?: "") == "true";
|
|
154
|
+
def isWebpEnabled = (findProperty('expo.webp.enabled') ?: "") == "true";
|
|
155
|
+
def isWebpAnimatedEnabled = (findProperty('expo.webp.animated') ?: "") == "true";
|
|
156
|
+
|
|
157
|
+
if (isGifEnabled) {
|
|
158
|
+
// For animated gif support
|
|
159
|
+
implementation("com.facebook.fresco:animated-gif:${reactAndroidLibs.versions.fresco.get()}")
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
if (isWebpEnabled) {
|
|
163
|
+
// For webp support
|
|
164
|
+
implementation("com.facebook.fresco:webpsupport:${reactAndroidLibs.versions.fresco.get()}")
|
|
165
|
+
if (isWebpAnimatedEnabled) {
|
|
166
|
+
// Animated webp support
|
|
167
|
+
implementation("com.facebook.fresco:animated-webp:${reactAndroidLibs.versions.fresco.get()}")
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
if (hermesEnabled.toBoolean()) {
|
|
172
|
+
implementation("com.facebook.react:hermes-android")
|
|
173
|
+
} else {
|
|
174
|
+
implementation jscFlavor
|
|
175
|
+
}
|
|
176
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Add project specific ProGuard rules here.
|
|
2
|
+
# By default, the flags in this file are appended to flags specified
|
|
3
|
+
# in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt
|
|
4
|
+
# You can edit the include path and order by changing the proguardFiles
|
|
5
|
+
# directive in build.gradle.
|
|
6
|
+
#
|
|
7
|
+
# For more details, see
|
|
8
|
+
# http://developer.android.com/guide/developing/tools/proguard.html
|
|
9
|
+
|
|
10
|
+
# react-native-reanimated
|
|
11
|
+
-keep class com.swmansion.reanimated.** { *; }
|
|
12
|
+
-keep class com.facebook.react.turbomodule.** { *; }
|
|
13
|
+
|
|
14
|
+
# Add any project specific keep options here:
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
2
|
+
xmlns:tools="http://schemas.android.com/tools">
|
|
3
|
+
|
|
4
|
+
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
|
|
5
|
+
|
|
6
|
+
<application android:usesCleartextTraffic="true" tools:targetApi="28" tools:ignore="GoogleAppIndexingWarning" tools:replace="android:usesCleartextTraffic" />
|
|
7
|
+
</manifest>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools">
|
|
2
|
+
<uses-permission-sdk-23 android:name="android.permission.ACCESS_COARSE_LOCATION" android:maxSdkVersion="30"/>
|
|
3
|
+
<uses-permission-sdk-23 android:name="android.permission.ACCESS_FINE_LOCATION" android:maxSdkVersion="30"/>
|
|
4
|
+
<uses-permission android:name="android.permission.BLUETOOTH"/>
|
|
5
|
+
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
|
|
6
|
+
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT"/>
|
|
7
|
+
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" android:usesPermissionFlags="neverForLocation" tools:targetApi="31"/>
|
|
8
|
+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
|
|
9
|
+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_CONNECTED_DEVICE"/>
|
|
10
|
+
<uses-permission android:name="android.permission.INTERNET"/>
|
|
11
|
+
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
|
|
12
|
+
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
|
|
13
|
+
<uses-permission android:name="android.permission.VIBRATE"/>
|
|
14
|
+
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
|
15
|
+
<uses-feature android:name="android.hardware.bluetooth_le" android:required="true"/>
|
|
16
|
+
<queries>
|
|
17
|
+
<intent>
|
|
18
|
+
<action android:name="android.intent.action.VIEW"/>
|
|
19
|
+
<category android:name="android.intent.category.BROWSABLE"/>
|
|
20
|
+
<data android:scheme="https"/>
|
|
21
|
+
</intent>
|
|
22
|
+
</queries>
|
|
23
|
+
<application android:name=".MainApplication" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round" android:allowBackup="true" android:theme="@style/AppTheme" android:supportsRtl="true">
|
|
24
|
+
<meta-data android:name="expo.modules.updates.ENABLED" android:value="false"/>
|
|
25
|
+
<meta-data android:name="expo.modules.updates.EXPO_UPDATES_CHECK_ON_LAUNCH" android:value="ALWAYS"/>
|
|
26
|
+
<meta-data android:name="expo.modules.updates.EXPO_UPDATES_LAUNCH_WAIT_MS" android:value="0"/>
|
|
27
|
+
<activity android:name=".MainActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenSize|screenLayout|uiMode" android:launchMode="singleTask" android:windowSoftInputMode="adjustResize" android:theme="@style/Theme.App.SplashScreen" android:exported="true" android:screenOrientation="portrait">
|
|
28
|
+
<intent-filter>
|
|
29
|
+
<action android:name="android.intent.action.MAIN"/>
|
|
30
|
+
<category android:name="android.intent.category.LAUNCHER"/>
|
|
31
|
+
</intent-filter>
|
|
32
|
+
<intent-filter>
|
|
33
|
+
<action android:name="android.intent.action.VIEW"/>
|
|
34
|
+
<category android:name="android.intent.category.DEFAULT"/>
|
|
35
|
+
<category android:name="android.intent.category.BROWSABLE"/>
|
|
36
|
+
<data android:scheme="expo.modules.nordicdfu.example"/>
|
|
37
|
+
</intent-filter>
|
|
38
|
+
</activity>
|
|
39
|
+
</application>
|
|
40
|
+
</manifest>
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
package expo.modules.nordicdfu.example
|
|
2
|
+
|
|
3
|
+
import android.os.Build
|
|
4
|
+
import android.os.Bundle
|
|
5
|
+
|
|
6
|
+
import com.facebook.react.ReactActivity
|
|
7
|
+
import com.facebook.react.ReactActivityDelegate
|
|
8
|
+
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled
|
|
9
|
+
import com.facebook.react.defaults.DefaultReactActivityDelegate
|
|
10
|
+
|
|
11
|
+
import expo.modules.ReactActivityDelegateWrapper
|
|
12
|
+
|
|
13
|
+
class MainActivity : ReactActivity() {
|
|
14
|
+
override fun onCreate(savedInstanceState: Bundle?) {
|
|
15
|
+
// Set the theme to AppTheme BEFORE onCreate to support
|
|
16
|
+
// coloring the background, status bar, and navigation bar.
|
|
17
|
+
// This is required for expo-splash-screen.
|
|
18
|
+
setTheme(R.style.AppTheme);
|
|
19
|
+
super.onCreate(null)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Returns the name of the main component registered from JavaScript. This is used to schedule
|
|
24
|
+
* rendering of the component.
|
|
25
|
+
*/
|
|
26
|
+
override fun getMainComponentName(): String = "main"
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate]
|
|
30
|
+
* which allows you to enable New Architecture with a single boolean flags [fabricEnabled]
|
|
31
|
+
*/
|
|
32
|
+
override fun createReactActivityDelegate(): ReactActivityDelegate {
|
|
33
|
+
return ReactActivityDelegateWrapper(
|
|
34
|
+
this,
|
|
35
|
+
BuildConfig.IS_NEW_ARCHITECTURE_ENABLED,
|
|
36
|
+
object : DefaultReactActivityDelegate(
|
|
37
|
+
this,
|
|
38
|
+
mainComponentName,
|
|
39
|
+
fabricEnabled
|
|
40
|
+
){})
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Align the back button behavior with Android S
|
|
45
|
+
* where moving root activities to background instead of finishing activities.
|
|
46
|
+
* @see <a href="https://developer.android.com/reference/android/app/Activity#onBackPressed()">onBackPressed</a>
|
|
47
|
+
*/
|
|
48
|
+
override fun invokeDefaultOnBackPressed() {
|
|
49
|
+
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.R) {
|
|
50
|
+
if (!moveTaskToBack(false)) {
|
|
51
|
+
// For non-root activities, use the default implementation to finish them.
|
|
52
|
+
super.invokeDefaultOnBackPressed()
|
|
53
|
+
}
|
|
54
|
+
return
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Use the default back button implementation on Android S
|
|
58
|
+
// because it's doing more than [Activity.moveTaskToBack] in fact.
|
|
59
|
+
super.invokeDefaultOnBackPressed()
|
|
60
|
+
}
|
|
61
|
+
}
|