Keep the Showkase codegen constructor in the designsystem module

The rule only kept the class, but ShowkaseBrowserActivity instantiates it with
Class.forName(...).getDeclaredConstructor().newInstance(), so R8 was free to
strip the constructor. Also drop the AGP template comments and rename the file
to .keep, for consistency with app/proguard.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Benoit Marty
2026-09-04 14:05:01 +02:00
parent fc519c7ddf
commit 230279566e
3 changed files with 6 additions and 24 deletions
+1 -1
View File
@@ -23,7 +23,7 @@ android {
buildTypes {
getByName("release") {
consumerProguardFiles("consumer-rules.pro")
consumerProguardFiles("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 {
<init>();
}
-23
View File
@@ -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 { }