From 3b6f548389d74642ec9eaf28fac9816e27dac8d8 Mon Sep 17 00:00:00 2001 From: Louis CAD Date: Mon, 22 Jul 2019 22:55:07 +0200 Subject: [PATCH] Improve proguard rules --- ...d-optimize.txt => proguard-android-really-optimize.txt | 0 samples/android-app/build.gradle.kts | 8 +++++++- samples/android-app/proguard-rules.pro | 4 ++++ 3 files changed, 11 insertions(+), 1 deletion(-) rename proguard-android-optimize.txt => proguard-android-really-optimize.txt (100%) diff --git a/proguard-android-optimize.txt b/proguard-android-really-optimize.txt similarity index 100% rename from proguard-android-optimize.txt rename to proguard-android-really-optimize.txt diff --git a/samples/android-app/build.gradle.kts b/samples/android-app/build.gradle.kts index 3d8491527..37419bedc 100644 --- a/samples/android-app/build.gradle.kts +++ b/samples/android-app/build.gradle.kts @@ -19,7 +19,7 @@ android { versionCode = 1 versionName = ProjectVersions.thisLibrary resConfigs("en", "fr") - proguardFile(getDefaultProguardFile("proguard-android-optimize.txt")) + proguardFile("../proguard-android-really-optimize.txt") proguardFile("proguard-rules.pro") testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" } @@ -46,6 +46,12 @@ android { manifest.srcFile("src/androidMain/AndroidManifest.xml") res.srcDir("src/androidMain/res") } + packagingOptions { + exclude("**/*.kotlin_module") + exclude("**/*.kotlin_builtins") + exclude("**/*.kotlin_metadata") + exclude("META-INF/kotlinx-coroutines-core.kotlin_module") + } } kotlin { diff --git a/samples/android-app/proguard-rules.pro b/samples/android-app/proguard-rules.pro index 872d9c4c4..5d5f5224e 100644 --- a/samples/android-app/proguard-rules.pro +++ b/samples/android-app/proguard-rules.pro @@ -15,3 +15,7 @@ #-keepclassmembers class fqcn.of.javascript.interface.for.webview { # public *; #} + +-keep class com.google.android.material.theme.MaterialComponentsViewInflater { + (...); +}