From d3cdc784b2f1164978207c36d0d7617de859521e Mon Sep 17 00:00:00 2001 From: Lorenzo Pichilli Date: Mon, 3 Oct 2022 14:29:30 +0200 Subject: [PATCH 1/7] applied v5.4.3+8 fixes --- CHANGELOG.md | 5 + LICENSE | 197 +----------------- example/ios/Flutter/AppFrameworkInfo.plist | 2 +- example/ios/Podfile | 2 +- example/ios/Runner.xcodeproj/project.pbxproj | 8 +- example/ios/Runner/Info.plist | 2 + ios/Classes/InAppWebView/InAppWebView.swift | 11 +- .../InAppWebView/InAppWebViewSettings.swift | 6 +- ios/Classes/Types/UserScript.swift | 12 +- .../in_app_webview_settings.dart | 2 +- 10 files changed, 43 insertions(+), 204 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 451997e5..68855c93 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,11 @@ - On Android, the `InAppWebView` widget uses hybrid composition by default (`useHybridComposition: true`). - All properties of `GeolocationPermissionShowPromptResponse` cannot be `null`; +## 5.4.3+8 + +- Merged "Xcode 14 build error: Stored properties cannot be marked potentially unavailable with '@available'" [#1216](https://github.com/pichillilorenzo/flutter_inappwebview/pull/1216) (thanks to [chreck](https://github.com/SethuSenthil)) +- Fixed example for iOS + ## 5.4.3+7 - Fixed possible Android java.lang.NullPointerException in "InAppBrowserActivity.onCreateOptionsMenu" about "webView.getTitle()" diff --git a/LICENSE b/LICENSE index d6493fe1..ce6d86e5 100755 --- a/LICENSE +++ b/LICENSE @@ -1,190 +1,13 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ +Copyright 2018-2022 Lorenzo Pichilli - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at - 1. Definitions. + http://www.apache.org/licenses/LICENSE-2.0 - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - Copyright 2018-2020 Lorenzo Pichilli - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. \ No newline at end of file diff --git a/example/ios/Flutter/AppFrameworkInfo.plist b/example/ios/Flutter/AppFrameworkInfo.plist index 8d4492f9..9625e105 100755 --- a/example/ios/Flutter/AppFrameworkInfo.plist +++ b/example/ios/Flutter/AppFrameworkInfo.plist @@ -21,6 +21,6 @@ CFBundleVersion 1.0 MinimumOSVersion - 9.0 + 11.0 diff --git a/example/ios/Podfile b/example/ios/Podfile index 1e8c3c90..88359b22 100644 --- a/example/ios/Podfile +++ b/example/ios/Podfile @@ -1,5 +1,5 @@ # Uncomment this line to define a global platform for your project -# platform :ios, '9.0' +# platform :ios, '11.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj index 99fee0fa..def4014e 100644 --- a/example/ios/Runner.xcodeproj/project.pbxproj +++ b/example/ios/Runner.xcodeproj/project.pbxproj @@ -376,7 +376,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -428,7 +428,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; @@ -459,7 +459,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - PRODUCT_BUNDLE_IDENTIFIER = com.pichillilorenzo.flutterinappwebviewExample; + PRODUCT_BUNDLE_IDENTIFIER = "com.pichillilorenzo.flutter-inappwebview--Example"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -490,7 +490,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - PRODUCT_BUNDLE_IDENTIFIER = com.pichillilorenzo.flutterinappwebviewExample; + PRODUCT_BUNDLE_IDENTIFIER = "com.pichillilorenzo.flutter-inappwebview--Example"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; diff --git a/example/ios/Runner/Info.plist b/example/ios/Runner/Info.plist index d78c9615..d13650c0 100755 --- a/example/ios/Runner/Info.plist +++ b/example/ios/Runner/Info.plist @@ -2,6 +2,8 @@ + CADisableMinimumFrameDurationOnPhone + CFBundleDevelopmentRegion en CFBundleExecutable diff --git a/ios/Classes/InAppWebView/InAppWebView.swift b/ios/Classes/InAppWebView/InAppWebView.swift index 8d870611..fa2bf105 100755 --- a/ios/Classes/InAppWebView/InAppWebView.swift +++ b/ios/Classes/InAppWebView/InAppWebView.swift @@ -454,10 +454,8 @@ public class InAppWebView: WKWebView, UIScrollViewDelegate, WKUIDelegate, configuration.preferences.isTextInteractionEnabled = settings.isTextInteractionEnabled } - if #available(iOS 15.0, *) { - if (configuration.preferences.responds(to: #selector(getter: InAppWebViewSettings.isSiteSpecificQuirksModeEnabled))) { - configuration.preferences.isSiteSpecificQuirksModeEnabled = settings.isSiteSpecificQuirksModeEnabled - } + if #available(iOS 15.4, *) { + configuration.preferences.isSiteSpecificQuirksModeEnabled = settings.isSiteSpecificQuirksModeEnabled } } } @@ -1178,8 +1176,9 @@ public class InAppWebView: WKWebView, UIScrollViewDelegate, WKUIDelegate, let underPageBackgroundColor = newSettings.underPageBackgroundColor, !underPageBackgroundColor.isEmpty { self.underPageBackgroundColor = UIColor(hexString: underPageBackgroundColor) } - if configuration.preferences.responds(to: #selector(getter: InAppWebViewSettings.isSiteSpecificQuirksModeEnabled)), - newSettingsMap["isSiteSpecificQuirksModeEnabled"] != nil && + } + if #available(iOS 15.4, *) { + if newSettingsMap["isSiteSpecificQuirksModeEnabled"] != nil && settings?.isSiteSpecificQuirksModeEnabled != newSettings.isSiteSpecificQuirksModeEnabled { configuration.preferences.isSiteSpecificQuirksModeEnabled = newSettings.isSiteSpecificQuirksModeEnabled } diff --git a/ios/Classes/InAppWebView/InAppWebViewSettings.swift b/ios/Classes/InAppWebView/InAppWebViewSettings.swift index 7bda38bd..84c4fd26 100755 --- a/ios/Classes/InAppWebView/InAppWebViewSettings.swift +++ b/ios/Classes/InAppWebView/InAppWebViewSettings.swift @@ -143,9 +143,9 @@ public class InAppWebViewSettings: ISettings { } if #available(iOS 15.0, *) { realSettings["underPageBackgroundColor"] = webView.underPageBackgroundColor.hexString - if configuration.preferences.responds(to: #selector(getter: self.isSiteSpecificQuirksModeEnabled)) { - realSettings["isSiteSpecificQuirksModeEnabled"] = configuration.preferences.isSiteSpecificQuirksModeEnabled - } + } + if #available(iOS 15.4, *) { + realSettings["isSiteSpecificQuirksModeEnabled"] = configuration.preferences.isSiteSpecificQuirksModeEnabled } } return realSettings diff --git a/ios/Classes/Types/UserScript.swift b/ios/Classes/Types/UserScript.swift index 254996e2..ae5f7ea0 100644 --- a/ios/Classes/Types/UserScript.swift +++ b/ios/Classes/Types/UserScript.swift @@ -10,8 +10,18 @@ import WebKit public class UserScript : WKUserScript { var groupName: String? + + private var contentWorldWrapper: Any? @available(iOS 14.0, *) - lazy var contentWorld: WKContentWorld = WKContentWorld.page + var contentWorld: WKContentWorld { + get { + if let value = contentWorldWrapper as? WKContentWorld { + return value + } + return .page + } + set { contentWorldWrapper = newValue } + } public override init(source: String, injectionTime: WKUserScriptInjectionTime, forMainFrameOnly: Bool) { super.init(source: source, injectionTime: injectionTime, forMainFrameOnly: forMainFrameOnly) diff --git a/lib/src/in_app_webview/in_app_webview_settings.dart b/lib/src/in_app_webview/in_app_webview_settings.dart index cc499ab2..29e5dcc0 100755 --- a/lib/src/in_app_webview/in_app_webview_settings.dart +++ b/lib/src/in_app_webview/in_app_webview_settings.dart @@ -985,7 +985,7 @@ class InAppWebViewSettings { ///to improve compatibility with certain known websites. You can disable site-specific quirks ///to help test your website without these workarounds. The default value is `true`. /// - ///**NOTE**: available on iOS 15.0+. + ///**NOTE**: available on iOS 15.4+. /// ///**Supported Platforms/Implementations**: ///- iOS From 4bdada17fefd593b10aaef8fe700da22ac24ceae Mon Sep 17 00:00:00 2001 From: Lorenzo Pichilli Date: Mon, 3 Oct 2022 14:46:10 +0200 Subject: [PATCH 2/7] fixed CHANGELOG --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 68855c93..96afe0c4 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,7 +21,7 @@ ## 5.4.3+8 -- Merged "Xcode 14 build error: Stored properties cannot be marked potentially unavailable with '@available'" [#1216](https://github.com/pichillilorenzo/flutter_inappwebview/pull/1216) (thanks to [chreck](https://github.com/SethuSenthil)) +- Merged "Xcode 14 build error: Stored properties cannot be marked potentially unavailable with '@available'" [#1238](https://github.com/pichillilorenzo/flutter_inappwebview/pull/1238) (thanks to [CodeEagle](https://github.com/CodeEagle)) - Fixed example for iOS ## 5.4.3+7 From 8abce4e7dd249041ed3c84dd5ee557bf043bb305 Mon Sep 17 00:00:00 2001 From: Lorenzo Pichilli Date: Mon, 3 Oct 2022 15:23:53 +0200 Subject: [PATCH 3/7] added all-contributors --- .all-contributorsrc | 493 ++++++++++++++++++++++++++++++++++++++++++++ README.md | 97 ++++++++- 2 files changed, 588 insertions(+), 2 deletions(-) create mode 100644 .all-contributorsrc diff --git a/.all-contributorsrc b/.all-contributorsrc new file mode 100644 index 00000000..9a84ab1e --- /dev/null +++ b/.all-contributorsrc @@ -0,0 +1,493 @@ +{ + "projectName": "flutter_inappwebview", + "projectOwner": "pichillilorenzo", + "repoType": "github", + "repoHost": "https://github.com", + "files": [ + "README.md" + ], + "imageSize": 100, + "commit": true, + "commitConvention": "none", + "contributors": [ + { + "login": "AlexV525", + "name": "Alex Li", + "avatar_url": "https://avatars.githubusercontent.com/u/15884415?v=4", + "profile": "https://blog.alexv525.com/", + "contributions": [ + "code" + ] + }, + { + "login": "crazecoder", + "name": "1/2", + "avatar_url": "https://avatars.githubusercontent.com/u/18387906?v=4", + "profile": "https://github.com/crazecoder", + "contributions": [ + "code" + ] + }, + { + "login": "cbodin", + "name": "Christofer Bodin", + "avatar_url": "https://avatars.githubusercontent.com/u/220255?v=4", + "profile": "https://github.com/cbodin", + "contributions": [ + "code" + ] + }, + { + "login": "matthewlloyd", + "name": "Matthew Lloyd", + "avatar_url": "https://avatars.githubusercontent.com/u/2041996?v=4", + "profile": "https://github.com/matthewlloyd", + "contributions": [ + "code" + ] + }, + { + "login": "carloserazo47", + "name": "C E", + "avatar_url": "https://avatars.githubusercontent.com/u/83635384?v=4", + "profile": "https://github.com/carloserazo47", + "contributions": [ + "code" + ] + }, + { + "login": "robsonmeemo", + "name": "Robson Araujo", + "avatar_url": "https://avatars.githubusercontent.com/u/47990393?v=4", + "profile": "https://github.com/robsonmeemo", + "contributions": [ + "code" + ] + }, + { + "login": "ryanhz", + "name": "Ryan", + "avatar_url": "https://avatars.githubusercontent.com/u/1142612?v=4", + "profile": "https://github.com/ryanhz", + "contributions": [ + "code" + ] + }, + { + "login": "CodeEagle", + "name": "CodeEagle", + "avatar_url": "https://avatars.githubusercontent.com/u/2311352?v=4", + "profile": "https://codeeagle.github.io/", + "contributions": [ + "code" + ] + }, + { + "login": "tneotia", + "name": "Tanay Neotia", + "avatar_url": "https://avatars.githubusercontent.com/u/50850142?v=4", + "profile": "https://github.com/tneotia", + "contributions": [ + "code" + ] + }, + { + "login": "panndoraBoo", + "name": "Jamie Joost", + "avatar_url": "https://avatars.githubusercontent.com/u/8928207?v=4", + "profile": "https://github.com/panndoraBoo", + "contributions": [ + "code" + ] + }, + { + "login": "deandreamatias", + "name": "Matias de Andrea", + "avatar_url": "https://avatars.githubusercontent.com/u/21011641?v=4", + "profile": "https://deandreamatias.com/", + "contributions": [ + "code" + ] + }, + { + "login": "YouCii", + "name": "YouCii", + "avatar_url": "https://avatars.githubusercontent.com/u/17899073?v=4", + "profile": "https://blog.csdn.net/j550341130", + "contributions": [ + "code" + ] + }, + { + "login": "cutzmf", + "name": "Salnikov Sergey", + "avatar_url": "https://avatars.githubusercontent.com/u/1662033?v=4", + "profile": "https://github.com/cutzmf", + "contributions": [ + "code" + ] + }, + { + "login": "a00012025", + "name": "Po-Jui Chen", + "avatar_url": "https://avatars.githubusercontent.com/u/12824216?v=4", + "profile": "https://github.com/a00012025", + "contributions": [ + "code" + ] + }, + { + "login": "Manuito83", + "name": "Manuito", + "avatar_url": "https://avatars.githubusercontent.com/u/4816367?v=4", + "profile": "https://github.com/Manuito83", + "contributions": [ + "code" + ] + }, + { + "login": "setcy", + "name": "setcy", + "avatar_url": "https://avatars.githubusercontent.com/u/86180691?v=4", + "profile": "https://github.com/setcy", + "contributions": [ + "code" + ] + }, + { + "login": "EArminjon2", + "name": "EArminjon", + "avatar_url": "https://avatars.githubusercontent.com/u/92172436?v=4", + "profile": "https://github.com/EArminjon2", + "contributions": [ + "code" + ] + }, + { + "login": "ashank96", + "name": "Ashank Bharati", + "avatar_url": "https://avatars.githubusercontent.com/u/22197948?v=4", + "profile": "https://www.linkedin.com/in/ashank-bharati-497989127/", + "contributions": [ + "code" + ] + }, + { + "login": "chownation", + "name": "Michael Chow", + "avatar_url": "https://avatars.githubusercontent.com/u/1755207?v=4", + "profile": "https://dart.art/", + "contributions": [ + "code" + ] + }, + { + "login": "RodXander", + "name": "Osvaldo Saez", + "avatar_url": "https://avatars.githubusercontent.com/u/23609784?v=4", + "profile": "https://github.com/RodXander", + "contributions": [ + "code" + ] + }, + { + "login": "rsydor", + "name": "rsydor", + "avatar_url": "https://avatars.githubusercontent.com/u/79581663?v=4", + "profile": "https://github.com/rsydor", + "contributions": [ + "code" + ] + }, + { + "login": "hoanglm4", + "name": "Le Minh Hoang", + "avatar_url": "https://avatars.githubusercontent.com/u/7067757?v=4", + "profile": "https://github.com/hoanglm4", + "contributions": [ + "code" + ] + }, + { + "login": "Miiha", + "name": "Michael Kao", + "avatar_url": "https://avatars.githubusercontent.com/u/3897167?v=4", + "profile": "https://github.com/Miiha", + "contributions": [ + "code" + ] + }, + { + "login": "cloudygeek", + "name": "cloudygeek", + "avatar_url": "https://avatars.githubusercontent.com/u/6059542?v=4", + "profile": "https://github.com/cloudygeek", + "contributions": [ + "code" + ] + }, + { + "login": "chreck", + "name": "Christoph Eck", + "avatar_url": "https://avatars.githubusercontent.com/u/8030398?v=4", + "profile": "https://github.com/chreck", + "contributions": [ + "code" + ] + }, + { + "login": "Ser1ous", + "name": "Ser1ous", + "avatar_url": "https://avatars.githubusercontent.com/u/4497968?v=4", + "profile": "https://github.com/Ser1ous", + "contributions": [ + "code" + ] + }, + { + "login": "ItsCalebJones", + "name": "Caleb Jones", + "avatar_url": "https://avatars.githubusercontent.com/u/4519230?v=4", + "profile": "https://spacelaunchnow.me/", + "contributions": [ + "code" + ] + }, + { + "login": "savy-91", + "name": "Saverio Murgia", + "avatar_url": "https://avatars.githubusercontent.com/u/6215122?v=4", + "profile": "https://sungazer.io/", + "contributions": [ + "code" + ] + }, + { + "login": "tranductam2802", + "name": "Trần Đức Tâm", + "avatar_url": "https://avatars.githubusercontent.com/u/4957579?v=4", + "profile": "https://github.com/tranductam2802", + "contributions": [ + "code" + ] + }, + { + "login": "pcqpcq", + "name": "Joker", + "avatar_url": "https://avatars.githubusercontent.com/u/1411571?v=4", + "profile": "http://pcqpcq.me/", + "contributions": [ + "code" + ] + }, + { + "login": "ycv005", + "name": "Yash Chandra Verma", + "avatar_url": "https://avatars.githubusercontent.com/u/26734819?v=4", + "profile": "https://www.linkedin.com/in/ycv005/", + "contributions": [ + "code" + ] + }, + { + "login": "arneke", + "name": "Arne Kepp", + "avatar_url": "https://avatars.githubusercontent.com/u/425235?v=4", + "profile": "https://github.com/arneke", + "contributions": [ + "code" + ] + }, + { + "login": "omralcrt", + "name": "Ömral Cörüt", + "avatar_url": "https://avatars.githubusercontent.com/u/12418327?v=4", + "profile": "https://omralcrt.github.io/", + "contributions": [ + "code" + ] + }, + { + "login": "albatrosify", + "name": "LrdHelmchen", + "avatar_url": "https://avatars.githubusercontent.com/u/64252708?v=4", + "profile": "https://github.com/albatrosify", + "contributions": [ + "code" + ] + }, + { + "login": "gunantosteven", + "name": "Steven Gunanto", + "avatar_url": "https://avatars.githubusercontent.com/u/8141036?v=4", + "profile": "https://ungapps.com/", + "contributions": [ + "code" + ] + }, + { + "login": "DRSchlaubi", + "name": "Michael Rittmeister", + "avatar_url": "https://avatars.githubusercontent.com/u/16060205?v=4", + "profile": "https://schlau.bi/", + "contributions": [ + "code" + ] + }, + { + "login": "AAkira", + "name": "Akira Aratani", + "avatar_url": "https://avatars.githubusercontent.com/u/3386962?v=4", + "profile": "https://aakira.app/", + "contributions": [ + "code" + ] + }, + { + "login": "Doflatango", + "name": "Doflatango", + "avatar_url": "https://avatars.githubusercontent.com/u/3091033?v=4", + "profile": "https://github.com/Doflatango", + "contributions": [ + "code" + ] + }, + { + "login": "Eddayy", + "name": "Edmund Tay", + "avatar_url": "https://avatars.githubusercontent.com/u/17043852?v=4", + "profile": "https://github.com/Eddayy", + "contributions": [ + "code" + ] + }, + { + "login": "andreidiaconu", + "name": "Andrei Diaconu", + "avatar_url": "https://avatars.githubusercontent.com/u/1402046?v=4", + "profile": "http://andreidiaconu.com/", + "contributions": [ + "code" + ] + }, + { + "login": "plateaukao", + "name": "Daniel Kao", + "avatar_url": "https://avatars.githubusercontent.com/u/4084738?v=4", + "profile": "https://github.com/plateaukao", + "contributions": [ + "code" + ] + }, + { + "login": "xtyxtyx", + "name": "xuty", + "avatar_url": "https://avatars.githubusercontent.com/u/15033141?v=4", + "profile": "https://github.com/xtyxtyx", + "contributions": [ + "code" + ] + }, + { + "login": "wwwdata", + "name": "Ben Bieker", + "avatar_url": "https://avatars.githubusercontent.com/u/818880?v=4", + "profile": "https://bieker.ninja/", + "contributions": [ + "code" + ] + }, + { + "login": "phamnhuvu-dev", + "name": "Phạm Như Vũ", + "avatar_url": "https://avatars.githubusercontent.com/u/22906656?v=4", + "profile": "https://github.com/phamnhuvu-dev", + "contributions": [ + "code" + ] + }, + { + "login": "SebastienBtr", + "name": "SebastienBtr", + "avatar_url": "https://avatars.githubusercontent.com/u/18089010?v=4", + "profile": "https://github.com/SebastienBtr", + "contributions": [ + "code" + ] + }, + { + "login": "fattiger00", + "name": "NeZha", + "avatar_url": "https://avatars.githubusercontent.com/u/38494401?v=4", + "profile": "https://github.com/fattiger00", + "contributions": [ + "code" + ] + }, + { + "login": "klydra", + "name": "Jan Klinge", + "avatar_url": "https://avatars.githubusercontent.com/u/40038209?v=4", + "profile": "https://github.com/klydra", + "contributions": [ + "code" + ] + }, + { + "login": "PauloDurrerMelo", + "name": "PauloDurrerMelo", + "avatar_url": "https://avatars.githubusercontent.com/u/29310557?v=4", + "profile": "https://github.com/PauloDurrerMelo", + "contributions": [ + "code" + ] + }, + { + "login": "benmeemo", + "name": "benmeemo", + "avatar_url": "https://avatars.githubusercontent.com/u/47991706?v=4", + "profile": "https://github.com/benmeemo", + "contributions": [ + "code" + ] + }, + { + "login": "cinos1", + "name": "cinos", + "avatar_url": "https://avatars.githubusercontent.com/u/19343437?v=4", + "profile": "https://github.com/cinos1", + "contributions": [ + "code" + ] + }, + { + "login": "juicycleff", + "name": "Rex Raphael", + "avatar_url": "https://avatars.githubusercontent.com/u/11243590?v=4", + "profile": "https://xraph.com/", + "contributions": [ + "code" + ] + }, + { + "login": "Sense545", + "name": "Jan Henrik Høiland", + "avatar_url": "https://avatars.githubusercontent.com/u/769406?v=4", + "profile": "https://github.com/Sense545", + "contributions": [ + "code" + ] + }, + { + "login": "igtm", + "name": "Iguchi Tomokatsu", + "avatar_url": "https://avatars.githubusercontent.com/u/6331737?v=4", + "profile": "https://github.com/igtm", + "contributions": [ + "code" + ] + } + ], + "contributorsPerLine": 7, + "linkToUsage": false +} diff --git a/README.md b/README.md index 65c22317..8d8e815e 100755 --- a/README.md +++ b/README.md @@ -1,4 +1,7 @@ # Flutter InAppWebView Plugin [![Share on Twitter](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=Flutter%20InAppBrowser%20plugin!&url=https://github.com/pichillilorenzo/flutter_inappwebview&hashtags=flutter,flutterio,dart,dartlang,webview) [![Share on Facebook](https://img.shields.io/badge/share-facebook-blue.svg?longCache=true&style=flat&colorB=%234267b2)](https://www.facebook.com/sharer/sharer.php?u=https%3A//github.com/pichillilorenzo/flutter_inappwebview) + +[![All Contributors](https://img.shields.io/badge/all_contributors-53-orange.svg?style=flat-square)](#contributors-) + [![Pub](https://img.shields.io/pub/v/flutter_inappwebview.svg)](https://pub.dartlang.org/packages/flutter_inappwebview) [![pub points](https://badges.bar/flutter_inappwebview/pub%20points)](https://pub.dev/packages/flutter_inappwebview/score) @@ -8,7 +11,6 @@ [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](/LICENSE) [![Donate to this project](https://img.shields.io/badge/support-donate-yellow.svg)](https://inappwebview.dev/donate/) -[![GitHub contributors](https://img.shields.io/github/contributors/pichillilorenzo/flutter_inappwebview)](https://github.com/pichillilorenzo/flutter_inappwebview/graphs/contributors) [![GitHub forks](https://img.shields.io/github/forks/pichillilorenzo/flutter_inappwebview?style=social)](https://github.com/pichillilorenzo/flutter_inappwebview) [![GitHub stars](https://img.shields.io/github/stars/pichillilorenzo/flutter_inappwebview?style=social)](https://github.com/pichillilorenzo/flutter_inappwebview) @@ -71,4 +73,95 @@ To make it work properly on the Web platformm, you need to add the `web_support. ## Support -Did you find this plugin useful? Please consider to [make a donation](https://inappwebview.dev/donate/) to help improve it! \ No newline at end of file +Did you find this plugin useful? Please consider to [make a donation](https://inappwebview.dev/donate/) to help improve it! + +## Contributors ✨ + +Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)): + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Alex Li
Alex Li

