Skip to content

Commit 10e436c

Browse files
committed
릴리즈 1.1.8 준비
1 parent 8179860 commit 10e436c

5 files changed

Lines changed: 70 additions & 4 deletions

File tree

.github/workflows/google-play-production.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ jobs:
9999
tracks: production
100100
status: completed
101101
releaseName: ${{ github.event.release.tag_name }}
102+
inAppUpdatePriority: 5
102103
whatsNewDirectory: distribution/whatsnew
103104
mappingFile: app/build/outputs/mapping/release/mapping.txt
104105
changesNotSentForReview: false

SKILL.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,12 @@ Follow this workflow when the user asks to deploy SSUTime.
3434
- Increase the hardcoded `versionName` by one patch step unless the user specified a version. Example: `1.0.7` -> `1.0.8`.
3535
- Use the bumped `versionName` as the GitHub Release tag with a `v` prefix, for example `v1.0.7`.
3636
- Do not rely on CI to derive app versions from the GitHub Release tag; the Play build uses the committed Gradle version.
37-
4. Run checks:
37+
4. Set the Play in-app update priority before the final release commit:
38+
- Inspect the release changes and commits to decide whether they include an LMS API version change. Treat changes to the `libs.lms` dependency version, LMS API client compatibility code, or other LMS API version migration work as an LMS API version change.
39+
- If the release includes an LMS API version change, set `.github/workflows/google-play-production.yml` `inAppUpdatePriority` to `5` so the app's immediate in-app update flow can run for that version.
40+
- For all other releases, set `.github/workflows/google-play-production.yml` `inAppUpdatePriority` to a low value such as `0`; do not leave it at `4` or `5`, because that would trigger the app's immediate update prompt.
41+
- Commit and push the workflow priority value together with the version bump and release changes. The GitHub Release workflow uses the committed workflow file, so this value must be correct before creating the GitHub Release.
42+
5. Run checks:
3843

