From a2e241ba1a8fdf22ce17e047ab6af8f46787faf8 Mon Sep 17 00:00:00 2001 From: Alex Li Date: Fri, 24 May 2024 10:24:29 +0800 Subject: [PATCH] [cronet_http] Apply relevant rules with the ProGuard (#1204) --- pkgs/cronet_http/CHANGELOG.md | 4 ++++ pkgs/cronet_http/android/consumer-rules.pro | 3 +++ pkgs/cronet_http/example/android/app/build.gradle | 1 + pkgs/cronet_http/pubspec.yaml | 2 +- 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/pkgs/cronet_http/CHANGELOG.md b/pkgs/cronet_http/CHANGELOG.md index fd2acca034..25d0df3e37 100644 --- a/pkgs/cronet_http/CHANGELOG.md +++ b/pkgs/cronet_http/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.3.1-wip + +* Add relevant rules with the ProGuard to avoid runtime exceptions. + ## 1.3.0 * Add integration to the diff --git a/pkgs/cronet_http/android/consumer-rules.pro b/pkgs/cronet_http/android/consumer-rules.pro index 00f4f3efe1..00a7e574f6 100644 --- a/pkgs/cronet_http/android/consumer-rules.pro +++ b/pkgs/cronet_http/android/consumer-rules.pro @@ -1 +1,4 @@ -keep class io.flutter.plugins.cronet_http.** { *; } +-keep class java.net.URL { *; } +-keep class java.util.concurrent.Executors { *; } +-keep class org.chromium.net.** { *; } diff --git a/pkgs/cronet_http/example/android/app/build.gradle b/pkgs/cronet_http/example/android/app/build.gradle index dfd74270c3..add4718db2 100644 --- a/pkgs/cronet_http/example/android/app/build.gradle +++ b/pkgs/cronet_http/example/android/app/build.gradle @@ -73,5 +73,6 @@ dependencies { implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.8.0")) // ""com.google.android.gms:play-services-cronet" is only present so that // `jnigen` will work. Applications should not include this line. + // The version should be synced with `pkgs/cronet_http/android/build.gradle`. implementation "com.google.android.gms:play-services-cronet:18.0.1" } diff --git a/pkgs/cronet_http/pubspec.yaml b/pkgs/cronet_http/pubspec.yaml index 4a3da88b00..8d7c5d2f61 100644 --- a/pkgs/cronet_http/pubspec.yaml +++ b/pkgs/cronet_http/pubspec.yaml @@ -1,5 +1,5 @@ name: cronet_http -version: 1.3.0 +version: 1.3.1-wip description: >- An Android Flutter plugin that provides access to the Cronet HTTP client. repository: https://github.com/dart-lang/http/tree/master/pkgs/cronet_http