From 5cb29988d8ebb4c9625af6452f7931d0e68d1cb7 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Mon, 2 Nov 2026 11:09:19 +0100 Subject: build: update to Gradle 9.8.2, AGP 9.5.0, Kotlin 2.4.21, Hilt 2.60.1 AGP 9 migration: - Configure the shared Android setup through the new DSL (CommonExtension, ApplicationExtension) instead of the removed TestedExtension and BaseAppModuleExtension; targetSdk moves to the application extension. - Stop applying the Kotlin Android plugin; AGP 9 compiles Kotlin itself. - Replace kapt with KSP 2.3.13 for Hilt, which built-in Kotlin requires, and carry the Dagger compiler options over as KSP arguments. - AGP 9 now applies packaging excludes to unit-test resources, which stripped the diceware word list (**/*.txt) from its tests; lift that exclude in the diceware module. - Use resources.directories instead of the deprecated srcDir. Plugin updates required by Gradle 9 / AGP 9: Sentry Gradle plugin 6.25.0 (sentry-android 8.62.0), metalava plugin 0.5.1, maven-publish 0.37.0, spotless 8.10.4, version-catalog-update 1.1.2, download task 5.7.0, foojay resolver 1.0.0, with their API changes. Newer metalava models Kotlin properties, so autofill-parser/api.txt is regenerated; the diff is representation only, no API was added or removed. Fix new Kotlin 2.4 and lint findings (explicit return type in a function with an early return, UseKtx in autofill-parser), drop deprecated Kotlin Gradle properties, and make the AGENTS.md pre-commit command cover every task CI runs (both flavors, lint on all modules). Co-Authored-By: Claude Opus 5.5 --- autofill-parser/api.txt | 74 ++++++++++------------ autofill-parser/build.gradle.kts | 2 +- .../autofillparser/AutofillFormParser.kt | 4 +- .../autofillparser/FeatureAndTrustDetection.kt | 4 +- 4 files changed, 37 insertions(+), 47 deletions(-) (limited to 'autofill-parser') diff --git a/autofill-parser/api.txt b/autofill-parser/api.txt index a999127f..89cfaa3c 100644 --- a/autofill-parser/api.txt +++ b/autofill-parser/api.txt @@ -2,8 +2,6 @@ package com.github.androidpasswordstore.autofillparser { public enum AutofillAction { - method public static com.github.androidpasswordstore.autofillparser.AutofillAction valueOf(String value) throws java.lang.IllegalArgumentException, java.lang.NullPointerException; - method public static com.github.androidpasswordstore.autofillparser.AutofillAction[] values(); enum_constant public static final com.github.androidpasswordstore.autofillparser.AutofillAction FillOtpFromSms; enum_constant public static final com.github.androidpasswordstore.autofillparser.AutofillAction Generate; enum_constant public static final com.github.androidpasswordstore.autofillparser.AutofillAction Match; @@ -14,13 +12,13 @@ package com.github.androidpasswordstore.autofillparser { method public static String computeCertificatesHash(android.content.Context context, String appPackage); } - @RequiresApi(android.os.Build.VERSION_CODES.O) public abstract sealed class AutofillScenario { - method public final java.util.List getFieldsToSave(); - method public final boolean getHasFieldsToSave(); - method public final boolean getHasPasswordFieldsToSave(); - method public final boolean getHasUsername(); - method public abstract java.util.List getPasswordFieldsToSave(); - method public abstract T? getUsername(); + @RequiresApi(android.os.Build.VERSION_CODES.O) public abstract sealed nonexhaustive class AutofillScenario { + method @InaccessibleFromKotlin public final java.util.List getFieldsToSave(); + method @InaccessibleFromKotlin public final boolean getHasFieldsToSave(); + method @InaccessibleFromKotlin public final boolean getHasPasswordFieldsToSave(); + method @InaccessibleFromKotlin public final boolean getHasUsername(); + method @InaccessibleFromKotlin public abstract java.util.List getPasswordFieldsToSave(); + method @InaccessibleFromKotlin public abstract T? getUsername(); method public final boolean hasFieldsToFillOn(com.github.androidpasswordstore.autofillparser.AutofillAction action); property public final java.util.List fieldsToSave; property public final boolean hasFieldsToSave; @@ -37,15 +35,16 @@ package com.github.androidpasswordstore.autofillparser { } public final class AutofillScenarioKt { - method @RequiresApi(android.os.Build.VERSION_CODES.O) public static void fillWithAutofillId(android.service.autofill.Dataset.Builder, com.github.androidpasswordstore.autofillparser.AutofillScenario scenario, com.github.androidpasswordstore.autofillparser.AutofillAction action, com.github.androidpasswordstore.autofillparser.Credentials? credentials); - method @RequiresApi(android.os.Build.VERSION_CODES.O) public static String? getPasswordValue(com.github.androidpasswordstore.autofillparser.AutofillScenario); - method @RequiresApi(android.os.Build.VERSION_CODES.O) public static String? getUsernameValue(com.github.androidpasswordstore.autofillparser.AutofillScenario); + method @KotlinOnly @RequiresApi(android.os.Build.VERSION_CODES.O) public static void fillWith(android.service.autofill.Dataset.Builder, com.github.androidpasswordstore.autofillparser.AutofillScenario scenario, com.github.androidpasswordstore.autofillparser.AutofillAction action, com.github.androidpasswordstore.autofillparser.Credentials? credentials); + method @InaccessibleFromKotlin @RequiresApi(android.os.Build.VERSION_CODES.O) public static void fillWithAutofillId(android.service.autofill.Dataset.Builder, com.github.androidpasswordstore.autofillparser.AutofillScenario scenario, com.github.androidpasswordstore.autofillparser.AutofillAction action, com.github.androidpasswordstore.autofillparser.Credentials? credentials); + method @InaccessibleFromKotlin @RequiresApi(android.os.Build.VERSION_CODES.O) public static String? getPasswordValue(com.github.androidpasswordstore.autofillparser.AutofillScenario); + method @InaccessibleFromKotlin @RequiresApi(android.os.Build.VERSION_CODES.O) public static String? getUsernameValue(com.github.androidpasswordstore.autofillparser.AutofillScenario); method @RequiresApi(android.os.Build.VERSION_CODES.O) public static com.github.androidpasswordstore.autofillparser.AutofillScenario? recoverNodes(com.github.androidpasswordstore.autofillparser.AutofillScenario, android.app.assist.AssistStructure structure); + property @RequiresApi(android.os.Build.VERSION_CODES.O) public static String? com.github.androidpasswordstore.autofillparser.AutofillScenario.passwordValue; + property @RequiresApi(android.os.Build.VERSION_CODES.O) public static String? com.github.androidpasswordstore.autofillparser.AutofillScenario.usernameValue; } public enum BrowserAutofillSupportLevel { - method public static com.github.androidpasswordstore.autofillparser.BrowserAutofillSupportLevel valueOf(String value) throws java.lang.IllegalArgumentException, java.lang.NullPointerException; - method public static com.github.androidpasswordstore.autofillparser.BrowserAutofillSupportLevel[] values(); enum_constant public static final com.github.androidpasswordstore.autofillparser.BrowserAutofillSupportLevel FlakyFill; enum_constant public static final com.github.androidpasswordstore.autofillparser.BrowserAutofillSupportLevel GeneralFill; enum_constant public static final com.github.androidpasswordstore.autofillparser.BrowserAutofillSupportLevel GeneralFillAndSave; @@ -59,13 +58,13 @@ package com.github.androidpasswordstore.autofillparser { method public String? component1(); method public String? component2(); method public String? component3(); - method public com.github.androidpasswordstore.autofillparser.Credentials copy(String? username, String? password, String? otp); - method public String? getOtp(); - method public String? getPassword(); - method public String? getUsername(); - property public final String? otp; - property public final String? password; - property public final String? username; + method public com.github.androidpasswordstore.autofillparser.Credentials copy(optional String? username, optional String? password, optional String? otp); + method @InaccessibleFromKotlin public String? getOtp(); + method @InaccessibleFromKotlin public String? getPassword(); + method @InaccessibleFromKotlin public String? getUsername(); + property public String? otp; + property public String? password; + property public String? username; } public final class FeatureAndTrustDetectionKt { @@ -73,15 +72,15 @@ package com.github.androidpasswordstore.autofillparser { } @RequiresApi(android.os.Build.VERSION_CODES.O) public final class FillableForm { - method public com.github.androidpasswordstore.autofillparser.FormOrigin getFormOrigin(); - method public java.util.List getIgnoredIds(); - method public Integer? getSaveFlags(); - method public com.github.androidpasswordstore.autofillparser.AutofillScenario getScenario(); + method @InaccessibleFromKotlin public com.github.androidpasswordstore.autofillparser.FormOrigin getFormOrigin(); + method @InaccessibleFromKotlin public java.util.List getIgnoredIds(); + method @InaccessibleFromKotlin public Integer? getSaveFlags(); + method @InaccessibleFromKotlin public com.github.androidpasswordstore.autofillparser.AutofillScenario getScenario(); method public android.os.Bundle toClientState(); - property public final com.github.androidpasswordstore.autofillparser.FormOrigin formOrigin; - property public final java.util.List ignoredIds; - property public final Integer? saveFlags; - property public final com.github.androidpasswordstore.autofillparser.AutofillScenario scenario; + property public com.github.androidpasswordstore.autofillparser.FormOrigin formOrigin; + property public java.util.List ignoredIds; + property public Integer? saveFlags; + property public com.github.androidpasswordstore.autofillparser.AutofillScenario scenario; field public static final com.github.androidpasswordstore.autofillparser.FillableForm.Companion Companion; } @@ -95,8 +94,8 @@ package com.github.androidpasswordstore.autofillparser { method public void onSuccess(android.content.IntentSender intentSender); } - public abstract sealed class FormOrigin { - method public String getIdentifier(); + public abstract sealed exhaustive class FormOrigin { + method @InaccessibleFromKotlin public String getIdentifier(); method public final String getPrettyIdentifier(android.content.Context context, optional boolean untrusted); method public final android.os.Bundle toBundle(); property public String identifier; @@ -106,7 +105,7 @@ package com.github.androidpasswordstore.autofillparser { public static final class FormOrigin.App extends com.github.androidpasswordstore.autofillparser.FormOrigin { ctor public FormOrigin.App(String identifier); method public String component1(); - method public com.github.androidpasswordstore.autofillparser.FormOrigin.App copy(String identifier); + method public com.github.androidpasswordstore.autofillparser.FormOrigin.App copy(optional String identifier); property public String identifier; } @@ -117,7 +116,7 @@ package com.github.androidpasswordstore.autofillparser { public static final class FormOrigin.Web extends com.github.androidpasswordstore.autofillparser.FormOrigin { ctor public FormOrigin.Web(String identifier); method public String component1(); - method public com.github.androidpasswordstore.autofillparser.FormOrigin.Web copy(String identifier); + method public com.github.androidpasswordstore.autofillparser.FormOrigin.Web copy(optional String identifier); property public String identifier; } @@ -127,12 +126,3 @@ package com.github.androidpasswordstore.autofillparser { } -package mozilla.components.lib.publicsuffixlist { - - public final class PublicSuffixListLoaderTest { - ctor public PublicSuffixListLoaderTest(); - method public void testLoadingBundledPublicSuffixList(); - } - -} - diff --git a/autofill-parser/build.gradle.kts b/autofill-parser/build.gradle.kts index 472f78fb..39157b37 100644 --- a/autofill-parser/build.gradle.kts +++ b/autofill-parser/build.gradle.kts @@ -15,7 +15,7 @@ android { minSdk = 23 consumerProguardFiles("consumer-rules.pro") } - sourceSets { getByName("test") { resources.srcDir("src/main/assets") } } + sourceSets { getByName("test") { resources.directories.add("src/main/assets") } } namespace = "com.github.androidpasswordstore.autofillparser" } diff --git a/autofill-parser/src/main/java/com/github/androidpasswordstore/autofillparser/AutofillFormParser.kt b/autofill-parser/src/main/java/com/github/androidpasswordstore/autofillparser/AutofillFormParser.kt index c273bdfc..3dc74f33 100644 --- a/autofill-parser/src/main/java/com/github/androidpasswordstore/autofillparser/AutofillFormParser.kt +++ b/autofill-parser/src/main/java/com/github/androidpasswordstore/autofillparser/AutofillFormParser.kt @@ -8,11 +8,11 @@ import android.app.assist.AssistStructure import android.content.Context import android.content.pm.PackageManager import android.content.pm.PackageManager.ApplicationInfoFlags -import android.net.Uri import android.os.Build import android.os.Bundle import android.view.autofill.AutofillId import androidx.annotation.RequiresApi +import androidx.core.net.toUri import logcat.logcat /** @@ -150,7 +150,7 @@ private class AutofillFormParser( } private fun webOriginToFormOrigin(context: Context, origin: String): FormOrigin? { - val uri = Uri.parse(origin) ?: return null + val uri = origin.toUri() val scheme = uri.scheme ?: return null if (scheme !in SUPPORTED_SCHEMES) return null val host = uri.host ?: return null diff --git a/autofill-parser/src/main/java/com/github/androidpasswordstore/autofillparser/FeatureAndTrustDetection.kt b/autofill-parser/src/main/java/com/github/androidpasswordstore/autofillparser/FeatureAndTrustDetection.kt index 2da3a102..d531dd49 100644 --- a/autofill-parser/src/main/java/com/github/androidpasswordstore/autofillparser/FeatureAndTrustDetection.kt +++ b/autofill-parser/src/main/java/com/github/androidpasswordstore/autofillparser/FeatureAndTrustDetection.kt @@ -8,11 +8,11 @@ import android.content.Context import android.content.Intent import android.content.pm.PackageManager import android.content.pm.PackageManager.ResolveInfoFlags -import android.net.Uri import android.os.Build import android.provider.Settings import android.service.autofill.SaveInfo import androidx.annotation.RequiresApi +import androidx.core.net.toUri /** * In order to add a new browser, do the following: @@ -244,7 +244,7 @@ private fun getBrowserAutofillSupportLevel( public fun getInstalledBrowsersWithAutofillSupportLevel( context: Context ): List> { - val testWebIntent = Intent(Intent.ACTION_VIEW).apply { data = Uri.parse("https://example.org") } + val testWebIntent = Intent(Intent.ACTION_VIEW).apply { data = "https://example.org".toUri() } val installedBrowsers = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { context.packageManager.queryIntentActivities( -- cgit v1.2.3