react-native-webview-bootpay 11.26.20 → 13.6.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/README.md +9 -31
- package/android/build.gradle +70 -112
- package/android/gradle.properties +5 -6
- package/android/src/main/java/kr/co/bootpay/webview/BPCBasicAuthCredential.java +11 -0
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebChromeClient.java +354 -434
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebView.java +350 -259
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebViewClient.java +253 -399
- package/android/src/main/java/kr/co/bootpay/webview/{WebViewConfig.java → BPCWebViewConfig.java} +3 -4
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebViewFileProvider.java +1 -1
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebViewManager.java +290 -877
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebViewManagerImpl.kt +664 -0
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebViewModule.java +29 -520
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebViewModuleImpl.java +554 -0
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebViewPackage.java +56 -0
- package/android/src/main/java/kr/co/bootpay/webview/BootpayUrlHelper.java +122 -0
- package/android/src/main/java/kr/co/bootpay/webview/events/TopCustomMenuSelectionEvent.kt +24 -0
- package/android/src/main/java/kr/co/bootpay/webview/events/TopNewWindowEvent.kt +25 -0
- package/android/src/newarch/com/reactnativecommunity/webview/BPCWebViewManager.java +544 -0
- package/android/src/newarch/com/reactnativecommunity/webview/BPCWebViewModule.java +57 -0
- package/apple/BPCWebView.h +22 -126
- package/apple/BPCWebView.mm +528 -0
- package/apple/BPCWebViewDecisionManager.h +20 -0
- package/apple/BPCWebViewDecisionManager.m +47 -0
- package/apple/BPCWebViewImpl.h +150 -0
- package/apple/{BPCWebView.m → BPCWebViewImpl.m} +381 -214
- package/apple/BPCWebViewManager.h +4 -8
- package/apple/{BPCWebViewManager.m → BPCWebViewManager.mm} +93 -149
- package/{android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream → ios/.DS_Store} +0 -0
- package/ios/{BPCWebView.xcodeproj → RNCWebView.xcodeproj}/project.pbxproj +18 -18
- package/ios/main.jsbundle +457 -0
- package/lib/BPCWebViewNativeComponent.d.ts +242 -0
- package/lib/BPCWebViewNativeComponent.d.ts.map +1 -0
- package/lib/BPCWebViewNativeComponent.js +6 -0
- package/lib/NativeBPCWebView.d.ts +10 -0
- package/lib/NativeBPCWebView.d.ts.map +1 -0
- package/lib/NativeBPCWebView.js +2 -0
- package/lib/NativeRNCWebView.d.ts +10 -0
- package/lib/NativeRNCWebView.d.ts.map +1 -0
- package/lib/NativeRNCWebView.js +2 -0
- package/lib/RNCWebViewNativeComponent.d.ts +242 -0
- package/lib/RNCWebViewNativeComponent.d.ts.map +1 -0
- package/lib/RNCWebViewNativeComponent.js +6 -0
- package/lib/WebView.android.d.ts.map +1 -1
- package/lib/WebView.android.js +53 -29
- package/lib/WebView.ios.d.ts.map +1 -1
- package/lib/WebView.ios.js +49 -28
- package/lib/WebView.macos.d.ts.map +1 -1
- package/lib/WebView.macos.js +10 -14
- package/lib/WebView.windows.d.ts.map +1 -1
- package/lib/WebView.windows.js +4 -6
- package/lib/WebViewNativeComponent.macos.d.ts +2 -2
- package/lib/WebViewNativeComponent.macos.js +2 -2
- package/lib/WebViewShared.d.ts +4 -2
- package/lib/WebViewShared.d.ts.map +1 -1
- package/lib/WebViewShared.js +8 -2
- package/lib/WebViewTypes.d.ts +62 -95
- package/lib/WebViewTypes.d.ts.map +1 -1
- package/lib/WebViewTypes.js +0 -16
- package/macos/RNCWebView.xcodeproj/project.pbxproj +44 -44
- package/package.json +38 -20
- package/react-native-webview-bootpay.podspec +22 -3
- package/react-native.config.js +1 -2
- package/src/BPCWebViewNativeComponent.ts +281 -0
- package/src/NativeBPCWebView.ts +14 -0
- package/src/WebView.android.tsx +229 -0
- package/src/WebView.ios.tsx +232 -0
- package/src/WebView.macos.tsx +177 -0
- package/src/WebView.styles.ts +44 -0
- package/src/WebView.tsx +18 -0
- package/src/WebView.windows.tsx +156 -0
- package/src/WebViewNativeComponent.macos.ts +8 -0
- package/src/WebViewNativeComponent.windows.ts +10 -0
- package/src/WebViewShared.tsx +235 -0
- package/src/WebViewTypes.ts +1287 -0
- package/src/__tests__/WebViewShared-test.js +208 -0
- package/src/__tests__/__snapshots__/WebViewShared-test.js.snap +8 -0
- package/src/index.ts +4 -0
- package/windows/.gitignore +353 -0
- package/windows/ReactNativeWebView/ReactNativeWebView.vcxproj +1 -1
- package/windows/ReactNativeWebView/ReactWebView.idl +1 -0
- package/windows/ReactNativeWebView/ReactWebView2.cpp +142 -19
- package/windows/ReactNativeWebView/ReactWebView2.h +3 -0
- package/windows/ReactNativeWebView/ReactWebView2Manager.cpp +29 -5
- package/windows/ReactNativeWebView/pch.h +1 -0
- package/android/.editorconfig +0 -6
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/results.bin +0 -1
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebChromeClient$1.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebChromeClient.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebView$1.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebView$BPCWebViewBridge.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebView$ProgressChangedFilter.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebView.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebViewClient.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebViewFileProvider.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebViewManager$1.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebViewManager$2.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebViewManager$3.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebViewManager$4.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebViewManager.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebViewModule$1.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebViewModule$2.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebViewModule$MimeType.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebViewModule$ShouldOverrideUrlLoadingLock$ShouldOverrideCallbackState.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebViewModule$ShouldOverrideUrlLoadingLock.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebViewModule.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebViewPackage.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BasicAuthCredential.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BuildConfig.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/URLUtil.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/WebViewConfig.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/events/TopHttpErrorEvent$Companion.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/events/TopHttpErrorEvent.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/events/TopLoadingErrorEvent$Companion.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/events/TopLoadingErrorEvent.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/events/TopLoadingFinishEvent$Companion.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/events/TopLoadingFinishEvent.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/events/TopLoadingProgressEvent$Companion.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/events/TopLoadingProgressEvent.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/events/TopLoadingStartEvent$Companion.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/events/TopLoadingStartEvent.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/events/TopMessageEvent$Companion.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/events/TopMessageEvent.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/events/TopRenderProcessGoneEvent$Companion.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/events/TopRenderProcessGoneEvent.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/events/TopShouldStartLoadWithRequestEvent$Companion.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/events/TopShouldStartLoadWithRequestEvent.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/desugar_graph.bin +0 -0
- package/android/build/.transforms/88c49d67076e4458a9ddee82f875eb6a/results.bin +0 -1
- package/android/build/.transforms/88c49d67076e4458a9ddee82f875eb6a/transformed/classes/classes.dex +0 -0
- package/android/build/.transforms/c0e86b44db04fcaf424a5b7ce79324f4/results.bin +0 -1
- package/android/build/generated/source/buildConfig/debug/kr/co/bootpay/webview/BuildConfig.java +0 -10
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/AndroidManifest.xml +0 -106
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/output-metadata.json +0 -18
- package/android/build/intermediates/aar_metadata/debug/aar-metadata.properties +0 -4
- package/android/build/intermediates/annotation_processor_list/debug/annotationProcessors.json +0 -1
- package/android/build/intermediates/compile_library_classes_jar/debug/classes.jar +0 -0
- package/android/build/intermediates/compile_r_class_jar/debug/R.jar +0 -0
- package/android/build/intermediates/compile_symbol_list/debug/R.txt +0 -1861
- package/android/build/intermediates/compiled_local_resources/debug/out/xml_file_provider_paths.xml.flat +0 -0
- package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +0 -2
- package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +0 -2
- package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +0 -2
- package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +0 -2
- package/android/build/intermediates/incremental/packageDebugAssets/merger.xml +0 -2
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebChromeClient$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebChromeClient.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebView$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebView$BPCWebViewBridge.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebView$ProgressChangedFilter.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebView.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebViewClient.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebViewFileProvider.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebViewManager$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebViewManager$2.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebViewManager$3.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebViewManager$4.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebViewManager.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebViewModule$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebViewModule$2.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebViewModule$MimeType.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebViewModule$ShouldOverrideUrlLoadingLock$ShouldOverrideCallbackState.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebViewModule$ShouldOverrideUrlLoadingLock.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebViewModule.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BasicAuthCredential.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BuildConfig.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/URLUtil.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/WebViewConfig.class +0 -0
- package/android/build/intermediates/library_java_res/debug/res.jar +0 -0
- package/android/build/intermediates/local_only_symbol_list/debug/R-def.txt +0 -3
- package/android/build/intermediates/manifest_merge_blame_file/debug/manifest-merger-blame-debug-report.txt +0 -210
- package/android/build/intermediates/merged_manifest/debug/AndroidManifest.xml +0 -106
- package/android/build/intermediates/navigation_json/debug/navigation.json +0 -1
- package/android/build/intermediates/packaged_manifests/debug/output-metadata.json +0 -18
- package/android/build/intermediates/packaged_res/debug/xml/file_provider_paths.xml +0 -6
- package/android/build/intermediates/runtime_library_classes_dir/debug/META-INF/react-native-webview-bootpay_debug.kotlin_module +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebChromeClient$1.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebChromeClient.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebView$1.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebView$BPCWebViewBridge.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebView$ProgressChangedFilter.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebView.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebViewClient.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebViewFileProvider.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebViewManager$1.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebViewManager$2.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebViewManager$3.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebViewManager$4.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebViewManager.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebViewModule$1.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebViewModule$2.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebViewModule$MimeType.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebViewModule$ShouldOverrideUrlLoadingLock$ShouldOverrideCallbackState.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebViewModule$ShouldOverrideUrlLoadingLock.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebViewModule.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebViewPackage.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BasicAuthCredential.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BuildConfig.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/URLUtil.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/WebViewConfig.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/events/TopHttpErrorEvent$Companion.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/events/TopHttpErrorEvent.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/events/TopLoadingErrorEvent$Companion.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/events/TopLoadingErrorEvent.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/events/TopLoadingFinishEvent$Companion.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/events/TopLoadingFinishEvent.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/events/TopLoadingProgressEvent$Companion.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/events/TopLoadingProgressEvent.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/events/TopLoadingStartEvent$Companion.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/events/TopLoadingStartEvent.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/events/TopMessageEvent$Companion.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/events/TopMessageEvent.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/events/TopRenderProcessGoneEvent$Companion.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/events/TopRenderProcessGoneEvent.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/events/TopShouldStartLoadWithRequestEvent$Companion.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/events/TopShouldStartLoadWithRequestEvent.class +0 -0
- package/android/build/intermediates/runtime_library_classes_jar/debug/classes.jar +0 -0
- package/android/build/intermediates/symbol_list_with_package_name/debug/package-aware-r.txt +0 -1381
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/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 +0 -2
- 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.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/local-state/build-history.bin +0 -0
- package/android/build/outputs/logs/manifest-merger-debug-report.txt +0 -229
- package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
- package/android/build/tmp/kotlin-classes/debug/META-INF/react-native-webview-bootpay_debug.kotlin_module +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/BPCWebViewPackage.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopHttpErrorEvent$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopHttpErrorEvent.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopLoadingErrorEvent$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopLoadingErrorEvent.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopLoadingFinishEvent$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopLoadingFinishEvent.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopLoadingProgressEvent$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopLoadingProgressEvent.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopLoadingStartEvent$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopLoadingStartEvent.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopMessageEvent$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopMessageEvent.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopRenderProcessGoneEvent$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopRenderProcessGoneEvent.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopShouldStartLoadWithRequestEvent$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopShouldStartLoadWithRequestEvent.class +0 -0
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebViewPackage.kt +0 -15
- package/android/src/main/java/kr/co/bootpay/webview/BasicAuthCredential.java +0 -11
- package/ios/BPCWebView.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
- package/ios/BPCWebView.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
- package/ios/BPCWebView.xcodeproj/project.xcworkspace/xcuserdata/ehowlsla.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/BPCWebView.xcodeproj/xcuserdata/ehowlsla.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
- package/lib/WebViewNativeComponent.android.d.ts +0 -4
- package/lib/WebViewNativeComponent.android.d.ts.map +0 -1
- package/lib/WebViewNativeComponent.android.js +0 -3
- package/lib/WebViewNativeComponent.ios.d.ts +0 -4
- package/lib/WebViewNativeComponent.ios.d.ts.map +0 -1
- package/lib/WebViewNativeComponent.ios.js +0 -3
|
@@ -1,550 +1,59 @@
|
|
|
1
1
|
package kr.co.bootpay.webview;
|
|
2
2
|
|
|
3
|
-
import android.Manifest;
|
|
4
|
-
import android.app.Activity;
|
|
5
3
|
import android.app.DownloadManager;
|
|
6
|
-
import android.content.Context;
|
|
7
|
-
import android.content.Intent;
|
|
8
|
-
import android.content.pm.PackageManager;
|
|
9
4
|
import android.net.Uri;
|
|
10
|
-
import android.os.Build;
|
|
11
|
-
import android.os.Environment;
|
|
12
|
-
import android.os.Parcelable;
|
|
13
|
-
import android.provider.MediaStore;
|
|
14
|
-
|
|
15
|
-
import androidx.annotation.Nullable;
|
|
16
|
-
import androidx.annotation.RequiresApi;
|
|
17
|
-
import androidx.core.content.ContextCompat;
|
|
18
|
-
import androidx.core.content.FileProvider;
|
|
19
|
-
import androidx.core.util.Pair;
|
|
20
|
-
|
|
21
|
-
import android.util.Log;
|
|
22
|
-
import android.webkit.MimeTypeMap;
|
|
23
5
|
import android.webkit.ValueCallback;
|
|
24
|
-
import android.webkit.WebChromeClient;
|
|
25
|
-
import android.widget.Toast;
|
|
26
6
|
|
|
27
|
-
import
|
|
7
|
+
import androidx.annotation.NonNull;
|
|
8
|
+
|
|
28
9
|
import com.facebook.react.bridge.Promise;
|
|
29
10
|
import com.facebook.react.bridge.ReactApplicationContext;
|
|
30
11
|
import com.facebook.react.bridge.ReactContextBaseJavaModule;
|
|
31
12
|
import com.facebook.react.bridge.ReactMethod;
|
|
32
13
|
import com.facebook.react.module.annotations.ReactModule;
|
|
33
|
-
import com.facebook.react.modules.core.PermissionAwareActivity;
|
|
34
|
-
import com.facebook.react.modules.core.PermissionListener;
|
|
35
|
-
|
|
36
|
-
import java.io.File;
|
|
37
|
-
import java.io.IOException;
|
|
38
|
-
import java.util.ArrayList;
|
|
39
|
-
import java.util.Arrays;
|
|
40
|
-
import java.util.HashMap;
|
|
41
|
-
import java.util.concurrent.atomic.AtomicReference;
|
|
42
|
-
|
|
43
|
-
import static android.app.Activity.RESULT_OK;
|
|
44
|
-
|
|
45
|
-
@ReactModule(name = BPCWebViewModule.MODULE_NAME)
|
|
46
|
-
public class BPCWebViewModule extends ReactContextBaseJavaModule implements ActivityEventListener {
|
|
47
|
-
public static final String MODULE_NAME = "BPCWebView";
|
|
48
|
-
private static final int PICKER = 1;
|
|
49
|
-
private static final int PICKER_LEGACY = 3;
|
|
50
|
-
private static final int FILE_DOWNLOAD_PERMISSION_REQUEST = 1;
|
|
51
|
-
private ValueCallback<Uri> filePathCallbackLegacy;
|
|
52
|
-
private ValueCallback<Uri[]> filePathCallback;
|
|
53
|
-
private File outputImage;
|
|
54
|
-
private File outputVideo;
|
|
55
|
-
private DownloadManager.Request downloadRequest;
|
|
56
|
-
|
|
57
|
-
protected static class ShouldOverrideUrlLoadingLock {
|
|
58
|
-
protected enum ShouldOverrideCallbackState {
|
|
59
|
-
UNDECIDED,
|
|
60
|
-
SHOULD_OVERRIDE,
|
|
61
|
-
DO_NOT_OVERRIDE,
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
private int nextLockIdentifier = 1;
|
|
65
|
-
private final HashMap<Integer, AtomicReference<ShouldOverrideCallbackState>> shouldOverrideLocks = new HashMap<>();
|
|
66
|
-
|
|
67
|
-
public synchronized Pair<Integer, AtomicReference<ShouldOverrideCallbackState>> getNewLock() {
|
|
68
|
-
final int lockIdentifier = nextLockIdentifier++;
|
|
69
|
-
final AtomicReference<ShouldOverrideCallbackState> shouldOverride = new AtomicReference<>(ShouldOverrideCallbackState.UNDECIDED);
|
|
70
|
-
shouldOverrideLocks.put(lockIdentifier, shouldOverride);
|
|
71
|
-
return new Pair<>(lockIdentifier, shouldOverride);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
@Nullable
|
|
75
|
-
public synchronized AtomicReference<ShouldOverrideCallbackState> getLock(Integer lockIdentifier) {
|
|
76
|
-
return shouldOverrideLocks.get(lockIdentifier);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
public synchronized void removeLock(Integer lockIdentifier) {
|
|
80
|
-
shouldOverrideLocks.remove(lockIdentifier);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
protected static final ShouldOverrideUrlLoadingLock shouldOverrideUrlLoadingLock = new ShouldOverrideUrlLoadingLock();
|
|
85
|
-
|
|
86
|
-
private enum MimeType {
|
|
87
|
-
DEFAULT("*/*"),
|
|
88
|
-
IMAGE("image"),
|
|
89
|
-
VIDEO("video");
|
|
90
|
-
|
|
91
|
-
private final String value;
|
|
92
|
-
|
|
93
|
-
MimeType(String value) {
|
|
94
|
-
this.value = value;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
private PermissionListener getWebviewFileDownloaderPermissionListener(String downloadingMessage, String lackPermissionToDownloadMessage) {
|
|
99
|
-
return new PermissionListener() {
|
|
100
|
-
@Override
|
|
101
|
-
public boolean onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
|
|
102
|
-
switch (requestCode) {
|
|
103
|
-
case FILE_DOWNLOAD_PERMISSION_REQUEST: {
|
|
104
|
-
// If request is cancelled, the result arrays are empty.
|
|
105
|
-
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
|
|
106
|
-
if (downloadRequest != null) {
|
|
107
|
-
downloadFile(downloadingMessage);
|
|
108
|
-
}
|
|
109
|
-
} else {
|
|
110
|
-
Toast.makeText(getCurrentActivity().getApplicationContext(), lackPermissionToDownloadMessage, Toast.LENGTH_LONG).show();
|
|
111
|
-
}
|
|
112
|
-
return true;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
return false;
|
|
116
|
-
}
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
public BPCWebViewModule(ReactApplicationContext reactContext) {
|
|
121
|
-
super(reactContext);
|
|
122
|
-
reactContext.addActivityEventListener(this);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
@Override
|
|
126
|
-
public String getName() {
|
|
127
|
-
return MODULE_NAME;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
@ReactMethod
|
|
131
|
-
public void isFileUploadSupported(final Promise promise) {
|
|
132
|
-
Boolean result = false;
|
|
133
|
-
int current = Build.VERSION.SDK_INT;
|
|
134
|
-
if (current >= Build.VERSION_CODES.LOLLIPOP) {
|
|
135
|
-
result = true;
|
|
136
|
-
}
|
|
137
|
-
if (current >= Build.VERSION_CODES.JELLY_BEAN && current <= Build.VERSION_CODES.JELLY_BEAN_MR2) {
|
|
138
|
-
result = true;
|
|
139
|
-
}
|
|
140
|
-
promise.resolve(result);
|
|
141
|
-
}
|
|
142
14
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
final
|
|
146
|
-
if (lockObject != null) {
|
|
147
|
-
synchronized (lockObject) {
|
|
148
|
-
lockObject.set(shouldStart ? ShouldOverrideUrlLoadingLock.ShouldOverrideCallbackState.DO_NOT_OVERRIDE : ShouldOverrideUrlLoadingLock.ShouldOverrideCallbackState.SHOULD_OVERRIDE);
|
|
149
|
-
lockObject.notify();
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
public void onActivityResult(Activity activity, int requestCode, int resultCode, Intent data) {
|
|
155
|
-
|
|
156
|
-
if (filePathCallback == null && filePathCallbackLegacy == null) {
|
|
157
|
-
return;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
boolean imageTaken = false;
|
|
161
|
-
boolean videoTaken = false;
|
|
162
|
-
|
|
163
|
-
if (outputImage != null && outputImage.length() > 0) {
|
|
164
|
-
imageTaken = true;
|
|
165
|
-
}
|
|
166
|
-
if (outputVideo != null && outputVideo.length() > 0) {
|
|
167
|
-
videoTaken = true;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
// based off of which button was pressed, we get an activity result and a file
|
|
171
|
-
// the camera activity doesn't properly return the filename* (I think?) so we use
|
|
172
|
-
// this filename instead
|
|
173
|
-
switch (requestCode) {
|
|
174
|
-
case PICKER:
|
|
175
|
-
if (resultCode != RESULT_OK) {
|
|
176
|
-
if (filePathCallback != null) {
|
|
177
|
-
filePathCallback.onReceiveValue(null);
|
|
178
|
-
}
|
|
179
|
-
} else {
|
|
180
|
-
if (imageTaken) {
|
|
181
|
-
filePathCallback.onReceiveValue(new Uri[]{getOutputUri(outputImage)});
|
|
182
|
-
} else if (videoTaken) {
|
|
183
|
-
filePathCallback.onReceiveValue(new Uri[]{getOutputUri(outputVideo)});
|
|
184
|
-
} else {
|
|
185
|
-
filePathCallback.onReceiveValue(this.getSelectedFiles(data, resultCode));
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
break;
|
|
189
|
-
case PICKER_LEGACY:
|
|
190
|
-
if (resultCode != RESULT_OK) {
|
|
191
|
-
filePathCallbackLegacy.onReceiveValue(null);
|
|
192
|
-
} else {
|
|
193
|
-
if (imageTaken) {
|
|
194
|
-
filePathCallbackLegacy.onReceiveValue(getOutputUri(outputImage));
|
|
195
|
-
} else if (videoTaken) {
|
|
196
|
-
filePathCallbackLegacy.onReceiveValue(getOutputUri(outputVideo));
|
|
197
|
-
} else {
|
|
198
|
-
filePathCallbackLegacy.onReceiveValue(data.getData());
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
break;
|
|
202
|
-
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
if (outputImage != null && !imageTaken) {
|
|
206
|
-
outputImage.delete();
|
|
207
|
-
}
|
|
208
|
-
if (outputVideo != null && !videoTaken) {
|
|
209
|
-
outputVideo.delete();
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
filePathCallback = null;
|
|
213
|
-
filePathCallbackLegacy = null;
|
|
214
|
-
outputImage = null;
|
|
215
|
-
outputVideo = null;
|
|
216
|
-
}
|
|
15
|
+
@ReactModule(name = BPCWebViewModuleImpl.NAME)
|
|
16
|
+
public class BPCWebViewModule extends ReactContextBaseJavaModule {
|
|
17
|
+
final private BPCWebViewModuleImpl mBPCWebViewModuleImpl;
|
|
217
18
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
private Uri[] getSelectedFiles(Intent data, int resultCode) {
|
|
222
|
-
if (data == null) {
|
|
223
|
-
return null;
|
|
19
|
+
public BPCWebViewModule(ReactApplicationContext reactContext) {
|
|
20
|
+
super(reactContext);
|
|
21
|
+
mBPCWebViewModuleImpl = new BPCWebViewModuleImpl(reactContext);
|
|
224
22
|
}
|
|
225
23
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
Uri[] result = new Uri[numSelectedFiles];
|
|
230
|
-
for (int i = 0; i < numSelectedFiles; i++) {
|
|
231
|
-
result[i] = data.getClipData().getItemAt(i).getUri();
|
|
232
|
-
}
|
|
233
|
-
return result;
|
|
24
|
+
@ReactMethod
|
|
25
|
+
public void isFileUploadSupported(final Promise promise) {
|
|
26
|
+
promise.resolve(mBPCWebViewModuleImpl.isFileUploadSupported());
|
|
234
27
|
}
|
|
235
28
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
29
|
+
@ReactMethod
|
|
30
|
+
public void shouldStartLoadWithLockIdentifier(boolean shouldStart, double lockIdentifier) {
|
|
31
|
+
mBPCWebViewModuleImpl.shouldStartLoadWithLockIdentifier(shouldStart, lockIdentifier);
|
|
239
32
|
}
|
|
240
33
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
public void startPhotoPickerIntent(ValueCallback<Uri> filePathCallback, String acceptType) {
|
|
245
|
-
filePathCallbackLegacy = filePathCallback;
|
|
246
|
-
|
|
247
|
-
Intent fileChooserIntent = getFileChooserIntent(acceptType);
|
|
248
|
-
Intent chooserIntent = Intent.createChooser(fileChooserIntent, "");
|
|
249
|
-
|
|
250
|
-
ArrayList<Parcelable> extraIntents = new ArrayList<>();
|
|
251
|
-
if (acceptsImages(acceptType)) {
|
|
252
|
-
Intent photoIntent = getPhotoIntent();
|
|
253
|
-
if (photoIntent != null) {
|
|
254
|
-
extraIntents.add(photoIntent);
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
if (acceptsVideo(acceptType)) {
|
|
258
|
-
Intent videoIntent = getVideoIntent();
|
|
259
|
-
if (videoIntent != null) {
|
|
260
|
-
extraIntents.add(videoIntent);
|
|
261
|
-
}
|
|
34
|
+
public void startPhotoPickerIntent(ValueCallback<Uri> filePathCallback, String acceptType) {
|
|
35
|
+
mBPCWebViewModuleImpl.startPhotoPickerIntent(acceptType, filePathCallback);
|
|
262
36
|
}
|
|
263
|
-
chooserIntent.putExtra(Intent.EXTRA_INITIAL_INTENTS, extraIntents.toArray(new Parcelable[]{}));
|
|
264
37
|
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
} else {
|
|
268
|
-
Log.w("BPCWebViewModule", "there is no Activity to handle this Intent");
|
|
38
|
+
public boolean startPhotoPickerIntent(final ValueCallback<Uri[]> callback, final String[] acceptTypes, final boolean allowMultiple, final boolean isCaptureEnabled) {
|
|
39
|
+
return mBPCWebViewModuleImpl.startPhotoPickerIntent(acceptTypes, allowMultiple, callback, isCaptureEnabled);
|
|
269
40
|
}
|
|
270
|
-
}
|
|
271
41
|
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
filePathCallback = callback;
|
|
275
|
-
|
|
276
|
-
ArrayList<Parcelable> extraIntents = new ArrayList<>();
|
|
277
|
-
if (!needsCameraPermission()) {
|
|
278
|
-
if (acceptsImages(acceptTypes)) {
|
|
279
|
-
Intent photoIntent = getPhotoIntent();
|
|
280
|
-
if (photoIntent != null) {
|
|
281
|
-
extraIntents.add(photoIntent);
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
if (acceptsVideo(acceptTypes)) {
|
|
285
|
-
Intent videoIntent = getVideoIntent();
|
|
286
|
-
if (videoIntent != null) {
|
|
287
|
-
extraIntents.add(videoIntent);
|
|
288
|
-
}
|
|
289
|
-
}
|
|
42
|
+
public void setDownloadRequest(DownloadManager.Request request) {
|
|
43
|
+
mBPCWebViewModuleImpl.setDownloadRequest(request);
|
|
290
44
|
}
|
|
291
45
|
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
Intent chooserIntent = new Intent(Intent.ACTION_CHOOSER);
|
|
295
|
-
chooserIntent.putExtra(Intent.EXTRA_INTENT, fileSelectionIntent);
|
|
296
|
-
chooserIntent.putExtra(Intent.EXTRA_INITIAL_INTENTS, extraIntents.toArray(new Parcelable[]{}));
|
|
297
|
-
|
|
298
|
-
if (chooserIntent.resolveActivity(getCurrentActivity().getPackageManager()) != null) {
|
|
299
|
-
getCurrentActivity().startActivityForResult(chooserIntent, PICKER);
|
|
300
|
-
} else {
|
|
301
|
-
Log.w("BPCWebViewModule", "there is no Activity to handle this Intent");
|
|
46
|
+
public void downloadFile(String downloadingMessage) {
|
|
47
|
+
mBPCWebViewModuleImpl.downloadFile(downloadingMessage);
|
|
302
48
|
}
|
|
303
49
|
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
public void setDownloadRequest(DownloadManager.Request request) {
|
|
308
|
-
this.downloadRequest = request;
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
public void downloadFile(String downloadingMessage) {
|
|
312
|
-
DownloadManager dm = (DownloadManager) getCurrentActivity().getBaseContext().getSystemService(Context.DOWNLOAD_SERVICE);
|
|
313
|
-
|
|
314
|
-
try {
|
|
315
|
-
dm.enqueue(this.downloadRequest);
|
|
316
|
-
} catch (IllegalArgumentException e) {
|
|
317
|
-
Log.w("BPCWebViewModule", "Unsupported URI, aborting download", e);
|
|
318
|
-
return;
|
|
50
|
+
public boolean grantFileDownloaderPermissions(String downloadingMessage, String lackPermissionToDownloadMessage) {
|
|
51
|
+
return mBPCWebViewModuleImpl.grantFileDownloaderPermissions(downloadingMessage, lackPermissionToDownloadMessage);
|
|
319
52
|
}
|
|
320
53
|
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
// Permission not required for Android Q and above
|
|
326
|
-
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.P) {
|
|
327
|
-
return true;
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
boolean result = ContextCompat.checkSelfPermission(getCurrentActivity(), Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED;
|
|
331
|
-
if (!result && Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
|
332
|
-
PermissionAwareActivity activity = getPermissionAwareActivity();
|
|
333
|
-
activity.requestPermissions(new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, FILE_DOWNLOAD_PERMISSION_REQUEST, getWebviewFileDownloaderPermissionListener(downloadingMessage, lackPermissionToDownloadMessage));
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
return result;
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
protected boolean needsCameraPermission() {
|
|
340
|
-
boolean needed = false;
|
|
341
|
-
|
|
342
|
-
PackageManager packageManager = getCurrentActivity().getPackageManager();
|
|
343
|
-
try {
|
|
344
|
-
String[] requestedPermissions = packageManager.getPackageInfo(getReactApplicationContext().getPackageName(), PackageManager.GET_PERMISSIONS).requestedPermissions;
|
|
345
|
-
if (Arrays.asList(requestedPermissions).contains(Manifest.permission.CAMERA)
|
|
346
|
-
&& ContextCompat.checkSelfPermission(getCurrentActivity(), Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED) {
|
|
347
|
-
needed = true;
|
|
348
|
-
}
|
|
349
|
-
} catch (PackageManager.NameNotFoundException e) {
|
|
350
|
-
needed = true;
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
return needed;
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
private Intent getPhotoIntent() {
|
|
357
|
-
Intent intent = null;
|
|
358
|
-
|
|
359
|
-
try {
|
|
360
|
-
outputImage = getCapturedFile(MimeType.IMAGE);
|
|
361
|
-
Uri outputImageUri = getOutputUri(outputImage);
|
|
362
|
-
intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
|
|
363
|
-
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputImageUri);
|
|
364
|
-
} catch (IOException | IllegalArgumentException e) {
|
|
365
|
-
Log.e("CREATE FILE", "Error occurred while creating the File", e);
|
|
366
|
-
e.printStackTrace();
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
return intent;
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
private Intent getVideoIntent() {
|
|
373
|
-
Intent intent = null;
|
|
374
|
-
|
|
375
|
-
try {
|
|
376
|
-
outputVideo = getCapturedFile(MimeType.VIDEO);
|
|
377
|
-
Uri outputVideoUri = getOutputUri(outputVideo);
|
|
378
|
-
intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
|
|
379
|
-
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputVideoUri);
|
|
380
|
-
} catch (IOException | IllegalArgumentException e) {
|
|
381
|
-
Log.e("CREATE FILE", "Error occurred while creating the File", e);
|
|
382
|
-
e.printStackTrace();
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
return intent;
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
private Intent getFileChooserIntent(String acceptTypes) {
|
|
389
|
-
String _acceptTypes = acceptTypes;
|
|
390
|
-
if (acceptTypes.isEmpty()) {
|
|
391
|
-
_acceptTypes = MimeType.DEFAULT.value;
|
|
392
|
-
}
|
|
393
|
-
if (acceptTypes.matches("\\.\\w+")) {
|
|
394
|
-
_acceptTypes = getMimeTypeFromExtension(acceptTypes.replace(".", ""));
|
|
395
|
-
}
|
|
396
|
-
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
|
|
397
|
-
intent.addCategory(Intent.CATEGORY_OPENABLE);
|
|
398
|
-
intent.setType(_acceptTypes);
|
|
399
|
-
return intent;
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
private Intent getFileChooserIntent(String[] acceptTypes, boolean allowMultiple) {
|
|
403
|
-
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
|
|
404
|
-
intent.addCategory(Intent.CATEGORY_OPENABLE);
|
|
405
|
-
intent.setType(MimeType.DEFAULT.value);
|
|
406
|
-
intent.putExtra(Intent.EXTRA_MIME_TYPES, getAcceptedMimeType(acceptTypes));
|
|
407
|
-
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, allowMultiple);
|
|
408
|
-
return intent;
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
private Boolean acceptsImages(String types) {
|
|
412
|
-
String mimeType = types;
|
|
413
|
-
if (types.matches("\\.\\w+")) {
|
|
414
|
-
mimeType = getMimeTypeFromExtension(types.replace(".", ""));
|
|
415
|
-
}
|
|
416
|
-
return mimeType.isEmpty() || mimeType.toLowerCase().contains(MimeType.IMAGE.value);
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
private Boolean acceptsImages(String[] types) {
|
|
420
|
-
String[] mimeTypes = getAcceptedMimeType(types);
|
|
421
|
-
return arrayContainsString(mimeTypes, MimeType.DEFAULT.value) || arrayContainsString(mimeTypes, MimeType.IMAGE.value);
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
private Boolean acceptsVideo(String types) {
|
|
425
|
-
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
|
|
426
|
-
return false;
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
String mimeType = types;
|
|
430
|
-
if (types.matches("\\.\\w+")) {
|
|
431
|
-
mimeType = getMimeTypeFromExtension(types.replace(".", ""));
|
|
432
|
-
}
|
|
433
|
-
return mimeType.isEmpty() || mimeType.toLowerCase().contains(MimeType.VIDEO.value);
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
private Boolean acceptsVideo(String[] types) {
|
|
437
|
-
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
|
|
438
|
-
return false;
|
|
439
|
-
}
|
|
440
|
-
|
|
441
|
-
String[] mimeTypes = getAcceptedMimeType(types);
|
|
442
|
-
return arrayContainsString(mimeTypes, MimeType.DEFAULT.value) || arrayContainsString(mimeTypes, MimeType.VIDEO.value);
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
private Boolean arrayContainsString(String[] array, String pattern) {
|
|
446
|
-
for (String content : array) {
|
|
447
|
-
if (content.contains(pattern)) {
|
|
448
|
-
return true;
|
|
449
|
-
}
|
|
450
|
-
}
|
|
451
|
-
return false;
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
private String[] getAcceptedMimeType(String[] types) {
|
|
455
|
-
if (noAcceptTypesSet(types)) {
|
|
456
|
-
return new String[]{MimeType.DEFAULT.value};
|
|
457
|
-
}
|
|
458
|
-
String[] mimeTypes = new String[types.length];
|
|
459
|
-
for (int i = 0; i < types.length; i++) {
|
|
460
|
-
String t = types[i];
|
|
461
|
-
// convert file extensions to mime types
|
|
462
|
-
if (t.matches("\\.\\w+")) {
|
|
463
|
-
String mimeType = getMimeTypeFromExtension(t.replace(".", ""));
|
|
464
|
-
if(mimeType != null) {
|
|
465
|
-
mimeTypes[i] = mimeType;
|
|
466
|
-
} else {
|
|
467
|
-
mimeTypes[i] = t;
|
|
468
|
-
}
|
|
469
|
-
} else {
|
|
470
|
-
mimeTypes[i] = t;
|
|
471
|
-
}
|
|
472
|
-
}
|
|
473
|
-
return mimeTypes;
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
private String getMimeTypeFromExtension(String extension) {
|
|
477
|
-
String type = null;
|
|
478
|
-
if (extension != null) {
|
|
479
|
-
type = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension);
|
|
480
|
-
}
|
|
481
|
-
return type;
|
|
482
|
-
}
|
|
483
|
-
|
|
484
|
-
private Uri getOutputUri(File capturedFile) {
|
|
485
|
-
// for versions below 6.0 (23) we use the old File creation & permissions model
|
|
486
|
-
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
|
|
487
|
-
return Uri.fromFile(capturedFile);
|
|
488
|
-
}
|
|
489
|
-
|
|
490
|
-
// for versions 6.0+ (23) we use the FileProvider to avoid runtime permissions
|
|
491
|
-
String packageName = getReactApplicationContext().getPackageName();
|
|
492
|
-
return FileProvider.getUriForFile(getReactApplicationContext(), packageName + ".fileprovider", capturedFile);
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
private File getCapturedFile(MimeType mimeType) throws IOException {
|
|
496
|
-
String prefix = "";
|
|
497
|
-
String suffix = "";
|
|
498
|
-
String dir = "";
|
|
499
|
-
|
|
500
|
-
switch (mimeType) {
|
|
501
|
-
case IMAGE:
|
|
502
|
-
prefix = "image-";
|
|
503
|
-
suffix = ".jpg";
|
|
504
|
-
dir = Environment.DIRECTORY_PICTURES;
|
|
505
|
-
break;
|
|
506
|
-
case VIDEO:
|
|
507
|
-
prefix = "video-";
|
|
508
|
-
suffix = ".mp4";
|
|
509
|
-
dir = Environment.DIRECTORY_MOVIES;
|
|
510
|
-
break;
|
|
511
|
-
|
|
512
|
-
default:
|
|
513
|
-
break;
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
String filename = prefix + String.valueOf(System.currentTimeMillis()) + suffix;
|
|
517
|
-
File outputFile = null;
|
|
518
|
-
|
|
519
|
-
// for versions below 6.0 (23) we use the old File creation & permissions model
|
|
520
|
-
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
|
|
521
|
-
// only this Directory works on all tested Android versions
|
|
522
|
-
// ctx.getExternalFilesDir(dir) was failing on Android 5.0 (sdk 21)
|
|
523
|
-
File storageDir = Environment.getExternalStoragePublicDirectory(dir);
|
|
524
|
-
outputFile = new File(storageDir, filename);
|
|
525
|
-
} else {
|
|
526
|
-
File storageDir = getReactApplicationContext().getExternalFilesDir(null);
|
|
527
|
-
outputFile = File.createTempFile(prefix, suffix, storageDir);
|
|
528
|
-
}
|
|
529
|
-
|
|
530
|
-
return outputFile;
|
|
531
|
-
}
|
|
532
|
-
|
|
533
|
-
private Boolean noAcceptTypesSet(String[] types) {
|
|
534
|
-
// when our array returned from getAcceptTypes() has no values set from the webview
|
|
535
|
-
// i.e. <input type="file" />, without any "accept" attr
|
|
536
|
-
// will be an array with one empty string element, afaik
|
|
537
|
-
|
|
538
|
-
return types.length == 0 || (types.length == 1 && types[0] != null && types[0].length() == 0);
|
|
539
|
-
}
|
|
540
|
-
|
|
541
|
-
private PermissionAwareActivity getPermissionAwareActivity() {
|
|
542
|
-
Activity activity = getCurrentActivity();
|
|
543
|
-
if (activity == null) {
|
|
544
|
-
throw new IllegalStateException("Tried to use permissions API while not attached to an Activity.");
|
|
545
|
-
} else if (!(activity instanceof PermissionAwareActivity)) {
|
|
546
|
-
throw new IllegalStateException("Tried to use permissions API but the host Activity doesn't implement PermissionAwareActivity.");
|
|
54
|
+
@NonNull
|
|
55
|
+
@Override
|
|
56
|
+
public String getName() {
|
|
57
|
+
return BPCWebViewModuleImpl.NAME;
|
|
547
58
|
}
|
|
548
|
-
|
|
549
|
-
}
|
|
550
|
-
}
|
|
59
|
+
}
|