Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Commit

Permalink
fix(build): compile against SDK 35
Browse files Browse the repository at this point in the history
  • Loading branch information
msfjarvis committed Aug 7, 2024
1 parent 4eb8f49 commit e8cdc20
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand All @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}
}
Expand Down

0 comments on commit e8cdc20

Please sign in to comment.