63 lines
1.9 KiB
Kotlin
63 lines
1.9 KiB
Kotlin
import java.util.Properties
|
|
|
|
plugins {
|
|
id("com.android.application")
|
|
id("org.jetbrains.kotlin.android")
|
|
}
|
|
|
|
// release 签名:从仓库根的 keystore.properties 读取(该文件已 .gitignore,缺失时不影响 debug 构建)
|
|
val ksProps = Properties().apply {
|
|
val f = rootProject.file("keystore.properties")
|
|
if (f.exists()) f.inputStream().use { load(it) }
|
|
}
|
|
|
|
android {
|
|
namespace = "com.iptv807.tv"
|
|
compileSdk = 35
|
|
|
|
defaultConfig {
|
|
applicationId = "com.iptv807.tv"
|
|
minSdk = 21
|
|
targetSdk = 35
|
|
versionCode = 961
|
|
versionName = "9.6.1"
|
|
}
|
|
|
|
signingConfigs {
|
|
if (ksProps.isNotEmpty()) {
|
|
create("release") {
|
|
storeFile = rootProject.file(ksProps.getProperty("storeFile", ""))
|
|
storePassword = ksProps.getProperty("storePassword")
|
|
keyAlias = ksProps.getProperty("keyAlias")
|
|
keyPassword = ksProps.getProperty("keyPassword")
|
|
}
|
|
}
|
|
}
|
|
|
|
buildTypes {
|
|
release {
|
|
isMinifyEnabled = false
|
|
signingConfig = signingConfigs.findByName("release")
|
|
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
|
|
}
|
|
}
|
|
compileOptions {
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
|
targetCompatibility = JavaVersion.VERSION_17
|
|
}
|
|
kotlinOptions {
|
|
jvmTarget = "17"
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation("androidx.core:core-ktx:1.12.0")
|
|
implementation("androidx.appcompat:appcompat:1.6.1")
|
|
implementation("androidx.webkit:webkit:1.9.0")
|
|
// ExoPlayer (Media3) 播放 FLV/HLS 直播流
|
|
implementation("androidx.media3:media3-exoplayer:1.3.1")
|
|
implementation("androidx.media3:media3-exoplayer-hls:1.3.1")
|
|
implementation("androidx.media3:media3-ui:1.3.1")
|
|
implementation("androidx.media3:media3-datasource:1.3.1")
|
|
}
|