diff --git a/app/build.gradle.kts b/app/build.gradle.kts index ab72ede..68d17e1 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -7,7 +7,7 @@ plugins { object Versions { private const val versionMajor = 2 private const val versionMinor = 0 - private const val versionPatch = 5 + private const val versionPatch = 6 const val minSdk = 28 const val targetSdk = 33 @@ -46,8 +46,8 @@ android { buildTypes { getByName("release") { - isMinifyEnabled = false - isShrinkResources = false + isMinifyEnabled = true + isShrinkResources = true isDebuggable = false isJniDebuggable = false isRenderscriptDebuggable = false diff --git a/app/src/main/java/dev/vdbroek/nekos/models/Errors.kt b/app/src/main/java/dev/vdbroek/nekos/models/Errors.kt index 3b38fd6..80a1c9d 100644 --- a/app/src/main/java/dev/vdbroek/nekos/models/Errors.kt +++ b/app/src/main/java/dev/vdbroek/nekos/models/Errors.kt @@ -1,11 +1,16 @@ package dev.vdbroek.nekos.models +import androidx.annotation.Keep + +@Keep data class HttpException( val message: String? ) +@Keep class EndException(override val message: String) : Exception(message) +@Keep class ApiException( httpException: HttpException, label: String = "UNKNOWN" diff --git a/app/src/main/java/dev/vdbroek/nekos/models/Nekos.kt b/app/src/main/java/dev/vdbroek/nekos/models/Nekos.kt index 592b81e..aa668aa 100644 --- a/app/src/main/java/dev/vdbroek/nekos/models/Nekos.kt +++ b/app/src/main/java/dev/vdbroek/nekos/models/Nekos.kt @@ -1,15 +1,20 @@ package dev.vdbroek.nekos.models +import androidx.annotation.Keep + +@Keep data class Uploader( val id: String, val username: String ) +@Keep data class Approver( val id: String, val username: String ) +@Keep data class Neko( val id: String, val originalHash: String, @@ -28,11 +33,13 @@ data class Neko( fun getThumbnailUrl(): String = "https://nekos.moe/thumbnail/$id" } +@Keep data class TagsResponse( val options: Any?, val tags: ArrayList ) +@Keep data class NekosResponse( val images: MutableList ) diff --git a/app/src/main/java/dev/vdbroek/nekos/models/UserData.kt b/app/src/main/java/dev/vdbroek/nekos/models/UserData.kt index d1d6a8f..c40ed24 100644 --- a/app/src/main/java/dev/vdbroek/nekos/models/UserData.kt +++ b/app/src/main/java/dev/vdbroek/nekos/models/UserData.kt @@ -1,9 +1,13 @@ package dev.vdbroek.nekos.models +import androidx.annotation.Keep + +@Keep data class UserResponse( val user: UserData ) +@Keep data class UserData( val id: String, val username: String, @@ -18,6 +22,7 @@ data class UserData( val savedTags: ArrayList ) +@Keep data class LoginResponse( val token: String ) diff --git a/app/src/main/java/dev/vdbroek/nekos/utils/Response.kt b/app/src/main/java/dev/vdbroek/nekos/utils/Response.kt index 4c85578..c753806 100644 --- a/app/src/main/java/dev/vdbroek/nekos/utils/Response.kt +++ b/app/src/main/java/dev/vdbroek/nekos/utils/Response.kt @@ -1,3 +1,6 @@ package dev.vdbroek.nekos.utils +import androidx.annotation.Keep + +@Keep data class Response(val value: V, val exception: E) diff --git a/app/src/main/java/dev/vdbroek/nekos/utils/Utils.kt b/app/src/main/java/dev/vdbroek/nekos/utils/Utils.kt index cba8e4b..20d623d 100644 --- a/app/src/main/java/dev/vdbroek/nekos/utils/Utils.kt +++ b/app/src/main/java/dev/vdbroek/nekos/utils/Utils.kt @@ -44,7 +44,6 @@ import java.util.* import kotlin.math.ln import kotlin.math.min - val LocalActivity = staticCompositionLocalOf { error("CompositionLocal LocalActivity not present") }