From c3cee0c91132dbf14d72a6bbd404979f6ddaa4dd Mon Sep 17 00:00:00 2001 From: particle-box Date: Mon, 19 Jan 2026 23:34:37 +0530 Subject: [PATCH] fix: versioning and changelog parsing --- .../ui/manager/pages/home/HomeRootSection.kt | 16 +++++++++------- build.gradle.kts | 4 ++-- gradle.properties | 4 ++-- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/app/src/main/kotlin/me/eternal/purrfectsnap/ui/manager/pages/home/HomeRootSection.kt b/app/src/main/kotlin/me/eternal/purrfectsnap/ui/manager/pages/home/HomeRootSection.kt index 89aee1ba..8df45643 100644 --- a/app/src/main/kotlin/me/eternal/purrfectsnap/ui/manager/pages/home/HomeRootSection.kt +++ b/app/src/main/kotlin/me/eternal/purrfectsnap/ui/manager/pages/home/HomeRootSection.kt @@ -1169,15 +1169,17 @@ class HomeRootSection : Routes.Route() { private fun extractChangelogForVersion(raw: String, version: String): String { val lines = raw.lines() val headerRegex = Regex("^\\s*#+\\s*v?${Regex.escape(version)}\\b", RegexOption.IGNORE_CASE) - var collecting = false val collected = mutableListOf() - lines.forEach { line -> - if (headerRegex.containsMatchIn(line)) { - collecting = true - return@forEach + var collecting = false + for (line in lines) { + if (!collecting) { + if (headerRegex.containsMatchIn(line)) { + collecting = true + } + continue } - if (collecting && line.startsWith("#")) return@forEach - if (collecting) collected.add(line) + if (line.trimStart().startsWith("#")) break + collected.add(line) } return collected.joinToString("\n").trim() } diff --git a/build.gradle.kts b/build.gradle.kts index 206e8563..bb10d019 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -33,8 +33,8 @@ tasks.register("getVersion") { } // You can still set these for legacy use by submodules or scripts: -rootProject.ext.set("appVersionName", providers.gradleProperty("APP_VERSION_NAME").orElse("1.1.0").get()) -rootProject.ext.set("appVersionCode", providers.gradleProperty("APP_VERSION_CODE").orElse("1").get().toInt()) +rootProject.ext.set("appVersionName", providers.gradleProperty("APP_VERSION_NAME").orElse("1.1.2").get()) +rootProject.ext.set("appVersionCode", providers.gradleProperty("APP_VERSION_CODE").orElse("252").get().toInt()) rootProject.ext.set("applicationId", "me.eternal.purrfectsnap") rootProject.ext.set( "buildHash", diff --git a/gradle.properties b/gradle.properties index d1c848bb..3bd28c78 100644 --- a/gradle.properties +++ b/gradle.properties @@ -8,8 +8,8 @@ org.gradle.configuration-cache=true org.gradle.configuration-cache.problems=warn nativeAbis=arm64-v8a -APP_VERSION_NAME=1.1.0 -APP_VERSION_CODE=250 +APP_VERSION_NAME=1.1.2 +APP_VERSION_CODE=252 debug_build_hash=18fe2a814d0e2eb5 psIntegrityPinnedSha256= EXPECTED_CERT_SHA256=97fc5c4dff7e33c159528eb9e53f86c356d430cd63d177f40c22b577ac829dee