Some checks failed
Build TV app / build (push) Failing after 2s
Control server security and robustness: - Socket read timeout, handshake deadline and a client cap so an idle or hostile connection can no longer pin threads forever (#1) - Per-address rate limiting that counts every failed hello, Origin checking on the upgrade, and a separate revocable session token for code-authenticated clients so the guessable path no longer yields the QR credential (#2) - Credentials excluded from cloud backup and device transfer, constant time comparisons, and a pairing reset in the settings (#3) - Playlist fetches restricted to http(s), capped at 24 MB and bounded by an overall transfer deadline (#4) - Port conflicts and MediaSession id collisions no longer crash the app; the remote degrades to unavailable with a plain-language note (#11) Player: - Seeking no longer collapses to position 0 when the duration is unknown (#5) - Pause acts on playWhenReady, so pausing during a stall works and playback cannot resume in the background after leaving the app (#6) - Playback failures stay on screen with a retry action instead of silently dropping back to the list (#7) - Reconnects are spaced 1s/3s/8s and re-entering the channel just closed waits out a short grace period, which is what the provider needs to release the previous session (#12) Channel list and remote: - Leaving playback returns to the channel the viewer came from (#13) - The remote only rebuilds its list when the data changed, never overwrites a focused input and carries indices instead of scanning (#8) - Pairing retry reconnects properly, resets its backoff and validates the code before spending an attempt (#9) - M3U parsing keeps commas in names, strips a BOM and rejects payloads that are not playlists, covered by unit tests under tests/ (#10) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
107 lines
3.3 KiB
Kotlin
107 lines
3.3 KiB
Kotlin
plugins {
|
|
id("com.android.application")
|
|
id("org.jetbrains.kotlin.android")
|
|
id("org.jetbrains.kotlin.plugin.compose")
|
|
}
|
|
|
|
android {
|
|
namespace = "dev.castarr.tv"
|
|
compileSdk = 35
|
|
|
|
defaultConfig {
|
|
applicationId = "dev.castarr.tv"
|
|
minSdk = 26
|
|
targetSdk = 35
|
|
versionCode = 23
|
|
versionName = "0.9.0"
|
|
}
|
|
|
|
// Release signing from environment (see ~/.keys/castarr-release.env on the
|
|
// build host); unsigned release build when unset.
|
|
val storeFileEnv = System.getenv("CASTARR_STORE_FILE")
|
|
if (storeFileEnv != null) {
|
|
signingConfigs {
|
|
create("release") {
|
|
storeFile = file(storeFileEnv)
|
|
storePassword = System.getenv("CASTARR_STORE_PASSWORD")
|
|
keyAlias = System.getenv("CASTARR_KEY_ALIAS")
|
|
keyPassword = System.getenv("CASTARR_STORE_PASSWORD")
|
|
}
|
|
}
|
|
}
|
|
|
|
buildTypes {
|
|
release {
|
|
isMinifyEnabled = true
|
|
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
|
|
if (storeFileEnv != null) {
|
|
signingConfig = signingConfigs.getByName("release")
|
|
}
|
|
}
|
|
}
|
|
|
|
compileOptions {
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
|
targetCompatibility = JavaVersion.VERSION_17
|
|
}
|
|
|
|
kotlinOptions {
|
|
jvmTarget = "17"
|
|
allWarningsAsErrors = true
|
|
}
|
|
|
|
|
|
// Global layout rule: everything test-related lives under tests/.
|
|
sourceSets {
|
|
getByName("test") {
|
|
java.setSrcDirs(listOf("../tests/unit"))
|
|
}
|
|
}
|
|
|
|
testOptions {
|
|
unitTests.all {
|
|
it.reports.junitXml.outputLocation.set(file("../tests/runs/junit"))
|
|
it.reports.html.outputLocation.set(file("../tests/runs/junit-html"))
|
|
}
|
|
}
|
|
|
|
buildFeatures {
|
|
compose = true
|
|
buildConfig = true
|
|
}
|
|
|
|
lint {
|
|
// Media3's UI classes are @UnstableApi; the opt-in lint check would
|
|
// otherwise fail release builds.
|
|
disable += "UnsafeOptInUsageError"
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation("androidx.core:core-ktx:1.15.0")
|
|
implementation(platform("androidx.compose:compose-bom:2024.10.01"))
|
|
implementation("androidx.activity:activity-compose:1.9.3")
|
|
implementation("androidx.compose.ui:ui")
|
|
implementation("androidx.compose.foundation:foundation")
|
|
implementation("androidx.tv:tv-material:1.0.0")
|
|
implementation("androidx.compose.material3:material3")
|
|
implementation("androidx.lifecycle:lifecycle-runtime-compose:2.8.7")
|
|
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.7")
|
|
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.9.0")
|
|
implementation("androidx.media3:media3-exoplayer:1.4.1")
|
|
implementation("androidx.media3:media3-exoplayer-hls:1.4.1")
|
|
implementation("androidx.media3:media3-ui:1.4.1")
|
|
implementation("androidx.media3:media3-session:1.4.1")
|
|
implementation("org.nanohttpd:nanohttpd:2.3.1")
|
|
implementation("org.nanohttpd:nanohttpd-websocket:2.3.1")
|
|
implementation("com.google.zxing:core:3.5.3")
|
|
implementation("io.coil-kt:coil-compose:2.7.0")
|
|
testImplementation("junit:junit:4.13.2")
|
|
}
|
|
|
|
// Full JDK for javac via toolchain (host may only have a JRE); resolved by
|
|
// the foojay convention plugin in settings.
|
|
kotlin {
|
|
jvmToolchain(17)
|
|
}
|