1- import java.util.Properties
1+ import org.jetbrains.kotlin.gradle.dsl.JvmTarget
22import java.io.FileInputStream
3- import com.android.build.gradle.internal.api.BaseVariantOutputImpl
3+ import java.util.Properties
4+
45
56plugins {
67 id(" com.android.application" )
7- id(" org.jetbrains.kotlin.android" )
8+ id(" org.jetbrains.kotlin.plugin.compose" )
9+ }
10+
11+ kotlin {
12+ compilerOptions {
13+ jvmTarget.set(JvmTarget .JVM_17 )
14+ }
815}
916
1017android {
1118 namespace = " com.apkupdater"
12- compileSdk = 34
19+ compileSdk = 36
1320
1421 val buildNumber = System .getenv(" BUILD_NUMBER" ).orEmpty()
1522 defaultConfig {
1623 applicationId = " com.apkupdater" + System .getenv(" BUILD_TAG" ).orEmpty()
17- minSdk = 21
18- targetSdk = 34
19- versionCode = 52
24+ minSdk = 23
25+ targetSdk = 36
26+ versionCode = if (buildNumber.isEmpty()) 52 else buildNumber.toInt()
2027 versionName = if (buildNumber.isEmpty()) " 3.0.3" else " 0.0.$buildNumber "
2128 testInstrumentationRunner = " androidx.test.runner.AndroidJUnitRunner"
2229 vectorDrawables.useSupportLibrary = true
@@ -31,7 +38,7 @@ android {
3138 storePassword = props.getProperty(" keystore.password" )
3239 keyAlias = props.getProperty(" keystore.keyalias" )
3340 keyPassword = props.getProperty(" keystore.keypassword" )
34- } catch (ignored : Exception ) {
41+ } catch (_ : Exception ) {
3542 val config = signingConfigs.getByName(" debug" )
3643 storeFile = config.storeFile
3744 storePassword = config.storePassword
@@ -51,24 +58,16 @@ android {
5158 }
5259 }
5360
54- applicationVariants.configureEach {
55- outputs.configureEach {
56- val variant = (this as BaseVariantOutputImpl )
57- variant.outputFileName = defaultConfig.applicationId + " -" + buildType.name + " .apk"
58- }
59- }
60-
6161 compileOptions {
62- sourceCompatibility = JavaVersion .VERSION_1_8
63- targetCompatibility = JavaVersion .VERSION_1_8
62+ sourceCompatibility = JavaVersion .VERSION_17
63+ targetCompatibility = JavaVersion .VERSION_17
6464 }
6565
66- kotlinOptions { jvmTarget = " 1.8 " }
66+
6767 buildFeatures {
6868 compose = true
6969 buildConfig = true
7070 }
71- composeOptions { kotlinCompilerExtensionVersion = " 1.5.1" }
7271
7372 packaging {
7473 resources {
@@ -83,37 +82,58 @@ android {
8382
8483dependencies {
8584
86- implementation(" androidx.activity:activity-compose:1.8.2" )
87- implementation(" androidx.compose.material3:material3:1.2.1" )
88- implementation(" androidx.compose.ui:ui:1.6.4" )
89- implementation(" androidx.core:core-ktx:1.12.0" )
90- implementation(" androidx.lifecycle:lifecycle-runtime-compose:2.7.0" )
91- implementation(" androidx.lifecycle:lifecycle-runtime-ktx:2.7.0" )
92- implementation(" androidx.navigation:navigation-compose:2.7.7" )
93- implementation(" androidx.navigation:navigation-runtime-ktx:2.7.7" )
94- implementation(" androidx.tv:tv-foundation:1.0.0-alpha10" )
95- implementation(" androidx.work:work-runtime-ktx:2.9.0" )
85+ val composeBom = platform(" androidx.compose:compose-bom:2026.02.01" )
86+ implementation(composeBom)
87+ implementation(" androidx.activity:activity-compose:1.12.4" )
88+ implementation(" androidx.compose.material3:material3" )
89+ implementation(" androidx.compose.material:material-icons-core" )
90+ implementation(" androidx.compose.ui:ui" )
91+ implementation(" androidx.core:core-ktx:1.17.0" )
92+ implementation(" androidx.lifecycle:lifecycle-runtime-compose:2.10.0" )
93+ implementation(" androidx.lifecycle:lifecycle-runtime-ktx:2.10.0" )
94+ implementation(" androidx.navigation:navigation-compose:2.9.7" )
95+ implementation(" androidx.navigation:navigation-runtime-ktx:2.9.7" )
96+ implementation(" androidx.tv:tv-foundation:1.0.0-alpha12" )
97+ implementation(" androidx.work:work-runtime-ktx:2.11.1" )
9698 implementation(" com.github.rumboalla.KryptoPrefs:kryptoprefs-gson:0.4.3" )
9799 implementation(" com.github.rumboalla.KryptoPrefs:kryptoprefs:0.4.3" )
98- implementation(" com.github.topjohnwu.libsu:core:5.2.1" )
99- implementation(" com.aurora:gplayapi:3.2.11" )
100- implementation(" com.google.code.gson:gson:2.10.1" )
101- implementation(" com.squareup.okhttp3:logging-interceptor:4.12.0" )
102- implementation(" com.squareup.retrofit2:converter-gson:2.11.0" )
103- implementation(" com.squareup.retrofit2:retrofit:2.11.0" )
104- implementation(" io.coil-kt:coil-compose:2.6.0" )
100+ implementation(" com.github.topjohnwu.libsu:core:6.0.0" )
101+ implementation(" com.auroraoss:gplayapi:3.5.8" )
102+ implementation(" com.google.code.gson:gson:2.13.2" )
103+ implementation(" com.squareup.okhttp3:logging-interceptor:5.3.2" )
104+ implementation(" com.squareup.retrofit2:converter-gson:3.0.0" )
105+ implementation(" com.squareup.retrofit2:retrofit:3.0.0" )
106+ implementation(" io.coil-kt.coil3:coil-compose:3.4.0" )
107+ implementation(" io.coil-kt.coil3:coil-network-okhttp:3.4.0" )
105108 implementation(" io.github.g00fy2:versioncompare:1.5.0" )
106- implementation(" io.insert-koin:koin-android:3.5.3 " )
107- implementation(" io.insert-koin:koin-androidx-compose:3.5.3 " )
108- implementation(" org.jsoup:jsoup:1.16 .1" )
109+ implementation(" io.insert-koin:koin-android:4.1.1 " )
110+ implementation(" io.insert-koin:koin-androidx-compose:4.1.1 " )
111+ implementation(" org.jsoup:jsoup:1.22 .1" )
109112
110113 testImplementation(" junit:junit:4.13.2" )
111114
112- androidTestImplementation(" androidx.compose.ui:ui-test-junit4:1.6.4" )
113- androidTestImplementation(" androidx.test.espresso:espresso-core:3.5.1" )
114- androidTestImplementation(" androidx.test.ext:junit:1.1.5" )
115+ androidTestImplementation(composeBom)
116+ androidTestImplementation(" androidx.compose.ui:ui-test-junit4" )
117+ androidTestImplementation(" androidx.test.espresso:espresso-core:3.7.0" )
118+ androidTestImplementation(" androidx.test.ext:junit:1.3.0" )
115119
116- debugImplementation(" androidx.compose.ui:ui-test-manifest:1.6.4" )
117- debugImplementation(" androidx.compose.ui:ui-tooling:1.6.4" )
120+ debugImplementation(" androidx.compose.ui:ui-test-manifest" )
121+ debugImplementation(" androidx.compose.ui:ui-tooling" )
122+
123+ }
118124
125+ androidComponents {
126+ onVariants { variant ->
127+ variant.outputs.forEach { _ ->
128+ tasks.configureEach {
129+ if (name == " package${variant.name.replaceFirstChar { it.uppercase() }} " ) {
130+ doLast {
131+ outputs.files.files
132+ .flatMap { it.walkTopDown().filter { f -> f.extension == " apk" }.toList() }
133+ .forEach { apk -> runCatching { apk.copyTo(File (apk.parentFile, " ${android.defaultConfig.applicationId} -${variant.buildType} .apk" ), true ) }.getOrNull() }
134+ }
135+ }
136+ }
137+ }
138+ }
119139}
0 commit comments