New: AppUpdater checks github.com/loop-uh/yourvpndead/releases/latest on app start, compares version tag with BuildConfig.VERSION_CODE, shows Russian update dialog with download progress, installs via FileProvider. - Dynamic versionCode from git commit count (matches CI release tags) - BuildConfig enabled for runtime version access - REQUEST_INSTALL_PACKAGES permission + FileProvider for APK install - Downloads to cache/updates/, cleans old APKs before new download - GitHub CDN redirect handling (instanceFollowRedirects = true) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
70 lines
1.9 KiB
Kotlin
70 lines
1.9 KiB
Kotlin
plugins {
|
|
id("com.android.application")
|
|
id("org.jetbrains.kotlin.android")
|
|
}
|
|
|
|
val gitVersionCode: Int = try {
|
|
val process = ProcessBuilder("git", "rev-list", "--count", "HEAD")
|
|
.directory(project.rootDir)
|
|
.start()
|
|
process.inputStream.bufferedReader().readText().trim().toInt()
|
|
} catch (_: Exception) { 2 }
|
|
|
|
android {
|
|
namespace = "com.yourvpndead"
|
|
compileSdk = 34
|
|
|
|
defaultConfig {
|
|
applicationId = "com.yourvpndead"
|
|
minSdk = 24
|
|
targetSdk = 34
|
|
versionCode = gitVersionCode
|
|
versionName = "0.${gitVersionCode}.0"
|
|
}
|
|
|
|
buildTypes {
|
|
release {
|
|
isMinifyEnabled = false
|
|
signingConfig = signingConfigs.getByName("debug")
|
|
}
|
|
}
|
|
|
|
compileOptions {
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
|
targetCompatibility = JavaVersion.VERSION_17
|
|
}
|
|
|
|
kotlinOptions {
|
|
jvmTarget = "17"
|
|
}
|
|
|
|
buildFeatures {
|
|
compose = true
|
|
buildConfig = true
|
|
}
|
|
|
|
composeOptions {
|
|
kotlinCompilerExtensionVersion = "1.5.8"
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
// Compose BOM
|
|
implementation(platform("androidx.compose:compose-bom:2024.02.00"))
|
|
implementation("androidx.compose.material3:material3")
|
|
implementation("androidx.compose.ui:ui")
|
|
implementation("androidx.compose.ui:ui-tooling-preview")
|
|
implementation("androidx.compose.material:material-icons-extended")
|
|
debugImplementation("androidx.compose.ui:ui-tooling")
|
|
|
|
// Activity + ViewModel
|
|
implementation("androidx.activity:activity-compose:1.8.2")
|
|
implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.7.0")
|
|
implementation("androidx.lifecycle:lifecycle-runtime-compose:2.7.0")
|
|
|
|
// Coroutines
|
|
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.0")
|
|
|
|
// Core
|
|
implementation("androidx.core:core-ktx:1.12.0")
|
|
}
|