Move update source to Gitea (git.beckm4nn.net)
Some checks failed
Build TV app / build (push) Failing after 3s

Releases API for the version check; the APK itself is served from the
orphan 'apk' branch of the public repo (asset uploads need a token,
raw files do not). Transitional GitHub release carries this change so
existing installs hop over.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-26 01:16:38 +02:00
parent 6ee7f53e3f
commit 17ff402de0
4 changed files with 18 additions and 13 deletions

View File

@@ -38,7 +38,7 @@ resolved automatically (foojay) if the host only has a JRE.
``` ```
APK output: `app/build/outputs/apk/<variant>/`. Releases on the APK output: `app/build/outputs/apk/<variant>/`. Releases on the
[releases page](https://github.com/be-nj/castarr/releases) are signed; install [releases page](https://git.beckm4nn.net/benjamin/castarr/releases) are signed; install
over an existing debug build requires uninstalling first (signature change). over an existing debug build requires uninstalling first (signature change).
## Backend ## Backend

View File

@@ -12,8 +12,8 @@ android {
applicationId = "dev.castarr.tv" applicationId = "dev.castarr.tv"
minSdk = 26 minSdk = 26
targetSdk = 35 targetSdk = 35
versionCode = 18 versionCode = 19
versionName = "0.8.2" versionName = "0.8.3"
} }
// Release signing from environment (see ~/.keys/castarr-release.env on the // Release signing from environment (see ~/.keys/castarr-release.env on the

View File

@@ -126,14 +126,12 @@ class DispatcharrRepository(context: Context, private val auth: DeviceAuth) {
name = obj.optString("effective_name").ifEmpty { obj.optString("name") }, name = obj.optString("effective_name").ifEmpty { obj.optString("name") },
url = streamUrl(uuid), url = streamUrl(uuid),
group = groups[obj.optInt("channel_group_id")].orEmpty(), group = groups[obj.optInt("channel_group_id")].orEmpty(),
// logo-cache endpoint is AllowAny — loads without auth. // The list serializer only carries logo ids; the
logo = obj.optJSONObject("logo")?.optString("cache_url").orEmpty().let { // cache endpoint serves the image without auth.
when { logo = (obj.optInt("effective_logo_id").takeIf { it > 0 }
it.isEmpty() || it == "null" -> "" ?: obj.optInt("logo_id").takeIf { it > 0 })
it.startsWith("http") -> it ?.let { "${auth.serverUrl.trimEnd('/')}/api/channels/logos/$it/cache/" }
else -> auth.serverUrl.trimEnd('/') + it .orEmpty(),
}
},
tvgId = obj.optString("effective_tvg_id").ifEmpty { obj.optString("tvg_id") }, tvgId = obj.optString("effective_tvg_id").ifEmpty { obj.optString("tvg_id") },
backendId = id, backendId = id,
streamKey = uuid, streamKey = uuid,

View File

@@ -13,11 +13,17 @@ import java.io.File
import java.net.HttpURLConnection import java.net.HttpURLConnection
import java.net.URL import java.net.URL
/** In-app updater over GitHub releases (#12). Explicit, never automatic. */ /** In-app updater over Gitea releases (#12). Explicit, never automatic. */
object UpdateChecker { object UpdateChecker {
private const val TAG = "UpdateChecker" private const val TAG = "UpdateChecker"
private const val LATEST = "https://api.github.com/repos/be-nj/castarr/releases/latest" private const val LATEST =
"https://git.beckm4nn.net/api/v1/repos/benjamin/castarr/releases/latest"
// Release assets need an API token to upload, so the APK is served from
// an orphan branch instead — anonymously fetchable on a public repo.
private const val APK_FALLBACK =
"https://git.beckm4nn.net/benjamin/castarr/raw/branch/apk/castarr.apk"
private var apkUrl: String = "" private var apkUrl: String = ""
@@ -35,6 +41,7 @@ object UpdateChecker {
break break
} }
} }
if (url.isEmpty() && tag.isNotEmpty()) url = APK_FALLBACK
if (url.isNotEmpty() && isNewer(tag, BuildConfig.VERSION_NAME)) { if (url.isNotEmpty() && isNewer(tag, BuildConfig.VERSION_NAME)) {
apkUrl = url apkUrl = url
val version = "v$tag" val version = "v$tag"