SkillAgentSearch skills...

restore-credentials

Provides knowledge and workflows to implement Android's Restore Credentials

Install / Use

npx skills add android/skills --skill restore-credentials

Installs into whichever agent you are using.

About this skill
📄

SKILL.md

Installable skill definition

Quality Score

92/100

Category

Automation

Supported Platforms

Universal

Our assessment of restore-credentials

restore-credentials scores 92/100 on our quality scale, 819th of 2,790 Automation skills we index (top 30%).

Its SKILL.md is 25 KB long, well organised into 25 sections with 2 code examples: a thorough specification that gives an agent plenty to work with.

With 7,514 GitHub stars, it is one of the more widely adopted skills in the catalogue.

Substance
30/30
Structure
18/20
Description
12/15
Adoption
16/20
Freshness
15/15

Maintenance, license and trust

  • The repository was last updated about 2 months ago, so restore-credentials is actively maintained.
  • Our last check on 2026-10-05 found the source still online.
  • It is released under the Apache-2.0 license, a permissive license that allows use, modification and commercial use with attribution.
  • Its trust signals score 100/100, with no cautions. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.

Safety scan

No issues found

Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful.

AI review by kimi-k2.7-code on 2026-09-26. Automated pattern scan on 2026-09-26. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.

restore-credentials compared with similar skills

All 4 of these similar skills score higher than restore-credentials; compare them before choosing.

SkillScoreStarsUpdatedFormat
restore-credentials (this skill)by android927.5k54d agoSKILL.md
Agent-Reachby Panniantong100112.3k8d agoCLAUDE.md
rufloby ruvnet10081.9ktodayCLAUDE.md
Claude-Code-Game-Studiosby Donchitos10039.7k7d agoCLAUDE.md
Scraplingby D4Vinci100103.6k2d agoMCP Server

Frequently asked questions

How do I install restore-credentials?
Run npx skills add android/skills --skill restore-credentials. The install tabs above show the steps for each supported agent.
Which AI agents does restore-credentials work with?
It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
Is restore-credentials safe to use?
Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful. It is Apache-2.0-licensed and scores 100/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
Is restore-credentials still maintained?
The repository was last updated about 2 months ago, so restore-credentials is actively maintained.

name: restore-credentials description: Provides knowledge and workflows to implement Android's Restore Credentials feature using the androidx.credentials library. Use this skill to create, sign in with, and delete restore keys, enabling silent user sign-in on new devices after a restore. It covers version compatibility, dependencies, server-side prerequisites, and the complete client-side implementation for creating, retrieving, and clearing restore keys. license: Complete terms in LICENSE.txt metadata: author: Google LLC last-updated: '2026-09-14' keywords:

  • Credential Manager
  • Restore Credentials
  • backup & restore
  • backup
  • restore
  • implementation

Fundamentals

The objective is to implement the Restore Credentials feature through the Android Credential Manager API (androidx.credentials). This allows apps that use or are integrating Credential Manager to silently log users back in when they restore their app on a new device. Restore Credentials operates independently of the app's primary authentication method (passwords, passkeys, federated sign-in) and requires no UI changes to existing sign-in flows.

Scope

Crucial: This skill focuses exclusively on the Android client-side integration. It does not implement the server-side cryptographic validation logic. The developer must be reminded of this and the Points to inform the developer about after implementation is done.

Implementation Guidelines

When instructed to implement Restore Credentials on a developer's application, remember the following:

  1. Before the implementation, you MUST read and understand the Two-Tier Restoration Architecture and review the DOs and DON'Ts.
  2. After the implementation, you MUST present the developer with the Backend Guidelines as a reminder for their backend setup. It is important that you remind the developer that they still have to implement the backend.

Two-Tier Restoration Architecture

To enable a resilient sign-in experience, retrieve credentials through a two-tier architecture:

  1. Tier 1 (Primary - Background): Executes automatically during device setup using the app's BackupAgent.onRestoreFinished() callback. This provides an invisible restoration before the user opens the app for the first time, allowing background sync and notification delivery.
  2. Tier 2 (Secondary - Foreground): Runs in the Launcher Activity.onCreate() to catch failovers if background restoration didn't complete (example: dropped network, delayed restoration) or if allowBackup is disabled.

If allowBackup in the manifest is set to true, implement both. Otherwise, only implement tier 2 (Foreground Restoration). Do NOT change the value of allowBackup in the manifest.

If you added a BackupAgent to the app, you MUST also set android:fullBackupOnly="true" in the manifest. Do NOT do this if there already existed a BackupAgent in the app before your implementation.

DOs and DON'Ts

DO:

  • Do check AndroidManifest.xml for the value of allowBackup to determine what you have to implement.
  • Do implement a fallback for createCredential: always try calling it first with isCloudBackupEnabled set to true. If an E2eeUnavailableException is thrown, catch it and retry the call with isCloudBackupEnabled set to false.
  • Do implement a BackupAgent (subclass of android.app.backup.BackupAgent) if allowBackup is true in the manifest.
  • Do set android:fullBackupOnly="true" in the manifest if you added a BackupAgent to the app.
  • Call clearCredentialState() when the user signs out. This is a mandatory security measure to log the user out fully.
  • Do attempt to get the restore key on the first launch of the app on a new device and also within the BackupAgent.onRestoreFinished() callback if your app uses it.
  • Do ensure that a restore credential is created even if the user is already logged in.
  • Do ensure that the credential retrieval and login in onRestoreFinished() is performed synchronously (for example using runBlocking).
  • Do restore notifications in the BackupAgent if your app uses them. (For example capture and send FCM token to backend)
  • Do ensure that if you implement mock network requests or stubs, you replace all placeholders with valid, properly formatted JSON payloads for the credential requests.
  • Do encapsulate credential creation and retrieval into their own dedicated functions. Because credential creation must be called in multiple places (sign-up, sign-in) and retrieval across multiple tiers (BackupAgent and Launcher Activity), this prevents code duplication.
  • Do remind the developer of the critical guidelines for implementing the backend once you're done with the implementation.
  • Do generate a separate restore key for each application if the organization has multiple apps with different package names, as a restore key is tied to a unique application package name.