💻
1/2
1/2

💻
Christofer Bodin
Christofer Bodin

💻
Matthew Lloyd
Matthew Lloyd

💻
C E
C E

💻
Robson Araujo
Robson Araujo

💻
Ryan
Ryan

💻
CodeEagle
CodeEagle

💻
Tanay Neotia
Tanay Neotia

💻
Jamie Joost
Jamie Joost

💻
Matias de Andrea
Matias de Andrea

💻
YouCii
YouCii

💻
Salnikov Sergey
Salnikov Sergey

💻
Po-Jui Chen
Po-Jui Chen

💻
Manuito
Manuito

💻
setcy
setcy

💻
EArminjon
EArminjon

💻
Ashank Bharati
Ashank Bharati

💻
Michael Chow
Michael Chow

💻
Osvaldo Saez
Osvaldo Saez

💻
rsydor
rsydor

💻
Le Minh Hoang
Le Minh Hoang

💻
Michael Kao
Michael Kao

💻
cloudygeek
cloudygeek

💻
Christoph Eck
Christoph Eck

💻
Ser1ous
Ser1ous

💻
Caleb Jones
Caleb Jones

💻
Saverio Murgia
Saverio Murgia

💻
Trần Đức Tâm
Trần Đức Tâm

💻
Joker
Joker

