Files
poli0981andClaude Opus 4.8 188b403696 feat(android): minSdk → Android 11 (API 30) + hide Steam Desktop on mobile, v1.4.4 (#106)
- minSdk 24 -> 30: OS-level install gate (INSTALL_FAILED_OLDER_SDK) drops EOL
  Android 7-10 (no Google OS patches, stale WebView vs the React 19 bundle);
  minSdk 30 still reaches ~87% of active devices.
- Hide the steam:// "Steam Desktop" button on the Android app / sub-768px
  viewport via a new reactive useIsMobile hook; the Web button stays.
- Docs: new docs/android-support.md (+vi mirror) with requirement, rationale,
  tested devices (emulator 11-16, real vivo 1907 on Android 12) and a sourced
  version-share/EOL table; update TAURI.md, pc_spec.md (+vi), the
  release-android.yml notes, and the README badge/links.
- Bump 1.4.3 -> 1.4.4 (repo 3.4.1 -> 3.4.2) + Cargo.lock/package-lock sync.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-15 20:08:42 +07:00

106 lines
4.1 KiB
Kotlin

import java.util.Properties
plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
id("rust")
}
val tauriProperties = Properties().apply {
val propFile = file("tauri.properties")
if (propFile.exists()) {
propFile.inputStream().use { load(it) }
}
}
// Release signing. keystore.properties (and the .jks it points to) live at the
// gen/android root and are gitignored; they're present locally or generated in
// CI from secrets. On a plain checkout the file is absent, so `release` stays
// unsigned and unsigned/debug builds still work.
val keystorePropertiesFile = rootProject.file("keystore.properties")
val keystoreProperties = Properties().apply {
if (keystorePropertiesFile.exists()) {
keystorePropertiesFile.inputStream().use { load(it) }
}
}
android {
compileSdk = 36
namespace = "io.github.poli0981.f2p_tracker"
defaultConfig {
manifestPlaceholders["usesCleartextTraffic"] = "false"
applicationId = "io.github.poli0981.f2p_tracker"
// Android 11 (API 30). PackageManager refuses to install the APK below
// this (INSTALL_FAILED_OLDER_SDK), so it doubles as the OS-level version
// gate. Why 11 and not lower: Android 7-10 are deeply end-of-life (no
// Google OS security backports) and tend to ship an outdated System
// WebView that breaks the app's modern ES/React 19 bundle. See
// docs/android-support.md for the rationale + version stats.
minSdk = 30
targetSdk = 36
versionCode = tauriProperties.getProperty("tauri.android.versionCode", "1").toInt()
versionName = tauriProperties.getProperty("tauri.android.versionName", "1.0")
}
signingConfigs {
create("release") {
// Populated only when keystore.properties exists (see top of file),
// so a keyless checkout still configures cleanly.
if (keystorePropertiesFile.exists()) {
keyAlias = keystoreProperties["keyAlias"] as String
keyPassword = keystoreProperties["keyPassword"] as String
storeFile = file(keystoreProperties["storeFile"] as String)
storePassword = keystoreProperties["storePassword"] as String
}
}
}
buildTypes {
getByName("debug") {
manifestPlaceholders["usesCleartextTraffic"] = "true"
isDebuggable = true
isJniDebuggable = true
isMinifyEnabled = false
packaging { jniLibs.keepDebugSymbols.add("*/arm64-v8a/*.so")
jniLibs.keepDebugSymbols.add("*/armeabi-v7a/*.so")
jniLibs.keepDebugSymbols.add("*/x86/*.so")
jniLibs.keepDebugSymbols.add("*/x86_64/*.so")
}
}
getByName("release") {
isMinifyEnabled = true
proguardFiles(
*fileTree(".") { include("**/*.pro") }
.plus(getDefaultProguardFile("proguard-android-optimize.txt"))
.toList().toTypedArray()
)
// Sign with the release key when keystore.properties is present;
// otherwise the release build stays unsigned (won't install, but
// still compiles for CI dry-runs / size checks).
if (keystorePropertiesFile.exists()) {
signingConfig = signingConfigs.getByName("release")
}
}
}
kotlinOptions {
jvmTarget = "1.8"
}
buildFeatures {
buildConfig = true
}
}
rust {
rootDirRel = "../../../"
}
dependencies {
implementation("androidx.webkit:webkit:1.14.0")
implementation("androidx.appcompat:appcompat:1.7.1")
implementation("androidx.activity:activity-ktx:1.10.1")
implementation("com.google.android.material:material:1.12.0")
implementation("androidx.lifecycle:lifecycle-process:2.10.0")
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.4")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.0")
}
apply(from = "tauri.build.gradle.kts")