From e45c0507b9d7a8ae0044cd510902985061c7c78f Mon Sep 17 00:00:00 2001 From: Reid Baker Date: Fri, 12 May 2023 12:30:45 -0400 Subject: [PATCH 1/6] Update the version of androidx used. --- .../url_launcher_android/android/build.gradle | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/url_launcher/url_launcher_android/android/build.gradle b/packages/url_launcher/url_launcher_android/android/build.gradle index 3344266b6b3..8e588595a9d 100644 --- a/packages/url_launcher/url_launcher_android/android/build.gradle +++ b/packages/url_launcher/url_launcher_android/android/build.gradle @@ -59,9 +59,18 @@ android { } dependencies { + def core_version = "1.10.1" + + // Java language implementation + implementation "androidx.core:core:$core_version" + compileOnly 'androidx.annotation:annotation:1.2.0' testImplementation 'junit:junit:4.13.2' testImplementation 'org.mockito:mockito-core:5.1.1' - testImplementation 'androidx.test:core:1.0.0' + testImplementation "androidx.test:core:$core_version" testImplementation 'org.robolectric:robolectric:4.4.1' + + // org.jetbrains.kotlin:kotlin-bom artifact purpose is to align kotlin stdlib and related code versions. + // See: https://youtrack.jetbrains.com/issue/KT-55297/kotlin-stdlib-should-declare-constraints-on-kotlin-stdlib-jdk8-and-kotlin-stdlib-jdk7 + implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.8.10")) } From 120ac9ae7db0173dc1e12a2066953b5f87436a20 Mon Sep 17 00:00:00 2001 From: Reid Baker Date: Fri, 12 May 2023 12:40:07 -0400 Subject: [PATCH 2/6] Explictly set Exported on previously exported broadcast reciever --- packages/url_launcher/url_launcher_android/CHANGELOG.md | 4 ++++ .../io/flutter/plugins/urllauncher/WebViewActivity.java | 6 ++++++ packages/url_launcher/url_launcher_android/pubspec.yaml | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/url_launcher/url_launcher_android/CHANGELOG.md b/packages/url_launcher/url_launcher_android/CHANGELOG.md index b37a9989cc7..0df0e869f93 100644 --- a/packages/url_launcher/url_launcher_android/CHANGELOG.md +++ b/packages/url_launcher/url_launcher_android/CHANGELOG.md @@ -1,3 +1,7 @@ +## 6.0.33 + +* Explicitly set if reciever for close should be exported. + ## 6.0.32 * Updates gradle, AGP and fixes some lint errors. diff --git a/packages/url_launcher/url_launcher_android/android/src/main/java/io/flutter/plugins/urllauncher/WebViewActivity.java b/packages/url_launcher/url_launcher_android/android/src/main/java/io/flutter/plugins/urllauncher/WebViewActivity.java index 5371d3e14fe..90095faff4c 100644 --- a/packages/url_launcher/url_launcher_android/android/src/main/java/io/flutter/plugins/urllauncher/WebViewActivity.java +++ b/packages/url_launcher/url_launcher_android/android/src/main/java/io/flutter/plugins/urllauncher/WebViewActivity.java @@ -26,6 +26,7 @@ import java.util.Collections; import java.util.HashMap; import java.util.Map; +import androidx.core.content.ContextCompat; /* Launches WebView activity */ public class WebViewActivity extends Activity { @@ -144,6 +145,11 @@ public void onCreate(@Nullable Bundle savedInstanceState) { // Register receiver that may finish this Activity. registerReceiver(broadcastReceiver, closeIntentFilter); + ContextCompat.registerReceiver( + this.getApplication(), + broadcastReceiver, + closeIntentFilter, + ContextCompat.RECEIVER_EXPORTED); } @VisibleForTesting diff --git a/packages/url_launcher/url_launcher_android/pubspec.yaml b/packages/url_launcher/url_launcher_android/pubspec.yaml index 6f43020e3f8..87bc23a08bc 100644 --- a/packages/url_launcher/url_launcher_android/pubspec.yaml +++ b/packages/url_launcher/url_launcher_android/pubspec.yaml @@ -2,7 +2,7 @@ name: url_launcher_android description: Android implementation of the url_launcher plugin. repository: https://github.com/flutter/packages/tree/main/packages/url_launcher/url_launcher_android issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+url_launcher%22 -version: 6.0.32 +version: 6.0.33 environment: sdk: ">=2.18.0 <4.0.0" From 253957d73dc614cf45d17c6d6bd560ba29bf40c6 Mon Sep 17 00:00:00 2001 From: Reid Baker Date: Fri, 12 May 2023 12:55:53 -0400 Subject: [PATCH 3/6] Fix import order --- .../java/io/flutter/plugins/urllauncher/WebViewActivity.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/url_launcher/url_launcher_android/android/src/main/java/io/flutter/plugins/urllauncher/WebViewActivity.java b/packages/url_launcher/url_launcher_android/android/src/main/java/io/flutter/plugins/urllauncher/WebViewActivity.java index 90095faff4c..cfdf7f621cc 100644 --- a/packages/url_launcher/url_launcher_android/android/src/main/java/io/flutter/plugins/urllauncher/WebViewActivity.java +++ b/packages/url_launcher/url_launcher_android/android/src/main/java/io/flutter/plugins/urllauncher/WebViewActivity.java @@ -23,10 +23,10 @@ import androidx.annotation.Nullable; import androidx.annotation.RequiresApi; import androidx.annotation.VisibleForTesting; +import androidx.core.content.ContextCompat; import java.util.Collections; import java.util.HashMap; import java.util.Map; -import androidx.core.content.ContextCompat; /* Launches WebView activity */ public class WebViewActivity extends Activity { From bea85855393d997cf10a2525cab124e9509db19c Mon Sep 17 00:00:00 2001 From: Reid Baker Date: Fri, 12 May 2023 12:58:47 -0400 Subject: [PATCH 4/6] independent version for core test --- packages/url_launcher/url_launcher_android/android/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/url_launcher/url_launcher_android/android/build.gradle b/packages/url_launcher/url_launcher_android/android/build.gradle index 8e588595a9d..9f9cfeda74c 100644 --- a/packages/url_launcher/url_launcher_android/android/build.gradle +++ b/packages/url_launcher/url_launcher_android/android/build.gradle @@ -67,7 +67,7 @@ dependencies { compileOnly 'androidx.annotation:annotation:1.2.0' testImplementation 'junit:junit:4.13.2' testImplementation 'org.mockito:mockito-core:5.1.1' - testImplementation "androidx.test:core:$core_version" + testImplementation 'androidx.test:core:1.0.0' testImplementation 'org.robolectric:robolectric:4.4.1' // org.jetbrains.kotlin:kotlin-bom artifact purpose is to align kotlin stdlib and related code versions. From 851fc86a9ca33f418bdab140d0b40cc031d6e186 Mon Sep 17 00:00:00 2001 From: Reid Baker Date: Fri, 12 May 2023 14:33:44 -0400 Subject: [PATCH 5/6] replace not add second registation --- .../java/io/flutter/plugins/urllauncher/WebViewActivity.java | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/url_launcher/url_launcher_android/android/src/main/java/io/flutter/plugins/urllauncher/WebViewActivity.java b/packages/url_launcher/url_launcher_android/android/src/main/java/io/flutter/plugins/urllauncher/WebViewActivity.java index cfdf7f621cc..f9e7ac4c39b 100644 --- a/packages/url_launcher/url_launcher_android/android/src/main/java/io/flutter/plugins/urllauncher/WebViewActivity.java +++ b/packages/url_launcher/url_launcher_android/android/src/main/java/io/flutter/plugins/urllauncher/WebViewActivity.java @@ -144,7 +144,6 @@ public void onCreate(@Nullable Bundle savedInstanceState) { webview.setWebChromeClient(new FlutterWebChromeClient()); // Register receiver that may finish this Activity. - registerReceiver(broadcastReceiver, closeIntentFilter); ContextCompat.registerReceiver( this.getApplication(), broadcastReceiver, From cd26d39adf7e75308290d3d2e7bbb4cc86b09b55 Mon Sep 17 00:00:00 2001 From: Reid Baker Date: Fri, 12 May 2023 14:45:57 -0400 Subject: [PATCH 6/6] Update packages/url_launcher/url_launcher_android/CHANGELOG.md --- packages/url_launcher/url_launcher_android/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/url_launcher/url_launcher_android/CHANGELOG.md b/packages/url_launcher/url_launcher_android/CHANGELOG.md index 0df0e869f93..79c9855619f 100644 --- a/packages/url_launcher/url_launcher_android/CHANGELOG.md +++ b/packages/url_launcher/url_launcher_android/CHANGELOG.md @@ -1,6 +1,6 @@ ## 6.0.33 -* Explicitly set if reciever for close should be exported. +* Explicitly sets if reciever for close should be exported. ## 6.0.32