💻
Yash Chandra Verma
Yash Chandra Verma

💻
Arne Kepp
Arne Kepp

💻
Ömral Cörüt
Ömral Cörüt

💻
LrdHelmchen
LrdHelmchen

💻
Steven Gunanto
Steven Gunanto

💻
Michael Rittmeister
Michael Rittmeister

💻
Akira Aratani
Akira Aratani

💻
Doflatango
Doflatango

💻
Edmund Tay
Edmund Tay

💻
Andrei Diaconu
Andrei Diaconu

💻
Daniel Kao
Daniel Kao

💻
xuty
xuty

💻
Ben Bieker
Ben Bieker

💻
Phạm Như Vũ
Phạm Như Vũ

💻
SebastienBtr
SebastienBtr

💻
NeZha
NeZha

💻
Jan Klinge
Jan Klinge

💻
PauloDurrerMelo
PauloDurrerMelo

💻
benmeemo
benmeemo

💻
cinos
cinos

💻
Rex Raphael
Rex Raphael

💻
Jan Henrik Høiland
Jan Henrik Høiland

💻
Iguchi Tomokatsu
Iguchi Tomokatsu

💻
+ + + + + + +This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! \ No newline at end of file From 4c06cfee18755704dd1988aba51e154355c02b1d Mon Sep 17 00:00:00 2001 From: Lorenzo Pichilli Date: Tue, 4 Oct 2022 12:35:50 +0200 Subject: [PATCH 4/7] merge with 5.4.4 --- .../workflows/android-integration-test.yml | 140 +++++++++--------- .github/workflows/ios-integration-test.yml | 138 ++++++++--------- CHANGELOG.md | 7 +- README.md | 8 +- android/build.gradle | 6 +- .../flutter_inappwebview/Util.java | 23 ++- .../webview/in_app_webview/InAppWebView.java | 41 +++-- example/android/app/build.gradle | 6 +- example/integration_test/constants.dart | 2 +- example/pubspec.yaml | 2 +- 10 files changed, 208 insertions(+), 165 deletions(-) diff --git a/.github/workflows/android-integration-test.yml b/.github/workflows/android-integration-test.yml index 1dd606ff..3f8d83f7 100644 --- a/.github/workflows/android-integration-test.yml +++ b/.github/workflows/android-integration-test.yml @@ -1,70 +1,70 @@ -# Name of your workflow. -name: Android Integration Tests -on: - # Trigger the workflow on push or pull request, - # but only for the main branch - push: - branches: - - master - pull_request: - branches: - - master -# A workflow run is made up of one or more jobs. -jobs: - # id of job, a string that is unique to the "jobs" node above. - android_integration_tests: - # Creates a build matrix for your jobs. You can define different - # variations of an environment to run each job in. - strategy: - # A set of different configurations of the virtual - # environment. - # matrix: - # When set to true, GitHub cancels all in-progress jobs if any - # matrix job fails. - fail-fast: false - # The type of machine to run the job on. - runs-on: macOS-latest - timeout-minutes: 60 - # Contains a sequence of tasks. - steps: - # The branch or tag ref that triggered the workflow will be - # checked out. - # https://github.com/actions/checkout - - uses: actions/checkout@v2 - # Sets up cache - - name: Cache multiple paths - uses: actions/cache@v2 - with: - path: | - ~/.pub-cache - ~/.npm - key: ${{ runner.os }}-pub-and-npm-cache - # Sets up a flutter environment. - # https://github.com/marketplace/actions/flutter-action - - name: "Install Flutter" - uses: subosito/flutter-action@v1.4.0 - with: - channel: 'dev' # 'stable' or 'dev' or 'beta' - - name: "Change Flutter channel to master" - run: | - flutter channel master - flutter upgrade - - uses: actions/setup-node@v2 - with: - node-version: '14' - - name: "Install npm dependencies" - run: | - cd ./nodejs_server_test_auth_basic_and_ssl - npm install - cd .. - - name: "Install flutter dependencies" - run: | - flutter pub get - # Sets up android emulator - - name: "Run Android Flutter Integration Test" - uses: ReactiveCircus/android-emulator-runner@v2.14.3 - with: - api-level: 29 - target: default - avd-name: Flutter-Android - script: ./scripts/test.sh $(ipconfig getifaddr en0) \ No newline at end of file +## Name of your workflow. +#name: Android Integration Tests +#on: +# # Trigger the workflow on push or pull request, +# # but only for the main branch +# push: +# branches: +# - master +# pull_request: +# branches: +# - master +## A workflow run is made up of one or more jobs. +#jobs: +# # id of job, a string that is unique to the "jobs" node above. +# android_integration_tests: +# # Creates a build matrix for your jobs. You can define different +# # variations of an environment to run each job in. +# strategy: +# # A set of different configurations of the virtual +# # environment. +# # matrix: +# # When set to true, GitHub cancels all in-progress jobs if any +# # matrix job fails. +# fail-fast: false +# # The type of machine to run the job on. +# runs-on: macOS-latest +# timeout-minutes: 60 +# # Contains a sequence of tasks. +# steps: +# # The branch or tag ref that triggered the workflow will be +# # checked out. +# # https://github.com/actions/checkout +# - uses: actions/checkout@v2 +# # Sets up cache +# - name: Cache multiple paths +# uses: actions/cache@v2 +# with: +# path: | +# ~/.pub-cache +# ~/.npm +# key: ${{ runner.os }}-pub-and-npm-cache +# # Sets up a flutter environment. +# # https://github.com/marketplace/actions/flutter-action +# - name: "Install Flutter" +# uses: subosito/flutter-action@v1.4.0 +# with: +# channel: 'dev' # 'stable' or 'dev' or 'beta' +# - name: "Change Flutter channel to master" +# run: | +# flutter channel master +# flutter upgrade +# - uses: actions/setup-node@v2 +# with: +# node-version: '14' +# - name: "Install npm dependencies" +# run: | +# cd ./nodejs_server_test_auth_basic_and_ssl +# npm install +# cd .. +# - name: "Install flutter dependencies" +# run: | +# flutter pub get +# # Sets up android emulator +# - name: "Run Android Flutter Integration Test" +# uses: ReactiveCircus/android-emulator-runner@v2.14.3 +# with: +# api-level: 29 +# target: default +# avd-name: Flutter-Android +# script: ./scripts/test.sh $(ipconfig getifaddr en0) \ No newline at end of file diff --git a/.github/workflows/ios-integration-test.yml b/.github/workflows/ios-integration-test.yml index cb790158..d9c99a5a 100644 --- a/.github/workflows/ios-integration-test.yml +++ b/.github/workflows/ios-integration-test.yml @@ -1,69 +1,69 @@ -# Name of your workflow. -name: iOS Integration Tests -on: - # Trigger the workflow on push or pull request, - # but only for the main branch - push: - branches: - - master - pull_request: - branches: - - master -# A workflow run is made up of one or more jobs. -jobs: - # id of job, a string that is unique to the "jobs" node above. - ios_integration_tests: - # Creates a build matrix for your jobs. You can define different - # variations of an environment to run each job in. - strategy: - # A set of different configurations of the virtual - # environment. - # matrix: - # When set to true, GitHub cancels all in-progress jobs if any - # matrix job fails. - fail-fast: false - # The type of machine to run the job on. - runs-on: macOS-latest - timeout-minutes: 60 - # Contains a sequence of tasks. - steps: - # A name for your step to display on GitHub. - - name: "Start Simulator" - run: | - xcrun simctl list - xcrun simctl create Flutter-iPhone com.apple.CoreSimulator.SimDeviceType.iPhone-12 com.apple.CoreSimulator.SimRuntime.iOS-14-3 | xargs xcrun simctl boot - # The branch or tag ref that triggered the workflow will be - # checked out. - # https://github.com/actions/checkout - - uses: actions/checkout@v2 - # Sets up cache - - name: Cache multiple paths - uses: actions/cache@v2 - with: - path: | - ~/.pub-cache - ~/.npm - key: ${{ runner.os }}-pub-and-npm-cache - # Sets up a flutter environment. - # https://github.com/marketplace/actions/flutter-action - - name: "Install Flutter" - uses: subosito/flutter-action@v1.4.0 - with: - channel: 'dev' # 'stable' or 'dev' or 'beta' - - name: "Change Flutter channel to master" - run: | - flutter channel master - flutter upgrade - - uses: actions/setup-node@v2 - with: - node-version: '14' - - name: "Install npm dependencies" - run: | - cd ./nodejs_server_test_auth_basic_and_ssl - npm install - cd .. - - name: "Run iOS Flutter Integration Test" - run: | - flutter pub get - flutter devices - ./scripts/test.sh $(ipconfig getifaddr en0) \ No newline at end of file +## Name of your workflow. +#name: iOS Integration Tests +#on: +# # Trigger the workflow on push or pull request, +# # but only for the main branch +# push: +# branches: +# - master +# pull_request: +# branches: +# - master +## A workflow run is made up of one or more jobs. +#jobs: +# # id of job, a string that is unique to the "jobs" node above. +# ios_integration_tests: +# # Creates a build matrix for your jobs. You can define different +# # variations of an environment to run each job in. +# strategy: +# # A set of different configurations of the virtual +# # environment. +# # matrix: +# # When set to true, GitHub cancels all in-progress jobs if any +# # matrix job fails. +# fail-fast: false +# # The type of machine to run the job on. +# runs-on: macOS-latest +# timeout-minutes: 60 +# # Contains a sequence of tasks. +# steps: +# # A name for your step to display on GitHub. +# - name: "Start Simulator" +# run: | +# xcrun simctl list +# xcrun simctl create Flutter-iPhone com.apple.CoreSimulator.SimDeviceType.iPhone-12 com.apple.CoreSimulator.SimRuntime.iOS-14-3 | xargs xcrun simctl boot +# # The branch or tag ref that triggered the workflow will be +# # checked out. +# # https://github.com/actions/checkout +# - uses: actions/checkout@v2 +# # Sets up cache +# - name: Cache multiple paths +# uses: actions/cache@v2 +# with: +# path: | +# ~/.pub-cache +# ~/.npm +# key: ${{ runner.os }}-pub-and-npm-cache +# # Sets up a flutter environment. +# # https://github.com/marketplace/actions/flutter-action +# - name: "Install Flutter" +# uses: subosito/flutter-action@v1.4.0 +# with: +# channel: 'dev' # 'stable' or 'dev' or 'beta' +# - name: "Change Flutter channel to master" +# run: | +# flutter channel master +# flutter upgrade +# - uses: actions/setup-node@v2 +# with: +# node-version: '14' +# - name: "Install npm dependencies" +# run: | +# cd ./nodejs_server_test_auth_basic_and_ssl +# npm install +# cd .. +# - name: "Run iOS Flutter Integration Test" +# run: | +# flutter pub get +# flutter devices +# ./scripts/test.sh $(ipconfig getifaddr en0) \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 96afe0c4..d09cdfe6 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,9 +16,14 @@ ### BREAKING CHANGES -- On Android, the `InAppWebView` widget uses hybrid composition by default (`useHybridComposition: true`). +- On Android, the `InAppWebView` widget uses hybrid composition by default (`useHybridComposition: true`). - All properties of `GeolocationPermissionShowPromptResponse` cannot be `null`; +## 5.4.4 + +- Added support for Android 33 +- Fixed possible null pointer exception in Android `ChromeCustomTabsActivity.java` + ## 5.4.3+8 - Merged "Xcode 14 build error: Stored properties cannot be marked potentially unavailable with '@available'" [#1238](https://github.com/pichillilorenzo/flutter_inappwebview/pull/1238) (thanks to [CodeEagle](https://github.com/CodeEagle)) diff --git a/README.md b/README.md index 8d8e815e..7d3069c0 100755 --- a/README.md +++ b/README.md @@ -3,10 +3,10 @@ [![All Contributors](https://img.shields.io/badge/all_contributors-53-orange.svg?style=flat-square)](#contributors-) -[![Pub](https://img.shields.io/pub/v/flutter_inappwebview.svg)](https://pub.dartlang.org/packages/flutter_inappwebview) -[![pub points](https://badges.bar/flutter_inappwebview/pub%20points)](https://pub.dev/packages/flutter_inappwebview/score) -[![popularity](https://badges.bar/flutter_inappwebview/popularity)](https://pub.dev/packages/flutter_inappwebview/score) -[![likes](https://badges.bar/flutter_inappwebview/likes)](https://pub.dev/packages/flutter_inappwebview/score) +[![Pub](https://img.shields.io/pub/v/flutter_inappwebview?include_prereleases)](https://pub.dartlang.org/packages/flutter_inappwebview) +[![Pub Points](https://img.shields.io/pub/points/flutter_inappwebview)](https://pub.dev/packages/flutter_inappwebview/score) +[![Pub Popularity](https://img.shields.io/pub/popularity/flutter_inappwebview)](https://pub.dev/packages/flutter_inappwebview/score) +[![Pub Likes](https://img.shields.io/pub/likes/flutter_inappwebview)](https://pub.dev/packages/flutter_inappwebview/score) [![Awesome Flutter](https://img.shields.io/badge/Awesome-Flutter-blue.svg?longCache=true&style=flat-square)](https://stackoverflow.com/questions/tagged/flutter-inappwebview) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](/LICENSE) diff --git a/android/build.gradle b/android/build.gradle index a6642d58..f6bfa929 100755 --- a/android/build.gradle +++ b/android/build.gradle @@ -22,7 +22,7 @@ rootProject.allprojects { apply plugin: 'com.android.library' android { - compileSdkVersion 31 + compileSdkVersion 33 defaultConfig { minSdkVersion 17 @@ -45,9 +45,9 @@ android { } } dependencies { - implementation 'androidx.webkit:webkit:1.4.0' + implementation 'androidx.webkit:webkit:1.5.0' implementation 'androidx.browser:browser:1.4.0' - implementation 'androidx.appcompat:appcompat:1.4.1' + implementation 'androidx.appcompat:appcompat:1.5.1' implementation 'com.squareup.okhttp3:okhttp:3.14.9' implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0' } diff --git a/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/Util.java b/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/Util.java index ad70ead6..4058a49d 100755 --- a/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/Util.java +++ b/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/Util.java @@ -23,6 +23,8 @@ import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; import java.net.Inet6Address; import java.net.InetAddress; import java.net.UnknownHostException; @@ -33,15 +35,11 @@ import java.security.cert.Certificate; import java.security.cert.CertificateException; import java.security.cert.CertificateFactory; import java.security.cert.X509Certificate; -import java.util.ArrayList; import java.util.Enumeration; -import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import java.util.regex.Matcher; import java.util.regex.Pattern; import javax.net.ssl.HostnameVerifier; @@ -333,4 +331,21 @@ public class Util { } return data; } + + @Nullable + public static Object invokeMethodIfExists(final O o, final String methodName, Object... args) { + Method[] methods = o.getClass().getMethods(); + for (Method method : methods) { + if (method.getName().equals(methodName)) { + try { + return method.invoke(o, args); + } catch (IllegalAccessException e) { + return null; + } catch (InvocationTargetException e) { + return null; + } + } + } + return null; + } } diff --git a/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/in_app_webview/InAppWebView.java b/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/in_app_webview/InAppWebView.java index 626b27fc..cfe9a5a6 100755 --- a/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/in_app_webview/InAppWebView.java +++ b/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/in_app_webview/InAppWebView.java @@ -288,8 +288,11 @@ final public class InAppWebView extends InputAwareWebView implements InAppWebVie settings.setAllowFileAccessFromFileURLs(customSettings.allowFileAccessFromFileURLs); settings.setAllowUniversalAccessFromFileURLs(customSettings.allowUniversalAccessFromFileURLs); setCacheEnabled(customSettings.cacheEnabled); - if (customSettings.appCachePath != null && !customSettings.appCachePath.isEmpty() && customSettings.cacheEnabled) - settings.setAppCachePath(customSettings.appCachePath); + if (customSettings.appCachePath != null && !customSettings.appCachePath.isEmpty() && customSettings.cacheEnabled) { + // removed from Android API 33+ (https://developer.android.com/sdk/api_diff/33/changes) + // settings.setAppCachePath(customSettings.appCachePath); + Util.invokeMethodIfExists(settings, "setAppCachePath", customSettings.appCachePath); + } settings.setBlockNetworkImage(customSettings.blockNetworkImage); settings.setBlockNetworkLoads(customSettings.blockNetworkLoads); if (customSettings.cacheMode != null) @@ -512,7 +515,11 @@ final public class InAppWebView extends InputAwareWebView implements InAppWebVie // Disable caching settings.setCacheMode(WebSettings.LOAD_NO_CACHE); - settings.setAppCacheEnabled(false); + + // removed from Android API 33+ (https://developer.android.com/sdk/api_diff/33/changes) + // settings.setAppCacheEnabled(false); + Util.invokeMethodIfExists(settings, "setAppCacheEnabled", false); + clearHistory(); clearCache(true); @@ -522,7 +529,11 @@ final public class InAppWebView extends InputAwareWebView implements InAppWebVie settings.setSaveFormData(false); } else { settings.setCacheMode(WebSettings.LOAD_DEFAULT); - settings.setAppCacheEnabled(true); + + // removed from Android API 33+ (https://developer.android.com/sdk/api_diff/33/changes) + // settings.setAppCacheEnabled(true); + Util.invokeMethodIfExists(settings, "setAppCacheEnabled", true); + settings.setSavePassword(true); settings.setSaveFormData(true); } @@ -533,13 +544,22 @@ final public class InAppWebView extends InputAwareWebView implements InAppWebVie if (enabled) { Context ctx = getContext(); if (ctx != null) { - settings.setAppCachePath(ctx.getCacheDir().getAbsolutePath()); + // removed from Android API 33+ (https://developer.android.com/sdk/api_diff/33/changes) + // settings.setAppCachePath(ctx.getCacheDir().getAbsolutePath()); + Util.invokeMethodIfExists(settings, "setAppCachePath", ctx.getCacheDir().getAbsolutePath()); + settings.setCacheMode(WebSettings.LOAD_DEFAULT); - settings.setAppCacheEnabled(true); + + // removed from Android API 33+ (https://developer.android.com/sdk/api_diff/33/changes) + // settings.setAppCacheEnabled(true); + Util.invokeMethodIfExists(settings, "setAppCacheEnabled", true); } } else { settings.setCacheMode(WebSettings.LOAD_NO_CACHE); - settings.setAppCacheEnabled(false); + + // removed from Android API 33+ (https://developer.android.com/sdk/api_diff/33/changes) + // settings.setAppCacheEnabled(false); + Util.invokeMethodIfExists(settings, "setAppCacheEnabled", false); } } @@ -788,8 +808,11 @@ final public class InAppWebView extends InputAwareWebView implements InAppWebVie if (newSettingsMap.get("cacheEnabled") != null && customSettings.cacheEnabled != newCustomSettings.cacheEnabled) setCacheEnabled(newCustomSettings.cacheEnabled); - if (newSettingsMap.get("appCachePath") != null && (customSettings.appCachePath == null || !customSettings.appCachePath.equals(newCustomSettings.appCachePath))) - settings.setAppCachePath(newCustomSettings.appCachePath); + if (newSettingsMap.get("appCachePath") != null && (customSettings.appCachePath == null || !customSettings.appCachePath.equals(newCustomSettings.appCachePath))) { + // removed from Android API 33+ (https://developer.android.com/sdk/api_diff/33/changes) + // settings.setAppCachePath(newCustomSettings.appCachePath); + Util.invokeMethodIfExists(settings, "setAppCachePath", newCustomSettings.appCachePath); + } if (newSettingsMap.get("blockNetworkImage") != null && customSettings.blockNetworkImage != newCustomSettings.blockNetworkImage) settings.setBlockNetworkImage(newCustomSettings.blockNetworkImage); diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index de44914a..4b28f2e2 100755 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -30,7 +30,7 @@ android { targetCompatibility 1.8 } - compileSdkVersion 31 + compileSdkVersion 33 lintOptions { disable 'InvalidPackage' @@ -40,7 +40,7 @@ android { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.pichillilorenzo.flutter_inappwebviewexample" minSdkVersion 17 - targetSdkVersion 31 + targetSdkVersion 33 versionCode flutterVersionCode.toInteger() versionName flutterVersionName testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" @@ -64,6 +64,6 @@ dependencies { testImplementation 'junit:junit:4.13' androidTestImplementation 'androidx.test:runner:1.2.0' androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' - implementation 'com.google.android.material:material:1.3.0' + implementation 'com.google.android.material:material:1.6.1' implementation 'com.android.support:multidex:1.0.3' } diff --git a/example/integration_test/constants.dart b/example/integration_test/constants.dart index 4a083c23..29b96416 100644 --- a/example/integration_test/constants.dart +++ b/example/integration_test/constants.dart @@ -15,4 +15,4 @@ final TEST_WEB_PLATFORM_URL_3 = Uri.parse(TEST_WEB_PLATFORM_BASE_URL.toString() final TEST_NOT_A_WEBSITE_URL = Uri.parse('https://www.notawebsite..com/'); final TEST_CHROME_SAFE_BROWSING_MALWARE = Uri.parse('chrome://safe-browsing/match?type=malware'); final TEST_PERMISSION_SITE = Uri.parse('https://permission.site/'); -final TEST_SERVICE_WORKER_URL = Uri.parse('https://mdn.github.io/sw-test/'); +final TEST_SERVICE_WORKER_URL = Uri.parse('https://mdn.github.io/dom-examples/service-worker/simple-service-worker/'); diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 9ef5bfa2..9e1b803e 100755 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -24,7 +24,7 @@ dependencies: cupertino_icons: ^1.0.4 flutter_downloader: ^1.7.3 path_provider: ^2.0.9 - permission_handler: ^9.2.0 + permission_handler: ^10.0.2 url_launcher: ^6.0.20 # connectivity: ^0.4.5+6 flutter_inappwebview: From f8dd026925bea746010306ea0261272855532d67 Mon Sep 17 00:00:00 2001 From: Lorenzo Pichilli Date: Tue, 4 Oct 2022 12:38:02 +0200 Subject: [PATCH 5/7] updated workflows --- .../workflows/android-integration-test.yml | 140 +++++++++--------- .github/workflows/ios-integration-test.yml | 138 ++++++++--------- 2 files changed, 139 insertions(+), 139 deletions(-) diff --git a/.github/workflows/android-integration-test.yml b/.github/workflows/android-integration-test.yml index 3f8d83f7..1dd606ff 100644 --- a/.github/workflows/android-integration-test.yml +++ b/.github/workflows/android-integration-test.yml @@ -1,70 +1,70 @@ -## Name of your workflow. -#name: Android Integration Tests -#on: -# # Trigger the workflow on push or pull request, -# # but only for the main branch -# push: -# branches: -# - master -# pull_request: -# branches: -# - master -## A workflow run is made up of one or more jobs. -#jobs: -# # id of job, a string that is unique to the "jobs" node above. -# android_integration_tests: -# # Creates a build matrix for your jobs. You can define different -# # variations of an environment to run each job in. -# strategy: -# # A set of different configurations of the virtual -# # environment. -# # matrix: -# # When set to true, GitHub cancels all in-progress jobs if any -# # matrix job fails. -# fail-fast: false -# # The type of machine to run the job on. -# runs-on: macOS-latest -# timeout-minutes: 60 -# # Contains a sequence of tasks. -# steps: -# # The branch or tag ref that triggered the workflow will be -# # checked out. -# # https://github.com/actions/checkout -# - uses: actions/checkout@v2 -# # Sets up cache -# - name: Cache multiple paths -# uses: actions/cache@v2 -# with: -# path: | -# ~/.pub-cache -# ~/.npm -# key: ${{ runner.os }}-pub-and-npm-cache -# # Sets up a flutter environment. -# # https://github.com/marketplace/actions/flutter-action -# - name: "Install Flutter" -# uses: subosito/flutter-action@v1.4.0 -# with: -# channel: 'dev' # 'stable' or 'dev' or 'beta' -# - name: "Change Flutter channel to master" -# run: | -# flutter channel master -# flutter upgrade -# - uses: actions/setup-node@v2 -# with: -# node-version: '14' -# - name: "Install npm dependencies" -# run: | -# cd ./nodejs_server_test_auth_basic_and_ssl -# npm install -# cd .. -# - name: "Install flutter dependencies" -# run: | -# flutter pub get -# # Sets up android emulator -# - name: "Run Android Flutter Integration Test" -# uses: ReactiveCircus/android-emulator-runner@v2.14.3 -# with: -# api-level: 29 -# target: default -# avd-name: Flutter-Android -# script: ./scripts/test.sh $(ipconfig getifaddr en0) \ No newline at end of file +# Name of your workflow. +name: Android Integration Tests +on: + # Trigger the workflow on push or pull request, + # but only for the main branch + push: + branches: + - master + pull_request: + branches: + - master +# A workflow run is made up of one or more jobs. +jobs: + # id of job, a string that is unique to the "jobs" node above. + android_integration_tests: + # Creates a build matrix for your jobs. You can define different + # variations of an environment to run each job in. + strategy: + # A set of different configurations of the virtual + # environment. + # matrix: + # When set to true, GitHub cancels all in-progress jobs if any + # matrix job fails. + fail-fast: false + # The type of machine to run the job on. + runs-on: macOS-latest + timeout-minutes: 60 + # Contains a sequence of tasks. + steps: + # The branch or tag ref that triggered the workflow will be + # checked out. + # https://github.com/actions/checkout + - uses: actions/checkout@v2 + # Sets up cache + - name: Cache multiple paths + uses: actions/cache@v2 + with: + path: | + ~/.pub-cache + ~/.npm + key: ${{ runner.os }}-pub-and-npm-cache + # Sets up a flutter environment. + # https://github.com/marketplace/actions/flutter-action + - name: "Install Flutter" + uses: subosito/flutter-action@v1.4.0 + with: + channel: 'dev' # 'stable' or 'dev' or 'beta' + - name: "Change Flutter channel to master" + run: | + flutter channel master + flutter upgrade + - uses: actions/setup-node@v2 + with: + node-version: '14' + - name: "Install npm dependencies" + run: | + cd ./nodejs_server_test_auth_basic_and_ssl + npm install + cd .. + - name: "Install flutter dependencies" + run: | + flutter pub get + # Sets up android emulator + - name: "Run Android Flutter Integration Test" + uses: ReactiveCircus/android-emulator-runner@v2.14.3 + with: + api-level: 29 + target: default + avd-name: Flutter-Android + script: ./scripts/test.sh $(ipconfig getifaddr en0) \ No newline at end of file diff --git a/.github/workflows/ios-integration-test.yml b/.github/workflows/ios-integration-test.yml index d9c99a5a..cb790158 100644 --- a/.github/workflows/ios-integration-test.yml +++ b/.github/workflows/ios-integration-test.yml @@ -1,69 +1,69 @@ -## Name of your workflow. -#name: iOS Integration Tests -#on: -# # Trigger the workflow on push or pull request, -# # but only for the main branch -# push: -# branches: -# - master -# pull_request: -# branches: -# - master -## A workflow run is made up of one or more jobs. -#jobs: -# # id of job, a string that is unique to the "jobs" node above. -# ios_integration_tests: -# # Creates a build matrix for your jobs. You can define different -# # variations of an environment to run each job in. -# strategy: -# # A set of different configurations of the virtual -# # environment. -# # matrix: -# # When set to true, GitHub cancels all in-progress jobs if any -# # matrix job fails. -# fail-fast: false -# # The type of machine to run the job on. -# runs-on: macOS-latest -# timeout-minutes: 60 -# # Contains a sequence of tasks. -# steps: -# # A name for your step to display on GitHub. -# - name: "Start Simulator" -# run: | -# xcrun simctl list -# xcrun simctl create Flutter-iPhone com.apple.CoreSimulator.SimDeviceType.iPhone-12 com.apple.CoreSimulator.SimRuntime.iOS-14-3 | xargs xcrun simctl boot -# # The branch or tag ref that triggered the workflow will be -# # checked out. -# # https://github.com/actions/checkout -# - uses: actions/checkout@v2 -# # Sets up cache -# - name: Cache multiple paths -# uses: actions/cache@v2 -# with: -# path: | -# ~/.pub-cache -# ~/.npm -# key: ${{ runner.os }}-pub-and-npm-cache -# # Sets up a flutter environment. -# # https://github.com/marketplace/actions/flutter-action -# - name: "Install Flutter" -# uses: subosito/flutter-action@v1.4.0 -# with: -# channel: 'dev' # 'stable' or 'dev' or 'beta' -# - name: "Change Flutter channel to master" -# run: | -# flutter channel master -# flutter upgrade -# - uses: actions/setup-node@v2 -# with: -# node-version: '14' -# - name: "Install npm dependencies" -# run: | -# cd ./nodejs_server_test_auth_basic_and_ssl -# npm install -# cd .. -# - name: "Run iOS Flutter Integration Test" -# run: | -# flutter pub get -# flutter devices -# ./scripts/test.sh $(ipconfig getifaddr en0) \ No newline at end of file +# Name of your workflow. +name: iOS Integration Tests +on: + # Trigger the workflow on push or pull request, + # but only for the main branch + push: + branches: + - master + pull_request: + branches: + - master +# A workflow run is made up of one or more jobs. +jobs: + # id of job, a string that is unique to the "jobs" node above. + ios_integration_tests: + # Creates a build matrix for your jobs. You can define different + # variations of an environment to run each job in. + strategy: + # A set of different configurations of the virtual + # environment. + # matrix: + # When set to true, GitHub cancels all in-progress jobs if any + # matrix job fails. + fail-fast: false + # The type of machine to run the job on. + runs-on: macOS-latest + timeout-minutes: 60 + # Contains a sequence of tasks. + steps: + # A name for your step to display on GitHub. + - name: "Start Simulator" + run: | + xcrun simctl list + xcrun simctl create Flutter-iPhone com.apple.CoreSimulator.SimDeviceType.iPhone-12 com.apple.CoreSimulator.SimRuntime.iOS-14-3 | xargs xcrun simctl boot + # The branch or tag ref that triggered the workflow will be + # checked out. + # https://github.com/actions/checkout + - uses: actions/checkout@v2 + # Sets up cache + - name: Cache multiple paths + uses: actions/cache@v2 + with: + path: | + ~/.pub-cache + ~/.npm + key: ${{ runner.os }}-pub-and-npm-cache + # Sets up a flutter environment. + # https://github.com/marketplace/actions/flutter-action + - name: "Install Flutter" + uses: subosito/flutter-action@v1.4.0 + with: + channel: 'dev' # 'stable' or 'dev' or 'beta' + - name: "Change Flutter channel to master" + run: | + flutter channel master + flutter upgrade + - uses: actions/setup-node@v2 + with: + node-version: '14' + - name: "Install npm dependencies" + run: | + cd ./nodejs_server_test_auth_basic_and_ssl + npm install + cd .. + - name: "Run iOS Flutter Integration Test" + run: | + flutter pub get + flutter devices + ./scripts/test.sh $(ipconfig getifaddr en0) \ No newline at end of file From 67235e37d0b572b600295cb11b27e88c6c4906b3 Mon Sep 17 00:00:00 2001 From: Lorenzo Pichilli Date: Tue, 4 Oct 2022 13:02:36 +0200 Subject: [PATCH 6/7] Fixed README --- .all-contributorsrc | 4 ++-- CHANGELOG.md | 4 ++++ README.md | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index 9a84ab1e..9bb8ce01 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -275,7 +275,7 @@ "login": "pcqpcq", "name": "Joker", "avatar_url": "https://avatars.githubusercontent.com/u/1411571?v=4", - "profile": "http://pcqpcq.me/", + "profile": "https://pcqpcq.me/", "contributions": [ "code" ] @@ -365,7 +365,7 @@ "login": "andreidiaconu", "name": "Andrei Diaconu", "avatar_url": "https://avatars.githubusercontent.com/u/1402046?v=4", - "profile": "http://andreidiaconu.com/", + "profile": "https://andreidiaconu.com/", "contributions": [ "code" ] diff --git a/CHANGELOG.md b/CHANGELOG.md index d09cdfe6..39ed22dc 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,10 @@ - On Android, the `InAppWebView` widget uses hybrid composition by default (`useHybridComposition: true`). - All properties of `GeolocationPermissionShowPromptResponse` cannot be `null`; +## 5.4.4+1 + +- Fixed README + ## 5.4.4 - Added support for Android 33 diff --git a/README.md b/README.md index 7d3069c0..00a9b2ad 100755 --- a/README.md +++ b/README.md @@ -122,7 +122,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d Trần Đức Tâm
Trần Đức Tâm

