react-native-webview-bootpay 11.18.1 → 11.18.13
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 +93 -83
- package/android/{build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab.keystream → .DS_Store} +0 -0
- package/android/.gradle/6.8/executionHistory/executionHistory.bin +0 -0
- package/android/.gradle/6.8/executionHistory/executionHistory.lock +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/7.0-rc-1/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/7.0-rc-1/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/7.0-rc-1/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/7.0-rc-1/fileChanges/last-build.bin +0 -0
- package/android/.gradle/7.0-rc-1/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/7.0-rc-1/gc.properties +0 -0
- package/android/.gradle/7.1.1/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/7.1.1/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/7.1.1/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +1 -1
- 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/.idea/jarRepositories.xml +8 -3
- package/android/.idea/libraries/Gradle__androidx_annotation_annotation_1_0_0.xml +13 -0
- package/android/.idea/libraries/Gradle__androidx_appcompat_appcompat_1_0_2_aar.xml +4 -4
- package/android/.idea/libraries/Gradle__androidx_arch_core_core_runtime_2_0_0_aar.xml +3 -3
- package/android/.idea/libraries/Gradle__androidx_asynclayoutinflater_asynclayoutinflater_1_0_0_aar.xml +3 -3
- package/android/.idea/libraries/Gradle__androidx_coordinatorlayout_coordinatorlayout_1_0_0_aar.xml +4 -4
- package/android/.idea/libraries/Gradle__androidx_core_core_1_0_1_aar.xml +16 -0
- package/android/.idea/libraries/Gradle__androidx_cursoradapter_cursoradapter_1_0_0_aar.xml +3 -3
- package/android/.idea/libraries/Gradle__androidx_customview_customview_1_0_0_aar.xml +3 -3
- package/android/.idea/libraries/Gradle__androidx_documentfile_documentfile_1_0_0_aar.xml +3 -3
- package/android/.idea/libraries/Gradle__androidx_drawerlayout_drawerlayout_1_0_0_aar.xml +4 -4
- package/android/.idea/libraries/Gradle__androidx_fragment_fragment_1_0_0_aar.xml +4 -4
- package/android/.idea/libraries/Gradle__androidx_interpolator_interpolator_1_0_0_aar.xml +3 -3
- package/android/.idea/libraries/Gradle__androidx_legacy_legacy_support_core_ui_1_0_0_aar.xml +3 -3
- package/android/.idea/libraries/Gradle__androidx_legacy_legacy_support_core_utils_1_0_0_aar.xml +3 -3
- package/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_livedata_2_0_0_aar.xml +3 -3
- package/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_livedata_core_2_0_0_aar.xml +3 -3
- package/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_runtime_2_0_0_aar.xml +3 -3
- package/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_viewmodel_2_0_0_aar.xml +3 -3
- package/android/.idea/libraries/Gradle__androidx_loader_loader_1_0_0_aar.xml +3 -3
- package/android/.idea/libraries/Gradle__androidx_localbroadcastmanager_localbroadcastmanager_1_0_0_aar.xml +3 -3
- package/android/.idea/libraries/Gradle__androidx_print_print_1_0_0_aar.xml +4 -4
- package/android/.idea/libraries/Gradle__androidx_slidingpanelayout_slidingpanelayout_1_0_0_aar.xml +3 -3
- package/android/.idea/libraries/Gradle__androidx_swiperefreshlayout_swiperefreshlayout_1_0_0_aar.xml +4 -4
- package/android/.idea/libraries/Gradle__androidx_vectordrawable_vectordrawable_1_0_1_aar.xml +3 -3
- package/android/.idea/libraries/Gradle__androidx_vectordrawable_vectordrawable_animated_1_0_0_aar.xml +3 -3
- package/android/.idea/libraries/Gradle__androidx_versionedparcelable_versionedparcelable_1_0_0_aar.xml +13 -0
- package/android/.idea/libraries/Gradle__androidx_viewpager_viewpager_1_0_0_aar.xml +3 -3
- package/android/.idea/libraries/Gradle__com_facebook_fbjni_fbjni_java_only_0_0_3.xml +13 -0
- package/android/.idea/libraries/Gradle__com_facebook_fresco_drawee_2_0_0_aar.xml +15 -0
- package/android/.idea/libraries/{Gradle__com_facebook_fresco_fbcore_2_5_0_aar.xml → Gradle__com_facebook_fresco_fbcore_2_0_0_aar.xml} +7 -7
- package/android/.idea/libraries/Gradle__com_facebook_fresco_fresco_2_0_0_aar.xml +18 -0
- package/android/.idea/libraries/Gradle__com_facebook_fresco_imagepipeline_2_0_0_aar.xml +18 -0
- package/android/.idea/libraries/Gradle__com_facebook_fresco_imagepipeline_base_2_0_0_aar.xml +18 -0
- package/android/.idea/libraries/Gradle__com_facebook_fresco_imagepipeline_okhttp3_2_0_0_aar.xml +15 -0
- package/android/.idea/libraries/Gradle__com_facebook_fresco_nativeimagefilters_2_0_0_aar.xml +15 -0
- package/android/.idea/libraries/Gradle__com_facebook_fresco_nativeimagetranscoder_2_0_0_aar.xml +15 -0
- package/android/.idea/libraries/{Gradle__com_facebook_infer_annotation_infer_annotation_0_18_0.xml → Gradle__com_facebook_infer_annotation_infer_annotation_0_11_2.xml} +4 -4
- package/android/.idea/libraries/Gradle__com_facebook_react_react_native_0_62_2_aar.xml +18 -0
- package/android/.idea/libraries/Gradle__com_facebook_soloader_annotation_0_8_0_aar.xml +15 -0
- package/android/.idea/libraries/Gradle__com_facebook_soloader_nativeloader_0_8_0.xml +13 -0
- package/android/.idea/libraries/Gradle__com_facebook_soloader_soloader_0_8_0_aar.xml +15 -0
- package/android/.idea/libraries/Gradle__com_facebook_yoga_proguard_annotations_1_14_1.xml +13 -0
- package/android/.idea/libraries/Gradle__com_squareup_okhttp3_okhttp_3_12_1.xml +13 -0
- package/android/.idea/libraries/Gradle__com_squareup_okhttp3_okhttp_urlconnection_3_12_1.xml +13 -0
- package/android/.idea/libraries/Gradle__com_squareup_okio_okio_1_15_0.xml +13 -0
- package/android/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_3_50.xml +13 -0
- package/android/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_common_1_3_50.xml +13 -0
- package/android/.idea/modules/android.iml +33 -42
- package/android/.project +34 -0
- package/android/.settings/org.eclipse.buildship.core.prefs +13 -0
- package/android/build/.transforms/d5207f219c4292752e7af446f7cc2789/classes/classes.dex +0 -0
- package/android/build/.transforms/{cef19407ab645b1b4c01cb89efaec997/results.bin → d5207f219c4292752e7af446f7cc2789.bin} +0 -0
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/AndroidManifest.xml +84 -3
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/output-metadata.json +2 -4
- package/android/build/intermediates/aar_metadata/debug/aar-metadata.properties +0 -2
- 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 +8 -72
- package/android/build/intermediates/compiled_local_resources/debug/out/xml_file_provider_paths.xml.flat +0 -0
- package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +1 -1
- package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +1 -1
- package/android/build/intermediates/incremental/packageDebugAssets/merger.xml +1 -1
- package/android/build/intermediates/incremental/packageDebugResources/compile-file-map.properties +2 -2
- package/android/build/intermediates/incremental/packageDebugResources/merger.xml +1 -1
- 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/BPCWebViewModule.class +0 -0
- package/android/build/intermediates/library_java_res/debug/res.jar +0 -0
- package/android/build/intermediates/library_manifest/debug/AndroidManifest.xml +102 -0
- package/android/build/intermediates/manifest_merge_blame_file/debug/manifest-merger-blame-debug-report.txt +200 -30
- package/android/build/intermediates/packaged_manifests/debug/output-metadata.json +3 -5
- 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 +8 -66
- package/android/build/kotlin/compileDebugKotlin/build-history.bin +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/constants.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/constants.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/{lookups/id-to-file.tab.keystream → jvm/kotlin/java-sources-proto-map.tab} +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/{subtypes.tab_i → java-sources-proto-map.tab_i} +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/last-build.bin +0 -0
- package/android/build/outputs/logs/manifest-merger-debug-report.txt +217 -27
- package/android/build/tmp/compileDebugJavaWithJavac/source-classes-mapping.txt +29 -0
- package/android/build/tmp/kotlin-classes/debug/META-INF/rnWebView_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 +5 -5
- package/android/gradle.properties +6 -6
- package/android/local.properties +1 -1
- package/android/{build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-attributes.tab → src/.DS_Store} +0 -0
- package/android/{build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/constants.tab.keystream → src/main/.DS_Store} +0 -0
- package/android/src/main/AndroidManifest.xml +75 -0
- package/android/src/main/java/.DS_Store +0 -0
- package/android/src/main/java/kr/.DS_Store +0 -0
- package/android/src/main/java/kr/co/.DS_Store +0 -0
- package/android/src/main/java/kr/co/bootpay/.DS_Store +0 -0
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebChromeClient.java +120 -2
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebView.java +11 -26
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebViewClient.java +119 -134
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebViewManager.java +49 -95
- package/apple/BPCWebView.h +0 -19
- package/apple/BPCWebView.m +127 -290
- package/apple/BPCWebViewManager.h +0 -2
- package/apple/BPCWebViewManager.m +1 -25
- package/index.d.ts +5 -5
- package/ios/.DS_Store +0 -0
- package/ios/RNCWebView.xcodeproj/project.pbxproj +18 -18
- package/ios/RNCWebView.xcodeproj/project.xcworkspace/xcuserdata/bootpay.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/RNCWebView.xcodeproj/xcuserdata/bootpay.xcuserdatad/xcschemes/xcschememanagement.plist +0 -8
- package/lib/WebView.android.d.ts +0 -3
- package/lib/WebView.android.d.ts.map +1 -1
- package/lib/WebView.android.js +4 -11
- package/lib/WebView.d.ts +2 -2
- package/lib/WebView.d.ts.map +1 -1
- package/lib/WebView.ios.d.ts +0 -1
- package/lib/WebView.ios.d.ts.map +1 -1
- package/lib/WebView.ios.js +7 -12
- package/lib/WebView.macos.d.ts.map +1 -1
- package/lib/WebView.macos.js +6 -10
- package/lib/WebView.windows.d.ts +2 -4
- package/lib/WebView.windows.d.ts.map +1 -1
- package/lib/WebView.windows.js +12 -18
- package/lib/WebViewShared.d.ts +0 -1
- package/lib/WebViewShared.d.ts.map +1 -1
- package/lib/WebViewTypes.d.ts +2 -113
- package/lib/WebViewTypes.d.ts.map +1 -1
- package/package.json +14 -16
- package/react-native-webview-bootpay.podspec +3 -1
- package/react-native.config.js +61 -47
- package/windows/ReactNativeWebView/ReactNativeWebView.vcxproj +20 -37
- package/windows/ReactNativeWebView/ReactPackageProvider.cpp +1 -5
- package/windows/ReactNativeWebView/ReactWebView.cpp +6 -2
- package/windows/ReactNativeWebView/ReactWebView.h +2 -3
- package/windows/ReactNativeWebView/ReactWebView.idl +1 -13
- package/windows/ReactNativeWebView/ReactWebViewManager.cpp +31 -36
- package/windows/ReactNativeWebView/packages.config +0 -2
- package/windows/ReactNativeWebView/pch.h +0 -6
- package/windows/ReactNativeWebView.sln +119 -81
- package/windows/WebViewBridgeComponent/PropertySheet.props +16 -0
- package/windows/{ReactNativeWebView → WebViewBridgeComponent}/WebBridge.cpp +1 -1
- package/windows/{ReactNativeWebView → WebViewBridgeComponent}/WebBridge.h +2 -2
- package/windows/{ReactNativeWebView → WebViewBridgeComponent}/WebBridge.idl +1 -1
- package/windows/WebViewBridgeComponent/WebViewBridgeComponent.def +3 -0
- package/windows/WebViewBridgeComponent/WebViewBridgeComponent.vcxproj +160 -0
- package/windows/WebViewBridgeComponent/WebViewBridgeComponent.vcxproj.filters +33 -0
- package/windows/WebViewBridgeComponent/packages.config +4 -0
- package/windows/WebViewBridgeComponent/pch.cpp +1 -0
- package/windows/WebViewBridgeComponent/pch.h +4 -0
- package/windows/WebViewBridgeComponent/readme.txt +23 -0
- package/android/.idea/libraries/Gradle__androidx_annotation_annotation_1_1_0.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_autofill_autofill_1_1_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_versionedparcelable_versionedparcelable_1_1_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_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_react_react_native_0_66_4_aar.xml +0 -14
- package/android/.idea/libraries/Gradle__com_facebook_soloader_annotation_0_10_1.xml +0 -13
- package/android/.idea/libraries/Gradle__com_facebook_soloader_nativeloader_0_10_1.xml +0 -13
- package/android/.idea/libraries/Gradle__com_facebook_soloader_soloader_0_10_1_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_squareup_okhttp3_okhttp_4_9_1.xml +0 -13
- package/android/.idea/libraries/Gradle__com_squareup_okhttp3_okhttp_urlconnection_4_9_1.xml +0 -13
- package/android/.idea/libraries/Gradle__com_squareup_okio_okio_2_9_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/build/.transforms/cef19407ab645b1b4c01cb89efaec997/transformed/classes/classes.dex +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BasicAuthCredential.class +0 -0
- package/android/build/intermediates/merged_manifest/debug/AndroidManifest.xml +0 -21
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-attributes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-attributes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-attributes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-attributes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-attributes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/constants.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/constants.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/constants.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/constants.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/counters.tab +0 -2
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab_i.len +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
- package/android/build/tmp/kotlin-classes/debug/META-INF/react-native-webview_debug.kotlin_module +0 -0
- package/android/src/main/java/kr/co/bootpay/webview/BasicAuthCredential.java +0 -12
- package/ios/RNCWebView.xcodeproj/xcshareddata/xcschemes/RNCWebView.xcscheme +0 -68
- 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
- package/lib/WebViewNativeComponent.macos.d.ts +0 -4
- package/lib/WebViewNativeComponent.macos.d.ts.map +0 -1
- package/lib/WebViewNativeComponent.macos.js +0 -3
- package/lib/WebViewNativeComponent.windows.d.ts +0 -4
- package/lib/WebViewNativeComponent.windows.d.ts.map +0 -1
- package/lib/WebViewNativeComponent.windows.js +0 -3
- package/lib/index.d.ts +0 -4
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js +0 -3
- package/windows/ExperimentalFeatures.props +0 -12
- package/windows/ReactNativeWebView/ReactWebView2.cpp +0 -119
- package/windows/ReactNativeWebView/ReactWebView2.h +0 -43
- package/windows/ReactNativeWebView/ReactWebView2Manager.cpp +0 -147
- package/windows/ReactNativeWebView/ReactWebView2Manager.h +0 -54
|
@@ -10,7 +10,6 @@ import android.net.http.SslError;
|
|
|
10
10
|
import android.os.Build;
|
|
11
11
|
import android.os.SystemClock;
|
|
12
12
|
import android.util.Log;
|
|
13
|
-
import android.webkit.HttpAuthHandler;
|
|
14
13
|
import android.webkit.RenderProcessGoneDetail;
|
|
15
14
|
import android.webkit.SslErrorHandler;
|
|
16
15
|
import android.webkit.WebResourceRequest;
|
|
@@ -31,18 +30,15 @@ import com.facebook.react.bridge.WritableMap;
|
|
|
31
30
|
import java.net.URISyntaxException;
|
|
32
31
|
import java.util.concurrent.atomic.AtomicReference;
|
|
33
32
|
|
|
34
|
-
|
|
35
33
|
import kr.co.bootpay.webview.events.TopHttpErrorEvent;
|
|
36
34
|
import kr.co.bootpay.webview.events.TopLoadingErrorEvent;
|
|
37
35
|
import kr.co.bootpay.webview.events.TopLoadingFinishEvent;
|
|
38
36
|
import kr.co.bootpay.webview.events.TopLoadingStartEvent;
|
|
39
37
|
import kr.co.bootpay.webview.events.TopRenderProcessGoneEvent;
|
|
40
38
|
import kr.co.bootpay.webview.events.TopShouldStartLoadWithRequestEvent;
|
|
41
|
-
import kr.co.bootpay.webview.BPCWebViewModule.ShouldOverrideUrlLoadingLock.ShouldOverrideCallbackState;
|
|
42
|
-
|
|
43
39
|
|
|
44
|
-
class BPCWebViewClient extends WebViewClient {
|
|
45
|
-
private static final String TAG = "
|
|
40
|
+
public class BPCWebViewClient extends WebViewClient {
|
|
41
|
+
private static final String TAG = "BPCWebViewClient";
|
|
46
42
|
protected static final int SHOULD_OVERRIDE_URL_LOADING_TIMEOUT = 250;
|
|
47
43
|
|
|
48
44
|
protected boolean mLastLoadFailed = false;
|
|
@@ -50,16 +46,11 @@ class BPCWebViewClient extends WebViewClient {
|
|
|
50
46
|
ReadableArray mUrlPrefixesForDefaultIntent;
|
|
51
47
|
protected BPCWebView.ProgressChangedFilter progressChangedFilter = null;
|
|
52
48
|
protected @Nullable String ignoreErrFailedForThisURL = null;
|
|
53
|
-
protected @Nullable BasicAuthCredential basicAuthCredential = null;
|
|
54
49
|
|
|
55
50
|
public void setIgnoreErrFailedForThisURL(@Nullable String url) {
|
|
56
51
|
ignoreErrFailedForThisURL = url;
|
|
57
52
|
}
|
|
58
53
|
|
|
59
|
-
public void setBasicAuthCredential(@Nullable BasicAuthCredential credential) {
|
|
60
|
-
basicAuthCredential = credential;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
54
|
@Override
|
|
64
55
|
public void onPageFinished(WebView webView, String url) {
|
|
65
56
|
super.onPageFinished(webView, url);
|
|
@@ -103,17 +94,20 @@ class BPCWebViewClient extends WebViewClient {
|
|
|
103
94
|
if(isInstallApp(intent, context)) return startApp(intent, context);
|
|
104
95
|
else return startGooglePlay(intent, context);
|
|
105
96
|
}
|
|
97
|
+
// return url.contains("vguardend");
|
|
106
98
|
return shouldOverrideUrlLoadingRN(view, url);
|
|
107
99
|
}
|
|
108
100
|
|
|
109
|
-
|
|
101
|
+
|
|
102
|
+
private boolean shouldOverrideUrlLoadingRN(WebView view, String url) {
|
|
103
|
+
|
|
110
104
|
final BPCWebView bpcWebView = (BPCWebView) view;
|
|
111
105
|
final boolean isJsDebugging = ((ReactContext) view.getContext()).getJavaScriptContextHolder().get() == 0;
|
|
112
106
|
|
|
113
107
|
if (!isJsDebugging && bpcWebView.mCatalystInstance != null) {
|
|
114
|
-
final Pair<Integer, AtomicReference<ShouldOverrideCallbackState>> lock = BPCWebViewModule.shouldOverrideUrlLoadingLock.getNewLock();
|
|
108
|
+
final Pair<Integer, AtomicReference<BPCWebViewModule.ShouldOverrideUrlLoadingLock.ShouldOverrideCallbackState>> lock = BPCWebViewModule.shouldOverrideUrlLoadingLock.getNewLock();
|
|
115
109
|
final int lockIdentifier = lock.first;
|
|
116
|
-
final AtomicReference<ShouldOverrideCallbackState> lockObject = lock.second;
|
|
110
|
+
final AtomicReference<BPCWebViewModule.ShouldOverrideUrlLoadingLock.ShouldOverrideCallbackState> lockObject = lock.second;
|
|
117
111
|
|
|
118
112
|
final WritableMap event = createWebViewEvent(view, url);
|
|
119
113
|
event.putInt("lockIdentifier", lockIdentifier);
|
|
@@ -123,7 +117,7 @@ class BPCWebViewClient extends WebViewClient {
|
|
|
123
117
|
assert lockObject != null;
|
|
124
118
|
synchronized (lockObject) {
|
|
125
119
|
final long startTime = SystemClock.elapsedRealtime();
|
|
126
|
-
while (lockObject.get() == ShouldOverrideCallbackState.UNDECIDED) {
|
|
120
|
+
while (lockObject.get() == BPCWebViewModule.ShouldOverrideUrlLoadingLock.ShouldOverrideCallbackState.UNDECIDED) {
|
|
127
121
|
if (SystemClock.elapsedRealtime() - startTime > SHOULD_OVERRIDE_URL_LOADING_TIMEOUT) {
|
|
128
122
|
FLog.w(TAG, "Did not receive response to shouldOverrideUrlLoading in time, defaulting to allow loading.");
|
|
129
123
|
BPCWebViewModule.shouldOverrideUrlLoadingLock.removeLock(lockIdentifier);
|
|
@@ -138,7 +132,7 @@ class BPCWebViewClient extends WebViewClient {
|
|
|
138
132
|
return false;
|
|
139
133
|
}
|
|
140
134
|
|
|
141
|
-
final boolean shouldOverride = lockObject.get() == ShouldOverrideCallbackState.SHOULD_OVERRIDE;
|
|
135
|
+
final boolean shouldOverride = lockObject.get() == BPCWebViewModule.ShouldOverrideUrlLoadingLock.ShouldOverrideCallbackState.SHOULD_OVERRIDE;
|
|
142
136
|
BPCWebViewModule.shouldOverrideUrlLoadingLock.removeLock(lockIdentifier);
|
|
143
137
|
|
|
144
138
|
return shouldOverride;
|
|
@@ -154,6 +148,112 @@ class BPCWebViewClient extends WebViewClient {
|
|
|
154
148
|
}
|
|
155
149
|
}
|
|
156
150
|
|
|
151
|
+
|
|
152
|
+
protected Boolean isSpecialCase(String url) {
|
|
153
|
+
return url.matches("^shinhan\\S+$")
|
|
154
|
+
|| url.startsWith("kftc-bankpay://")
|
|
155
|
+
|| url.startsWith("v3mobileplusweb://")
|
|
156
|
+
|| url.startsWith("hdcardappcardansimclick://")
|
|
157
|
+
|| url.startsWith("nidlogin://")
|
|
158
|
+
|| url.startsWith("mpocket.online.ansimclick://")
|
|
159
|
+
|| url.startsWith("wooripay://")
|
|
160
|
+
|| url.startsWith("kakaotalk://");
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
protected Boolean isIntent(String url) {
|
|
164
|
+
return url.startsWith("intent:");
|
|
165
|
+
}
|
|
166
|
+
protected Boolean isMarket(String url) {
|
|
167
|
+
return url.startsWith("market://");
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
protected Intent getIntentWithPackage(String url) {
|
|
172
|
+
try {
|
|
173
|
+
Intent intent = Intent.parseUri(url, Intent.URI_INTENT_SCHEME);
|
|
174
|
+
if(intent.getPackage() == null) {
|
|
175
|
+
if (url == null) return intent;
|
|
176
|
+
if (url.startsWith("shinhan-sr-ansimclick")) intent.setPackage("com.shcard.smartpay");
|
|
177
|
+
else if (url.startsWith("kftc-bankpay")) intent.setPackage("com.kftc.bankpay.android");
|
|
178
|
+
else if (url.startsWith("ispmobile")) intent.setPackage("kvp.jjy.MispAndroid320");
|
|
179
|
+
else if (url.startsWith("hdcardappcardansimclick")) intent.setPackage("com.hyundaicard.appcard");
|
|
180
|
+
else if (url.startsWith("kb-acp")) intent.setPackage("com.kbcard.kbkookmincard");
|
|
181
|
+
else if (url.startsWith("mpocket.online.ansimclick")) intent.setPackage("kr.co.samsungcard.mpocket");
|
|
182
|
+
else if (url.startsWith("lotteappcard")) intent.setPackage("com.lcacApp");
|
|
183
|
+
else if (url.startsWith("cloudpay")) intent.setPackage("com.hanaskcard.paycla");
|
|
184
|
+
else if (url.startsWith("nhappvardansimclick")) intent.setPackage("nh.smart.nhallonepay");
|
|
185
|
+
else if (url.startsWith("citispay")) intent.setPackage("kr.co.citibank.citimobile");
|
|
186
|
+
else if (url.startsWith("kakaotalk")) intent.setPackage("com.kakao.talk");
|
|
187
|
+
}
|
|
188
|
+
return intent;
|
|
189
|
+
} catch (URISyntaxException e) {
|
|
190
|
+
e.printStackTrace();
|
|
191
|
+
return null;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
protected boolean isInstallApp(Intent intent, Context context) {
|
|
196
|
+
return isExistPackageInfo(intent, context) || isExistLaunchedIntent(intent, context);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
protected boolean isExistPackageInfo(Intent intent, Context context) {
|
|
201
|
+
try {
|
|
202
|
+
return intent != null && context.getPackageManager().getPackageInfo(intent.getPackage(), PackageManager.GET_ACTIVITIES) != null;
|
|
203
|
+
} catch (PackageManager.NameNotFoundException e) {
|
|
204
|
+
e.printStackTrace();
|
|
205
|
+
return false;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
protected boolean isExistLaunchedIntent(Intent intent, Context context) {
|
|
210
|
+
return intent != null && intent.getPackage() != null && context.getPackageManager().getLaunchIntentForPackage(intent.getPackage()) != null;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
protected boolean startApp(Intent intent, Context context) {
|
|
214
|
+
intent.addFlags(intent.FLAG_ACTIVITY_CLEAR_TASK);
|
|
215
|
+
intent.addFlags(intent.FLAG_ACTIVITY_NEW_TASK);
|
|
216
|
+
context.startActivity(intent);
|
|
217
|
+
return true;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
protected boolean startGooglePlay(Intent intent, Context context) {
|
|
221
|
+
final String appPackageName = intent.getPackage();
|
|
222
|
+
|
|
223
|
+
if(appPackageName == null) {
|
|
224
|
+
Uri dataUri = intent.getData();
|
|
225
|
+
|
|
226
|
+
try {
|
|
227
|
+
Intent addIntent = new Intent(Intent.ACTION_VIEW, intent.getData());
|
|
228
|
+
addIntent.addFlags(intent.FLAG_ACTIVITY_CLEAR_TASK);
|
|
229
|
+
addIntent.addFlags(intent.FLAG_ACTIVITY_NEW_TASK);
|
|
230
|
+
context.startActivity(addIntent);
|
|
231
|
+
} catch (Exception e) {
|
|
232
|
+
String packageName = "com.nhn.android.search"; //appPackageName이 비어있으면 네이버로 보내기(네이버 로그인)
|
|
233
|
+
if(dataUri != null && dataUri.toString().startsWith("wooripay://")) packageName = "com.wooricard.wpay"; //우리카드 예외처리
|
|
234
|
+
|
|
235
|
+
Intent addIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=" + packageName));
|
|
236
|
+
addIntent.addFlags(intent.FLAG_ACTIVITY_CLEAR_TASK);
|
|
237
|
+
addIntent.addFlags(intent.FLAG_ACTIVITY_NEW_TASK);
|
|
238
|
+
context.startActivity(addIntent);
|
|
239
|
+
// context.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=" + packageName)));
|
|
240
|
+
}
|
|
241
|
+
return true;
|
|
242
|
+
}
|
|
243
|
+
try {
|
|
244
|
+
Intent addIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + appPackageName));
|
|
245
|
+
addIntent.addFlags(intent.FLAG_ACTIVITY_CLEAR_TASK);
|
|
246
|
+
addIntent.addFlags(intent.FLAG_ACTIVITY_NEW_TASK);
|
|
247
|
+
context.startActivity(addIntent);
|
|
248
|
+
} catch (android.content.ActivityNotFoundException anfe) {
|
|
249
|
+
Intent addIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=" + appPackageName));
|
|
250
|
+
addIntent.addFlags(intent.FLAG_ACTIVITY_CLEAR_TASK);
|
|
251
|
+
addIntent.addFlags(intent.FLAG_ACTIVITY_NEW_TASK);
|
|
252
|
+
context.startActivity(addIntent);
|
|
253
|
+
}
|
|
254
|
+
return true;
|
|
255
|
+
}
|
|
256
|
+
|
|
157
257
|
@TargetApi(Build.VERSION_CODES.N)
|
|
158
258
|
@Override
|
|
159
259
|
public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
|
|
@@ -161,15 +261,6 @@ class BPCWebViewClient extends WebViewClient {
|
|
|
161
261
|
return this.shouldOverrideUrlLoading(view, url);
|
|
162
262
|
}
|
|
163
263
|
|
|
164
|
-
@Override
|
|
165
|
-
public void onReceivedHttpAuthRequest(WebView view, HttpAuthHandler handler, String host, String realm) {
|
|
166
|
-
if (basicAuthCredential != null) {
|
|
167
|
-
handler.proceed(basicAuthCredential.username, basicAuthCredential.password);
|
|
168
|
-
return;
|
|
169
|
-
}
|
|
170
|
-
super.onReceivedHttpAuthRequest(view, handler, host, realm);
|
|
171
|
-
}
|
|
172
|
-
|
|
173
264
|
@Override
|
|
174
265
|
public void onReceivedSslError(final WebView webView, final SslErrorHandler handler, final SslError error) {
|
|
175
266
|
// onReceivedSslError is called for most requests, per Android docs: https://developer.android.com/reference/android/webkit/WebViewClient#onReceivedSslError(android.webkit.WebView,%2520android.webkit.SslErrorHandler,%2520android.net.http.SslError)
|
|
@@ -186,7 +277,7 @@ class BPCWebViewClient extends WebViewClient {
|
|
|
186
277
|
|
|
187
278
|
if (!topWindowUrl.equalsIgnoreCase(failingUrl)) {
|
|
188
279
|
// If error is not due to top-level navigation, then do not call onReceivedError()
|
|
189
|
-
Log.w(
|
|
280
|
+
Log.w("BPCWebViewManager", "Resource blocked from loading due to SSL error. Blocked URL: "+failingUrl);
|
|
190
281
|
return;
|
|
191
282
|
}
|
|
192
283
|
|
|
@@ -295,10 +386,10 @@ class BPCWebViewClient extends WebViewClient {
|
|
|
295
386
|
super.onRenderProcessGone(webView, detail);
|
|
296
387
|
|
|
297
388
|
if(detail.didCrash()){
|
|
298
|
-
Log.e(
|
|
389
|
+
Log.e("BPCWebViewManager", "The WebView rendering process crashed.");
|
|
299
390
|
}
|
|
300
391
|
else{
|
|
301
|
-
Log.w(
|
|
392
|
+
Log.w("BPCWebViewManager", "The WebView rendering process was killed by the system.");
|
|
302
393
|
}
|
|
303
394
|
|
|
304
395
|
// if webView is null, we cannot return any event
|
|
@@ -348,110 +439,4 @@ class BPCWebViewClient extends WebViewClient {
|
|
|
348
439
|
public void setProgressChangedFilter(BPCWebView.ProgressChangedFilter filter) {
|
|
349
440
|
progressChangedFilter = filter;
|
|
350
441
|
}
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
protected Boolean isSpecialCase(String url) {
|
|
354
|
-
return url.matches("^shinhan\\S+$")
|
|
355
|
-
|| url.startsWith("kftc-bankpay://")
|
|
356
|
-
|| url.startsWith("v3mobileplusweb://")
|
|
357
|
-
|| url.startsWith("hdcardappcardansimclick://")
|
|
358
|
-
|| url.startsWith("nidlogin://")
|
|
359
|
-
|| url.startsWith("mpocket.online.ansimclick://")
|
|
360
|
-
|| url.startsWith("wooripay://")
|
|
361
|
-
|| url.startsWith("kakaotalk://");
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
protected Boolean isIntent(String url) {
|
|
365
|
-
return url.startsWith("intent:");
|
|
366
|
-
}
|
|
367
|
-
protected Boolean isMarket(String url) {
|
|
368
|
-
return url.startsWith("market://");
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
protected Intent getIntentWithPackage(String url) {
|
|
373
|
-
try {
|
|
374
|
-
Intent intent = Intent.parseUri(url, Intent.URI_INTENT_SCHEME);
|
|
375
|
-
if(intent.getPackage() == null) {
|
|
376
|
-
if (url == null) return intent;
|
|
377
|
-
if (url.startsWith("shinhan-sr-ansimclick")) intent.setPackage("com.shcard.smartpay");
|
|
378
|
-
else if (url.startsWith("kftc-bankpay")) intent.setPackage("com.kftc.bankpay.android");
|
|
379
|
-
else if (url.startsWith("ispmobile")) intent.setPackage("kvp.jjy.MispAndroid320");
|
|
380
|
-
else if (url.startsWith("hdcardappcardansimclick")) intent.setPackage("com.hyundaicard.appcard");
|
|
381
|
-
else if (url.startsWith("kb-acp")) intent.setPackage("com.kbcard.kbkookmincard");
|
|
382
|
-
else if (url.startsWith("mpocket.online.ansimclick")) intent.setPackage("kr.co.samsungcard.mpocket");
|
|
383
|
-
else if (url.startsWith("lotteappcard")) intent.setPackage("com.lcacApp");
|
|
384
|
-
else if (url.startsWith("cloudpay")) intent.setPackage("com.hanaskcard.paycla");
|
|
385
|
-
else if (url.startsWith("nhappvardansimclick")) intent.setPackage("nh.smart.nhallonepay");
|
|
386
|
-
else if (url.startsWith("citispay")) intent.setPackage("kr.co.citibank.citimobile");
|
|
387
|
-
else if (url.startsWith("kakaotalk")) intent.setPackage("com.kakao.talk");
|
|
388
|
-
}
|
|
389
|
-
return intent;
|
|
390
|
-
} catch (URISyntaxException e) {
|
|
391
|
-
e.printStackTrace();
|
|
392
|
-
return null;
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
protected boolean isInstallApp(Intent intent, Context context) {
|
|
397
|
-
return isExistPackageInfo(intent, context) || isExistLaunchedIntent(intent, context);
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
protected boolean isExistPackageInfo(Intent intent, Context context) {
|
|
402
|
-
try {
|
|
403
|
-
return intent != null && context.getPackageManager().getPackageInfo(intent.getPackage(), PackageManager.GET_ACTIVITIES) != null;
|
|
404
|
-
} catch (PackageManager.NameNotFoundException e) {
|
|
405
|
-
e.printStackTrace();
|
|
406
|
-
return false;
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
protected boolean isExistLaunchedIntent(Intent intent, Context context) {
|
|
411
|
-
return intent != null && intent.getPackage() != null && context.getPackageManager().getLaunchIntentForPackage(intent.getPackage()) != null;
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
protected boolean startApp(Intent intent, Context context) {
|
|
415
|
-
intent.addFlags(intent.FLAG_ACTIVITY_CLEAR_TASK);
|
|
416
|
-
intent.addFlags(intent.FLAG_ACTIVITY_NEW_TASK);
|
|
417
|
-
context.startActivity(intent);
|
|
418
|
-
return true;
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
protected boolean startGooglePlay(Intent intent, Context context) {
|
|
422
|
-
final String appPackageName = intent.getPackage();
|
|
423
|
-
|
|
424
|
-
if(appPackageName == null) {
|
|
425
|
-
Uri dataUri = intent.getData();
|
|
426
|
-
|
|
427
|
-
try {
|
|
428
|
-
Intent addIntent = new Intent(Intent.ACTION_VIEW, intent.getData());
|
|
429
|
-
addIntent.addFlags(intent.FLAG_ACTIVITY_CLEAR_TASK);
|
|
430
|
-
addIntent.addFlags(intent.FLAG_ACTIVITY_NEW_TASK);
|
|
431
|
-
context.startActivity(addIntent);
|
|
432
|
-
} catch (Exception e) {
|
|
433
|
-
String packageName = "com.nhn.android.search"; //appPackageName이 비어있으면 네이버로 보내기(네이버 로그인)
|
|
434
|
-
if(dataUri != null && dataUri.toString().startsWith("wooripay://")) packageName = "com.wooricard.wpay"; //우리카드 예외처리
|
|
435
|
-
|
|
436
|
-
Intent addIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=" + packageName));
|
|
437
|
-
addIntent.addFlags(intent.FLAG_ACTIVITY_CLEAR_TASK);
|
|
438
|
-
addIntent.addFlags(intent.FLAG_ACTIVITY_NEW_TASK);
|
|
439
|
-
context.startActivity(addIntent);
|
|
440
|
-
// context.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=" + packageName)));
|
|
441
|
-
}
|
|
442
|
-
return true;
|
|
443
|
-
}
|
|
444
|
-
try {
|
|
445
|
-
Intent addIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + appPackageName));
|
|
446
|
-
addIntent.addFlags(intent.FLAG_ACTIVITY_CLEAR_TASK);
|
|
447
|
-
addIntent.addFlags(intent.FLAG_ACTIVITY_NEW_TASK);
|
|
448
|
-
context.startActivity(addIntent);
|
|
449
|
-
} catch (android.content.ActivityNotFoundException anfe) {
|
|
450
|
-
Intent addIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=" + appPackageName));
|
|
451
|
-
addIntent.addFlags(intent.FLAG_ACTIVITY_CLEAR_TASK);
|
|
452
|
-
addIntent.addFlags(intent.FLAG_ACTIVITY_NEW_TASK);
|
|
453
|
-
context.startActivity(addIntent);
|
|
454
|
-
}
|
|
455
|
-
return true;
|
|
456
|
-
}
|
|
457
442
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
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;
|
|
@@ -9,10 +10,13 @@ import android.content.pm.PackageManager;
|
|
|
9
10
|
import android.graphics.Bitmap;
|
|
10
11
|
import android.graphics.Color;
|
|
11
12
|
import android.Manifest;
|
|
13
|
+
import android.net.http.SslError;
|
|
12
14
|
import android.net.Uri;
|
|
13
15
|
import android.os.Build;
|
|
14
16
|
import android.os.Environment;
|
|
15
17
|
import android.os.Message;
|
|
18
|
+
import android.os.SystemClock;
|
|
19
|
+
import android.text.TextUtils;
|
|
16
20
|
import android.util.Log;
|
|
17
21
|
import android.view.Gravity;
|
|
18
22
|
import android.view.View;
|
|
@@ -23,36 +27,51 @@ import android.webkit.ConsoleMessage;
|
|
|
23
27
|
import android.webkit.CookieManager;
|
|
24
28
|
import android.webkit.DownloadListener;
|
|
25
29
|
import android.webkit.GeolocationPermissions;
|
|
30
|
+
import android.webkit.JavascriptInterface;
|
|
31
|
+
import android.webkit.RenderProcessGoneDetail;
|
|
32
|
+
import android.webkit.SslErrorHandler;
|
|
26
33
|
import android.webkit.PermissionRequest;
|
|
27
34
|
import android.webkit.URLUtil;
|
|
28
35
|
import android.webkit.ValueCallback;
|
|
29
36
|
import android.webkit.WebChromeClient;
|
|
37
|
+
import android.webkit.WebResourceRequest;
|
|
38
|
+
import android.webkit.WebResourceResponse;
|
|
30
39
|
import android.webkit.WebSettings;
|
|
31
40
|
import android.webkit.WebView;
|
|
41
|
+
import android.webkit.WebViewClient;
|
|
32
42
|
import android.widget.FrameLayout;
|
|
33
43
|
|
|
34
44
|
import androidx.annotation.Nullable;
|
|
35
45
|
import androidx.annotation.RequiresApi;
|
|
36
46
|
import androidx.core.content.ContextCompat;
|
|
37
|
-
import androidx.
|
|
38
|
-
import androidx.webkit.WebViewFeature;
|
|
47
|
+
import androidx.core.util.Pair;
|
|
39
48
|
|
|
49
|
+
import com.facebook.common.logging.FLog;
|
|
40
50
|
import com.facebook.react.modules.core.PermissionAwareActivity;
|
|
41
51
|
import com.facebook.react.modules.core.PermissionListener;
|
|
52
|
+
import com.facebook.react.views.scroll.ScrollEvent;
|
|
42
53
|
import com.facebook.react.views.scroll.ScrollEventType;
|
|
54
|
+
import com.facebook.react.views.scroll.OnScrollDispatchHelper;
|
|
43
55
|
import com.facebook.react.bridge.Arguments;
|
|
56
|
+
import com.facebook.react.bridge.CatalystInstance;
|
|
44
57
|
import com.facebook.react.bridge.LifecycleEventListener;
|
|
45
58
|
import com.facebook.react.bridge.ReactContext;
|
|
46
59
|
import com.facebook.react.bridge.ReadableArray;
|
|
47
60
|
import com.facebook.react.bridge.ReadableMap;
|
|
48
61
|
import com.facebook.react.bridge.ReadableMapKeySetIterator;
|
|
49
62
|
import com.facebook.react.bridge.WritableMap;
|
|
63
|
+
import com.facebook.react.bridge.WritableNativeArray;
|
|
64
|
+
import com.facebook.react.bridge.WritableNativeMap;
|
|
50
65
|
import com.facebook.react.common.MapBuilder;
|
|
51
66
|
import com.facebook.react.common.build.ReactBuildConfig;
|
|
52
67
|
import com.facebook.react.module.annotations.ReactModule;
|
|
53
68
|
import com.facebook.react.uimanager.SimpleViewManager;
|
|
54
69
|
import com.facebook.react.uimanager.ThemedReactContext;
|
|
70
|
+
import com.facebook.react.uimanager.UIManagerModule;
|
|
55
71
|
import com.facebook.react.uimanager.annotations.ReactProp;
|
|
72
|
+
import com.facebook.react.uimanager.events.ContentSizeChangeEvent;
|
|
73
|
+
import com.facebook.react.uimanager.events.Event;
|
|
74
|
+
import com.facebook.react.uimanager.events.EventDispatcher;
|
|
56
75
|
import kr.co.bootpay.webview.BPCWebViewModule.ShouldOverrideUrlLoadingLock.ShouldOverrideCallbackState;
|
|
57
76
|
import kr.co.bootpay.webview.events.TopLoadingErrorEvent;
|
|
58
77
|
import kr.co.bootpay.webview.events.TopHttpErrorEvent;
|
|
@@ -67,15 +86,16 @@ import org.json.JSONException;
|
|
|
67
86
|
import org.json.JSONObject;
|
|
68
87
|
|
|
69
88
|
import java.io.UnsupportedEncodingException;
|
|
70
|
-
import java.lang.IllegalArgumentException;
|
|
71
89
|
import java.net.MalformedURLException;
|
|
72
90
|
import java.net.URL;
|
|
91
|
+
import java.net.URLEncoder;
|
|
73
92
|
import java.util.ArrayList;
|
|
74
93
|
import java.util.Collections;
|
|
75
94
|
import java.util.HashMap;
|
|
76
95
|
import java.util.List;
|
|
77
96
|
import java.util.Locale;
|
|
78
97
|
import java.util.Map;
|
|
98
|
+
import java.util.concurrent.atomic.AtomicReference;
|
|
79
99
|
|
|
80
100
|
/**
|
|
81
101
|
* Manages instances of {@link WebView}
|
|
@@ -103,7 +123,6 @@ import java.util.Map;
|
|
|
103
123
|
*/
|
|
104
124
|
@ReactModule(name = BPCWebViewManager.REACT_CLASS)
|
|
105
125
|
public class BPCWebViewManager extends SimpleViewManager<WebView> {
|
|
106
|
-
private static final String TAG = "BPCWebViewManager";
|
|
107
126
|
|
|
108
127
|
public static final int COMMAND_GO_BACK = 1;
|
|
109
128
|
public static final int COMMAND_GO_FORWARD = 2;
|
|
@@ -122,12 +141,11 @@ public class BPCWebViewManager extends SimpleViewManager<WebView> {
|
|
|
122
141
|
protected static final String REACT_CLASS = "BPCWebView";
|
|
123
142
|
protected static final String HTML_ENCODING = "UTF-8";
|
|
124
143
|
protected static final String HTML_MIME_TYPE = "text/html";
|
|
125
|
-
//
|
|
144
|
+
// protected static final String JAVASCRIPT_INTERFACE = "ReactNativeWebView";
|
|
126
145
|
protected static final String HTTP_METHOD_POST = "POST";
|
|
127
146
|
// Use `webView.loadUrl("about:blank")` to reliably reset the view
|
|
128
147
|
// state and release page resources (including any running JavaScript).
|
|
129
148
|
protected static final String BLANK_URL = "about:blank";
|
|
130
|
-
|
|
131
149
|
protected WebViewConfig mWebViewConfig;
|
|
132
150
|
|
|
133
151
|
protected BPCWebChromeClient mWebChromeClient = null;
|
|
@@ -191,13 +209,7 @@ public class BPCWebViewManager extends SimpleViewManager<WebView> {
|
|
|
191
209
|
|
|
192
210
|
BPCWebViewModule module = getModule(reactContext);
|
|
193
211
|
|
|
194
|
-
DownloadManager.Request request;
|
|
195
|
-
try {
|
|
196
|
-
request = new DownloadManager.Request(Uri.parse(url));
|
|
197
|
-
} catch (IllegalArgumentException e) {
|
|
198
|
-
Log.w(TAG, "Unsupported URI, aborting download", e);
|
|
199
|
-
return;
|
|
200
|
-
}
|
|
212
|
+
DownloadManager.Request request = new DownloadManager.Request(Uri.parse(url));
|
|
201
213
|
|
|
202
214
|
String fileName = URLUtil.guessFileName(url, contentDisposition, mimetype);
|
|
203
215
|
String downloadMessage = "Downloading " + fileName;
|
|
@@ -210,7 +222,8 @@ public class BPCWebViewManager extends SimpleViewManager<WebView> {
|
|
|
210
222
|
String cookie = CookieManager.getInstance().getCookie(baseUrl);
|
|
211
223
|
request.addRequestHeader("Cookie", cookie);
|
|
212
224
|
} catch (MalformedURLException e) {
|
|
213
|
-
|
|
225
|
+
System.out.println("Error getting cookie for DownloadManager: " + e.toString());
|
|
226
|
+
e.printStackTrace();
|
|
214
227
|
}
|
|
215
228
|
|
|
216
229
|
//Finish setting up request
|
|
@@ -237,16 +250,6 @@ public class BPCWebViewManager extends SimpleViewManager<WebView> {
|
|
|
237
250
|
view.getSettings().setJavaScriptEnabled(enabled);
|
|
238
251
|
}
|
|
239
252
|
|
|
240
|
-
@ReactProp(name = "setBuiltInZoomControls")
|
|
241
|
-
public void setBuiltInZoomControls(WebView view, boolean enabled) {
|
|
242
|
-
view.getSettings().setBuiltInZoomControls(enabled);
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
@ReactProp(name = "setDisplayZoomControls")
|
|
246
|
-
public void setDisplayZoomControls(WebView view, boolean enabled) {
|
|
247
|
-
view.getSettings().setDisplayZoomControls(enabled);
|
|
248
|
-
}
|
|
249
|
-
|
|
250
253
|
@ReactProp(name = "setSupportMultipleWindows")
|
|
251
254
|
public void setSupportMultipleWindows(WebView view, boolean enabled){
|
|
252
255
|
view.getSettings().setSupportMultipleWindows(enabled);
|
|
@@ -338,11 +341,6 @@ public class BPCWebViewManager extends SimpleViewManager<WebView> {
|
|
|
338
341
|
view.setOverScrollMode(overScrollMode);
|
|
339
342
|
}
|
|
340
343
|
|
|
341
|
-
@ReactProp(name = "nestedScrollEnabled")
|
|
342
|
-
public void setNestedScrollEnabled(WebView view, boolean enabled) {
|
|
343
|
-
((BPCWebView) view).setNestedScrollEnabled(enabled);
|
|
344
|
-
}
|
|
345
|
-
|
|
346
344
|
@ReactProp(name = "thirdPartyCookiesEnabled")
|
|
347
345
|
public void setThirdPartyCookiesEnabled(WebView view, boolean enabled) {
|
|
348
346
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
|
@@ -538,19 +536,6 @@ public class BPCWebViewManager extends SimpleViewManager<WebView> {
|
|
|
538
536
|
view.loadUrl(BLANK_URL);
|
|
539
537
|
}
|
|
540
538
|
|
|
541
|
-
@ReactProp(name = "basicAuthCredential")
|
|
542
|
-
public void setBasicAuthCredential(WebView view, @Nullable ReadableMap credential) {
|
|
543
|
-
@Nullable BasicAuthCredential basicAuthCredential = null;
|
|
544
|
-
if (credential != null) {
|
|
545
|
-
if (credential.hasKey("username") && credential.hasKey("password")) {
|
|
546
|
-
String username = credential.getString("username");
|
|
547
|
-
String password = credential.getString("password");
|
|
548
|
-
basicAuthCredential = new BasicAuthCredential(username, password);
|
|
549
|
-
}
|
|
550
|
-
}
|
|
551
|
-
((BPCWebView) view).setBasicAuthCredential(basicAuthCredential);
|
|
552
|
-
}
|
|
553
|
-
|
|
554
539
|
@ReactProp(name = "onContentSizeChange")
|
|
555
540
|
public void setOnContentSizeChange(WebView view, boolean sendContentSizeChangeEvents) {
|
|
556
541
|
((BPCWebView) view).setSendContentSizeChangeEvents(sendContentSizeChangeEvents);
|
|
@@ -606,32 +591,6 @@ public class BPCWebViewManager extends SimpleViewManager<WebView> {
|
|
|
606
591
|
((BPCWebView) view).setHasScrollEvent(hasScrollEvent);
|
|
607
592
|
}
|
|
608
593
|
|
|
609
|
-
@ReactProp(name = "forceDarkOn")
|
|
610
|
-
public void setForceDarkOn(WebView view, boolean enabled) {
|
|
611
|
-
// Only Android 10+ support dark mode
|
|
612
|
-
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.P) {
|
|
613
|
-
// Switch WebView dark mode
|
|
614
|
-
if (WebViewFeature.isFeatureSupported(WebViewFeature.FORCE_DARK)) {
|
|
615
|
-
int forceDarkMode = enabled ? WebSettingsCompat.FORCE_DARK_ON : WebSettingsCompat.FORCE_DARK_OFF;
|
|
616
|
-
WebSettingsCompat.setForceDark(view.getSettings(), forceDarkMode);
|
|
617
|
-
}
|
|
618
|
-
|
|
619
|
-
// Set how WebView content should be darkened.
|
|
620
|
-
// PREFER_WEB_THEME_OVER_USER_AGENT_DARKENING: checks for the "color-scheme" <meta> tag.
|
|
621
|
-
// If present, it uses media queries. If absent, it applies user-agent (automatic)
|
|
622
|
-
// More information about Force Dark Strategy can be found here:
|
|
623
|
-
// https://developer.android.com/reference/androidx/webkit/WebSettingsCompat#setForceDarkStrategy(android.webkit.WebSettings)
|
|
624
|
-
if (enabled && WebViewFeature.isFeatureSupported(WebViewFeature.FORCE_DARK_STRATEGY)) {
|
|
625
|
-
WebSettingsCompat.setForceDarkStrategy(view.getSettings(), WebSettingsCompat.DARK_STRATEGY_PREFER_WEB_THEME_OVER_USER_AGENT_DARKENING);
|
|
626
|
-
}
|
|
627
|
-
}
|
|
628
|
-
}
|
|
629
|
-
|
|
630
|
-
@ReactProp(name = "minimumFontSize")
|
|
631
|
-
public void setMinimumFontSize(WebView view, int fontSize) {
|
|
632
|
-
view.getSettings().setMinimumFontSize(fontSize);
|
|
633
|
-
}
|
|
634
|
-
|
|
635
594
|
@Override
|
|
636
595
|
protected void addEventEmitters(ThemedReactContext reactContext, WebView view) {
|
|
637
596
|
// Do not register default touch emitter and let WebView implementation handle touches
|
|
@@ -745,11 +704,8 @@ public class BPCWebViewManager extends SimpleViewManager<WebView> {
|
|
|
745
704
|
}
|
|
746
705
|
|
|
747
706
|
protected void setupWebChromeClient(ReactContext reactContext, WebView webView) {
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
if (mAllowsFullscreenVideo && activity != null) {
|
|
751
|
-
int initialRequestedOrientation = activity.getRequestedOrientation();
|
|
752
|
-
|
|
707
|
+
if (mAllowsFullscreenVideo) {
|
|
708
|
+
int initialRequestedOrientation = reactContext.getCurrentActivity().getRequestedOrientation();
|
|
753
709
|
mWebChromeClient = new BPCWebChromeClient(reactContext, webView) {
|
|
754
710
|
@Override
|
|
755
711
|
public Bitmap getDefaultVideoPoster() {
|
|
@@ -766,32 +722,31 @@ public class BPCWebViewManager extends SimpleViewManager<WebView> {
|
|
|
766
722
|
mVideoView = view;
|
|
767
723
|
mCustomViewCallback = callback;
|
|
768
724
|
|
|
769
|
-
|
|
725
|
+
mReactContext.getCurrentActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
|
|
770
726
|
|
|
771
727
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
|
772
728
|
mVideoView.setSystemUiVisibility(FULLSCREEN_SYSTEM_UI_VISIBILITY);
|
|
773
|
-
|
|
774
|
-
WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS,
|
|
775
|
-
WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS
|
|
776
|
-
);
|
|
729
|
+
mReactContext.getCurrentActivity().getWindow().setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
|
|
777
730
|
}
|
|
778
731
|
|
|
779
732
|
mVideoView.setBackgroundColor(Color.BLACK);
|
|
780
733
|
|
|
781
|
-
//
|
|
782
|
-
// we will decide which View to
|
|
783
|
-
// does not match (i.e., the
|
|
784
|
-
// NOTE: We could use
|
|
734
|
+
// since RN's Modals interfere with the View hierarchy
|
|
735
|
+
// we will decide which View to Hide if the hierarchy
|
|
736
|
+
// does not match (i.e., the webview is within a Modal)
|
|
737
|
+
// NOTE: We could use mWebView.getRootView() instead of getRootView()
|
|
785
738
|
// but that breaks the Modal's styles and layout, so we need this to render
|
|
786
|
-
// in the main View hierarchy regardless
|
|
739
|
+
// in the main View hierarchy regardless.
|
|
787
740
|
ViewGroup rootView = getRootView();
|
|
788
741
|
rootView.addView(mVideoView, FULLSCREEN_LAYOUT_PARAMS);
|
|
789
742
|
|
|
790
743
|
// Different root views, we are in a Modal
|
|
791
|
-
if
|
|
744
|
+
if(rootView.getRootView() != mWebView.getRootView()){
|
|
792
745
|
mWebView.getRootView().setVisibility(View.GONE);
|
|
793
|
-
}
|
|
794
|
-
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
// Same view hierarchy (no Modal), just hide the webview then
|
|
749
|
+
else{
|
|
795
750
|
mWebView.setVisibility(View.GONE);
|
|
796
751
|
}
|
|
797
752
|
|
|
@@ -804,18 +759,20 @@ public class BPCWebViewManager extends SimpleViewManager<WebView> {
|
|
|
804
759
|
return;
|
|
805
760
|
}
|
|
806
761
|
|
|
807
|
-
//
|
|
762
|
+
// same logic as above
|
|
808
763
|
ViewGroup rootView = getRootView();
|
|
809
764
|
|
|
810
|
-
if
|
|
765
|
+
if(rootView.getRootView() != mWebView.getRootView()){
|
|
811
766
|
mWebView.getRootView().setVisibility(View.VISIBLE);
|
|
812
|
-
}
|
|
813
|
-
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
// Same view hierarchy (no Modal)
|
|
770
|
+
else{
|
|
814
771
|
mWebView.setVisibility(View.VISIBLE);
|
|
815
772
|
}
|
|
816
773
|
|
|
817
774
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
|
818
|
-
|
|
775
|
+
mReactContext.getCurrentActivity().getWindow().clearFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
|
|
819
776
|
}
|
|
820
777
|
|
|
821
778
|
rootView.removeView(mVideoView);
|
|
@@ -824,25 +781,22 @@ public class BPCWebViewManager extends SimpleViewManager<WebView> {
|
|
|
824
781
|
mVideoView = null;
|
|
825
782
|
mCustomViewCallback = null;
|
|
826
783
|
|
|
827
|
-
|
|
784
|
+
mReactContext.getCurrentActivity().setRequestedOrientation(initialRequestedOrientation);
|
|
828
785
|
|
|
829
786
|
mReactContext.removeLifecycleEventListener(this);
|
|
830
787
|
}
|
|
831
788
|
};
|
|
832
|
-
|
|
833
789
|
webView.setWebChromeClient(mWebChromeClient);
|
|
834
790
|
} else {
|
|
835
791
|
if (mWebChromeClient != null) {
|
|
836
792
|
mWebChromeClient.onHideCustomView();
|
|
837
793
|
}
|
|
838
|
-
|
|
839
794
|
mWebChromeClient = new BPCWebChromeClient(reactContext, webView) {
|
|
840
795
|
@Override
|
|
841
796
|
public Bitmap getDefaultVideoPoster() {
|
|
842
797
|
return Bitmap.createBitmap(50, 50, Bitmap.Config.ARGB_8888);
|
|
843
798
|
}
|
|
844
799
|
};
|
|
845
|
-
|
|
846
800
|
webView.setWebChromeClient(mWebChromeClient);
|
|
847
801
|
}
|
|
848
802
|
}
|