3944
```bash
4045
./gradlew test :app:compileReleaseKotlin :app:bundleRelease :app:assembleRelease

app/build.gradle.kts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ android {
5151
applicationId = "com.yourssu.ssutime.v2"
5252
minSdk = 26
5353
targetSdk = 36
54-
versionCode = 32
55-
versionName = "1.1.7"
54+
versionCode = 36
55+
versionName = "1.1.8"
5656

5757
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
5858
buildConfigField(
@@ -124,6 +124,8 @@ dependencies {
124124
compileOnly("androidx.glance:glance-preview:$glanceVersion")
125125
implementation(libs.androidx.work.runtime.ktx)
126126

127+
implementation("com.google.android.play:app-update:2.1.0")
128+
127129
implementation(libs.ktor.client.core)
128130
implementation(libs.ktor.client.android)
129131
implementation(libs.ktor.content.negotiation)

app/src/main/java/com/yourssu/ssutime/v2/MainActivity.kt

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@ package com.yourssu.ssutime.v2
22

33
import android.content.Intent
44
import android.os.Bundle
5+
import android.util.Log
56
import androidx.activity.ComponentActivity
67
import androidx.activity.compose.setContent
78
import androidx.activity.enableEdgeToEdge
9+
import androidx.activity.result.ActivityResult
10+
import androidx.activity.result.contract.ActivityResultContracts
811
import androidx.compose.foundation.background
912
import androidx.compose.foundation.layout.fillMaxSize
1013
import androidx.compose.runtime.mutableStateOf
@@ -13,6 +16,11 @@ import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
1316
import androidx.navigation.compose.NavHost
1417
import androidx.navigation.compose.composable
1518
import androidx.navigation.compose.rememberNavController
19+
import com.google.android.play.core.appupdate.AppUpdateInfo
20+
import com.google.android.play.core.appupdate.AppUpdateManagerFactory
21+
import com.google.android.play.core.appupdate.AppUpdateOptions
22+
import com.google.android.play.core.install.model.AppUpdateType
23+
import com.google.android.play.core.install.model.UpdateAvailability
1624
import com.yourssu.data.SubjectInfo
1725
import com.yourssu.data.TodoInfo
1826
import com.yourssu.data.TodoType
@@ -32,6 +40,30 @@ class MainActivity : ComponentActivity() {
3240
private val homeEntrySource = mutableStateOf(ENTRY_SOURCE_APP)
3341
private val homeEntryVersion = mutableStateOf(0)
3442

43+
private val appUpdateManager by lazy { AppUpdateManagerFactory.create(this) }
44+
45+
private val appUpdateLauncher =
46+
registerForActivityResult(ActivityResultContracts.StartIntentSenderForResult()) { result: ActivityResult ->
47+
if (result.resultCode != RESULT_OK) {
48+
Log.e(TAG, "Update flow failed! Result code: ${result.resultCode}")
49+
}
50+
}
51+
52+
override fun onResume() {
53+
super.onResume()
54+
55+
appUpdateManager
56+
.appUpdateInfo
57+
.addOnSuccessListener { appUpdateInfo ->
58+
if (
59+
appUpdateInfo.updateAvailability() ==
60+
UpdateAvailability.DEVELOPER_TRIGGERED_UPDATE_IN_PROGRESS
61+
) {
62+
startImmediateUpdate(appUpdateInfo)
63+
}
64+
}
65+
}
66+
3567
override fun onCreate(savedInstanceState: Bundle?) {
3668
installSplashScreen()
3769
super.onCreate(savedInstanceState)
@@ -42,6 +74,9 @@ class MainActivity : ComponentActivity() {
4274
intent.captureEntryAnalytics()
4375
}
4476
enableEdgeToEdge()
77+
78+
checkForImmediateUpdate()
79+
4580
setContent {
4681
val navController = rememberNavController()
4782

@@ -131,6 +166,26 @@ class MainActivity : ComponentActivity() {
131166
}
132167
}
133168

169+
private fun checkForImmediateUpdate() {
170+
appUpdateManager.appUpdateInfo.addOnSuccessListener { appUpdateInfo ->
171+
if (
172+
appUpdateInfo.updateAvailability() == UpdateAvailability.UPDATE_AVAILABLE &&
173+
appUpdateInfo.updatePriority() >= IMMEDIATE_UPDATE_PRIORITY_THRESHOLD &&
174+
appUpdateInfo.isUpdateTypeAllowed(AppUpdateType.IMMEDIATE)
175+
) {
176+
startImmediateUpdate(appUpdateInfo)
177+
}
178+
}
179+
}
180+
181+
private fun startImmediateUpdate(appUpdateInfo: AppUpdateInfo) {
182+
appUpdateManager.startUpdateFlowForResult(
183+
appUpdateInfo,
184+
appUpdateLauncher,
185+
AppUpdateOptions.newBuilder(AppUpdateType.IMMEDIATE).build()
186+
)
187+
}
188+
134189
override fun onNewIntent(intent: Intent) {
135190
super.onNewIntent(intent)
136191
setIntent(intent)
@@ -142,6 +197,9 @@ class MainActivity : ComponentActivity() {
142197
}
143198

144199
companion object {
200+
private const val TAG = "In-App Update"
201+
private const val IMMEDIATE_UPDATE_PRIORITY_THRESHOLD = 4
202+
145203
const val EXTRA_SKIP_INITIAL_LMS_REFRESH = "extra_skip_initial_lms_refresh"
146204
const val EXTRA_ENTRY_SOURCE = "extra_entry_source"
147205
const val EXTRA_WIDGET_SIZE = "extra_widget_size"

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ lifecycleRuntimeKtx = "2.6.1"
1313
activityCompose = "1.8.0"
1414
kotlin = "2.3.20"
1515
composeBom = "2026.02.01"
16-
lms = "1.4.4"
16+
lms = "1.4.5"
1717
navigationCompose = "2.9.8"
1818
jetbrainsKotlinJvm = "2.2.10"
1919
koin-plugin = "1.0.0-RC2"

0 commit comments

Comments
 (0)