💻 - Joker
Joker

💻 + Joker
Joker

💻 Yash Chandra Verma
Yash Chandra Verma

💻 Arne Kepp
Arne Kepp

💻 Ömral Cörüt
Ömral Cörüt

💻 @@ -134,7 +134,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d Akira Aratani
Akira Aratani

💻 Doflatango
Doflatango

💻 Edmund Tay
Edmund Tay

💻 - Andrei Diaconu
Andrei Diaconu

💻 + Andrei Diaconu
Andrei Diaconu

💻 Daniel Kao
Daniel Kao

💻 xuty
xuty

💻 From 4f36d930da9176d11ad55e017cd02324a47779fb Mon Sep 17 00:00:00 2001 From: Lorenzo Pichilli Date: Tue, 4 Oct 2022 13:15:11 +0200 Subject: [PATCH 7/7] Fixed LICENSE --- CHANGELOG.md | 4 + LICENSE | 208 ++++++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 202 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 39ed22dc..1917a417 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,10 @@ - On Android, the `InAppWebView` widget uses hybrid composition by default (`useHybridComposition: true`). - All properties of `GeolocationPermissionShowPromptResponse` cannot be `null`; +## 5.4.4+2 + +- Fixed LICENSE + ## 5.4.4+1 - Fixed README diff --git a/LICENSE b/LICENSE index ce6d86e5..4dada16d 100755 --- a/LICENSE +++ b/LICENSE @@ -1,13 +1,201 @@ -Copyright 2018-2022 Lorenzo Pichilli + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - http://www.apache.org/licenses/LICENSE-2.0 + 1. Definitions. -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. \ No newline at end of file + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2022 Lorenzo Pichilli + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License.