DON'T:

  • DON'T change the value of allowBackup in AndroidManifest.xml. Restore Credentials functionality is not affected by the allowBackup setting, meaning the user will still be automatically logged in when a Restore Credential exists, even if allowBackup is false.
  • DON'T implement a BackupAgent if allowBackup is false in AndroidManifest.xml.
  • DON'T assume the credential stored in the GetCredentialResponse to be of type PublicKeyCredential. It has type RestoreCredential.
  • DON'T chain GetRestoreCredentialOption with any other CredentialOption in the construction of a GetCredentialRequest.
  • DON'T assume CredentialManager or the Android system will automatically delete a restore key when a user signs out of the app. You must explicitly call clearCredentialState with a ClearCredentialStateRequest of TYPE_CLEAR_RESTORE_CREDENTIAL.
  • DON'T remove any existing calls to clearCredentialState(). A ClearCredentialStateRequest without a type specified only clears all NON-restore credentials.

Implementation Guide

Implement the Android client-side code by using the following guide. Follow it step-by-step and don't implement any backend functionality, only remind the user of the Backend Guidelines once you're done.

Version compatibility

Credential Manager's Restore Credentials works on devices running Android 9 (API level 28) and higher, Google Play services (GMS) core version 24220000 or higher, and version 1.5.0 or higher of the androidx.credentials library.

Prerequisites

Set up a relying party server similar to the server for passkeys. If you already have a server set up to handle authentication with passkeys, use the same server-side implementation for restore keys.

[!NOTE] Note: While the server-side implementation is the same for passkeys and restore keys, your client-side app can support restore keys without supporting passkeys. Because restore keys work independently of the authentication method in your app (for example, passwords or Sign in with Google), you don't need to make any additional changes to the existing authentication methods in your app's code.

Dependencies

Add the following dependencies to your app module's build.gradle file:

Kotlin

dependencies {
    implementation("androidx.credentials:credentials:1.7.0-alpha03")
    implementation("androidx.credentials:credentials-play-services-auth:1.7.0-alpha03")
}

Groovy

dependencies {
    implementation "androidx.credentials:credentials:1.7.0-alpha03"
    implementation "androidx.credentials:credentials-play-services-auth:1.7.0-alpha03"
}

Restore Credentials is available from version 1.5.0 and higher of the androidx.credentials library. However, it's recommended to use the latest stable versions of the dependencies where possible.

[!NOTE] Note: The Restore Credentials feature works regardless of whether allowBackup is set in the manifest.

Overview

  1. Create a restore key: To create a restore key, complete the following steps:
    1. Instantiate Credential Manager: Create a CredentialManager object.
    2. Get credential creation options from the app server: Send the client app the details required to create the restore key from your app server.
    3. Create the restore key: Create a restore key for the user's account if the user is signed in to your app.
    4. Handle the credential creation response: Send the credentials from your client app to your app server for processing, and handle any exceptions.
  2. Sign in with a restore key: To sign in with a restore key, complete the following steps:
    1. Get credential retrieval options from the app server: Send the client app the details required to retrieve the restore key from your app server.
    2. Get the restore key: Request the restore key from Credential Manager when the user sets up a new device. This lets the user sign in without additional input.
    3. Handle the credential retrieval response: Send the restore key from the client app to the app server to sign in the user.
  3. Delete a restore key.

Create a restore key

Your app should cover all cases of a user signing in to ensure active users have a restore key created. Create the restore key in the following scenarios:

  • If the user is signed in and a restore key isn't already created (such as in the onCreate method for the main Activity).
  • When the user is signing in or completing a new account registration flow.

To optimize performance and avoid the overhead of creating or checking for a restore credential on every single login, set a boolean flag or a credential creation timestamp in local storage, such as has_synced_restore_credential, to track whether the key has already been created.

[!NOTE] Note: A restore key is tied to an application's unique package name. If your organization's main app and sub-apps have different package names, create a separate restore key for each app.

Instantiate Credential Manager

Use your app's activity context to instantiate a CredentialManager object.

// Use your app or activity context to instantiate a client instance of
// CredentialManager.
private val credentialManager = CredentialManager.create(context)

Get credential creation options from your app server

Use a FIDO-compliant library in your app server to send your client app the information required to create the restore credential, such as information about the user, the app, and additional configuration properties. For more information about the server-side implementation, see Server-side guidance.

Create the restore key

After parsing the public key creation options sent by the server, create a restore key by wrapping these options in a CreateRestoreCredentialRequest object and calling the createCredential() method with the CredentialManager object.

// createRestoreRequest contains th

Truncated for display — read the full file on GitHub.

Related Skills

View on GitHub
GitHub Stars7.5k
CategoryAutomation
Updated1mo ago
Forks488

Languages

Python

Trust signals

100/100

From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.

No cautions