Skip to content

Commit 015f137

Browse files
committed
Upgrade AGP, dependencies, target API level 35
1 parent 98d0463 commit 015f137

File tree

10 files changed

+53
-47
lines changed

10 files changed

+53
-47
lines changed

.idea/compiler.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/deploymentTargetDropDown.xml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/gradle.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/build.gradle

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ plugins {
77

88
android {
99
namespace 'com.phpbg.easysync'
10-
compileSdk 34
10+
compileSdk 35
1111

1212
defaultConfig {
1313
applicationId "com.phpbg.easysync"
1414
minSdk 26
1515
resourceConfigurations += ["en", "fr", "de", "ru"]
16-
targetSdk 34
16+
targetSdk 35
1717
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1818
vectorDrawables {
1919
useSupportLibrary true
@@ -46,11 +46,11 @@ android {
4646
}
4747
}
4848
compileOptions {
49-
sourceCompatibility JavaVersion.VERSION_1_8
50-
targetCompatibility JavaVersion.VERSION_1_8
49+
sourceCompatibility JavaVersion.VERSION_17
50+
targetCompatibility JavaVersion.VERSION_17
5151
}
5252
kotlinOptions {
53-
jvmTarget = '1.8'
53+
jvmTarget = '17'
5454
}
5555
buildFeatures {
5656
compose true
@@ -67,35 +67,34 @@ android {
6767
}
6868

6969
dependencies {
70-
implementation 'androidx.work:work-runtime-ktx:2.9.0'
70+
implementation 'androidx.work:work-runtime-ktx:2.10.0'
7171
implementation 'androidx.room:room-runtime:2.6.1'
7272
annotationProcessor 'androidx.room:room-compiler:2.6.1'
7373
ksp 'androidx.room:room-compiler:2.6.1'
7474
implementation 'androidx.room:room-ktx:2.6.1'
75-
implementation 'androidx.core:core-ktx:1.12.0'
76-
implementation platform('org.jetbrains.kotlin:kotlin-bom:1.8.0')
77-
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.7.0'
78-
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.7.0'
79-
implementation 'androidx.activity:activity-compose:1.8.2'
80-
implementation 'androidx.activity:activity-ktx:1.8.2'
81-
implementation 'androidx.fragment:fragment-ktx:1.6.2'
82-
implementation platform('androidx.compose:compose-bom:2022.10.00')
83-
implementation 'androidx.compose.ui:ui:1.5.4'
84-
// CircularProgressIndicator is broken on 1.6.0 https://github.com/JetBrains/compose-multiplatform/issues/4157
85-
implementation 'androidx.compose.ui:ui-graphics:1.5.4'
86-
implementation 'androidx.compose.ui:ui-tooling-preview:1.5.4'
87-
implementation 'androidx.compose.material3:material3:1.1.2'
88-
implementation 'androidx.compose.material:material-icons-extended:1.5.4'
89-
implementation 'androidx.compose.runtime:runtime-livedata:1.5.4'
90-
implementation 'androidx.datastore:datastore-preferences:1.0.0'
91-
implementation 'com.squareup.okhttp3:okhttp:4.11.0'
92-
implementation 'com.squareup.okhttp3:logging-interceptor:4.11.0'
93-
implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2'
75+
implementation 'androidx.core:core-ktx:1.15.0'
76+
implementation platform('org.jetbrains.kotlin:kotlin-bom:2.0.0')
77+
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.8.7'
78+
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.8.7'
79+
implementation 'androidx.activity:activity-compose:1.9.3'
80+
implementation 'androidx.activity:activity-ktx:1.9.3'
81+
implementation 'androidx.fragment:fragment-ktx:1.8.5'
82+
implementation platform('androidx.compose:compose-bom:2024.10.01')
83+
implementation 'androidx.compose.ui:ui:1.7.5'
84+
implementation 'androidx.compose.ui:ui-graphics:1.7.5'
85+
implementation 'androidx.compose.ui:ui-tooling-preview:1.7.5'
86+
implementation 'androidx.compose.material3:material3:1.3.1'
87+
implementation 'androidx.compose.material:material-icons-extended:1.7.5'
88+
implementation 'androidx.compose.runtime:runtime-livedata:1.7.5'
89+
implementation 'androidx.datastore:datastore-preferences:1.1.1'
90+
implementation 'com.squareup.okhttp3:okhttp:4.12.0'
91+
implementation 'com.squareup.okhttp3:logging-interceptor:4.12.0'
92+
implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.3'
9493
testImplementation 'junit:junit:4.13.2'
9594
testImplementation 'net.sf.kxml:kxml2:2.3.0'
96-
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
97-
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
98-
androidTestImplementation platform('androidx.compose:compose-bom:2022.10.00')
95+
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
96+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
97+
androidTestImplementation platform('androidx.compose:compose-bom:2024.10.01')
9998
androidTestImplementation 'androidx.compose.ui:ui-test-junit4'
10099
debugImplementation 'androidx.compose.ui:ui-tooling'
101100
debugImplementation 'androidx.compose.ui:ui-test-manifest'

app/src/main/java/com/phpbg/easysync/Permissions.kt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ import androidx.core.content.PackageManagerCompat
3535
import androidx.core.content.UnusedAppRestrictionsConstants.API_30
3636
import androidx.core.content.UnusedAppRestrictionsConstants.API_30_BACKPORT
3737
import androidx.core.content.UnusedAppRestrictionsConstants.API_31
38-
import androidx.work.await
38+
import kotlinx.coroutines.Dispatchers
39+
import kotlinx.coroutines.withContext
3940

4041

4142
object Permissions {
@@ -69,7 +70,9 @@ object Permissions {
6970
suspend fun needHibernationExclusion(context: Context): Boolean {
7071
// https://developer.android.com/topic/performance/app-hibernation
7172
// https://source.android.com/docs/core/perf/hiber?hl=en
72-
return when (PackageManagerCompat.getUnusedAppRestrictionsStatus(context).await()) {
73+
return when (withContext(Dispatchers.IO) {
74+
PackageManagerCompat.getUnusedAppRestrictionsStatus(context).get()
75+
}) {
7376
API_30_BACKPORT, API_30, API_31 -> true
7477
else -> false
7578
}
@@ -94,7 +97,9 @@ object Permissions {
9497
}
9598

9699
suspend fun areOthersGranted(context: Context): Boolean {
97-
return ! needNotificationPermission(context) && ! needHibernationExclusion(context) && ! needIgnoringBatteryOptimizations(context)
100+
return !needNotificationPermission(context) && !needHibernationExclusion(context) && !needIgnoringBatteryOptimizations(
101+
context
102+
)
98103
}
99104

100105
fun getMissingOldStoragePermissions(context: Context): List<String> {

app/src/main/java/com/phpbg/easysync/mediastore/MediaStoreService.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ import android.os.Environment
3434
import android.os.storage.StorageManager
3535
import android.provider.MediaStore
3636
import android.util.Log
37-
import androidx.activity.ComponentActivity
3837
import kotlinx.coroutines.Dispatchers
3938
import kotlinx.coroutines.withContext
4039
import java.time.Instant
@@ -69,7 +68,7 @@ class MediaStoreService(private val context: Context) {
6968
return URIS
7069
.flatMap { getByUri(it) }
7170
.filter { !pathExclusions.contains(it.relativePath) }
72-
.map { it.id }
71+
.map { it.id }
7372
.toSet()
7473
}
7574

@@ -86,7 +85,7 @@ class MediaStoreService(private val context: Context) {
8685
suspend fun getAllPaths(): Set<String> {
8786
return URIS
8887
.flatMap { getByUri(it) }
89-
.map { it.relativePath }
88+
.map { it.relativePath }
9089
.toSet()
9190
}
9291

@@ -169,7 +168,7 @@ class MediaStoreService(private val context: Context) {
169168

170169
private fun getVolumesPath(): Set<String> {
171170
val storageManager =
172-
context.getSystemService(ComponentActivity.STORAGE_SERVICE) as StorageManager
171+
context.getSystemService(Context.STORAGE_SERVICE) as StorageManager
173172
val volumes = storageManager.javaClass
174173
.getMethod("getVolumePaths", *arrayOfNulls(0))
175174
.invoke(storageManager, *arrayOfNulls(0)) as Array<String>

app/src/main/java/com/phpbg/easysync/worker/FullSyncWorker.kt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,10 @@ class FullSyncWorker(context: Context, parameters: WorkerParameters) :
122122
.build()
123123

124124
val workRequest =
125-
PeriodicWorkRequestBuilder<FullSyncWorker>(settings.syncIntervalMinutes, TimeUnit.MINUTES)
125+
PeriodicWorkRequestBuilder<FullSyncWorker>(
126+
settings.syncIntervalMinutes,
127+
TimeUnit.MINUTES
128+
)
126129
.setInputData(data)
127130
.build()
128131

@@ -133,11 +136,11 @@ class FullSyncWorker(context: Context, parameters: WorkerParameters) :
133136
)
134137
}
135138

136-
fun getLiveData(context: Context): LiveData<MutableList<WorkInfo>> {
139+
fun getLiveData(context: Context): LiveData<List<WorkInfo>> {
137140
return WorkManager.getInstance(context).getWorkInfosForUniqueWorkLiveData(TAG)
138141
}
139142

140-
fun getAllLiveData(context: Context): LiveData<MutableList<WorkInfo>> {
143+
fun getAllLiveData(context: Context): LiveData<List<WorkInfo>> {
141144
return WorkManager.getInstance(context).getWorkInfosByTagLiveData(WorkersConstants.TAG)
142145
}
143146
}

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ buildscript {
55
}
66
}
77
plugins {
8-
id 'com.android.application' version '8.2.2' apply false
9-
id 'com.android.library' version '8.2.2' apply false
8+
id 'com.android.application' version '8.7.2' apply false
9+
id 'com.android.library' version '8.7.2' apply false
1010
id 'org.jetbrains.kotlin.android' version '1.9.10' apply false
1111
id 'com.google.devtools.ksp' version '1.9.10-1.0.13' apply false
1212
}
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
#Mon May 29 21:37:06 CEST 2023
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
55
zipStoreBase=GRADLE_USER_HOME
66
zipStorePath=wrapper/dists
7-
87
# https://docs.gradle.org/current/userguide/gradle_wrapper.html#sec:verification
9-
distributionSha256Sum=38f66cd6eef217b4c35855bb11ea4e9fbc53594ccccb5fb82dfd317ef8c2c5a3
8+
distributionSha256Sum=d725d707bfabd4dfdc958c624003b3c80accc03f7037b5122c4b1d0ef15cecab

0 commit comments

Comments
 (0)