restore-credentials
Ce qu’il fait
Ce skill guide la partie Android de Restore Credentials, avec la bibliothèque Credential Manager. Elle permet aux utilisateurs de revenir se connecter silencieusement après la restauration d'une application sur un nouvel appareil. Il s'adresse aux développeurs Android qui utilisent déjà Credential Manager.
Quand l’utiliser
- ✓Quand vous voulez que les utilisateurs se reconnectent automatiquement après avoir restauré votre application sur un nouveau téléphone.
- ✓Quand vous devez créer, utiliser ou supprimer des clés de restauration dans votre application Android.
- ✓Quand vous voulez savoir ce que votre backend doit faire pour que Restore Credentials fonctionne.
Lien du skill
https://github.com/android/skills/blob/main/identity/restore-credentials/SKILL.mdCopiez-le et collez-le dans votre IA (Claude, ChatGPT ou Cursor) en lui demandant de suivre les instructions.
Comment l’utiliser
Le plus simple : copiez le message et collez-le dans votre IA. Elle lit le skill et suit les instructions.
Message prêt à coller
Pour Claude Code, Codex ou Cursor : lancez-la dans le dossier du projet et le skill est installé.
Téléchargez le SKILL.md et placez-le dans le dossier de skills de votre agent.
Exemple de demande à votre IA
“Ajoute Restore Credentials à mon application Android pour que les utilisateurs se reconnectent après une restauration sur un nouveau téléphone.”
5 nouveaux skills par semaine. 1 minute de lecture.
Comment ça marche
Le skill explique la conception à deux niveaux de la restauration, puis ajoute le code pour créer, récupérer et supprimer les clés de restauration dans l'application. Il se termine par une liste d'étapes backend que vous devrez réaliser.
Contenu technique (SKILL.md original)
Texte original de l’auteur, en anglais, directement depuis GitHub.
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 Credenti
Questions fréquentes
Le skill construit-il mon serveur ?
Non. Il couvre seulement la partie application Android et vous rappelle de construire vous-même les vérifications côté backend.
Modifie-t-il mes écrans de connexion ?
Non. La fonction fonctionne à côté de votre connexion existante et ne nécessite aucun changement d'interface.
Quelle bibliothèque utilise-t-il ?
Il utilise la bibliothèque androidx.credentials de l'API Credential Manager.
Détails
Description originale de l’auteur
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.
repo: android/skills
Popularité
- Étoiles GitHub
- 10k
- Position au classement
- #11916
- Licence
- Apache-2.0
- Mis à jour
- 29/10/2026
Commentaires
- …
Autres skills de ce dépôt
agp-9-upgrade
10kAide votre agent à migrer une application Android vers Android Gradle Plugin 9 et à corriger les changements incompatibles. Hors Kotlin Multiplatform.
camerax
10kAide votre agent à créer des fonctions de caméra Android avec CameraX : vidéo, commandes matérielles, ML Kit et effets Media3.
android-for-cars-parked-apps
10kAide votre agent à adapter une application vidéo, de jeu ou de navigateur Android pour qu'elle tourne sur Android Auto ou Automotive.
appfunctions
10kAide votre agent à exposer les parcours clés d'une application Android sous forme d'AppFunctions, que les agents IA et la voix peuvent exécuter.
Skills similaires
reverse-engineer-anything
422kAide votre agent à analyser les applications et paquets livrés, pour expliquer leurs fonctions, comparer des versions ou guider une reconstruction, avec REA.
1password
394kAide votre agent à configurer l'interface en ligne de commande de 1Password, à se connecter, et à lire ou injecter des secrets sans afficher leurs valeurs dans le chat.
healthcheck
394kAide votre agent à auditer l'ordinateur ou le serveur qui fait tourner OpenClaw pour détecter des risques de sécurité, comme SSH, le pare-feu, les mises à jour et les sauvegardes, puis à proposer des corrections sûres.