Skip to content

Commit

Permalink
Fix crash when minify and shrinkresources are enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Pepijn98 committed Dec 14, 2022
1 parent 0187c48 commit 79a2dce
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 4 deletions.
6 changes: 3 additions & 3 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -46,8 +46,8 @@ android {

buildTypes {
getByName("release") {
isMinifyEnabled = false
isShrinkResources = false
isMinifyEnabled = true
isShrinkResources = true
isDebuggable = false
isJniDebuggable = false
isRenderscriptDebuggable = false
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/java/dev/vdbroek/nekos/models/Errors.kt
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
7 changes: 7 additions & 0 deletions app/src/main/java/dev/vdbroek/nekos/models/Nekos.kt
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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<String>
)

@Keep
data class NekosResponse(
val images: MutableList<Neko>
)
5 changes: 5 additions & 0 deletions app/src/main/java/dev/vdbroek/nekos/models/UserData.kt
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -18,6 +22,7 @@ data class UserData(
val savedTags: ArrayList<String>
)

@Keep
data class LoginResponse(
val token: String
)
3 changes: 3 additions & 0 deletions app/src/main/java/dev/vdbroek/nekos/utils/Response.kt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
package dev.vdbroek.nekos.utils

import androidx.annotation.Keep

@Keep
data class Response<out V : Any?, out E : Exception?>(val value: V, val exception: E)
1 change: 0 additions & 1 deletion app/src/main/java/dev/vdbroek/nekos/utils/Utils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ import java.util.*
import kotlin.math.ln
import kotlin.math.min


val LocalActivity = staticCompositionLocalOf<ComponentActivity> {
error("CompositionLocal LocalActivity not present")
}
Expand Down

0 comments on commit 79a2dce

Please sign in to comment.