From 6b09de4c59280f9d56d811823a4ab0defca89b47 Mon Sep 17 00:00:00 2001 From: Jonas Lochmann Date: Mon, 14 Oct 2024 02:00:00 +0200 Subject: [PATCH 1/4] Update buildtools --- app/build.gradle | 4 ++-- build.gradle | 4 ++-- gradle/wrapper/gradle-wrapper.properties | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 566f68b..5994748 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -146,8 +146,8 @@ android { } compileOptions { - sourceCompatibility JavaVersion.VERSION_17 - targetCompatibility JavaVersion.VERSION_17 + sourceCompatibility JavaVersion.VERSION_21 + targetCompatibility JavaVersion.VERSION_21 } kotlinOptions { diff --git a/build.gradle b/build.gradle index 703c8bc..00a3688 100644 --- a/build.gradle +++ b/build.gradle @@ -15,8 +15,8 @@ */ plugins { - id 'com.android.application' version '8.5.1' apply false - id 'com.android.library' version '8.5.1' apply false + id 'com.android.application' version '8.7.1' apply false + id 'com.android.library' version '8.7.1' apply false id 'org.jetbrains.kotlin.android' version "1.9.21" apply false id 'com.google.devtools.ksp' version '1.9.21-1.0.16' apply false id 'androidx.navigation.safeargs' version '2.6.0' apply false diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 9118fc8..bfe49c6 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -2,5 +2,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip -distributionSha256Sum=194717442575a6f96e1c1befa2c30e9a4fc90f701d7aee33eb879b79e7ff05c0 \ No newline at end of file +distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-all.zip +distributionSha256Sum=258e722ec21e955201e31447b0aed14201765a3bfbae296a46cf60b70e66db70 \ No newline at end of file From 6a4b4505bb61a03ee5dbe1abd2ae5e4c54d324ab Mon Sep 17 00:00:00 2001 From: Jonas Lochmann Date: Mon, 14 Oct 2024 02:00:00 +0200 Subject: [PATCH 2/4] Update dependencies --- app/build.gradle | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 5994748..27898e2 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -167,8 +167,8 @@ wire { dependencies { def nav_version = "2.5.3" def room_version = "2.6.1" - def work_version = '2.9.0' - def paging_version = "3.3.1" + def work_version = '2.9.1' + def paging_version = "3.3.2" implementation fileTree(dir: 'libs', include: ['*.jar']) implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.21" @@ -177,12 +177,12 @@ dependencies { implementation 'androidx.cardview:cardview:1.0.0' implementation 'androidx.gridlayout:gridlayout:1.0.0' implementation "com.google.android.material:material:1.12.0" - implementation 'androidx.compose.material:material:1.6.8' - implementation 'androidx.activity:activity-compose:1.9.1' + implementation 'androidx.compose.material:material:1.7.4' + implementation 'androidx.activity:activity-compose:1.9.3' implementation "com.google.accompanist:accompanist-flowlayout:0.30.0" - implementation 'androidx.compose.material:material-icons-extended:1.6.8' - debugImplementation "androidx.compose.ui:ui-tooling:1.6.8" - implementation 'androidx.fragment:fragment-ktx:1.8.2' + implementation 'androidx.compose.material:material-icons-extended:1.7.4' + debugImplementation "androidx.compose.ui:ui-tooling:1.7.4" + implementation 'androidx.fragment:fragment-ktx:1.8.4' implementation "androidx.navigation:navigation-fragment-ktx:$nav_version" implementation "androidx.navigation:navigation-ui:$nav_version" @@ -203,7 +203,7 @@ dependencies { implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3' testImplementation 'junit:junit:4.13.2' - androidTestImplementation 'androidx.test:runner:1.6.1' + androidTestImplementation 'androidx.test:runner:1.6.2' androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1' implementation 'org.mindrot:jbcrypt:0.4' @@ -216,7 +216,7 @@ dependencies { implementation 'com.squareup.okhttp3:okhttp-tls:4.9.3' implementation 'com.squareup.okhttp3:logging-interceptor:4.9.3' - googleApiImplementation "com.android.billingclient:billing-ktx:7.0.0" + googleApiImplementation "com.android.billingclient:billing-ktx:7.1.1" implementation('io.socket:socket.io-client:2.0.0') { exclude group: 'org.json', module: 'json' From 6e9641638fe865a3f1fdb8a7adf684ce156eefd5 Mon Sep 17 00:00:00 2001 From: Jonas Lochmann Date: Mon, 14 Oct 2024 02:00:00 +0200 Subject: [PATCH 3/4] Update target sdk --- app/build.gradle | 4 ++-- .../android/foregroundapp/LollipopForegroundAppHelper.kt | 4 ++-- .../java/io/timelimit/android/update/UpdateIntegration.kt | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 27898e2..786d148 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -25,11 +25,11 @@ plugins { android { namespace 'io.timelimit.android' - compileSdkVersion 34 + compileSdk 35 defaultConfig { applicationId "io.timelimit.android" minSdkVersion 26 - targetSdkVersion 34 + targetSdkVersion 35 versionCode 218 versionName "7.1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" diff --git a/app/src/main/java/io/timelimit/android/integration/platform/android/foregroundapp/LollipopForegroundAppHelper.kt b/app/src/main/java/io/timelimit/android/integration/platform/android/foregroundapp/LollipopForegroundAppHelper.kt index 417e86e..ddabc3f 100644 --- a/app/src/main/java/io/timelimit/android/integration/platform/android/foregroundapp/LollipopForegroundAppHelper.kt +++ b/app/src/main/java/io/timelimit/android/integration/platform/android/foregroundapp/LollipopForegroundAppHelper.kt @@ -1,5 +1,5 @@ /* - * TimeLimit Copyright 2019 - 2022 Jonas Lochmann + * TimeLimit Copyright 2019 - 2024 Jonas Lochmann * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -184,7 +184,7 @@ class LollipopForegroundAppHelper(context: Context) : UsageStatsForegroundAppHel } private fun doesActivityExistAsAlias(app: ForegroundApp) = try { - packageManager.getPackageInfo(app.packageName, PackageManager.GET_ACTIVITIES).activities.find { + packageManager.getPackageInfo(app.packageName, PackageManager.GET_ACTIVITIES).activities?.find { it.enabled && it.targetActivity == app.activityName } != null } catch (ex: PackageManager.NameNotFoundException) { diff --git a/app/src/main/java/io/timelimit/android/update/UpdateIntegration.kt b/app/src/main/java/io/timelimit/android/update/UpdateIntegration.kt index 33a3684..f1bc4f8 100644 --- a/app/src/main/java/io/timelimit/android/update/UpdateIntegration.kt +++ b/app/src/main/java/io/timelimit/android/update/UpdateIntegration.kt @@ -1,5 +1,5 @@ /* - * TimeLimit Copyright 2019 - 2020 Jonas Lochmann + * TimeLimit Copyright 2019 - 2024 Jonas Lochmann * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -70,12 +70,12 @@ object UpdateIntegration { val signatures = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { // new signature - context.packageManager.getPackageInfo(context.packageName, PackageManager.GET_SIGNING_CERTIFICATES).signingInfo.apkContentsSigners + context.packageManager.getPackageInfo(context.packageName, PackageManager.GET_SIGNING_CERTIFICATES).signingInfo!!.apkContentsSigners } else { // old signature // this is "unsafe", but it is not used for security features - context.packageManager.getPackageInfo(context.packageName, PackageManager.GET_SIGNATURES).signatures + context.packageManager.getPackageInfo(context.packageName, PackageManager.GET_SIGNATURES).signatures!! } return signatures.map { HexString.toHex(MessageDigest.getInstance("SHA-256").digest(it.toByteArray())) } From d5bc1f98810f0408e00524645b33ff9cd797bff7 Mon Sep 17 00:00:00 2001 From: Jonas Lochmann Date: Mon, 14 Oct 2024 02:00:00 +0200 Subject: [PATCH 4/4] Enable predictive back gesture --- app/src/main/AndroidManifest.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 7bb37a4..74a652d 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -55,7 +55,9 @@ android:roundIcon="@mipmap/ic_launcher_round" android:label="@string/app_name" android:supportsRtl="true" - android:theme="@style/AppTheme"> + android:theme="@style/AppTheme" + android:enableOnBackInvokedCallback="true" + tools:targetApi="tiramisu">