From 568e8bb162d2b440b961ec829212d383a7f3d77d Mon Sep 17 00:00:00 2001 From: Reid Baker Date: Wed, 17 May 2023 14:06:04 -0500 Subject: [PATCH] Revert "[url_launcher] Set broadcast reciever visability as required by target api 34" (#4027) Reverts flutter/packages#3973 flutter/flutter#127014 https://github.com/flutter/flutter/issues/126460#issuecomment-1551621165 https://stackoverflow.com/questions/76244218/flutter-url-launcher-plugin-throws-java-lang-illegalargumentexception-receiver --- packages/url_launcher/url_launcher_android/CHANGELOG.md | 4 ++++ .../url_launcher_android/android/build.gradle | 9 --------- .../io/flutter/plugins/urllauncher/WebViewActivity.java | 7 +------ packages/url_launcher/url_launcher_android/pubspec.yaml | 2 +- 4 files changed, 6 insertions(+), 16 deletions(-) diff --git a/packages/url_launcher/url_launcher_android/CHANGELOG.md b/packages/url_launcher/url_launcher_android/CHANGELOG.md index 79c9855619f8..48abee6a10a1 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.34 + +* Reverts ContextCompat usage that caused flutter/flutter#127014 + ## 6.0.33 * Explicitly sets if reciever for close should be exported. diff --git a/packages/url_launcher/url_launcher_android/android/build.gradle b/packages/url_launcher/url_launcher_android/android/build.gradle index 9f9cfeda74c1..3344266b6b37 100644 --- a/packages/url_launcher/url_launcher_android/android/build.gradle +++ b/packages/url_launcher/url_launcher_android/android/build.gradle @@ -59,18 +59,9 @@ 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 '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")) } 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 f9e7ac4c39bf..5371d3e14fe2 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,7 +23,6 @@ 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; @@ -144,11 +143,7 @@ public void onCreate(@Nullable Bundle savedInstanceState) { webview.setWebChromeClient(new FlutterWebChromeClient()); // Register receiver that may finish this Activity. - ContextCompat.registerReceiver( - this.getApplication(), - broadcastReceiver, - closeIntentFilter, - ContextCompat.RECEIVER_EXPORTED); + registerReceiver(broadcastReceiver, closeIntentFilter); } @VisibleForTesting diff --git a/packages/url_launcher/url_launcher_android/pubspec.yaml b/packages/url_launcher/url_launcher_android/pubspec.yaml index 87bc23a08bcd..6b1e168e9bc3 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.33 +version: 6.0.34 environment: sdk: ">=2.18.0 <4.0.0"