adjust proguard rules

This commit is contained in:
tapframe 2026-04-18 02:05:11 +05:30
parent 2e963c3ccd
commit c2342397a4
14 changed files with 76 additions and 1 deletions

View file

@ -91,6 +91,30 @@ abstract class GenerateRuntimeConfigsTask : DefaultTask() {
} }
} }
abstract class RenameReleaseDmgTask : DefaultTask() {
@get:Input
abstract val versionName: Property<String>
@get:OutputDirectory
abstract val dmgDirectory: DirectoryProperty
@TaskAction
fun renameArtifact() {
val dmgDir = dmgDirectory.get().asFile
val targetFile = dmgDir.resolve("Nuvio-${versionName.get()}.dmg")
val sourceFile = dmgDir.listFiles()
?.filter { it.extension == "dmg" && it.name.startsWith("Nuvio-") }
?.maxByOrNull { it.lastModified() }
?: error("No DMG output found in ${dmgDir.path}")
if (sourceFile.absolutePath != targetFile.absolutePath) {
targetFile.delete()
sourceFile.copyTo(targetFile, overwrite = true)
sourceFile.delete()
}
}
}
fun readXcconfigValue(file: File, key: String): String? { fun readXcconfigValue(file: File, key: String): String? {
if (!file.exists()) return null if (!file.exists()) return null
return file.readLines() return file.readLines()
@ -281,8 +305,16 @@ dependencies {
compose.desktop { compose.desktop {
application { application {
mainClass = "com.nuvio.app.DesktopAppKt" mainClass = "com.nuvio.app.DesktopAppKt"
buildTypes.release.proguard {
configurationFiles.from(project.file("desktop-proguard-rules.pro"))
}
nativeDistributions { nativeDistributions {
packageName = "Nuvio"
modules("java.net.http")
targetFormats(org.jetbrains.compose.desktop.application.dsl.TargetFormat.Dmg)
macOS { macOS {
dockName = "Nuvio"
iconFile.set(project.file("desktop-icons/nuvio.icns"))
infoPlist { infoPlist {
extraKeysRawXml = """ extraKeysRawXml = """
<key>NSRequiresAquaSystemAppearance</key> <key>NSRequiresAquaSystemAppearance</key>
@ -294,6 +326,15 @@ compose.desktop {
} }
} }
val renameReleaseDmgArtifact = tasks.register<RenameReleaseDmgTask>("renameReleaseDmgArtifact") {
versionName.set(releaseAppVersionName)
dmgDirectory.set(layout.buildDirectory.dir("compose/binaries/main-release/dmg"))
}
tasks.matching { it.name == "packageReleaseDistributionForCurrentOS" || it.name == "packageReleaseDmg" }.configureEach {
finalizedBy(renameReleaseDmgArtifact)
}
configurations.all { configurations.all {
exclude(group = "androidx.media3", module = "media3-exoplayer") exclude(group = "androidx.media3", module = "media3-exoplayer")
exclude(group = "androidx.media3", module = "media3-ui") exclude(group = "androidx.media3", module = "media3-ui")

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 859 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

View file

@ -0,0 +1,34 @@
-dontshrink
-dontoptimize
-dontobfuscate
-keepattributes *Annotation*,Signature,InnerClasses,EnclosingMethod
-keep class com.nuvio.app.** { *; }
-keep interface com.nuvio.app.** { *; }
-keep enum com.nuvio.app.** { *; }
-keep class coil3.** { *; }
-keep interface coil3.** { *; }
-keep enum coil3.** { *; }
-keep class io.ktor.** { *; }
-keep interface io.ktor.** { *; }
-keep enum io.ktor.** { *; }
-keep class kotlinx.serialization.** { *; }
-keep interface kotlinx.serialization.** { *; }
-keep enum kotlinx.serialization.** { *; }
-keep class dev.whyoleg.** { *; }
-keep interface dev.whyoleg.** { *; }
-keep enum dev.whyoleg.** { *; }
-keep class com.typesafe.config.** { *; }
-keep interface com.typesafe.config.** { *; }
-keep enum com.typesafe.config.** { *; }
-keep class io.ktor.client.engine.java.** { *; }
-keep class io.ktor.serialization.kotlinx.json.** { *; }
-keep class coil3.network.ktor3.internal.** { *; }
-keep class dev.whyoleg.cryptography.providers.jdk.** { *; }
-keep class io.ktor.server.config.** { *; }

View file

@ -1,3 +1,3 @@
CURRENT_PROJECT_VERSION=26 CURRENT_PROJECT_VERSION=27
MARKETING_VERSION=0.1.0 MARKETING_VERSION=0.1.0