restore-credentials
Provides knowledge and workflows to implement Android's Restore Credentials
Install / Use
npx skills add android/skills --skill restore-credentialsInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
AutomationSupported Platforms
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.
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 foundOur 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.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| restore-credentials (this skill)by android | 92 | 7.5k | 54d ago | SKILL.md |
| Agent-Reachby Panniantong | 100 | 112.3k | 8d ago | CLAUDE.md |
| rufloby ruvnet | 100 | 81.9k | today | CLAUDE.md |
| Claude-Code-Game-Studiosby Donchitos | 100 | 39.7k | 7d ago | CLAUDE.md |
| Scraplingby D4Vinci | 100 | 103.6k | 2d ago | MCP 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.
Skill content
View source on GitHubname: 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:
- Before the implementation, you MUST read and understand the Two-Tier Restoration Architecture and review the DOs and DON'Ts.
- 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:
- 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. - 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 ifallowBackupis 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.xmlfor the value of allowBackup to determine what you have to implement. - Do implement a fallback for createCredential: always try calling it first with
isCloudBackupEnabledset to true. If anE2eeUnavailableExceptionis thrown, catch it and retry the call withisCloudBackupEnabledset tofalse. - Do implement a
BackupAgent(subclass ofandroid.app.backup.BackupAgent) ifallowBackupis true in the manifest. - Do set
android:fullBackupOnly="true"in the manifest if you added aBackupAgentto 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 usingrunBlocking). - Do restore notifications in the
BackupAgentif 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 (
BackupAgentand LauncherActivity), 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
allowBackupinAndroidManifest.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 ifallowBackupis false. - DON'T implement a
BackupAgentifallowBackupisfalseinAndroidManifest.xml. - DON'T assume the credential stored in the
GetCredentialResponseto be of typePublicKeyCredential. It has typeRestoreCredential. - DON'T chain
GetRestoreCredentialOptionwith any otherCredentialOptionin the construction of aGetCredentialRequest. - DON'T assume
CredentialManageror the Android system will automatically delete a restore key when a user signs out of the app. You must explicitly callclearCredentialStatewith aClearCredentialStateRequestofTYPE_CLEAR_RESTORE_CREDENTIAL. - DON'T remove any existing calls to
clearCredentialState(). AClearCredentialStateRequestwithout 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
allowBackupis set in the manifest.
Overview
- Create a restore key: To create a restore key, complete the following steps:
- Instantiate Credential Manager: Create a
CredentialManagerobject. - Get credential creation options from the app server: Send the client app the details required to create the restore key from your app server.
- Create the restore key: Create a restore key for the user's account if the user is signed in to your app.
- Handle the credential creation response: Send the credentials from your client app to your app server for processing, and handle any exceptions.
- Instantiate Credential Manager: Create a
- Sign in with a restore key: To sign in with a restore key, complete the following steps:
- Get credential retrieval options from the app server: Send the client app the details required to retrieve the restore key from your app server.
- 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.
- Handle the credential retrieval response: Send the restore key from the client app to the app server to sign in the user.
- 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
onCreatemethod for the mainActivity). - 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
Agent-Reach
112.3kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
ruflo
81.9k🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated
Claude-Code-Game-Studios
39.7kTurn Claude Code into a full game dev studio — 49 AI agents, 72 workflow skills, and a complete coordination system mirroring real studio hierarchy.
Scrapling
103.6k🕷️ The BEST Web Scraping framework that handles everything from a single request to a full-scale crawl! Don't be shy, join here: https://discord.gg/EMgGbDceNQ and follow here for daily tips and tricks: https://x.com/Scrapling_dev
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
