mirror of
https://github.com/Darkrock-Studios/hammer-editor.git
synced 2026-08-21 15:33:17 +00:00
ProGuard stripped org.apache.commons.logging.impl.LogFactoryImpl, which LogFactory resolves by name, so PDDocument's static init threw ExceptionInInitializerError on every PDF export from a packaged build. Only pdfkmp-jvm pulls in PDFBox, so Android is unaffected. Export failures also went uncaught in ExportDirectoryPicker on all three platforms, killing the app instead of showing the existing failure toast.
111 lines
5 KiB
Prolog
111 lines
5 KiB
Prolog
################################################################################
|
|
# GLOBAL SETTINGS (Minification Only - Stable for 2025)
|
|
################################################################################
|
|
-dontobfuscate
|
|
-dontoptimize
|
|
-ignorewarnings
|
|
|
|
# Essential for stack traces, reflection, and DI (Koin/Serialization)
|
|
-keepattributes SourceFile,LineNumberTable,Signature,InnerClasses,EnclosingMethod,Exceptions,*Annotation*
|
|
|
|
# Preserve the ServiceLoader directory (Essential for Ktor and Coil)
|
|
-keepdirectories META-INF/services
|
|
-adaptresourcefilenames META-INF/services/**
|
|
-adaptresourcefilecontents META-INF/services/**
|
|
|
|
################################################################################
|
|
# ENTRY POINT & PROJECT
|
|
################################################################################
|
|
-keepclasseswithmembers public class com.darkrockstudios.apps.hammer.desktop.MainKt {
|
|
public static void main(java.lang.String[]);
|
|
}
|
|
-keep class com.darkrockstudios.** { *; }
|
|
|
|
################################################################################
|
|
# COIL 3 (Fixes Images Not Loading)
|
|
################################################################################
|
|
-keep class coil3.** { *; }
|
|
-keep class * implements coil3.util.DecoderServiceLoaderTarget
|
|
-keep class * implements coil3.util.FetcherServiceLoaderTarget
|
|
# Keep Ktor network fetcher if used by Coil
|
|
-keep class coil3.network.ktor.** { *; }
|
|
|
|
################################################################################
|
|
# KTOR & SERIALIZATION
|
|
################################################################################
|
|
-keep class io.ktor.** { *; }
|
|
-keep class io.ktor.serialization.kotlinx.json.KotlinxSerializationJsonExtensionProvider { *; }
|
|
-keep class * implements io.ktor.serialization.kotlinx.KotlinxSerializationExtensionProvider
|
|
|
|
################################################################################
|
|
# SYSTEM & NATIVE (OSHI / JNA)
|
|
################################################################################
|
|
# Fix for the NullPointerException inside EnumMap
|
|
-keepclassmembers enum * {
|
|
public static **[] values();
|
|
public static ** valueOf(java.lang.String);
|
|
}
|
|
-keep class com.sun.jna.** { *; }
|
|
-keep class * implements com.sun.jna.** { *; }
|
|
-keep class oshi.** { *; }
|
|
-keep class sun.** { *; }
|
|
-keep class com.sun.** { *; }
|
|
-keepclasseswithmembernames class * {
|
|
native <methods>;
|
|
}
|
|
|
|
################################################################################
|
|
# NUCLEUS LAUNCHER (JNI bridge classes — JNI invokes static on*(...) callbacks)
|
|
# Windows launcher ships its own keep rules via the Nucleus Gradle plugin.
|
|
################################################################################
|
|
-keep class dev.nucleusframework.launcher.linux.NativeLinuxLauncherBridge {
|
|
native <methods>;
|
|
static ** on*(...);
|
|
}
|
|
-keep class dev.nucleusframework.launcher.macos.NativeMacOsDockMenuBridge {
|
|
native <methods>;
|
|
static ** on*(...);
|
|
}
|
|
|
|
################################################################################
|
|
# NUCLEUS TAO BACKEND (native window layer: JNI bridges call back into these,
|
|
# and the Tao main dispatcher is discovered reflectively via ServiceLoader)
|
|
################################################################################
|
|
-keep class dev.nucleusframework.window.tao.** { *; }
|
|
-keep class kotlinx.coroutines.internal.MainDispatcherFactory
|
|
|
|
################################################################################
|
|
# LIBRARIES (Broad Keeps for Stability)
|
|
################################################################################
|
|
-keep class androidx.compose.** { *; }
|
|
-keep class androidx.collection.** { *; }
|
|
-keep class kotlinx.coroutines.** { *; }
|
|
-keep class org.jetbrains.compose.** { *; }
|
|
-keep class org.jetbrains.skia.** { *; }
|
|
-keep class org.jetbrains.skiko.** { *; }
|
|
-keep class com.arkivanov.** { *; }
|
|
-keep class org.koin.** { *; }
|
|
|
|
################################################################################
|
|
# SLF4J (provider is wired via META-INF/services only, so the shrinker drops it)
|
|
################################################################################
|
|
-keep class * implements org.slf4j.spi.SLF4JServiceProvider { *; }
|
|
|
|
################################################################################
|
|
# COMMONS-LOGGING (PDFBox, used by PDF export)
|
|
# LogFactory resolves its implementation by name, so the shrinker sees no
|
|
# reference to LogFactoryImpl and drops it. PDDocument's static init then dies.
|
|
################################################################################
|
|
-keep class org.apache.commons.logging.** { *; }
|
|
-dontwarn org.apache.commons.logging.**
|
|
|
|
################################################################################
|
|
# CLEANUP & WARNING SUPPRESSION
|
|
################################################################################
|
|
-dontwarn okio.**
|
|
-dontwarn org.slf4j.**
|
|
-dontwarn javax.annotation.**
|
|
-dontwarn oshi.**
|
|
|
|
-keep class com.arkivanov.decompose.extensions.compose.mainthread.SwingMainThreadChecker { *; }
|
|
|