fix crash in drafts caused by minification of DraftAttachment (#2337)
* fix crash in drafts caused by minification of DraftAttachment * fix formatting
This commit is contained in:
parent
329df1280b
commit
97fe4f88c5
2 changed files with 12 additions and 5 deletions
5
app/proguard-rules.pro
vendored
5
app/proguard-rules.pro
vendored
|
@ -47,12 +47,13 @@
|
|||
public *;
|
||||
}
|
||||
|
||||
-keepclassmembers class com.keylesspalace.tusky.components.conversation.ConversationAccountEntity { *; }
|
||||
-keepclassmembers class com.keylesspalace.tusky.db.DraftAttachment { *; }
|
||||
|
||||
-keep enum com.keylesspalace.tusky.db.DraftAttachment$Type {
|
||||
public *;
|
||||
}
|
||||
|
||||
-keepclassmembers class com.keylesspalace.tusky.components.conversation.ConversationAccountEntity { *; }
|
||||
|
||||
# https://github.com/google/gson/blob/master/examples/android-proguard-example/proguard.cfg
|
||||
|
||||
# Prevent proguard from stripping interface information from TypeAdapter, TypeAdapterFactory,
|
||||
|
|
|
@ -21,6 +21,7 @@ import androidx.core.net.toUri
|
|||
import androidx.room.Entity
|
||||
import androidx.room.PrimaryKey
|
||||
import androidx.room.TypeConverters
|
||||
import com.google.gson.annotations.SerializedName
|
||||
import com.keylesspalace.tusky.entity.NewPoll
|
||||
import com.keylesspalace.tusky.entity.Status
|
||||
import kotlinx.parcelize.Parcelize
|
||||
|
@ -40,11 +41,16 @@ data class DraftEntity(
|
|||
val failedToSend: Boolean
|
||||
)
|
||||
|
||||
/**
|
||||
* The alternate names are here because we accidentally published versions were DraftAttachment was minified
|
||||
* Tusky 15: uriString = e, description = f, type = g
|
||||
* Tusky 16 beta: uriString = i, description = j, type = k
|
||||
*/
|
||||
@Parcelize
|
||||
data class DraftAttachment(
|
||||
val uriString: String,
|
||||
val description: String?,
|
||||
val type: Type
|
||||
@SerializedName(value = "uriString", alternate = ["e", "i"]) val uriString: String,
|
||||
@SerializedName(value = "description", alternate = ["f", "j"]) val description: String?,
|
||||
@SerializedName(value = "type", alternate = ["g", "k"]) val type: Type
|
||||
) : Parcelable {
|
||||
val uri: Uri
|
||||
get() = uriString.toUri()
|
||||
|
|
Loading…
Reference in a new issue