diff options
author | Harsh Shandilya <me@msfjarvis.dev> | 2024-08-08 02:46:08 +0530 |
---|---|---|
committer | Harsh Shandilya <me@msfjarvis.dev> | 2024-08-08 03:34:14 +0530 |
commit | e8cdc2077f295cf61ed7157f8ae2cdbb53c39054 (patch) | |
tree | efc3d7b56d13c9962d4b32bba5375b1d00cc87e5 | |
parent | 4eb8f497d598c731a3628c7ae71a398ac462cfc0 (diff) |
fix(build): compile against SDK 35
5 files changed, 10 insertions, 7 deletions
diff --git a/app/src/main/java/app/passwordstore/util/shortcuts/ShortcutHandler.kt b/app/src/main/java/app/passwordstore/util/shortcuts/ShortcutHandler.kt index b7e6549a..9248ba55 100644 --- a/app/src/main/java/app/passwordstore/util/shortcuts/ShortcutHandler.kt +++ b/app/src/main/java/app/passwordstore/util/shortcuts/ShortcutHandler.kt @@ -41,7 +41,9 @@ class ShortcutHandler @Inject constructor(@ApplicationContext val context: Conte val shortcuts = shortcutManager.dynamicShortcuts // If we're above or equal to the maximum shortcuts allowed, drop the last item. if (shortcuts.size >= MAX_SHORTCUT_COUNT) { - shortcuts.removeLast() + // We'd just do List.removeLast but the Kotlin stdlib extension gets shadowed by the API 35 + // JDK implementation + shortcuts.removeAt(shortcuts.lastIndex) } // Reverse the list so we can append our new shortcut at the 'end'. shortcuts.reverse() diff --git a/autofill-parser/src/main/java/com/github/androidpasswordstore/autofillparser/AutofillHelper.kt b/autofill-parser/src/main/java/com/github/androidpasswordstore/autofillparser/AutofillHelper.kt index f08f3172..3514e8f1 100644 --- a/autofill-parser/src/main/java/com/github/androidpasswordstore/autofillparser/AutofillHelper.kt +++ b/autofill-parser/src/main/java/com/github/androidpasswordstore/autofillparser/AutofillHelper.kt @@ -50,7 +50,10 @@ public fun computeCertificatesHash(context: Context, appPackage: String): String @SuppressLint("PackageManagerGetSignatures") @Suppress("DEPRECATION") val signaturesOld = - context.packageManager.getPackageInfo(appPackage, PackageManager.GET_SIGNATURES).signatures + context.packageManager + .getPackageInfo(appPackage, PackageManager.GET_SIGNATURES) + .signatures + .orEmpty() val stableHashOld = stableHash(signaturesOld.map { it.toByteArray() }) if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { val info = @@ -63,7 +66,7 @@ public fun computeCertificatesHash(context: Context, appPackage: String): String context.packageManager.getPackageInfo(appPackage, PackageManager.GET_SIGNING_CERTIFICATES) } val signaturesNew = - info.signingInfo.signingCertificateHistory ?: info.signingInfo.apkContentsSigners + info.signingInfo?.signingCertificateHistory ?: info.signingInfo?.apkContentsSigners.orEmpty() val stableHashNew = stableHash(signaturesNew.map { it.toByteArray() }) if (stableHashNew != stableHashOld) logcat("CertificatesHash", ERROR) { diff --git a/build-logic/src/main/kotlin/app/passwordstore/gradle/AndroidCommon.kt b/build-logic/src/main/kotlin/app/passwordstore/gradle/AndroidCommon.kt index 7157d3ae..bf12a32d 100644 --- a/build-logic/src/main/kotlin/app/passwordstore/gradle/AndroidCommon.kt +++ b/build-logic/src/main/kotlin/app/passwordstore/gradle/AndroidCommon.kt @@ -15,7 +15,7 @@ import org.gradle.kotlin.dsl.withType object AndroidCommon { fun configure(project: Project) { project.extensions.configure<TestedExtension> { - compileSdkVersion(34) + compileSdkVersion(35) defaultConfig { minSdk = 26 targetSdk = 34 diff --git a/gradle.properties b/gradle.properties index 0cc380ff..dde45722 100644 --- a/gradle.properties +++ b/gradle.properties @@ -48,6 +48,7 @@ android.disableEarlyManifestParsing=true # Disable warnings about unsupported features android.suppressUnsupportedOptionWarnings=android.dependencyResolutionAtConfigurationTime.disallow,android.disableEarlyManifestParsing,android.suppressUnsupportedOptionWarnings +android.suppressUnsupportedCompileSdk=35 # Maven publishing GROUP=com.github.android-password-store diff --git a/ui/compose/src/main/kotlin/app/passwordstore/ui/compose/theme/Theme.kt b/ui/compose/src/main/kotlin/app/passwordstore/ui/compose/theme/Theme.kt index 6827e01a..cf122f20 100644 --- a/ui/compose/src/main/kotlin/app/passwordstore/ui/compose/theme/Theme.kt +++ b/ui/compose/src/main/kotlin/app/passwordstore/ui/compose/theme/Theme.kt @@ -10,8 +10,6 @@ import androidx.compose.material3.dynamicLightColorScheme import androidx.compose.material3.lightColorScheme import androidx.compose.runtime.Composable import androidx.compose.runtime.SideEffect -import androidx.compose.ui.graphics.Color -import androidx.compose.ui.graphics.toArgb import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalView import androidx.core.view.WindowCompat @@ -95,7 +93,6 @@ public fun APSTheme( if (!view.isInEditMode) { SideEffect { val window = (view.context as Activity).window - window.statusBarColor = Color.Transparent.toArgb() WindowCompat.getInsetsController(window, view).isAppearanceLightStatusBars = !darkTheme } } |