From 25ddb1307ad2d5c3ffca088fd7f3bc06b0654c93 Mon Sep 17 00:00:00 2001 From: Torsten Grote Date: Fri, 6 Jun 2025 14:32:06 -0300 Subject: [PATCH] Android 16 can still install targetSdk 24 apps --- .../src/androidMain/kotlin/org/fdroid/CompatibilityChecker.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libs/index/src/androidMain/kotlin/org/fdroid/CompatibilityChecker.kt b/libs/index/src/androidMain/kotlin/org/fdroid/CompatibilityChecker.kt index e9a4d1261..ab57f6bd1 100644 --- a/libs/index/src/androidMain/kotlin/org/fdroid/CompatibilityChecker.kt +++ b/libs/index/src/androidMain/kotlin/org/fdroid/CompatibilityChecker.kt @@ -56,12 +56,15 @@ public class CompatibilityCheckerImpl @JvmOverloads constructor( public object CompatibilityCheckerUtils { // Mirrored from AOSP due to lack of public APIs // frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java + // search for MIN_INSTALLABLE_TARGET_SDK + // https://android.googlesource.com/platform/frameworks/base/+/refs/tags/android-16.0.0_r1/services/core/java/com/android/server/pm/PackageManagerService.java // TODO: Keep this in sync with AOSP to avoid INSTALL_FAILED_DEPRECATED_SDK_VERSION errors @JvmOverloads public fun minInstallableTargetSdk(sdkInt: Int = SDK_INT): Int { return when (sdkInt) { 34 -> 23 // Android 6.0, M 35 -> 24 // Android 7.0, N + 36 -> 24 // Android 7.0, N (didn't change) else -> 1 // Android 1.0, BASE } }