मुख्य सामग्री पर जाएँ
Skillpedia
सिक्योरिटी10k · #11916

restore-credentials

यह क्या करती है

यह स्किल Credential Manager लाइब्रेरी से Restore Credentials के Android हिस्से का मार्गदर्शन देती है। इससे लौटने वाले उपयोगकर्ता नए डिवाइस पर ऐप restore होने के बाद चुपचाप साइन इन कर सकते हैं। यह उन Android डेवलपरों के लिए है जो पहले से Credential Manager इस्तेमाल कर रहे हैं।

कब इस्तेमाल करें

  • ✓जब आप चाहते हैं कि नया फ़ोन पर ऐप restore करने के बाद उपयोगकर्ता अपने-आप फिर साइन इन हो जाएँ।
  • ✓जब आपको Android ऐप में restore keys बनाने, उनसे साइन इन करने या उन्हें हटाने की ज़रूरत हो।
  • ✓जब आपको यह जानना हो कि restore credentials काम करने के लिए आपके backend को क्या करना होगा।

Skill का लिंक

https://github.com/android/skills/blob/main/identity/restore-credentials/SKILL.md

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/android/skills/blob/main/identity/restore-credentials/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“मेरे Android ऐप में Restore Credentials जोड़िए, ताकि नया फ़ोन पर restore के बाद उपयोगकर्ता फिर साइन इन हो जाएँ।”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

स्किल दो-स्तरीय restore डिज़ाइन समझाती है, फिर ऐप में restore keys बनाने, लाने और हटाने का कोड जोड़ती है। अंत में वह उन backend चरणों की सूची देती है जो आपको खुद बनाने होंगे।

तकनीकी सामग्री (मूल SKILL.md)

लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे 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:

  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 Credenti
अक्सर पूछे जाने वाले सवाल

क्या यह मेरा सर्वर बनाती है?

नहीं। यह सिर्फ़ Android ऐप वाला हिस्सा कवर करती है और याद दिलाती है कि backend जाँच आपको खुद बनानी है।

क्या यह मेरी साइन-इन स्क्रीन बदलती है?

नहीं। यह फ़ीचर आपकी मौजूदा साइन-इन के साथ काम करता है और UI में बदलाव की ज़रूरत नहीं होती।

यह कौन सी लाइब्रेरी इस्तेमाल करती है?

यह Credential Manager API की androidx.credentials लाइब्रेरी इस्तेमाल करती है।

जानकारी

लेखक का मूल विवरण

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

लोकप्रियता

GitHub स्टार
10k
रैंकिंग में स्थान
#11916
लाइसेंस
Apache-2.0
अपडेट की गई
29/10/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

agp-9-upgrade

10k

आपके एजेंट को Android ऐप को Android Gradle Plugin 9 पर ले जाने और उसके breaking changes सुधारने में मदद करती है। मल्टीप्लेटफ़ॉर्म प्रोजेक्ट के लिए नहीं।

कोडिंगमोबाइल ऐप

camerax

10k

आपके एजेंट को CameraX से Android कैमरा फ़ीचर बनाने में मदद करती है, जिसमें वीडियो रिकॉर्डिंग, हार्डवेयर कंट्रोल, ML Kit और Media3 इफ़ेक्ट शामिल हैं।

कोडिंगमोबाइल ऐप

android-for-cars-parked-apps

10k

आपके एजेंट को Android वीडियो, गेम या ब्राउज़र ऐप को Android Auto और Android Automotive पर parked ऐप के रूप में चलाने के लिए ढालने में मदद करती है।

कोडिंगमोबाइल ऐप

appfunctions

10k

आपके एजेंट को Android ऐप के मुख्य काम ढूँढकर उन्हें AppFunctions के रूप में देने में मदद करती है, ताकि AI एजेंट और वॉइस कमांड उन्हें चला सकें।

AI और एजेंटएजेंट

मिलती-जुलती skills