diff --git a/features/messages/impl/consumer-rules.pro b/features/messages/impl/consumer-rules.pro deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/features/roomdetails/impl/consumer-rules.pro b/features/roomdetails/impl/consumer-rules.pro deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/features/verifysession/impl/consumer-rules.pro b/features/verifysession/impl/consumer-rules.pro deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/libraries/androidutils/consumer-rules.pro b/libraries/androidutils/consumer-rules.pro deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/libraries/dateformatter/api/consumer-rules.pro b/libraries/dateformatter/api/consumer-rules.pro deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/libraries/dateformatter/impl/consumer-rules.pro b/libraries/dateformatter/impl/consumer-rules.pro deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/libraries/dateformatter/test/consumer-rules.pro b/libraries/dateformatter/test/consumer-rules.pro deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/libraries/designsystem/build.gradle.kts b/libraries/designsystem/build.gradle.kts index c159659fb0..9ef66f7b2f 100644 --- a/libraries/designsystem/build.gradle.kts +++ b/libraries/designsystem/build.gradle.kts @@ -23,7 +23,7 @@ android { buildTypes { getByName("release") { - consumerProguardFiles("consumer-rules.pro") + consumerProguardFiles("consumer-rules.keep") } } } diff --git a/libraries/designsystem/consumer-rules.keep b/libraries/designsystem/consumer-rules.keep new file mode 100644 index 0000000000..c84e1c0613 --- /dev/null +++ b/libraries/designsystem/consumer-rules.keep @@ -0,0 +1,5 @@ +# Showkase generates this class, and Showkase's ShowkaseBrowserActivity loads it reflectively with +# Class.forName(...).getDeclaredConstructor().newInstance(), so its constructor must be kept too. +-keep class io.element.android.libraries.designsystem.showkase.DesignSystemShowkaseRootModuleCodegen { + (); +} diff --git a/libraries/designsystem/consumer-rules.pro b/libraries/designsystem/consumer-rules.pro deleted file mode 100644 index dabf5661a4..0000000000 --- a/libraries/designsystem/consumer-rules.pro +++ /dev/null @@ -1,23 +0,0 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle.kts. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile - --keep class io.element.android.libraries.designsystem.showkase.DesignSystemShowkaseRootModuleCodegen { } diff --git a/libraries/encrypted-db/build.gradle.kts b/libraries/encrypted-db/build.gradle.kts index d48d4aefd1..70020f2bc8 100644 --- a/libraries/encrypted-db/build.gradle.kts +++ b/libraries/encrypted-db/build.gradle.kts @@ -17,7 +17,6 @@ android { buildTypes { release { isMinifyEnabled = false - consumerProguardFiles("consumer-proguard-rules.pro") } } } diff --git a/libraries/encrypted-db/consumer-proguard-rules.pro b/libraries/encrypted-db/consumer-proguard-rules.pro deleted file mode 100644 index f1b424510d..0000000000 --- a/libraries/encrypted-db/consumer-proguard-rules.pro +++ /dev/null @@ -1,21 +0,0 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile diff --git a/libraries/network/build.gradle.kts b/libraries/network/build.gradle.kts index 20f75091d9..faabe91a1c 100644 --- a/libraries/network/build.gradle.kts +++ b/libraries/network/build.gradle.kts @@ -13,12 +13,6 @@ plugins { android { namespace = "io.element.android.libraries.network" - - buildTypes { - release { - consumerProguardFiles("consumer-rules.pro") - } - } } setupDependencyInjection() diff --git a/libraries/network/consumer-rules.pro b/libraries/network/consumer-rules.pro deleted file mode 100644 index 1026dca840..0000000000 --- a/libraries/network/consumer-rules.pro +++ /dev/null @@ -1,9 +0,0 @@ -# From https://github.com/square/retrofit/issues/3751#issuecomment-1192043644 -# Keep generic signature of Call, Response (R8 full mode strips signatures from non-kept items). --keep,allowobfuscation,allowshrinking interface retrofit2.Call --keep,allowobfuscation,allowshrinking class retrofit2.Response - -# With R8 full mode generic signatures are stripped for classes that are not -# kept. Suspend functions are wrapped in continuations where the type argument -# is used. --keep,allowobfuscation,allowshrinking class kotlin.coroutines.Continuation diff --git a/libraries/pushproviders/firebase/build.gradle.kts b/libraries/pushproviders/firebase/build.gradle.kts index 33e88dd94c..cfe5dd01fb 100644 --- a/libraries/pushproviders/firebase/build.gradle.kts +++ b/libraries/pushproviders/firebase/build.gradle.kts @@ -26,10 +26,10 @@ android { buildTypes { getByName("release") { - consumerProguardFiles("consumer-proguard-rules.pro") + consumerProguardFiles("consumer-rules.keep") } register("nightly") { - consumerProguardFiles("consumer-proguard-rules.pro") + consumerProguardFiles("consumer-rules.keep") matchingFallbacks += listOf("release") } } diff --git a/libraries/pushproviders/firebase/consumer-proguard-rules.pro b/libraries/pushproviders/firebase/consumer-proguard-rules.pro deleted file mode 100644 index 0bc7b604bf..0000000000 --- a/libraries/pushproviders/firebase/consumer-proguard-rules.pro +++ /dev/null @@ -1,4 +0,0 @@ -# Fix this error: -# ERROR: Missing classes detected while running R8. Please add the missing classes or apply additional keep rules that are generated in /Users/bmarty/workspaces/element-x-android/app/build/outputs/mapping/nightly/missing_rules.txt. -# ERROR: R8: Missing class com.google.firebase.analytics.connector.AnalyticsConnector (referenced from: void com.google.firebase.messaging.MessagingAnalytics.logToScion(java.lang.String, android.os.Bundle) and 1 other context) --dontwarn com.google.firebase.analytics.connector.AnalyticsConnector diff --git a/libraries/pushproviders/firebase/consumer-rules.keep b/libraries/pushproviders/firebase/consumer-rules.keep new file mode 100644 index 0000000000..401c769d27 --- /dev/null +++ b/libraries/pushproviders/firebase/consumer-rules.keep @@ -0,0 +1,4 @@ +# firebase-messaging references AnalyticsConnector, but we exclude firebase-analytics and +# firebase-measurement-connector from its dependencies (see build.gradle.kts), so R8 reports it as a +# missing class. +-dontwarn com.google.firebase.analytics.connector.AnalyticsConnector diff --git a/tests/uitests/consumer-rules.pro b/tests/uitests/consumer-rules.pro deleted file mode 100644 index e69de29bb2..0000000000