Remove unnecessary ProGuard keep rule and extract SaveResult to own file

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) <noreply@anthropic.com>
This commit is contained in:
Ole-Morten Duesund 2026-03-18 16:45:22 +01:00
commit c58c45c52c
3 changed files with 16 additions and 15 deletions

View file

@ -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.** { *; }

View file

@ -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.
*/

View file

@ -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()
}