From e1fcf5f78ac5e4dea48a5a200bccb7bb3ee12910 Mon Sep 17 00:00:00 2001 From: Gregory Oschwald Date: Fri, 24 Jul 2026 19:08:24 +0000 Subject: [PATCH 1/4] Remove androidx.core:core-ktx dependency The SDK's only androidx usage was the SharedPreferences.edit {} extension in StoredIDStorage. That extension is inline and compiles to exactly edit() / mutate / apply(), so calling the framework methods directly is behaviorally identical. StoredIDStorageTest already mocked the raw framework calls and asserted apply(), so it passes unchanged. Removing it means the published POM no longer exports any androidx artifact, so the SDK is out of androidx version alignment entirely and imposes no compileSdk or AGP floor on consumers. core-ktx 1.18.0 declared minCompileSdk 36 / minAndroidGradlePluginVersion 8.9.1, and the queued 1.19.0 bump declares 37 / 9.1.0 -- the same shape of consumer breakage reported in GitHub #63. This removes that class of problem rather than re-evaluating it on each core-ktx release. Verified with :device-sdk:build (328 tests, lint), detekt, ktlintCheck, and :sample:assembleDebug. releaseRuntimeClasspath now contains no androidx entries. Co-Authored-By: Claude Opus 5 (1M context) --- CHANGELOG.md | 6 ++++++ device-sdk/build.gradle.kts | 3 --- .../main/java/com/maxmind/device/storage/StoredIDStorage.kt | 5 ++--- gradle/libs.versions.toml | 2 -- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 26cde7b..499e8a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,12 @@ - Removed the unused `kotlinx-coroutines-android` dependency. The SDK only uses `Dispatchers.IO`, so it does not need the Android `Dispatchers.Main` integration this artifact provides. +- Removed the `androidx.core:core-ktx` dependency. Its only use was the + `SharedPreferences.edit {}` extension, which has been replaced with the + equivalent framework calls. The published artifact now has no `androidx` + dependencies, so it no longer participates in androidx version alignment and + imposes no `compileSdk` or Android Gradle Plugin floor on consumers. + Previously `core-ktx` 1.18.0 required `compileSdk` 36 and AGP 8.9.1. ## 0.3.0 (2026-06-23) diff --git a/device-sdk/build.gradle.kts b/device-sdk/build.gradle.kts index 738c95e..23303f5 100644 --- a/device-sdk/build.gradle.kts +++ b/device-sdk/build.gradle.kts @@ -78,9 +78,6 @@ dependencies { implementation(libs.kotlinx.coroutines.core) implementation(libs.kotlinx.serialization.json) - // AndroidX - implementation(libs.androidx.core.ktx) - // Networking implementation(libs.bundles.ktor) diff --git a/device-sdk/src/main/java/com/maxmind/device/storage/StoredIDStorage.kt b/device-sdk/src/main/java/com/maxmind/device/storage/StoredIDStorage.kt index c4f742f..4dc1509 100644 --- a/device-sdk/src/main/java/com/maxmind/device/storage/StoredIDStorage.kt +++ b/device-sdk/src/main/java/com/maxmind/device/storage/StoredIDStorage.kt @@ -2,7 +2,6 @@ package com.maxmind.device.storage import android.content.Context import android.content.SharedPreferences -import androidx.core.content.edit /** * Manages persistent storage of server-generated stored IDs. @@ -33,14 +32,14 @@ internal class StoredIDStorage( * @param id The stored ID to save (format: "{uuid}:{hmac}") */ fun save(id: String) { - prefs.edit { putString(KEY_STORED_ID, id) } + prefs.edit().putString(KEY_STORED_ID, id).apply() } /** * Clears the stored ID. */ fun clear() { - prefs.edit { remove(KEY_STORED_ID) } + prefs.edit().remove(KEY_STORED_ID).apply() } internal companion object { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 1d3461d..6b78982 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -11,7 +11,6 @@ serialization = "1.11.0" # Android androidGradlePlugin = "8.13.1" -androidxCore = "1.18.0" androidxAppCompat = "1.7.1" androidxLifecycle = "2.11.0" @@ -49,7 +48,6 @@ kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutine kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "serialization" } # AndroidX -androidx-core-ktx = { module = "androidx.core:core-ktx", version.ref = "androidxCore" } androidx-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "androidxAppCompat" } androidx-lifecycle-runtime-ktx = { module = "androidx.lifecycle:lifecycle-runtime-ktx", version.ref = "androidxLifecycle" } From 7d93de6f39d548ccd24812c09ee45dd6fdc5917b Mon Sep 17 00:00:00 2001 From: Gregory Oschwald Date: Fri, 24 Jul 2026 19:08:33 +0000 Subject: [PATCH 2/4] Use a copyright year range The project's first release was in 2025 and it is still being changed in 2026, so a range rather than a single year. Co-Authored-By: Claude Opus 5 (1M context) --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6b35dff..c3d9c92 100644 --- a/README.md +++ b/README.md @@ -205,11 +205,11 @@ Documentation will be generated in `device-sdk/build/dokka/`. ## License -This software is Copyright (c) 2025 by MaxMind, Inc. +This software is Copyright (c) 2025-2026 by MaxMind, Inc. This is free software, licensed under the [Apache License, Version 2.0](LICENSE-APACHE) or the [MIT License](LICENSE-MIT), -at your option. Copyright 2025 MaxMind, Inc. +at your option. Copyright 2025-2026 MaxMind, Inc. ## Support From 0751c1eac6ae85a2ad31a636a95b34a705f21c21 Mon Sep 17 00:00:00 2001 From: Gregory Oschwald Date: Fri, 24 Jul 2026 19:08:46 +0000 Subject: [PATCH 3/4] Set 0.3.1 release date Co-Authored-By: Claude Opus 5 (1M context) --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 499e8a8..d19b2ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## 0.3.1 (TBD) +## 0.3.1 (2026-07-24) - Removed the unused `androidx.lifecycle:lifecycle-runtime-ktx` dependency. In 0.3.0 this dependency was at version 2.11.0, which forced consumers with any From ee20e532ab0ccd07f765448209f8a7bfbd408663 Mon Sep 17 00:00:00 2001 From: Gregory Oschwald Date: Fri, 24 Jul 2026 13:15:48 -0700 Subject: [PATCH 4/4] Preparing for 0.3.1 --- README.md | 4 ++-- build.gradle.kts | 2 +- device-sdk/build.gradle.kts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c3d9c92..89a343e 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Add the dependency to your app's `build.gradle.kts`: ```kotlin dependencies { - implementation("com.maxmind.device:device-sdk:0.3.0") + implementation("com.maxmind.device:device-sdk:0.3.1") } ``` @@ -24,7 +24,7 @@ dependencies { ```groovy dependencies { - implementation 'com.maxmind.device:device-sdk:0.3.0' + implementation 'com.maxmind.device:device-sdk:0.3.1' } ``` diff --git a/build.gradle.kts b/build.gradle.kts index 14c14e5..ba265be 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -12,7 +12,7 @@ plugins { allprojects { group = "com.maxmind.device" - version = "0.3.0" + version = "0.3.1" } tasks.register("clean", Delete::class) { diff --git a/device-sdk/build.gradle.kts b/device-sdk/build.gradle.kts index 23303f5..11ca3d7 100644 --- a/device-sdk/build.gradle.kts +++ b/device-sdk/build.gradle.kts @@ -170,7 +170,7 @@ signing { // API compatibility checking with japicmp // Compares the current build against the latest released version on Maven Central // Update this version after each release (the release script should do this automatically) -val baselineVersion = "0.3.0" +val baselineVersion = "0.3.1" // Download baseline AAR directly from Maven Central to avoid local project resolution val downloadBaselineAar by tasks.registering {