react-native-webview-bootpay 11.22.87 → 11.26.19
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 +10 -10
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/results.bin +1 -0
- 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/transformed/classes/classes.dex +0 -0
- package/android/build/.transforms/c0e86b44db04fcaf424a5b7ce79324f4/results.bin +1 -0
- package/android/build/intermediates/compile_library_classes_jar/debug/classes.jar +0 -0
- package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +2 -0
- 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/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/URLUtil.class +0 -0
- package/android/build/intermediates/library_java_res/debug/res.jar +0 -0
- package/android/build/intermediates/manifest_merge_blame_file/debug/manifest-merger-blame-debug-report.txt +1 -1
- 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/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.values.at +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-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/internal-name-to-source.tab +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/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/{.gradle/6.8/executionHistory/executionHistory.bin → 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.values.at +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/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/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/lookups/file-to-id.tab +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/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/lookups.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at +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 +1 -1
- 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/build.gradle +1 -1
- package/android/gradle.properties +2 -2
- package/android/src/main/AndroidManifest.xml +1 -1
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebChromeClient.java +145 -53
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebView.java +0 -1
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebViewClient.java +6 -11
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebViewManager.java +65 -13
- package/android/src/main/java/kr/co/bootpay/webview/URLUtil.java +179 -0
- package/apple/BPCWebView.h +3 -1
- package/apple/BPCWebView.m +112 -68
- package/ios/BPCWebView.xcodeproj/project.pbxproj +95 -132
- package/ios/BPCWebView.xcodeproj/project.xcworkspace/contents.xcworkspacedata +1 -1
- package/ios/BPCWebView.xcodeproj/project.xcworkspace/xcuserdata/ehowlsla.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/BPCWebView.xcodeproj/xcuserdata/ehowlsla.xcuserdatad/xcschemes/xcschememanagement.plist +0 -15
- package/lib/WebView.android.js +1 -1
- package/lib/WebView.ios.js +1 -1
- package/lib/WebView.macos.js +6 -6
- package/lib/WebView.windows.js +2 -2
- package/lib/WebViewNativeComponent.macos.d.ts +2 -2
- package/lib/WebViewNativeComponent.macos.js +2 -2
- package/lib/WebViewShared.d.ts +1 -1
- package/lib/WebViewShared.d.ts.map +1 -1
- package/lib/WebViewTypes.d.ts +12 -3
- package/lib/WebViewTypes.d.ts.map +1 -1
- package/package.json +5 -5
- package/react-native-webview-bootpay.podspec +1 -2
- package/android/.gradle/6.8/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/6.8/fileChanges/last-build.bin +0 -0
- package/android/.gradle/6.8/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/6.8/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/6.8/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
- package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
- package/android/.gradle/checksums/checksums.lock +0 -0
- package/android/.gradle/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/configuration-cache/gc.properties +0 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/.idea/compiler.xml +0 -6
- package/android/.idea/gradle.xml +0 -19
- package/android/.idea/jarRepositories.xml +0 -30
- package/android/.idea/libraries/Gradle__androidx_annotation_annotation_1_1_0.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_appcompat_appcompat_1_0_2_aar.xml +0 -16
- package/android/.idea/libraries/Gradle__androidx_arch_core_core_common_2_0_0.xml +0 -11
- package/android/.idea/libraries/Gradle__androidx_arch_core_core_runtime_2_0_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_asynclayoutinflater_asynclayoutinflater_1_0_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_autofill_autofill_1_1_0_aar.xml +0 -16
- package/android/.idea/libraries/Gradle__androidx_collection_collection_1_0_0.xml +0 -11
- package/android/.idea/libraries/Gradle__androidx_coordinatorlayout_coordinatorlayout_1_0_0_aar.xml +0 -16
- package/android/.idea/libraries/Gradle__androidx_core_core_1_1_0_aar.xml +0 -16
- package/android/.idea/libraries/Gradle__androidx_cursoradapter_cursoradapter_1_0_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_customview_customview_1_0_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_documentfile_documentfile_1_0_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_drawerlayout_drawerlayout_1_0_0_aar.xml +0 -16
- package/android/.idea/libraries/Gradle__androidx_fragment_fragment_1_0_0_aar.xml +0 -16
- package/android/.idea/libraries/Gradle__androidx_interpolator_interpolator_1_0_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_legacy_legacy_support_core_ui_1_0_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_legacy_legacy_support_core_utils_1_0_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_common_2_0_0.xml +0 -11
- package/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_livedata_2_0_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_livedata_core_2_0_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_runtime_2_0_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_viewmodel_2_0_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_loader_loader_1_0_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_localbroadcastmanager_localbroadcastmanager_1_0_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_print_print_1_0_0_aar.xml +0 -16
- package/android/.idea/libraries/Gradle__androidx_slidingpanelayout_slidingpanelayout_1_0_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_swiperefreshlayout_swiperefreshlayout_1_0_0_aar.xml +0 -16
- package/android/.idea/libraries/Gradle__androidx_vectordrawable_vectordrawable_1_0_1_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_vectordrawable_vectordrawable_animated_1_0_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_versionedparcelable_versionedparcelable_1_1_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_viewpager_viewpager_1_0_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_webkit_webkit_1_4_0_aar.xml +0 -16
- package/android/.idea/libraries/Gradle__com_facebook_fbjni_fbjni_java_only_0_2_2.xml +0 -13
- package/android/.idea/libraries/Gradle__com_facebook_fresco_drawee_2_5_0_aar.xml +0 -15
- package/android/.idea/libraries/Gradle__com_facebook_fresco_fbcore_2_5_0_aar.xml +0 -18
- package/android/.idea/libraries/Gradle__com_facebook_fresco_fresco_2_5_0_aar.xml +0 -18
- package/android/.idea/libraries/Gradle__com_facebook_fresco_imagepipeline_2_5_0_aar.xml +0 -18
- package/android/.idea/libraries/Gradle__com_facebook_fresco_imagepipeline_base_2_5_0_aar.xml +0 -18
- package/android/.idea/libraries/Gradle__com_facebook_fresco_imagepipeline_native_2_5_0_aar.xml +0 -15
- package/android/.idea/libraries/Gradle__com_facebook_fresco_imagepipeline_okhttp3_2_5_0_aar.xml +0 -15
- package/android/.idea/libraries/Gradle__com_facebook_fresco_memory_type_ashmem_2_5_0_aar.xml +0 -15
- package/android/.idea/libraries/Gradle__com_facebook_fresco_memory_type_java_2_5_0_aar.xml +0 -15
- package/android/.idea/libraries/Gradle__com_facebook_fresco_memory_type_native_2_5_0_aar.xml +0 -15
- package/android/.idea/libraries/Gradle__com_facebook_fresco_nativeimagefilters_2_5_0_aar.xml +0 -15
- package/android/.idea/libraries/Gradle__com_facebook_fresco_nativeimagetranscoder_2_5_0_aar.xml +0 -15
- package/android/.idea/libraries/Gradle__com_facebook_fresco_ui_common_2_5_0_aar.xml +0 -15
- package/android/.idea/libraries/Gradle__com_facebook_infer_annotation_infer_annotation_0_18_0.xml +0 -13
- package/android/.idea/libraries/Gradle__com_facebook_react_react_native_0_68_2_aar.xml +0 -16
- package/android/.idea/libraries/Gradle__com_facebook_soloader_annotation_0_10_3.xml +0 -13
- package/android/.idea/libraries/Gradle__com_facebook_soloader_nativeloader_0_10_3.xml +0 -13
- package/android/.idea/libraries/Gradle__com_facebook_soloader_soloader_0_10_3_aar.xml +0 -15
- package/android/.idea/libraries/Gradle__com_facebook_yoga_proguard_annotations_1_19_0.xml +0 -13
- package/android/.idea/libraries/Gradle__com_google_code_findbugs_jsr305_3_0_2.xml +0 -13
- package/android/.idea/libraries/Gradle__com_squareup_okhttp3_okhttp_4_9_2.xml +0 -13
- package/android/.idea/libraries/Gradle__com_squareup_okhttp3_okhttp_urlconnection_4_9_2.xml +0 -13
- package/android/.idea/libraries/Gradle__com_squareup_okio_okio_2_9_0.xml +0 -13
- package/android/.idea/libraries/Gradle__javax_inject_javax_inject_1.xml +0 -13
- package/android/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml +0 -13
- package/android/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_annotations_jvm_1_3_72.xml +0 -13
- package/android/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_4_10.xml +0 -13
- package/android/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_common_1_4_10.xml +0 -13
- package/android/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_jdk7_1_4_10.xml +0 -13
- package/android/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_jdk8_1_4_10.xml +0 -13
- package/android/.idea/misc.xml +0 -9
- package/android/.idea/modules/android.iml +0 -133
- package/android/.idea/modules.xml +0 -8
- package/android/.idea/vcs.xml +0 -6
- package/android/build/.transforms/28ceacf58c1f53104331b6d3900dca4f/transformed/classes/classes.dex +0 -0
- package/android/build/intermediates/incremental/packageDebugResources/compile-file-map.properties +0 -2
- package/android/build/kotlin/compileDebugKotlin/localstate/build-history.bin +0 -0
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +0 -5
- package/android/gradlew +0 -185
- package/android/gradlew.bat +0 -89
- package/android/local.properties +0 -8
- /package/android/build/.transforms/{28ceacf58c1f53104331b6d3900dca4f → 88c49d67076e4458a9ddee82f875eb6a}/results.bin +0 -0
- /package/android/build/intermediates/incremental/{packageDebugResources → debug/packageDebugResources}/merger.xml +0 -0
|
@@ -42,6 +42,7 @@ import java.util.List;
|
|
|
42
42
|
|
|
43
43
|
import kr.co.bootpay.webview.events.TopLoadingProgressEvent;
|
|
44
44
|
|
|
45
|
+
|
|
45
46
|
class BPCWebChromeClient extends WebChromeClient implements LifecycleEventListener {
|
|
46
47
|
protected static final FrameLayout.LayoutParams FULLSCREEN_LAYOUT_PARAMS = new FrameLayout.LayoutParams(
|
|
47
48
|
ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT, Gravity.CENTER);
|
|
@@ -86,24 +87,28 @@ class BPCWebChromeClient extends WebChromeClient implements LifecycleEventListen
|
|
|
86
87
|
|
|
87
88
|
protected BPCWebView.ProgressChangedFilter progressChangedFilter = null;
|
|
88
89
|
|
|
90
|
+
// True if protected media should be allowed, false otherwise
|
|
91
|
+
protected boolean mAllowsProtectedMedia = false;
|
|
92
|
+
|
|
89
93
|
public BPCWebChromeClient(ReactContext reactContext, WebView webView) {
|
|
90
94
|
this.mReactContext = reactContext;
|
|
91
95
|
this.mWebView = webView;
|
|
92
96
|
}
|
|
93
97
|
|
|
98
|
+
|
|
94
99
|
/** bootpay change **/
|
|
95
100
|
|
|
96
101
|
@Override
|
|
97
102
|
public void onCloseWindow(WebView window) {
|
|
98
103
|
super.onCloseWindow(window);
|
|
99
104
|
((BPCWebView) window).dissmissDialog();
|
|
100
|
-
|
|
101
105
|
// if(mainView != null) {
|
|
102
106
|
// mainView.removeView(window);
|
|
103
107
|
// }
|
|
104
108
|
// window.setVisibility(View.GONE);
|
|
105
109
|
}
|
|
106
110
|
|
|
111
|
+
|
|
107
112
|
void setWebSettingCopy(WebView view, WebView newWebView) {
|
|
108
113
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
|
|
109
114
|
newWebView.getSettings().setMediaPlaybackRequiresUserGesture( view.getSettings().getMediaPlaybackRequiresUserGesture() );
|
|
@@ -158,67 +163,134 @@ class BPCWebChromeClient extends WebChromeClient implements LifecycleEventListen
|
|
|
158
163
|
}
|
|
159
164
|
}
|
|
160
165
|
|
|
161
|
-
// WebView mainView;
|
|
162
166
|
@Override
|
|
163
167
|
public boolean onCreateWindow(WebView view, boolean isDialog, boolean isUserGesture, Message resultMsg) {
|
|
164
168
|
|
|
169
|
+
if(isDialog) {
|
|
170
|
+
|
|
171
|
+
final BPCWebView newWebView = new BPCWebView((ThemedReactContext) view.getContext());
|
|
172
|
+
BPCWebChromeClient client = new BPCWebChromeClient(this.mReactContext, view);
|
|
173
|
+
// client.onCloseWindow();
|
|
174
|
+
client.setProgressChangedFilter(progressChangedFilter);
|
|
175
|
+
newWebView.setWebChromeClient(client);
|
|
176
|
+
setWebSettingCopy(view, newWebView);
|
|
177
|
+
|
|
178
|
+
newWebView.setWebViewClient(new BPCWebViewClient() {
|
|
179
|
+
|
|
180
|
+
@Override
|
|
181
|
+
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
|
182
|
+
Intent intent = getIntentWithPackage(url);
|
|
183
|
+
Context context = view.getContext();
|
|
184
|
+
|
|
185
|
+
if(isIntent(url)) {
|
|
186
|
+
if(isInstallApp(intent, context)) return startApp(intent, context);
|
|
187
|
+
else return startGooglePlay(intent, context);
|
|
188
|
+
} else if(isMarket(url)) {
|
|
189
|
+
if(isInstallApp(intent, context)) return startApp(intent, context);
|
|
190
|
+
else return startGooglePlay(intent, context);
|
|
191
|
+
} else if(isSpecialCase(url)) {
|
|
192
|
+
if(isInstallApp(intent, context)) return startApp(intent, context);
|
|
193
|
+
else return startGooglePlay(intent, context);
|
|
194
|
+
}
|
|
195
|
+
return url.contains("vguardend");
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
Dialog popupDialog = new Dialog(view.getContext(), android.R.style.Theme_Black_NoTitleBar_Fullscreen);
|
|
200
|
+
popupDialog.setContentView(newWebView);
|
|
201
|
+
ViewGroup.LayoutParams params = popupDialog.getWindow().getAttributes();
|
|
202
|
+
params.width = ViewGroup.LayoutParams.MATCH_PARENT;
|
|
203
|
+
params.height = ViewGroup.LayoutParams.MATCH_PARENT;
|
|
204
|
+
popupDialog.getWindow().setAttributes((WindowManager.LayoutParams) params);
|
|
205
|
+
popupDialog.setOnDismissListener(dialog -> {
|
|
206
|
+
// Toast.makeText(view.getContext(), "팝업취소", Toast.LENGTH_SHORT).show();
|
|
207
|
+
onCloseWindow(view); //rn에선 딱히 동작하지 않음
|
|
208
|
+
});
|
|
209
|
+
newWebView.setDialog(popupDialog);
|
|
210
|
+
popupDialog.show();
|
|
211
|
+
|
|
212
|
+
final WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj;
|
|
213
|
+
transport.setWebView(newWebView);
|
|
214
|
+
resultMsg.sendToTarget();
|
|
215
|
+
|
|
216
|
+
return true;
|
|
217
|
+
} else {
|
|
218
|
+
final WebView newWebView = new WebView(view.getContext());
|
|
219
|
+
final WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj;
|
|
220
|
+
transport.setWebView(newWebView);
|
|
221
|
+
resultMsg.sendToTarget();
|
|
165
222
|
|
|
223
|
+
return true;
|
|
224
|
+
}
|
|
166
225
|
|
|
167
226
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
227
|
+
/*
|
|
228
|
+
|
|
229
|
+
String url = resultMsg.getData().getString("url");
|
|
230
|
+
|
|
231
|
+
if(url.startsWith("https://gw.bootpay.co.kr") || url.startsWith("http://gw.bootpay.co.kr")) {
|
|
232
|
+
final BPCWebView newWebView = new BPCWebView((ThemedReactContext) view.getContext());
|
|
233
|
+
BPCWebChromeClient client = new BPCWebChromeClient(this.mReactContext, view);
|
|
234
|
+
// client.onCloseWindow();
|
|
235
|
+
client.setProgressChangedFilter(progressChangedFilter);
|
|
236
|
+
newWebView.setWebChromeClient(client);
|
|
237
|
+
setWebSettingCopy(view, newWebView);
|
|
238
|
+
|
|
239
|
+
newWebView.setWebViewClient(new BPCWebViewClient() {
|
|
240
|
+
|
|
241
|
+
@Override
|
|
242
|
+
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
|
243
|
+
Intent intent = getIntentWithPackage(url);
|
|
244
|
+
Context context = view.getContext();
|
|
245
|
+
|
|
246
|
+
if(isIntent(url)) {
|
|
247
|
+
if(isInstallApp(intent, context)) return startApp(intent, context);
|
|
248
|
+
else return startGooglePlay(intent, context);
|
|
249
|
+
} else if(isMarket(url)) {
|
|
250
|
+
if(isInstallApp(intent, context)) return startApp(intent, context);
|
|
251
|
+
else return startGooglePlay(intent, context);
|
|
252
|
+
} else if(isSpecialCase(url)) {
|
|
253
|
+
if(isInstallApp(intent, context)) return startApp(intent, context);
|
|
254
|
+
else return startGooglePlay(intent, context);
|
|
255
|
+
}
|
|
256
|
+
return url.contains("vguardend");
|
|
257
|
+
}
|
|
258
|
+
});
|
|
259
|
+
|
|
260
|
+
Dialog popupDialog = new Dialog(view.getContext(), android.R.style.Theme_Black_NoTitleBar_Fullscreen);
|
|
261
|
+
popupDialog.setContentView(newWebView);
|
|
262
|
+
ViewGroup.LayoutParams params = popupDialog.getWindow().getAttributes();
|
|
263
|
+
params.width = ViewGroup.LayoutParams.MATCH_PARENT;
|
|
264
|
+
params.height = ViewGroup.LayoutParams.MATCH_PARENT;
|
|
265
|
+
popupDialog.getWindow().setAttributes((WindowManager.LayoutParams) params);
|
|
266
|
+
popupDialog.setOnDismissListener(dialog -> {
|
|
267
|
+
// Toast.makeText(view.getContext(), "팝업취소", Toast.LENGTH_SHORT).show();
|
|
268
|
+
onCloseWindow(view); //rn에선 딱히 동작하지 않음
|
|
269
|
+
});
|
|
270
|
+
newWebView.setDialog(popupDialog);
|
|
271
|
+
popupDialog.show();
|
|
272
|
+
|
|
273
|
+
final WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj;
|
|
274
|
+
transport.setWebView(newWebView);
|
|
275
|
+
resultMsg.sendToTarget();
|
|
276
|
+
|
|
277
|
+
return true;
|
|
172
278
|
|
|
173
|
-
|
|
279
|
+
} else {
|
|
280
|
+
final WebView newWebView = new WebView(view.getContext());
|
|
281
|
+
final WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj;
|
|
282
|
+
transport.setWebView(newWebView);
|
|
283
|
+
resultMsg.sendToTarget();
|
|
174
284
|
|
|
175
|
-
|
|
285
|
+
return true;
|
|
176
286
|
|
|
177
|
-
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
*/
|
|
290
|
+
|
|
178
291
|
|
|
179
|
-
@Override
|
|
180
|
-
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
|
181
|
-
Intent intent = getIntentWithPackage(url);
|
|
182
|
-
Context context = view.getContext();
|
|
183
292
|
|
|
184
|
-
if(isIntent(url)) {
|
|
185
|
-
if(isInstallApp(intent, context)) return startApp(intent, context);
|
|
186
|
-
else return startGooglePlay(intent, context);
|
|
187
|
-
} else if(isMarket(url)) {
|
|
188
|
-
if(isInstallApp(intent, context)) return startApp(intent, context);
|
|
189
|
-
else return startGooglePlay(intent, context);
|
|
190
|
-
} else if(isSpecialCase(url)) {
|
|
191
|
-
if(isInstallApp(intent, context)) return startApp(intent, context);
|
|
192
|
-
else return startGooglePlay(intent, context);
|
|
193
|
-
}
|
|
194
|
-
return url.contains("vguardend");
|
|
195
|
-
}
|
|
196
|
-
});
|
|
197
|
-
|
|
198
|
-
Dialog popupDialog = new Dialog(view.getContext(), android.R.style.Theme_Black_NoTitleBar_Fullscreen);
|
|
199
|
-
popupDialog.setContentView(newWebView);
|
|
200
|
-
ViewGroup.LayoutParams params = popupDialog.getWindow().getAttributes();
|
|
201
|
-
params.width = ViewGroup.LayoutParams.MATCH_PARENT;
|
|
202
|
-
params.height = ViewGroup.LayoutParams.MATCH_PARENT;
|
|
203
|
-
popupDialog.getWindow().setAttributes((WindowManager.LayoutParams) params);
|
|
204
|
-
popupDialog.setOnDismissListener(dialog -> {
|
|
205
|
-
// Toast.makeText(view.getContext(), "팝업취소", Toast.LENGTH_SHORT).show();
|
|
206
|
-
onCloseWindow(view); //rn에선 딱히 동작하지 않음
|
|
207
|
-
});
|
|
208
|
-
newWebView.setDialog(popupDialog);
|
|
209
|
-
popupDialog.show();
|
|
210
|
-
|
|
211
|
-
final WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj;
|
|
212
|
-
transport.setWebView(newWebView);
|
|
213
|
-
resultMsg.sendToTarget();
|
|
214
293
|
|
|
215
|
-
return true;
|
|
216
|
-
// final WebView newWebView = new WebView(view.getContext());
|
|
217
|
-
// final WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj;
|
|
218
|
-
// transport.setWebView(newWebView);
|
|
219
|
-
// resultMsg.sendToTarget();
|
|
220
|
-
//
|
|
221
|
-
// return true;
|
|
222
294
|
}
|
|
223
295
|
|
|
224
296
|
@Override
|
|
@@ -266,9 +338,20 @@ class BPCWebChromeClient extends WebChromeClient implements LifecycleEventListen
|
|
|
266
338
|
} else if (requestedResource.equals(PermissionRequest.RESOURCE_VIDEO_CAPTURE)) {
|
|
267
339
|
androidPermission = Manifest.permission.CAMERA;
|
|
268
340
|
} else if(requestedResource.equals(PermissionRequest.RESOURCE_PROTECTED_MEDIA_ID)) {
|
|
269
|
-
|
|
341
|
+
if (mAllowsProtectedMedia) {
|
|
342
|
+
grantedPermissions.add(requestedResource);
|
|
343
|
+
} else {
|
|
344
|
+
/**
|
|
345
|
+
* Legacy handling (Kept in case it was working under some conditions (given Android version or something))
|
|
346
|
+
*
|
|
347
|
+
* Try to ask user to grant permission using Activity.requestPermissions
|
|
348
|
+
*
|
|
349
|
+
* Find more details here: https://github.com/react-native-webview/react-native-webview/pull/2732
|
|
350
|
+
*/
|
|
351
|
+
androidPermission = PermissionRequest.RESOURCE_PROTECTED_MEDIA_ID;
|
|
352
|
+
}
|
|
270
353
|
}
|
|
271
|
-
// TODO: RESOURCE_MIDI_SYSEX
|
|
354
|
+
// TODO: RESOURCE_MIDI_SYSEX.
|
|
272
355
|
|
|
273
356
|
if (androidPermission != null) {
|
|
274
357
|
if (ContextCompat.checkSelfPermission(mReactContext, androidPermission) == PackageManager.PERMISSION_GRANTED) {
|
|
@@ -458,4 +541,13 @@ class BPCWebChromeClient extends WebChromeClient implements LifecycleEventListen
|
|
|
458
541
|
public void setProgressChangedFilter(BPCWebView.ProgressChangedFilter filter) {
|
|
459
542
|
progressChangedFilter = filter;
|
|
460
543
|
}
|
|
461
|
-
|
|
544
|
+
|
|
545
|
+
/**
|
|
546
|
+
* Set whether or not protected media should be allowed
|
|
547
|
+
* /!\ Setting this to false won't revoke permission already granted to the current webpage.
|
|
548
|
+
* In order to do so, you'd need to reload the page /!\
|
|
549
|
+
*/
|
|
550
|
+
public void setAllowsProtectedMedia(boolean enabled) {
|
|
551
|
+
mAllowsProtectedMedia = enabled;
|
|
552
|
+
}
|
|
553
|
+
}
|
|
@@ -32,7 +32,6 @@ import java.io.UnsupportedEncodingException;
|
|
|
32
32
|
import java.net.URLEncoder;
|
|
33
33
|
|
|
34
34
|
import kr.co.bootpay.webview.events.TopMessageEvent;
|
|
35
|
-
|
|
36
35
|
/**
|
|
37
36
|
* Subclass of {@link WebView} that implements {@link LifecycleEventListener} interface in order
|
|
38
37
|
* to call {@link WebView#destroy} on activity destroy event and also to clear the client
|
|
@@ -177,11 +177,9 @@ class BPCWebViewClient extends WebViewClient {
|
|
|
177
177
|
basicAuthCredential = credential;
|
|
178
178
|
}
|
|
179
179
|
|
|
180
|
-
/** bootpay changed **/
|
|
181
180
|
@Override
|
|
182
181
|
public void onPageFinished(WebView webView, String url) {
|
|
183
182
|
super.onPageFinished(webView, url);
|
|
184
|
-
updateBlindViewIfNaverLogin(webView, url);
|
|
185
183
|
|
|
186
184
|
if (!mLastLoadFailed) {
|
|
187
185
|
BPCWebView reactWebView = (BPCWebView) webView;
|
|
@@ -207,14 +205,12 @@ class BPCWebViewClient extends WebViewClient {
|
|
|
207
205
|
createWebViewEvent(webView, url)));
|
|
208
206
|
}
|
|
209
207
|
|
|
210
|
-
/** bootpay changed **/
|
|
211
208
|
|
|
212
209
|
@Override
|
|
213
210
|
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
|
214
211
|
Intent intent = getIntentWithPackage(url);
|
|
215
212
|
Context context = view.getContext();
|
|
216
|
-
|
|
217
|
-
Log.d("bootpay", "shouldOverrideUrlLoading : " + url);
|
|
213
|
+
|
|
218
214
|
|
|
219
215
|
if(isIntent(url)) {
|
|
220
216
|
if(isInstallApp(intent, context)) return startApp(intent, context);
|
|
@@ -229,20 +225,19 @@ class BPCWebViewClient extends WebViewClient {
|
|
|
229
225
|
// return url.contains("vguardend");
|
|
230
226
|
return shouldOverrideUrlLoadingRN(view, url);
|
|
231
227
|
}
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
final BPCWebView bpcWebView = (BPCWebView) view;
|
|
228
|
+
|
|
229
|
+
public boolean shouldOverrideUrlLoadingRN(WebView view, String url) {
|
|
230
|
+
final BPCWebView BPCWebView = (BPCWebView) view;
|
|
236
231
|
final boolean isJsDebugging = ((ReactContext) view.getContext()).getJavaScriptContextHolder().get() == 0;
|
|
237
232
|
|
|
238
|
-
if (!isJsDebugging &&
|
|
233
|
+
if (!isJsDebugging && BPCWebView.mCatalystInstance != null) {
|
|
239
234
|
final Pair<Integer, AtomicReference<BPCWebViewModule.ShouldOverrideUrlLoadingLock.ShouldOverrideCallbackState>> lock = BPCWebViewModule.shouldOverrideUrlLoadingLock.getNewLock();
|
|
240
235
|
final int lockIdentifier = lock.first;
|
|
241
236
|
final AtomicReference<BPCWebViewModule.ShouldOverrideUrlLoadingLock.ShouldOverrideCallbackState> lockObject = lock.second;
|
|
242
237
|
|
|
243
238
|
final WritableMap event = createWebViewEvent(view, url);
|
|
244
239
|
event.putInt("lockIdentifier", lockIdentifier);
|
|
245
|
-
|
|
240
|
+
BPCWebView.sendDirectMessage("onShouldStartLoadWithRequest", event);
|
|
246
241
|
|
|
247
242
|
try {
|
|
248
243
|
assert lockObject != null;
|
|
@@ -1,43 +1,82 @@
|
|
|
1
1
|
package kr.co.bootpay.webview;
|
|
2
2
|
|
|
3
|
+
import android.annotation.SuppressLint;
|
|
3
4
|
import android.annotation.TargetApi;
|
|
4
5
|
import android.app.Activity;
|
|
5
6
|
import android.app.DownloadManager;
|
|
6
7
|
import android.content.Context;
|
|
7
8
|
import android.content.pm.ActivityInfo;
|
|
9
|
+
import android.content.pm.PackageManager;
|
|
8
10
|
import android.graphics.Bitmap;
|
|
9
11
|
import android.graphics.Color;
|
|
12
|
+
import android.Manifest;
|
|
13
|
+
import android.net.http.SslError;
|
|
10
14
|
import android.net.Uri;
|
|
11
15
|
import android.os.Build;
|
|
12
16
|
import android.os.Environment;
|
|
17
|
+
import android.os.Message;
|
|
18
|
+
import android.os.SystemClock;
|
|
19
|
+
import android.text.TextUtils;
|
|
13
20
|
import android.util.Log;
|
|
21
|
+
import android.view.Gravity;
|
|
22
|
+
import android.view.MotionEvent;
|
|
14
23
|
import android.view.View;
|
|
15
24
|
import android.view.ViewGroup;
|
|
16
25
|
import android.view.ViewGroup.LayoutParams;
|
|
17
26
|
import android.view.WindowManager;
|
|
27
|
+
import android.webkit.ConsoleMessage;
|
|
18
28
|
import android.webkit.CookieManager;
|
|
19
29
|
import android.webkit.DownloadListener;
|
|
20
|
-
import android.webkit.
|
|
30
|
+
import android.webkit.GeolocationPermissions;
|
|
31
|
+
import android.webkit.HttpAuthHandler;
|
|
32
|
+
import android.webkit.JavascriptInterface;
|
|
33
|
+
import android.webkit.RenderProcessGoneDetail;
|
|
34
|
+
import android.webkit.SslErrorHandler;
|
|
35
|
+
import android.webkit.PermissionRequest;
|
|
36
|
+
import android.webkit.ValueCallback;
|
|
37
|
+
import android.webkit.WebChromeClient;
|
|
38
|
+
import android.webkit.WebResourceRequest;
|
|
39
|
+
import android.webkit.WebResourceResponse;
|
|
21
40
|
import android.webkit.WebSettings;
|
|
22
41
|
import android.webkit.WebView;
|
|
42
|
+
import android.webkit.WebViewClient;
|
|
43
|
+
import android.widget.FrameLayout;
|
|
23
44
|
|
|
24
45
|
import androidx.annotation.NonNull;
|
|
25
46
|
import androidx.annotation.Nullable;
|
|
47
|
+
import androidx.annotation.RequiresApi;
|
|
48
|
+
import androidx.core.content.ContextCompat;
|
|
49
|
+
import androidx.core.util.Pair;
|
|
26
50
|
import androidx.webkit.WebSettingsCompat;
|
|
27
51
|
import androidx.webkit.WebViewFeature;
|
|
28
52
|
|
|
53
|
+
import com.facebook.common.logging.FLog;
|
|
54
|
+
import com.facebook.react.modules.core.PermissionAwareActivity;
|
|
55
|
+
import com.facebook.react.modules.core.PermissionListener;
|
|
56
|
+
import com.facebook.react.views.scroll.ScrollEvent;
|
|
29
57
|
import com.facebook.react.views.scroll.ScrollEventType;
|
|
58
|
+
import com.facebook.react.views.scroll.OnScrollDispatchHelper;
|
|
59
|
+
import com.facebook.react.bridge.Arguments;
|
|
60
|
+
import com.facebook.react.bridge.CatalystInstance;
|
|
61
|
+
import com.facebook.react.bridge.LifecycleEventListener;
|
|
30
62
|
import com.facebook.react.bridge.ReactContext;
|
|
31
63
|
import com.facebook.react.bridge.ReadableArray;
|
|
32
64
|
import com.facebook.react.bridge.ReadableMap;
|
|
33
65
|
import com.facebook.react.bridge.ReadableMapKeySetIterator;
|
|
66
|
+
import com.facebook.react.bridge.WritableMap;
|
|
67
|
+
import com.facebook.react.bridge.WritableNativeArray;
|
|
68
|
+
import com.facebook.react.bridge.WritableNativeMap;
|
|
34
69
|
import com.facebook.react.common.MapBuilder;
|
|
35
70
|
import com.facebook.react.common.build.ReactBuildConfig;
|
|
36
71
|
import com.facebook.react.module.annotations.ReactModule;
|
|
37
72
|
import com.facebook.react.uimanager.SimpleViewManager;
|
|
38
73
|
import com.facebook.react.uimanager.ThemedReactContext;
|
|
74
|
+
import com.facebook.react.uimanager.UIManagerModule;
|
|
39
75
|
import com.facebook.react.uimanager.annotations.ReactProp;
|
|
40
|
-
|
|
76
|
+
import com.facebook.react.uimanager.events.ContentSizeChangeEvent;
|
|
77
|
+
import com.facebook.react.uimanager.events.Event;
|
|
78
|
+
import com.facebook.react.uimanager.events.EventDispatcher;
|
|
79
|
+
import kr.co.bootpay.webview.BPCWebViewModule.ShouldOverrideUrlLoadingLock.ShouldOverrideCallbackState;
|
|
41
80
|
import kr.co.bootpay.webview.events.TopLoadingErrorEvent;
|
|
42
81
|
import kr.co.bootpay.webview.events.TopHttpErrorEvent;
|
|
43
82
|
import kr.co.bootpay.webview.events.TopLoadingFinishEvent;
|
|
@@ -54,9 +93,14 @@ import java.io.UnsupportedEncodingException;
|
|
|
54
93
|
import java.lang.IllegalArgumentException;
|
|
55
94
|
import java.net.MalformedURLException;
|
|
56
95
|
import java.net.URL;
|
|
96
|
+
import java.net.URLEncoder;
|
|
97
|
+
import java.util.ArrayList;
|
|
98
|
+
import java.util.Collections;
|
|
57
99
|
import java.util.HashMap;
|
|
100
|
+
import java.util.List;
|
|
58
101
|
import java.util.Locale;
|
|
59
102
|
import java.util.Map;
|
|
103
|
+
import java.util.concurrent.atomic.AtomicReference;
|
|
60
104
|
|
|
61
105
|
/**
|
|
62
106
|
* Manages instances of {@link WebView}
|
|
@@ -116,6 +160,7 @@ public class BPCWebViewManager extends SimpleViewManager<WebView> {
|
|
|
116
160
|
|
|
117
161
|
protected BPCWebChromeClient mWebChromeClient = null;
|
|
118
162
|
protected boolean mAllowsFullscreenVideo = false;
|
|
163
|
+
protected boolean mAllowsProtectedMedia = false;
|
|
119
164
|
protected @Nullable String mUserAgent = null;
|
|
120
165
|
protected @Nullable String mUserAgentWithApplicationName = null;
|
|
121
166
|
protected @Nullable String mDownloadingMessage = null;
|
|
@@ -268,14 +313,7 @@ public class BPCWebViewManager extends SimpleViewManager<WebView> {
|
|
|
268
313
|
|
|
269
314
|
@ReactProp(name = "cacheEnabled")
|
|
270
315
|
public void setCacheEnabled(WebView view, boolean enabled) {
|
|
271
|
-
|
|
272
|
-
Context ctx = view.getContext();
|
|
273
|
-
if (ctx != null) {
|
|
274
|
-
view.getSettings().setCacheMode(WebSettings.LOAD_DEFAULT);
|
|
275
|
-
}
|
|
276
|
-
} else {
|
|
277
|
-
view.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
|
|
278
|
-
}
|
|
316
|
+
view.getSettings().setCacheMode(enabled ? WebSettings.LOAD_DEFAULT : WebSettings.LOAD_NO_CACHE);
|
|
279
317
|
}
|
|
280
318
|
|
|
281
319
|
@ReactProp(name = "cacheMode")
|
|
@@ -632,6 +670,20 @@ public class BPCWebViewManager extends SimpleViewManager<WebView> {
|
|
|
632
670
|
view.getSettings().setMinimumFontSize(fontSize);
|
|
633
671
|
}
|
|
634
672
|
|
|
673
|
+
@ReactProp(name = "allowsProtectedMedia")
|
|
674
|
+
public void setAllowsProtectedMedia(WebView view, boolean enabled) {
|
|
675
|
+
// This variable is used to keep consistency
|
|
676
|
+
// in case a new WebChromeClient is created
|
|
677
|
+
// (eg. when mAllowsFullScreenVideo changes)
|
|
678
|
+
mAllowsProtectedMedia = enabled;
|
|
679
|
+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
|
680
|
+
WebChromeClient client = view.getWebChromeClient();
|
|
681
|
+
if (client != null && client instanceof BPCWebChromeClient) {
|
|
682
|
+
((BPCWebChromeClient) client).setAllowsProtectedMedia(enabled);
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
|
|
635
687
|
@Override
|
|
636
688
|
protected void addEventEmitters(ThemedReactContext reactContext, WebView view) {
|
|
637
689
|
// Do not register default touch emitter and let WebView implementation handle touches
|
|
@@ -838,6 +890,7 @@ public class BPCWebViewManager extends SimpleViewManager<WebView> {
|
|
|
838
890
|
}
|
|
839
891
|
};
|
|
840
892
|
|
|
893
|
+
// bootpay added //
|
|
841
894
|
webView.setWebChromeClient(mWebChromeClient);
|
|
842
895
|
} else {
|
|
843
896
|
if (mWebChromeClient != null) {
|
|
@@ -850,9 +903,8 @@ public class BPCWebViewManager extends SimpleViewManager<WebView> {
|
|
|
850
903
|
return Bitmap.createBitmap(50, 50, Bitmap.Config.ARGB_8888);
|
|
851
904
|
}
|
|
852
905
|
};
|
|
853
|
-
|
|
854
|
-
webView.setWebChromeClient(mWebChromeClient);
|
|
855
906
|
}
|
|
907
|
+
mWebChromeClient.setAllowsProtectedMedia(mAllowsProtectedMedia);
|
|
908
|
+
webView.setWebChromeClient(mWebChromeClient);
|
|
856
909
|
}
|
|
857
|
-
|
|
858
910
|
}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2006 The Android Open Source Project
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/*
|
|
18
|
+
* The source code is obtained from the Android SDK Sources (API level 31),
|
|
19
|
+
* and modified by UNIDY2002 <UNIDY2002@outlook.com>.
|
|
20
|
+
*
|
|
21
|
+
* Change list:
|
|
22
|
+
* - Remove all unused class members except guessFileName,
|
|
23
|
+
* CONTENT_DISPOSITION_PATTERN and parseContentDisposition
|
|
24
|
+
* - Improve CONTENT_DISPOSITION_PATTERN and parseContentDisposition to add
|
|
25
|
+
* support for the "filename*" parameter in content disposition
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
package kr.co.bootpay.webview;
|
|
29
|
+
|
|
30
|
+
import android.net.Uri;
|
|
31
|
+
import android.webkit.MimeTypeMap;
|
|
32
|
+
import androidx.annotation.Nullable;
|
|
33
|
+
|
|
34
|
+
import java.io.UnsupportedEncodingException;
|
|
35
|
+
import java.net.URLDecoder;
|
|
36
|
+
import java.util.Locale;
|
|
37
|
+
import java.util.regex.Matcher;
|
|
38
|
+
import java.util.regex.Pattern;
|
|
39
|
+
|
|
40
|
+
public final class URLUtil {
|
|
41
|
+
/**
|
|
42
|
+
* Guesses canonical filename that a download would have, using
|
|
43
|
+
* the URL and contentDisposition. File extension, if not defined,
|
|
44
|
+
* is added based on the mimetype
|
|
45
|
+
* @param url Url to the content
|
|
46
|
+
* @param contentDisposition Content-Disposition HTTP header or {@code null}
|
|
47
|
+
* @param mimeType Mime-type of the content or {@code null}
|
|
48
|
+
*
|
|
49
|
+
* @return suggested filename
|
|
50
|
+
*/
|
|
51
|
+
public static final String guessFileName(
|
|
52
|
+
String url,
|
|
53
|
+
@Nullable String contentDisposition,
|
|
54
|
+
@Nullable String mimeType) {
|
|
55
|
+
String filename = null;
|
|
56
|
+
String extension = null;
|
|
57
|
+
|
|
58
|
+
// If we couldn't do anything with the hint, move toward the content disposition
|
|
59
|
+
if (filename == null && contentDisposition != null) {
|
|
60
|
+
filename = parseContentDisposition(contentDisposition);
|
|
61
|
+
if (filename != null) {
|
|
62
|
+
int index = filename.lastIndexOf('/') + 1;
|
|
63
|
+
if (index > 0) {
|
|
64
|
+
filename = filename.substring(index);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// If all the other http-related approaches failed, use the plain uri
|
|
70
|
+
if (filename == null) {
|
|
71
|
+
String decodedUrl = Uri.decode(url);
|
|
72
|
+
if (decodedUrl != null) {
|
|
73
|
+
int queryIndex = decodedUrl.indexOf('?');
|
|
74
|
+
// If there is a query string strip it, same as desktop browsers
|
|
75
|
+
if (queryIndex > 0) {
|
|
76
|
+
decodedUrl = decodedUrl.substring(0, queryIndex);
|
|
77
|
+
}
|
|
78
|
+
if (!decodedUrl.endsWith("/")) {
|
|
79
|
+
int index = decodedUrl.lastIndexOf('/') + 1;
|
|
80
|
+
if (index > 0) {
|
|
81
|
+
filename = decodedUrl.substring(index);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// Finally, if couldn't get filename from URI, get a generic filename
|
|
88
|
+
if (filename == null) {
|
|
89
|
+
filename = "downloadfile";
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// Split filename between base and extension
|
|
93
|
+
// Add an extension if filename does not have one
|
|
94
|
+
int dotIndex = filename.indexOf('.');
|
|
95
|
+
if (dotIndex < 0) {
|
|
96
|
+
if (mimeType != null) {
|
|
97
|
+
extension = MimeTypeMap.getSingleton().getExtensionFromMimeType(mimeType);
|
|
98
|
+
if (extension != null) {
|
|
99
|
+
extension = "." + extension;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
if (extension == null) {
|
|
103
|
+
if (mimeType != null && mimeType.toLowerCase(Locale.ROOT).startsWith("text/")) {
|
|
104
|
+
if (mimeType.equalsIgnoreCase("text/html")) {
|
|
105
|
+
extension = ".html";
|
|
106
|
+
} else {
|
|
107
|
+
extension = ".txt";
|
|
108
|
+
}
|
|
109
|
+
} else {
|
|
110
|
+
extension = ".bin";
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
} else {
|
|
114
|
+
if (mimeType != null) {
|
|
115
|
+
// Compare the last segment of the extension against the mime type.
|
|
116
|
+
// If there's a mismatch, discard the entire extension.
|
|
117
|
+
int lastDotIndex = filename.lastIndexOf('.');
|
|
118
|
+
String typeFromExt = MimeTypeMap.getSingleton().getMimeTypeFromExtension(
|
|
119
|
+
filename.substring(lastDotIndex + 1));
|
|
120
|
+
if (typeFromExt != null && !typeFromExt.equalsIgnoreCase(mimeType)) {
|
|
121
|
+
extension = MimeTypeMap.getSingleton().getExtensionFromMimeType(mimeType);
|
|
122
|
+
if (extension != null) {
|
|
123
|
+
extension = "." + extension;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
if (extension == null) {
|
|
128
|
+
extension = filename.substring(dotIndex);
|
|
129
|
+
}
|
|
130
|
+
filename = filename.substring(0, dotIndex);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
return filename + extension;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/** Regex used to parse content-disposition headers */
|
|
137
|
+
private static final Pattern CONTENT_DISPOSITION_PATTERN =
|
|
138
|
+
Pattern.compile("attachment(?:;\\s*filename\\s*=\\s*(\"?)([^\"]*)\\1)?(?:;\\s*filename\\s*\\*\\s*=\\s*([^']*)'[^']*'([^']*))?\\s*$",
|
|
139
|
+
Pattern.CASE_INSENSITIVE);
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Parse the Content-Disposition HTTP Header. The format of the header
|
|
143
|
+
* is defined here: <a href="https://www.rfc-editor.org/rfc/rfc6266">RFC 6266</a>
|
|
144
|
+
* This header provides a filename for content that is going to be
|
|
145
|
+
* downloaded to the file system. We only support the attachment type.
|
|
146
|
+
*/
|
|
147
|
+
static String parseContentDisposition(String contentDisposition) {
|
|
148
|
+
try {
|
|
149
|
+
// The regex attempts to match the following pattern:
|
|
150
|
+
// attachment; filename="(Group 2)"; filename*=(Group 3)'(lang)'(Group 4)
|
|
151
|
+
// Group 4 refers to the percent-encoded filename, and the charset
|
|
152
|
+
// is specified in Group 3.
|
|
153
|
+
// Group 2 is the fallback filename.
|
|
154
|
+
// Group 1 refers to the quotation marks around Group 2.
|
|
155
|
+
//
|
|
156
|
+
// Test cases can be found at http://test.greenbytes.de/tech/tc2231/
|
|
157
|
+
// Examples can be found at https://www.rfc-editor.org/rfc/rfc6266#section-5
|
|
158
|
+
// There are a few known limitations:
|
|
159
|
+
// - any Content Disposition value that does not have parameters
|
|
160
|
+
// arranged in the order of "attachment...filename...filename*"
|
|
161
|
+
// or contains extra parameters shall fail to be parsed
|
|
162
|
+
// - any filename that contains " shall fail to be parsed
|
|
163
|
+
Matcher m = CONTENT_DISPOSITION_PATTERN.matcher(contentDisposition);
|
|
164
|
+
if (m.find()) {
|
|
165
|
+
if (m.group(3) != null && m.group(4) != null) {
|
|
166
|
+
try {
|
|
167
|
+
return URLDecoder.decode(m.group(4), m.group(3).isEmpty() ? "UTF-8" : m.group(3));
|
|
168
|
+
} catch (UnsupportedEncodingException e) {
|
|
169
|
+
// Skip the ext-parameter as the encoding is unsupported
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
return m.group(2);
|
|
173
|
+
}
|
|
174
|
+
} catch (IllegalStateException ex) {
|
|
175
|
+
// This function is defined as returning null when it can't parse the header
|
|
176
|
+
}
|
|
177
|
+
return null;
|
|
178
|
+
}
|
|
179
|
+
}
|