diff --git a/IdentityCredentials/.gitignore b/IdentityCredentials/.gitignore
new file mode 100644
index 0000000..bbc8263
--- /dev/null
+++ b/IdentityCredentials/.gitignore
@@ -0,0 +1,10 @@
+*.iml
+.gradle
+/local.properties
+.DS_Store
+.idea
+/build
+/captures
+.externalNativeBuild
+.cxx
+local.properties
diff --git a/IdentityCredentials/README.md b/IdentityCredentials/README.md
new file mode 100644
index 0000000..89371bf
--- /dev/null
+++ b/IdentityCredentials/README.md
@@ -0,0 +1,12 @@
+Android Identity Credential Sample
+===================================
+
+This sample demonstrates how to use the Identity Credential API. The Identity Credential API allows your app to store user credentials that it can later retrieve to re-authenticate users on a new device. This sample demonstrates that by allowing you to save text, uninstall the app, reinstall it and retreive that text.
+
+Running the sample
+-When you run the sample you will see a screen with an EditText and a button that says Sign In.
+-To save text, type text into the EditText and press register. There will now be a TextView displaying the text you just typed in.
+-To test Identity Credential, uninstall the app and reinstall it. Your text will still be displayed in the TextView.
+-To clear your text press Sign Out.
+
+To learn more about Identity check out the documentation: https://developers.google.com/identity/credential-management.
diff --git a/IdentityCredentials/app/.gitignore b/IdentityCredentials/app/.gitignore
new file mode 100644
index 0000000..796b96d
--- /dev/null
+++ b/IdentityCredentials/app/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/IdentityCredentials/app/build.gradle b/IdentityCredentials/app/build.gradle
new file mode 100644
index 0000000..1d7a14d
--- /dev/null
+++ b/IdentityCredentials/app/build.gradle
@@ -0,0 +1,88 @@
+/*
+ * Copyright 2021 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+plugins {
+ alias(libs.plugins.android.application)
+ alias(libs.plugins.kotlin.android)
+ alias(libs.plugins.hilt.android)
+ alias(libs.plugins.kotlin.kapt)
+}
+
+android {
+ compileSdk 35
+ namespace "com.google.android.gms.identity.credentials.sample"
+ defaultConfig {
+ applicationId "com.google.android.gms.identity.credentials.sample"
+ minSdk 21
+ targetSdk 35
+ versionCode 1
+ versionName "1.0"
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+ }
+
+ buildFeatures {
+ viewBinding true
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
+ }
+
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_17
+ targetCompatibility JavaVersion.VERSION_17
+ }
+
+ kotlinOptions {
+ jvmTarget = '17'
+ }
+}
+
+dependencies {
+ implementation libs.kotlin.stdlib
+ implementation libs.material.design
+ implementation libs.androidx.activity.ktx
+ implementation libs.androidx.core.ktx
+ implementation libs.androidx.appcompat
+ implementation libs.androidx.constraintlayout
+ implementation libs.androidx.test.espresso.idling.resource
+
+ implementation libs.google.play.services.identity.credentials
+ implementation libs.androidx.credentials.play.services.auth
+
+ // Required because the broadcast pending-intent otherwise lacks the intent-flag.
+ // IllegalArgumentException: Targeting S+ (version 31 and above) requires that one of
+ // FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
+ implementation libs.androidx.work.runtime
+
+ // Lifecycle
+ implementation libs.bundles.androidx.lifecycle
+
+ // Coroutines
+ implementation libs.kotlinx.coroutines.play.services
+
+ // Hilt
+ implementation libs.hilt.android
+ kapt libs.hilt.android.compiler
+ implementation libs.hilt.work
+ kapt libs.hilt.compiler
+
+ testImplementation libs.junit
+ debugImplementation libs.androidx.test.monitor
+ androidTestImplementation libs.bundles.androidx.test
+}
\ No newline at end of file
diff --git a/IdentityCredentials/app/proguard-rules.pro b/IdentityCredentials/app/proguard-rules.pro
new file mode 100644
index 0000000..481bb43
--- /dev/null
+++ b/IdentityCredentials/app/proguard-rules.pro
@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
\ No newline at end of file
diff --git a/IdentityCredentials/app/src/main/AndroidManifest.xml b/IdentityCredentials/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..76447a4
--- /dev/null
+++ b/IdentityCredentials/app/src/main/AndroidManifest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/IdentityCredentials/app/src/main/java/com/google/android/gms/identity/credentials/sample/AppModule.kt b/IdentityCredentials/app/src/main/java/com/google/android/gms/identity/credentials/sample/AppModule.kt
new file mode 100644
index 0000000..db6321e
--- /dev/null
+++ b/IdentityCredentials/app/src/main/java/com/google/android/gms/identity/credentials/sample/AppModule.kt
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.android.gms.identity.credentials.sample
+
+import android.content.Context
+import com.google.android.gms.identitycredentials.IdentityCredentialManager
+import com.google.android.gms.identitycredentials.IdentityCredentialClient
+import dagger.Module
+import dagger.Provides
+import dagger.hilt.InstallIn
+import dagger.hilt.android.qualifiers.ApplicationContext
+import dagger.hilt.components.SingletonComponent
+import javax.inject.Singleton
+
+/**
+ * Hilt module that provides singleton (application-scoped) objects.
+ */
+@Module
+@InstallIn(SingletonComponent::class)
+class AppModule {
+ @Singleton
+ @Provides
+ fun provideIdentityCredentialClient(@ApplicationContext context: Context): IdentityCredentialClient =
+ IdentityCredentialManager.getClient(context)
+}
diff --git a/IdentityCredentials/app/src/main/java/com/google/android/gms/identity/credentials/sample/IdentityCredentialsRepository.kt b/IdentityCredentials/app/src/main/java/com/google/android/gms/identity/credentials/sample/IdentityCredentialsRepository.kt
new file mode 100644
index 0000000..420eb50
--- /dev/null
+++ b/IdentityCredentials/app/src/main/java/com/google/android/gms/identity/credentials/sample/IdentityCredentialsRepository.kt
@@ -0,0 +1,75 @@
+/*
+ * Copyright 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.android.gms.identity.credentials.sample
+
+import android.os.Bundle
+import android.os.ResultReceiver
+import com.google.android.gms.identitycredentials.ClearRegistryRequest
+import com.google.android.gms.identitycredentials.ClearRegistryResponse
+import com.google.android.gms.identitycredentials.CredentialOption
+import com.google.android.gms.identitycredentials.GetCredentialRequest
+import com.google.android.gms.identitycredentials.IdentityCredentialClient
+import com.google.android.gms.identitycredentials.PendingGetCredentialHandle
+import com.google.android.gms.identitycredentials.RegistrationRequest
+import com.google.android.gms.identitycredentials.RegistrationResponse
+import com.google.android.gms.tasks.Task
+import javax.inject.Inject
+
+/**
+ * The Repository handles data operations and provides a clean API so that
+ * the rest of the app can retrieve the Identity Credential data easily.
+ * @see IdentityCredentialClient
+ * @see CommonStatusCodes
+ */
+class IdentityCredentialsRepository @Inject constructor(
+ private val client: IdentityCredentialClient
+) {
+ /**
+ * Returns a Task which asynchronously generates a RegistrationResponse on success
+ * or throws an OperationException on failure, when attempting to write to the registry.
+ *
+ * eg. com.google.android.gms.common.api.ApiException: 17 means:
+ * The client attempted to call a method from an API that failed to connect.
+ */
+ fun registerCredentials(
+ credentials: ByteArray, matcher: ByteArray, type: String,
+ requestType: String, protocolTypes: List, id: String
+ ): Task {
+ return client.registerCredentials(
+ RegistrationRequest(credentials, matcher, type, requestType, protocolTypes, id)
+ )
+ }
+
+ /** Returns a Task which asynchronously generates a pending intent to get credentials. */
+ fun getCredential(
+ credentialOptions: List, data: Bundle,
+ origin: String?, resultReceiver: ResultReceiver
+ ): Task {
+ return client.getCredential(
+ GetCredentialRequest(credentialOptions, data, origin, resultReceiver)
+ )
+ }
+
+ /**
+ * Returns a Task which asynchronously generates a ClearRegistryResponse on success
+ * or throws an OperationException on failure, when attempting to clear from the registry.
+ */
+ fun clearRegistry(): Task {
+ return client.clearRegistry(
+ ClearRegistryRequest()
+ )
+ }
+}
diff --git a/IdentityCredentials/app/src/main/java/com/google/android/gms/identity/credentials/sample/MainActivity.kt b/IdentityCredentials/app/src/main/java/com/google/android/gms/identity/credentials/sample/MainActivity.kt
new file mode 100644
index 0000000..d3ef671
--- /dev/null
+++ b/IdentityCredentials/app/src/main/java/com/google/android/gms/identity/credentials/sample/MainActivity.kt
@@ -0,0 +1,85 @@
+/*
+ * Copyright 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.android.gms.identity.credentials.sample
+
+import android.os.Bundle
+import android.os.Handler
+import android.os.Looper
+import android.os.ResultReceiver
+import android.text.Editable
+import androidx.activity.viewModels
+import androidx.appcompat.app.AppCompatActivity
+import androidx.core.view.isVisible
+import androidx.lifecycle.lifecycleScope
+import com.google.android.gms.identity.credentials.sample.databinding.ActivityMainBinding
+import com.google.android.gms.identitycredentials.CredentialOption
+import dagger.hilt.android.AndroidEntryPoint
+import kotlinx.coroutines.launch
+
+@AndroidEntryPoint
+class MainActivity : AppCompatActivity() {
+
+ private val binding: ActivityMainBinding by lazy {
+ ActivityMainBinding.inflate(layoutInflater)
+ }
+ private val viewModel: MainViewModel by viewModels()
+
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+
+ setContentView(binding.root)
+
+ lifecycleScope.launch {
+ viewModel.state
+ .collect { state ->
+ binding.buttonClearRegistry.isVisible = state.hasCredential
+ binding.buttonRegisterCredentials.isVisible = !state.hasCredential
+ if (state.hasCredential) {
+ binding.nameTextView.text.insert(0, state.credential.toString())
+ }
+ }
+ }
+
+ binding.buttonRegisterCredentials.setOnClickListener {
+ val credentialBytes = binding.nameTextView.text.toString().toByteArray()
+ val matcherBytes = "".toByteArray()
+
+ // IllegalArgumentException: Either type: default,
+ // or requestType: default and protocolTypes: [] must be specified,
+ // but all were blank, or for protocolTypes, empty or full of blank elements.
+ viewModel.registerCredentials(
+ credentialBytes,
+ matcherBytes,
+ "default",
+ "",
+ emptyList(),
+ "1"
+ )
+ }
+
+ binding.buttonGetCredential.setOnClickListener {
+ val credentialOptions: List = listOf()
+ val data: Bundle = Bundle()
+ val origin: String = ""
+ val receiver: ResultReceiver = ResultReceiver(Handler(Looper.getMainLooper()))
+ viewModel.launchCredentialSelector(credentialOptions, data, origin, receiver)
+ }
+
+ binding.buttonClearRegistry.setOnClickListener {
+ viewModel.clearRegistry()
+ }
+ }
+}
diff --git a/IdentityCredentials/app/src/main/java/com/google/android/gms/identity/credentials/sample/MainApplication.kt b/IdentityCredentials/app/src/main/java/com/google/android/gms/identity/credentials/sample/MainApplication.kt
new file mode 100644
index 0000000..9e7610b
--- /dev/null
+++ b/IdentityCredentials/app/src/main/java/com/google/android/gms/identity/credentials/sample/MainApplication.kt
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.android.gms.identity.credentials.sample
+
+import android.app.Application
+import dagger.hilt.android.HiltAndroidApp
+
+/** Application class, needed to enable dependency injection with Hilt. */
+@HiltAndroidApp
+class MainApplication : Application()
diff --git a/IdentityCredentials/app/src/main/java/com/google/android/gms/identity/credentials/sample/MainViewModel.kt b/IdentityCredentials/app/src/main/java/com/google/android/gms/identity/credentials/sample/MainViewModel.kt
new file mode 100644
index 0000000..cf6d03c
--- /dev/null
+++ b/IdentityCredentials/app/src/main/java/com/google/android/gms/identity/credentials/sample/MainViewModel.kt
@@ -0,0 +1,103 @@
+/*
+ * Copyright 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.android.gms.identity.credentials.sample
+
+import android.app.PendingIntent
+import android.app.PendingIntent.CanceledException
+import android.os.Bundle
+import android.os.ResultReceiver
+import android.util.Log
+import androidx.lifecycle.ViewModel
+import androidx.lifecycle.viewModelScope
+import com.google.android.gms.identitycredentials.ClearRegistryResponse
+import com.google.android.gms.identitycredentials.Credential
+import com.google.android.gms.identitycredentials.CredentialOption
+import com.google.android.gms.identitycredentials.PendingGetCredentialHandle
+import com.google.android.gms.identitycredentials.RegistrationResponse
+import com.google.android.gms.tasks.Task
+import dagger.hilt.android.lifecycle.HiltViewModel
+import kotlinx.coroutines.flow.MutableStateFlow
+import kotlinx.coroutines.flow.StateFlow
+import kotlinx.coroutines.flow.asStateFlow
+import kotlinx.coroutines.launch
+import kotlinx.coroutines.tasks.await
+import javax.inject.Inject
+
+data class State(
+ val credential: Credential? = null
+)
+
+val State.hasCredential get() = credential != null
+
+/** ViewModel is used to access the Identity Credential Data and to observe changes to it. */
+@HiltViewModel
+class MainViewModel @Inject constructor(
+ private val repository: IdentityCredentialsRepository
+) : ViewModel() {
+
+ private val _state = MutableStateFlow(State())
+ val state: StateFlow = _state.asStateFlow()
+
+ init {
+ viewModelScope.launch {
+ Log.d("", "init")
+ }
+ }
+
+ fun registerCredentials(
+ credentials: ByteArray, matcher: ByteArray, type: String,
+ requestType: String, protocolTypes: List, id: String
+ ) {
+ viewModelScope.launch {
+ var response: RegistrationResponse = repository.registerCredentials(credentials, matcher, type, requestType, protocolTypes, id).await()
+ // _state.value = State(credential = result)
+ }
+ }
+
+ /** Launch the credential-selector UI. */
+ fun launchCredentialSelector(
+ credentialOptions: List, data: Bundle,
+ origin: String?, resultReceiver: ResultReceiver
+ ) {
+ viewModelScope.launch {
+ val intent: PendingIntent = getCredentialSelectorPendingIntent(
+ credentialOptions, data, origin, resultReceiver
+ )
+ try {
+ intent.send()
+ } catch (e: CanceledException) {
+ e.printStackTrace()
+ }
+ }
+ }
+
+ /** Obtain the PendingIntent to launch the credential-selector UI. */
+ private suspend fun getCredentialSelectorPendingIntent(
+ credentialOptions: List, data: Bundle,
+ origin: String?, resultReceiver: ResultReceiver
+ ): PendingIntent {
+ val response: Task = repository.getCredential(credentialOptions, data, origin, resultReceiver)
+ response.await()
+ return response.result.pendingIntent
+ }
+
+ fun clearRegistry() {
+ viewModelScope.launch {
+ var response: ClearRegistryResponse = repository.clearRegistry().await()
+ _state.value = State(credential = null)
+ }
+ }
+}
diff --git a/IdentityCredentials/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/IdentityCredentials/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
new file mode 100644
index 0000000..f5ba0ea
--- /dev/null
+++ b/IdentityCredentials/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/IdentityCredentials/app/src/main/res/drawable/ic_launcher_background.xml b/IdentityCredentials/app/src/main/res/drawable/ic_launcher_background.xml
new file mode 100644
index 0000000..873df7a
--- /dev/null
+++ b/IdentityCredentials/app/src/main/res/drawable/ic_launcher_background.xml
@@ -0,0 +1,182 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/IdentityCredentials/app/src/main/res/layout/activity_main.xml b/IdentityCredentials/app/src/main/res/layout/activity_main.xml
new file mode 100644
index 0000000..0cdcc51
--- /dev/null
+++ b/IdentityCredentials/app/src/main/res/layout/activity_main.xml
@@ -0,0 +1,54 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/IdentityCredentials/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/IdentityCredentials/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
new file mode 100644
index 0000000..0a2bb41
--- /dev/null
+++ b/IdentityCredentials/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/IdentityCredentials/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/IdentityCredentials/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
new file mode 100644
index 0000000..0a2bb41
--- /dev/null
+++ b/IdentityCredentials/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/IdentityCredentials/app/src/main/res/mipmap-hdpi/ic_launcher.png b/IdentityCredentials/app/src/main/res/mipmap-hdpi/ic_launcher.png
new file mode 100644
index 0000000..a571e60
Binary files /dev/null and b/IdentityCredentials/app/src/main/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/IdentityCredentials/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/IdentityCredentials/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
new file mode 100644
index 0000000..61da551
Binary files /dev/null and b/IdentityCredentials/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ
diff --git a/IdentityCredentials/app/src/main/res/mipmap-mdpi/ic_launcher.png b/IdentityCredentials/app/src/main/res/mipmap-mdpi/ic_launcher.png
new file mode 100644
index 0000000..c41dd28
Binary files /dev/null and b/IdentityCredentials/app/src/main/res/mipmap-mdpi/ic_launcher.png differ
diff --git a/IdentityCredentials/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/IdentityCredentials/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
new file mode 100644
index 0000000..db5080a
Binary files /dev/null and b/IdentityCredentials/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ
diff --git a/IdentityCredentials/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/IdentityCredentials/app/src/main/res/mipmap-xhdpi/ic_launcher.png
new file mode 100644
index 0000000..6dba46d
Binary files /dev/null and b/IdentityCredentials/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ
diff --git a/IdentityCredentials/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/IdentityCredentials/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..da31a87
Binary files /dev/null and b/IdentityCredentials/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ
diff --git a/IdentityCredentials/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/IdentityCredentials/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
new file mode 100644
index 0000000..15ac681
Binary files /dev/null and b/IdentityCredentials/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/IdentityCredentials/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/IdentityCredentials/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..b216f2d
Binary files /dev/null and b/IdentityCredentials/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ
diff --git a/IdentityCredentials/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/IdentityCredentials/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
new file mode 100644
index 0000000..f25a419
Binary files /dev/null and b/IdentityCredentials/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ
diff --git a/IdentityCredentials/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/IdentityCredentials/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..e96783c
Binary files /dev/null and b/IdentityCredentials/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ
diff --git a/IdentityCredentials/app/src/main/res/values-night/themes.xml b/IdentityCredentials/app/src/main/res/values-night/themes.xml
new file mode 100644
index 0000000..887e843
--- /dev/null
+++ b/IdentityCredentials/app/src/main/res/values-night/themes.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/IdentityCredentials/app/src/main/res/values/colors.xml b/IdentityCredentials/app/src/main/res/values/colors.xml
new file mode 100644
index 0000000..45cda05
--- /dev/null
+++ b/IdentityCredentials/app/src/main/res/values/colors.xml
@@ -0,0 +1,22 @@
+
+
+
+ #FFBB86FC
+ #FF6200EE
+ #FF3700B3
+ #FF03DAC5
+ #FF018786
+ #FF000000
+ #FFFFFFFF
+
diff --git a/IdentityCredentials/app/src/main/res/values/strings.xml b/IdentityCredentials/app/src/main/res/values/strings.xml
new file mode 100644
index 0000000..4de364d
--- /dev/null
+++ b/IdentityCredentials/app/src/main/res/values/strings.xml
@@ -0,0 +1,19 @@
+
+
+ Identity Credentials App
+ register credentials
+ get credential
+ clear registry
+ Name
+
diff --git a/IdentityCredentials/app/src/main/res/values/themes.xml b/IdentityCredentials/app/src/main/res/values/themes.xml
new file mode 100644
index 0000000..cc5535f
--- /dev/null
+++ b/IdentityCredentials/app/src/main/res/values/themes.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
diff --git a/IdentityCredentials/build.gradle b/IdentityCredentials/build.gradle
new file mode 100644
index 0000000..a5ff863
--- /dev/null
+++ b/IdentityCredentials/build.gradle
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2021 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+plugins {
+ alias(libs.plugins.android.application) apply false
+ alias(libs.plugins.android.library) apply false
+ alias(libs.plugins.kotlin.android) apply false
+ alias(libs.plugins.hilt.android) apply false
+}
+
+tasks.register('clean', Delete) {
+ delete rootProject.fileTree("build")
+}
diff --git a/IdentityCredentials/gradle.properties b/IdentityCredentials/gradle.properties
new file mode 100644
index 0000000..2521752
--- /dev/null
+++ b/IdentityCredentials/gradle.properties
@@ -0,0 +1,19 @@
+# Project-wide Gradle settings.
+# IDE (e.g. Android Studio) users:
+# Gradle settings configured through the IDE *will override*
+# any settings specified in this file.
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
+# When configured, Gradle will run in incubating parallel mode.
+# This option should only be used with decoupled projects. More details, visit
+# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
+# org.gradle.parallel=true
+# AndroidX package structure to make it clearer which packages are bundled with the
+# Android operating system, and which are packaged with your app"s APK
+# https://developer.android.com/topic/libraries/support-library/androidx-rn
+android.useAndroidX=true
+# Kotlin code style for this project: "official" or "obsolete":
+kotlin.code.style=official
\ No newline at end of file
diff --git a/IdentityCredentials/gradle/libs.versions.toml b/IdentityCredentials/gradle/libs.versions.toml
new file mode 100644
index 0000000..e3ca6dc
--- /dev/null
+++ b/IdentityCredentials/gradle/libs.versions.toml
@@ -0,0 +1,55 @@
+[versions]
+android_gradle_plugin = '8.6.0'
+hilt_android = "2.52"
+hilt = "1.2.0"
+kotlin = '2.0.20'
+kotlinx_coroutines = '1.7.3'
+junit = '4.13.2'
+material_design = '1.12.0'
+androidx_core = '1.13.1'
+androidx_activity = '1.9.2'
+androidx_appcompat = '1.7.0'
+androidx_constraintlayout = '2.1.4'
+androidx_lifecycle = '2.8.5'
+androidx_work_runtime = '2.9.1'
+androidx_test_ext_junit = '1.2.1'
+androidx_test_monitor = '1.7.2'
+androidx_test_espresso = '3.6.1'
+androidx_credentials_play_services_auth = "1.5.0-alpha05"
+google_play_services_identity_credentials = '16.0.0-alpha03'
+
+[plugins]
+android_application = { id = "com.android.application", version.ref = "android_gradle_plugin" }
+android_library = { id = "com.android.library", version.ref = "android_gradle_plugin" }
+kotlin_android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
+kotlin_kapt = { id = "org.jetbrains.kotlin.kapt" }
+hilt_android = { id = "com.google.dagger.hilt.android", version.ref = "hilt_android" }
+
+[libraries]
+hilt_compiler = { module = "androidx.hilt:hilt-compiler", version.ref = "hilt" }
+hilt_work = { module = "androidx.hilt:hilt-work", version.ref = "hilt" }
+hilt_android = { module = "com.google.dagger:hilt-android", version.ref = "hilt_android" }
+hilt_android_compiler = { module = "com.google.dagger:hilt-android-compiler", version.ref = "hilt_android" }
+junit = { module = "junit:junit", version.ref = "junit" }
+kotlin_stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" }
+kotlinx_coroutines_play_services = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-play-services", version.ref = "kotlinx_coroutines" }
+material_design = { module = "com.google.android.material:material", version.ref = "material_design" }
+androidx_core_ktx = { module = "androidx.core:core-ktx", version.ref = "androidx_core" }
+androidx_activity_ktx = { module = "androidx.activity:activity-ktx", version.ref = "androidx_activity" }
+androidx_appcompat = { module = "androidx.appcompat:appcompat", version.ref = "androidx_appcompat" }
+androidx_constraintlayout = { module = "androidx.constraintlayout:constraintlayout", version.ref = "androidx_constraintlayout" }
+androidx_lifecycle_common_java8 = { module = "androidx.lifecycle:lifecycle-common-java8", version.ref = "androidx_lifecycle" }
+androidx_lifecycle_livedata_ktx = { module = "androidx.lifecycle:lifecycle-livedata-ktx", version.ref = "androidx_lifecycle" }
+androidx_lifecycle_viewmodel_ktx = { module = "androidx.lifecycle:lifecycle-viewmodel-ktx", version.ref = "androidx_lifecycle" }
+androidx_work_runtime = { module = "androidx.work:work-runtime", version.ref = "androidx_work_runtime" }
+androidx_work_runtime_ktx = { module = "androidx.work:work-runtime-ktx", version.ref = "androidx_work_runtime" }
+androidx_test_monitor = { module = "androidx.test:monitor", version.ref = "androidx_test_monitor" }
+androidx_test_ext_junit = { module = "androidx.test.ext:junit", version.ref = "androidx_test_ext_junit" }
+androidx_test_espresso_core = { module = "androidx.test.espresso:espresso-core", version.ref = "androidx_test_espresso" }
+androidx_test_espresso_idling_resource = { module = "androidx.test.espresso:espresso-idling-resource", version.ref = "androidx_test_espresso" }
+google_play_services_identity_credentials = { module = "com.google.android.gms:play-services-identity-credentials", version.ref = "google_play_services_identity_credentials" }
+androidx_credentials_play_services_auth = { module = "androidx.credentials:credentials-play-services-auth", version.ref = "androidx_credentials_play_services_auth" }
+
+[bundles]
+androidx_lifecycle = ["androidx_lifecycle_common_java8", "androidx_lifecycle_livedata_ktx", "androidx_lifecycle_viewmodel_ktx"]
+androidx_test = ["androidx_test_ext_junit", "androidx_test_espresso_core"]
diff --git a/IdentityCredentials/gradle/wrapper/gradle-wrapper.jar b/IdentityCredentials/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..f6b961f
Binary files /dev/null and b/IdentityCredentials/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/IdentityCredentials/gradle/wrapper/gradle-wrapper.properties b/IdentityCredentials/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..8fcac46
--- /dev/null
+++ b/IdentityCredentials/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,20 @@
+# Copyright 2021 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+#Thu Aug 19 16:25:07 EDT 2021
+distributionBase=GRADLE_USER_HOME
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
+distributionPath=wrapper/dists
+zipStorePath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
diff --git a/IdentityCredentials/gradlew b/IdentityCredentials/gradlew
new file mode 100644
index 0000000..cccdd3d
--- /dev/null
+++ b/IdentityCredentials/gradlew
@@ -0,0 +1,172 @@
+#!/usr/bin/env sh
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+ echo "$*"
+}
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+ NONSTOP* )
+ nonstop=true
+ ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
+}
+APP_ARGS=$(save "$@")
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
+ cd "$(dirname "$0")"
+fi
+
+exec "$JAVACMD" "$@"
diff --git a/IdentityCredentials/gradlew.bat b/IdentityCredentials/gradlew.bat
new file mode 100644
index 0000000..f955316
--- /dev/null
+++ b/IdentityCredentials/gradlew.bat
@@ -0,0 +1,84 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/IdentityCredentials/settings.gradle b/IdentityCredentials/settings.gradle
new file mode 100644
index 0000000..dcb98fa
--- /dev/null
+++ b/IdentityCredentials/settings.gradle
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2021 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+pluginManagement {
+ repositories {
+ gradlePluginPortal()
+ google()
+ mavenCentral()
+ }
+}
+dependencyResolutionManagement {
+ repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
+ repositories {
+ google {
+ content {
+ includeGroupByRegex("com\\.android.*")
+ includeGroupByRegex("com\\.google.*")
+ includeGroupByRegex("androidx.*")
+ }
+ }
+ mavenCentral()
+ }
+}
+rootProject.name = "IdentityCredential"
+include ':app'