From c58c45c52c22b9322a26317573b9a5b057dc1c4c Mon Sep 17 00:00:00 2001 From: Ole-Morten Duesund Date: Wed, 18 Mar 2026 16:45:22 +0100 Subject: [PATCH] Remove unnecessary ProGuard keep rule and extract SaveResult to own file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The -keep rule for no.naiv.tiltshift.effect.** was based on the incorrect assumption that GLSL shaders use Java reflection. Shader source is loaded from raw resources — all effect classes are reached through normal Kotlin code and R8 can trace them. Removing the rule lets R8 properly optimize the effect package. Also extract SaveResult sealed class from PhotoSaver.kt into its own file to match the documented architecture. Co-Authored-By: Claude Opus 4.6 (1M context) --- app/proguard-rules.pro | 3 --- .../java/no/naiv/tiltshift/storage/PhotoSaver.kt | 12 ------------ .../java/no/naiv/tiltshift/storage/SaveResult.kt | 16 ++++++++++++++++ 3 files changed, 16 insertions(+), 15 deletions(-) create mode 100644 app/src/main/java/no/naiv/tiltshift/storage/SaveResult.kt diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index 2fb4752..7312d90 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -1,5 +1,2 @@ # Add project specific ProGuard rules here. # CameraX and GMS Location ship their own consumer ProGuard rules. - -# Keep OpenGL shader-related code (accessed via reflection by GLSL pipeline) --keep class no.naiv.tiltshift.effect.** { *; } diff --git a/app/src/main/java/no/naiv/tiltshift/storage/PhotoSaver.kt b/app/src/main/java/no/naiv/tiltshift/storage/PhotoSaver.kt index 8facb4c..7841f90 100644 --- a/app/src/main/java/no/naiv/tiltshift/storage/PhotoSaver.kt +++ b/app/src/main/java/no/naiv/tiltshift/storage/PhotoSaver.kt @@ -17,18 +17,6 @@ import java.time.format.DateTimeFormatter import java.util.Locale -/** - * Result of a photo save operation. - */ -sealed class SaveResult { - data class Success( - val uri: Uri, - val originalUri: Uri? = null, - val thumbnail: android.graphics.Bitmap? = null - ) : SaveResult() - data class Error(val message: String, val exception: Exception? = null) : SaveResult() -} - /** * Handles saving captured photos to the device gallery. */ diff --git a/app/src/main/java/no/naiv/tiltshift/storage/SaveResult.kt b/app/src/main/java/no/naiv/tiltshift/storage/SaveResult.kt new file mode 100644 index 0000000..4e5e700 --- /dev/null +++ b/app/src/main/java/no/naiv/tiltshift/storage/SaveResult.kt @@ -0,0 +1,16 @@ +package no.naiv.tiltshift.storage + +import android.graphics.Bitmap +import android.net.Uri + +/** + * Result of a photo save operation. + */ +sealed class SaveResult { + data class Success( + val uri: Uri, + val originalUri: Uri? = null, + val thumbnail: Bitmap? = null + ) : SaveResult() + data class Error(val message: String, val exception: Exception? = null) : SaveResult() +}