Enable R8 for release builds
- Turn on minification for the release build and sign it with the debug key so it is installable for testing (a public release would use a dedicated keystore). - proguard-rules.pro keeps the reflection-heavy mail/auth stack: Jakarta/Angus Mail (IMAP/SMTP providers resolved via reflection + service files) and AppAuth. - Verified on the Android 17 emulator: the release APK builds with R8, installs, and syncs mail over IMAP — confirming Angus Mail's provider resolution survives shrinking. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -48,11 +48,14 @@ android {
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
isMinifyEnabled = false
|
||||
isMinifyEnabled = true
|
||||
proguardFiles(
|
||||
getDefaultProguardFile("proguard-android-optimize.txt"),
|
||||
"proguard-rules.pro",
|
||||
)
|
||||
// Sign release builds with the debug key so they're installable for testing.
|
||||
// A public release would configure a dedicated upload/release keystore here.
|
||||
signingConfig = signingConfigs.getByName("debug")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Vendored
+18
-13
@@ -1,14 +1,19 @@
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# LibreMail ProGuard/R8 rules.
|
||||
#
|
||||
# Release builds are currently not minified (see app/build.gradle.kts). When
|
||||
# minification is enabled for release, add keep rules for the email/auth stack:
|
||||
#
|
||||
# Jakarta / Angus Mail (reflection-based provider registration):
|
||||
# -keep class jakarta.mail.** { *; }
|
||||
# -keep class org.eclipse.angus.mail.** { *; }
|
||||
# -keep class com.sun.mail.** { *; }
|
||||
# -dontwarn jakarta.activation.**
|
||||
#
|
||||
# AppAuth:
|
||||
# -keep class net.openid.appauth.** { *; }
|
||||
# R8/ProGuard keep rules for LibreMail's release build.
|
||||
|
||||
# --- Jakarta / Angus Mail (IMAP/SMTP) ---
|
||||
# Protocol providers (IMAP/SMTP stores and transports) are discovered via reflection and
|
||||
# META-INF service files, so keep the mail and activation classes and their members intact.
|
||||
-keep class jakarta.mail.** { *; }
|
||||
-keep class jakarta.activation.** { *; }
|
||||
-keep class org.eclipse.angus.mail.** { *; }
|
||||
-keep class org.eclipse.angus.activation.** { *; }
|
||||
-dontwarn jakarta.mail.**
|
||||
-dontwarn jakarta.activation.**
|
||||
-dontwarn org.eclipse.angus.**
|
||||
-dontwarn com.sun.activation.**
|
||||
|
||||
# --- AppAuth ---
|
||||
# AppAuth (de)serializes its models (AuthState, token responses) reflectively.
|
||||
-keep class net.openid.appauth.** { *; }
|
||||
-dontwarn net.openid.appauth.**
|
||||
|
||||
Reference in New Issue
Block a user