mirror of
https://github.com/f-droid/fdroidclient.git
synced 2026-05-18 21:47:37 -04:00
[index] add versionName to PackageVersion
This commit is contained in:
@@ -14,9 +14,9 @@ internal class UpdateCheckerTest {
|
||||
private val signer = "9f9261f0b911c60f8db722f5d430a9e9d557a3f8078ce43e1c07522ef41efedb"
|
||||
private val signerV2 = SignerV2(listOf(signer))
|
||||
private val betaChannels = listOf(RELEASE_CHANNEL_BETA)
|
||||
private val version1 = Version(1)
|
||||
private val version2 = Version(2)
|
||||
private val version3 = Version(3)
|
||||
private val version1 = Version(1, "1", 23, 1)
|
||||
private val version2 = Version(2, "2", 23, 2)
|
||||
private val version3 = Version(3, "2", 23, 3)
|
||||
private val versions = listOf(version3, version2, version1)
|
||||
|
||||
@Test
|
||||
@@ -181,6 +181,9 @@ internal class UpdateCheckerTest {
|
||||
|
||||
private data class Version(
|
||||
override val versionCode: Long,
|
||||
override val versionName: String,
|
||||
override val added: Long,
|
||||
override val size: Long?,
|
||||
override val signer: SignerV2? = null,
|
||||
override val releaseChannels: List<String>? = null,
|
||||
// the manifest is only needed for compatibility checking which we can test differently
|
||||
|
||||
@@ -2,8 +2,6 @@ package org.fdroid.index.v2
|
||||
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
import kotlinx.serialization.decodeFromString
|
||||
import kotlinx.serialization.encodeToString
|
||||
import org.fdroid.IndexFile
|
||||
import org.fdroid.index.IndexParser
|
||||
|
||||
@@ -78,6 +76,9 @@ public data class Screenshots(
|
||||
|
||||
public interface PackageVersion {
|
||||
public val versionCode: Long
|
||||
public val versionName: String
|
||||
public val added: Long
|
||||
public val size: Long?
|
||||
public val signer: SignerV2?
|
||||
public val releaseChannels: List<String>?
|
||||
public val packageManifest: PackageManifest
|
||||
@@ -88,7 +89,7 @@ public const val ANTI_FEATURE_KNOWN_VULNERABILITY: String = "KnownVuln"
|
||||
|
||||
@Serializable
|
||||
public data class PackageVersionV2(
|
||||
val added: Long,
|
||||
override val added: Long,
|
||||
val file: FileV1,
|
||||
val src: FileV2? = null,
|
||||
val manifest: ManifestV2,
|
||||
@@ -97,6 +98,8 @@ public data class PackageVersionV2(
|
||||
val whatsNew: LocalizedTextV2 = emptyMap(),
|
||||
) : PackageVersion {
|
||||
override val versionCode: Long = manifest.versionCode
|
||||
override val versionName: String = manifest.versionName
|
||||
override val size: Long? = file.size
|
||||
override val signer: SignerV2? = manifest.signer
|
||||
override val packageManifest: PackageManifest = manifest
|
||||
override val hasKnownVulnerability: Boolean
|
||||
|
||||
Reference in New Issue
Block a user