From c70a681f1ed7d25890636ecd149dcbd4950b2df1 Mon Sep 17 00:00:00 2001 From: Christophe Beyls Date: Wed, 29 May 2024 00:38:44 +0200 Subject: [PATCH] chore: remove additional Kotlin assertions thanks to new Proguard rules --- app/build.gradle.kts | 9 +-------- app/proguard-defaults.txt | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 037cf202..08731eca 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -35,14 +35,6 @@ android { isShrinkResources = true proguardFiles("proguard-defaults.txt", "proguard-rules.pro") - kotlinOptions { - freeCompilerArgs = listOf( - "-Xno-param-assertions", - "-Xno-call-assertions", - "-Xno-receiver-assertions" - ) - } - packaging { resources { excludes += listOf( @@ -55,6 +47,7 @@ android { jniLibs { excludes += "**/libdatastore_shared_counter.so" } + vcsInfo.include = false } } } diff --git a/app/proguard-defaults.txt b/app/proguard-defaults.txt index 38cc90b7..affe5e67 100644 --- a/app/proguard-defaults.txt +++ b/app/proguard-defaults.txt @@ -28,4 +28,21 @@ -dontwarn android.util.FloatMath # These classes are duplicated between android.jar and core-lambda-stubs.jar. --dontnote java.lang.invoke.** \ No newline at end of file +-dontnote java.lang.invoke.** + +# Remove Kotlin assertions +-assumenosideeffects class kotlin.jvm.internal.Intrinsics { + public static void checkNotNull(...); + public static void checkExpressionValueIsNotNull(...); + public static void checkNotNullExpressionValue(...); + public static void checkParameterIsNotNull(...); + public static void checkNotNullParameter(...); + public static void checkReturnedValueIsNotNull(...); + public static void checkFieldIsNotNull(...); + public static void throwUninitializedPropertyAccessException(...); + public static void throwNpe(...); + public static void throwJavaNpe(...); + public static void throwAssert(...); + public static void throwIllegalArgument(...); + public static void throwIllegalState(...); +} \ No newline at end of file