From 04f53466e03a9aabcce8236c084418c48f1503b8 Mon Sep 17 00:00:00 2001 From: Chiping Yeh Date: Mon, 17 Mar 2025 16:43:50 -0400 Subject: [PATCH] Add build and proguard rules snippets --- gradle/libs.versions.toml | 4 ++++ identity/credentialmanager/build.gradle.kts | 8 +++++++- identity/credentialmanager/proguard-rules.pro | 9 ++++++++- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 72e8d4975..7edd2bbdc 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -9,6 +9,8 @@ androidx-constraintlayout = "2.2.0" androidx-constraintlayout-compose = "1.1.0" androidx-coordinator-layout = "1.2.0" androidx-corektx = "1.15.0" +androidx-credentials = "1.5.0" +androidx-credentials-play-services-auth = "1.5.0" androidx-emoji2-views = "1.5.0" androidx-fragment-ktx = "1.8.6" androidx-glance-appwidget = "1.1.1" @@ -93,6 +95,8 @@ androidx-constraintlayout-compose = { module = "androidx.constraintlayout:constr androidx-coordinator-layout = { module = "androidx.coordinatorlayout:coordinatorlayout", version.ref = "androidx-coordinator-layout" } androidx-core-ktx = { module = "androidx.core:core-ktx", version.ref = "androidx-corektx" } androidx-core-splashscreen = { module = "androidx.core:core-splashscreen", version.ref = "coreSplashscreen" } +androidx-credentials = { module = "androidx.credentials:credentials", version.ref = "androidx-credentials" } +androidx-credentials-play-services-auth = { module = "androidx.credentials:credentials-play-services-auth", version.ref = "androidx-credentials-play-services-auth" } androidx-emoji2-views = { module = "androidx.emoji2:emoji2-views", version.ref = "androidx-emoji2-views" } androidx-fragment-ktx = { module = "androidx.fragment:fragment-ktx", version.ref = "androidx-fragment-ktx" } androidx-glance-appwidget = { module = "androidx.glance:glance-appwidget", version.ref = "androidx-glance-appwidget" } diff --git a/identity/credentialmanager/build.gradle.kts b/identity/credentialmanager/build.gradle.kts index 560866d16..fab41549b 100644 --- a/identity/credentialmanager/build.gradle.kts +++ b/identity/credentialmanager/build.gradle.kts @@ -40,7 +40,6 @@ android { } dependencies { - implementation(libs.androidx.core.ktx) implementation(libs.androidx.lifecycle.runtime) implementation(libs.androidx.activity.compose) @@ -49,6 +48,13 @@ dependencies { implementation(libs.androidx.compose.ui.graphics) implementation(libs.androidx.compose.ui.tooling.preview) implementation(libs.androidx.compose.material3) + // [START android_identity_gradle_dependencies] + implementation(libs.androidx.credentials) + + // optional - needed for credentials support from play services, for devices running + // Android 13 and below. + implementation(libs.androidx.credentials.play.services.auth) + // [END android_identity_gradle_dependencies] debugImplementation(libs.androidx.compose.ui.tooling) debugImplementation(libs.androidx.compose.ui.test.manifest) } \ No newline at end of file diff --git a/identity/credentialmanager/proguard-rules.pro b/identity/credentialmanager/proguard-rules.pro index 481bb4348..6075f01e2 100644 --- a/identity/credentialmanager/proguard-rules.pro +++ b/identity/credentialmanager/proguard-rules.pro @@ -18,4 +18,11 @@ # If you keep the line number information, uncomment this to # hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file +#-renamesourcefileattribute SourceFile + +# // [START android_identity_proguard_rules] +-if class androidx.credentials.CredentialManager +-keep class androidx.credentials.playservices.** { + *; +} +# // [END android_identity_proguard_rules] \ No newline at end of file