TASK-070: update check and download read the team's Gitea
The old download page asked for a password and is no longer used. The app now reads version.json and fetches UBGitea.apk from the apk branch. Agent: main (opus) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
11bb082f0f
commit
a9f08ebbdf
@ -660,14 +660,14 @@ class MainActivity : ComponentActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
// TASK-066: the download page asks for its password itself, so it opens in the browser.
|
||||
// TASK-070: the address is the APK itself, so the browser it opens in downloads it.
|
||||
private fun openDownloadPage() {
|
||||
try {
|
||||
CustomTabsIntent.Builder()
|
||||
.build()
|
||||
.launchUrl(this, Uri.parse(AppUpdateLocations.DOWNLOAD_PAGE))
|
||||
.launchUrl(this, Uri.parse(AppUpdateLocations.DOWNLOAD))
|
||||
} catch (_: ActivityNotFoundException) {
|
||||
Toast.makeText(this, AppUpdateLocations.DOWNLOAD_PAGE, Toast.LENGTH_LONG).show()
|
||||
Toast.makeText(this, AppUpdateLocations.DOWNLOAD, Toast.LENGTH_LONG).show()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -8,13 +8,15 @@ import okhttp3.Request
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
/**
|
||||
* Where new builds of the app are published (TASK-066): a page that hands out the APK behind a
|
||||
* password, and beside it a plain file naming the newest version. The app only ever reads that
|
||||
* file; no Gitea token goes there.
|
||||
* Where new builds of the app are published (TASK-070): the `apk` branch of the app's own
|
||||
* repository on the team's Gitea holds the APK and, beside it, a file naming the newest version.
|
||||
* Both are public and read without signing in; the app's Gitea token is not sent with either.
|
||||
*/
|
||||
object AppUpdateLocations {
|
||||
const val DOWNLOAD_PAGE = "https://choimy0204.github.io/ubgitea/"
|
||||
const val LATEST_VERSION = DOWNLOAD_PAGE + "version.json"
|
||||
private const val RELEASES =
|
||||
"https://gitea.ubisampaju.synology.me/RobotAutomationDevelopment-Dept/Ubisam-MobileGit/raw/branch/apk/"
|
||||
const val DOWNLOAD = RELEASES + "UBGitea.apk"
|
||||
const val LATEST_VERSION = RELEASES + "version.json"
|
||||
}
|
||||
|
||||
/** The newest published build. */
|
||||
@ -26,7 +28,7 @@ data class AppRelease(
|
||||
|
||||
/**
|
||||
* Reads `{"versionCode": 2, "versionName": "0.2.0", "notes": "..."}`. Anything else is null, so
|
||||
* a page that is broken or not there yet never offers an update.
|
||||
* a file that is broken or not there yet never offers an update.
|
||||
*/
|
||||
fun parseAppRelease(json: String): AppRelease? = try {
|
||||
val root = JsonParser.parseString(json).asJsonObject
|
||||
@ -49,7 +51,7 @@ class HttpAppReleaseSource(
|
||||
) : AppReleaseSource {
|
||||
override suspend fun latest(): AppRelease? = withContext(Dispatchers.IO) {
|
||||
try {
|
||||
// no-cache: GitHub Pages is cached for minutes, and a check by hand should see a release at once.
|
||||
// no-cache: a check by hand should see a release at once, whatever sits in between.
|
||||
val request = Request.Builder().url(url).header("Cache-Control", "no-cache").build()
|
||||
client.newCall(request).execute().use { response ->
|
||||
if (!response.isSuccessful) null else parseAppRelease(response.body.string())
|
||||
|
||||
@ -7,9 +7,9 @@
|
||||
<string name="update_up_to_date">최신 버전입니다.</string>
|
||||
<string name="update_failed">새 버전을 확인하지 못했습니다. 네트워크를 확인하세요.</string>
|
||||
<string name="update_available">새 버전 %1$s을(를) 받을 수 있습니다.</string>
|
||||
<string name="update_download">다운로드 페이지 열기</string>
|
||||
<string name="update_download">새 버전 받기</string>
|
||||
<string name="update_dialog_title">새 버전이 있습니다</string>
|
||||
<string name="update_dialog_body">현재 %1$s → 새 버전 %2$s\n다운로드 페이지에서 비밀번호를 입력해 받은 뒤 설치하세요.</string>
|
||||
<string name="update_dialog_body">현재 %1$s → 새 버전 %2$s\n다운로드를 누르면 설치 파일을 받습니다. 받은 파일을 열어 설치하세요.</string>
|
||||
<string name="update_dialog_download">다운로드</string>
|
||||
<string name="update_dialog_later">나중에</string>
|
||||
</resources>
|
||||
|
||||
@ -1516,3 +1516,18 @@ This is the append-only implementation and handoff record shared by Codex and Cl
|
||||
first guesses. During the 90 ms a screen fades out it is drawn from the current view model
|
||||
state, so a screen whose state is cleared on leaving may flash its loading view.
|
||||
- Next owner: the product owner, to look at it on the device.
|
||||
|
||||
## 2026-10-12 — TASK-070: update check and download from the team's Gitea
|
||||
|
||||
- Request: the update notice opened the old password page; the product owner no longer uses that
|
||||
page and asked for Gitea.
|
||||
- What changed: `AppUpdateLocations` names `version.json` and `UBGitea.apk` on the `apk` branch of
|
||||
the team's repository; the wording drops the password and the "download page". `version.json`
|
||||
(0.2.1, versionCode 3) was added to the `apk` branch to match the APK already there.
|
||||
- Checks and results: the five required checks pass; lint 0 errors. Both addresses answer 200
|
||||
without signing in.
|
||||
- Caution: no build with this change is published yet. Copies installed so far still read the
|
||||
old page, so they will not be told about builds published on Gitea; they need one install by
|
||||
hand. `tools/publish-download.py` and the old page are left alone and unused.
|
||||
- Next owner: the product owner, to say when a build with the new icon, motion and this change
|
||||
should be published as 0.2.2.
|
||||
|
||||
65
tasks/070-update-from-gitea.md
Normal file
65
tasks/070-update-from-gitea.md
Normal file
@ -0,0 +1,65 @@
|
||||
# TASK-070: The app's update check and download use the team's Gitea
|
||||
|
||||
Status: implemented; required checks pass; not yet seen on a device
|
||||
Owner: Claude
|
||||
Reviewer: human product owner
|
||||
|
||||
## Request
|
||||
|
||||
The update notice in the app opened the old download page, which asks for a password. The product
|
||||
owner no longer uses that page (2026-10-12) and asked for the app to use the Gitea link instead.
|
||||
|
||||
## Outcome
|
||||
|
||||
- The app reads the newest version from `version.json` on the `apk` branch of
|
||||
`RobotAutomationDevelopment-Dept/Ubisam-MobileGit`, and "download" opens `UBGitea.apk` on that
|
||||
branch. Neither asks for a password or a sign-in.
|
||||
- The wording no longer mentions a password or a download page.
|
||||
|
||||
## Scope
|
||||
|
||||
- Included: the two addresses, the wording, `version.json` on the `apk` branch.
|
||||
- Excluded: `tools/publish-download.py` and the `choimy0204.github.io/ubgitea/` page. Both are left
|
||||
as they are and are no longer part of publishing.
|
||||
|
||||
## Writable paths
|
||||
|
||||
- `app/src/main/java/com/ubisam/ubgitea/core/update/AppUpdate.kt`
|
||||
- `app/src/main/java/com/ubisam/ubgitea/MainActivity.kt`
|
||||
- `app/src/main/res/values/strings_update.xml`
|
||||
- `tasks/070-update-from-gitea.md`
|
||||
- `docs/development-log.md`
|
||||
|
||||
## Acceptance criteria
|
||||
|
||||
- [x] No address of the old page is left in the app.
|
||||
- [x] `version.json` is on the `apk` branch and names the APK that is there.
|
||||
- [ ] Seen on a device: the notice appears for a newer build and "download" fetches the APK.
|
||||
|
||||
## Security and privacy
|
||||
|
||||
The two addresses are public and are fetched with a client that carries no Gitea token. The
|
||||
repository being public was the product owner's choice in TASK-067.
|
||||
|
||||
## Publishing a build from now on
|
||||
|
||||
1. Raise `versionCode` and `versionName` in `app/build.gradle.kts`, then `assembleDebug`.
|
||||
2. On the `apk` branch, replace `UBGitea.apk` and set `version.json` to the same version.
|
||||
3. Push the `apk` branch.
|
||||
|
||||
Copies installed before this task still read the old page's `version.json`, so they are never told
|
||||
about a build published here; they need one install by hand from the Gitea link.
|
||||
|
||||
## Required checks
|
||||
|
||||
```text
|
||||
./gradlew compileDebugKotlin compileDebugUnitTestKotlin testDebugUnitTest assembleDebug lintDebug
|
||||
```
|
||||
|
||||
## Evidence
|
||||
|
||||
See the development log entry for TASK-070.
|
||||
|
||||
## Review findings
|
||||
|
||||
None yet.
|
||||
Loading…
x
Reference in New Issue
Block a user