From da889746d449276be3502b01c2608d8281ab0256 Mon Sep 17 00:00:00 2001 From: Alex Li Date: Sat, 18 May 2024 09:12:59 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=F0=9F=94=A7=20Apply=20relevant=20rules=20w?= =?UTF-8?q?ith=20the=20ProGuard?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkgs/cronet_http/android/consumer-rules.pro | 3 +++ pkgs/cronet_http/example/android/app/build.gradle | 1 + 2 files changed, 4 insertions(+) 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" } From 1b857ebb1994cac116761560e8b68b060ea0da93 Mon Sep 17 00:00:00 2001 From: Alex Li Date: Sat, 18 May 2024 23:05:18 +0800 Subject: [PATCH 2/3] Update CHANGELOG.md --- pkgs/cronet_http/CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/cronet_http/CHANGELOG.md b/pkgs/cronet_http/CHANGELOG.md index 188b3cd17e..75bd81b44e 100644 --- a/pkgs/cronet_http/CHANGELOG.md +++ b/pkgs/cronet_http/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.2.2-wip + +* Add relevant rules with the ProGuard to avoid runtime exceptions. + ## 1.2.1 * Upgrade `package:jni` to 0.9.2 to fix the build error in the latest versions From 8643719b40597895f7add5f1b9b0c6aa063e5131 Mon Sep 17 00:00:00 2001 From: Alex Li Date: Sat, 18 May 2024 23:05:34 +0800 Subject: [PATCH 3/3] Update pubspec.yaml --- pkgs/cronet_http/pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/cronet_http/pubspec.yaml b/pkgs/cronet_http/pubspec.yaml index 2e869381f9..b75ebc4508 100644 --- a/pkgs/cronet_http/pubspec.yaml +++ b/pkgs/cronet_http/pubspec.yaml @@ -1,5 +1,5 @@ name: cronet_http -version: 1.2.1 +version: 1.2.2-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