Android Setup & Backend-Verifizierung
Ein Setup-Vorschlag mit den Installationsanweisungen und der vollständigen Markdown-Anleitung für diesen Plugin kopieren.
Android-native-System verwendet
Abschnitt mit dem Titel ‘Android-native-System verwendet’Bei Android verwendet dieses Plugin Google Play Integrity Standard API:
prepareIntegrityTokenwährendprepare()requestStandardIntegrityTokenFürcreateAttestation()undcreateAssertion()
Anforderungen
Section titled “Requirements”- Android-App im Google Play-Store verteilt
- Google Play-Dienste verfügbar auf Gerät
- Play Integrity API aktiviert für Ihre App
- Google Cloud-Projekt-Nummer konfiguriert
Google-Einrichtung
Section titled “Google setup”- Enable Play Integrity API in Ihrem Google Cloud-Projekt.
- Öffnen Sie das Play Console und konfigurieren Sie den Zugriff auf Play Integrity für Ihre App.
- Bieten
cloudProjectNumberden Plugin-Entwicklern.
Capacitor-Konfiguration
Abschnitt mit dem Titel „Capacitor-Konfiguration“plugins: { AppAttest: { cloudProjectNumber: '123456789012', },}Sie können auch cloudProjectNumber pro Aufruf in der Methode Optionen.
import { AppAttest } from '@capgo/capacitor-app-attest';
const { keyId } = await AppAttest.prepare({ cloudProjectNumber: '123456789012',});
const attestation = await AppAttest.createAttestation({ keyId, challenge: 'backend-registration-challenge',});
const assertion = await AppAttest.createAssertion({ keyId, payload: 'backend-request-payload',});token es ist ein Play-Integritäts-Token und muss serverseitig entschlüsselt werden.
Hintergrundprozess (Android)
Section titled “Backend workflow (Android)”Registration (createAttestation)
Der Hintergrund erstellt einen einmaligen- Hintergrund erstellt einmalig
challenge. - App Aufrufe
createAttestation({ keyId, challenge }). - __CAPGO_KEEP_0__.
decodeIntegrityTokenAPI. - entspricht Ihrer Android-Anwendungs-ID
requestDetails.requestHash === base64url(SHA256(challenge))appIntegrity.packageNameBackend-Workflow (Android)appIntegrity.certificateSha256Digestenthält Ihr Release-Zertifikats-Digest- Ihre Sicherheitsrichtlinie entspricht den Integritätsurteilen
Anforderungsschutz ("createAssertion)
Abschnitt mit Titel “Anforderungsschutz (createAssertion)”- Hintergrund erstellt einen einmaligen
payload. - App ruft
createAssertion({ keyId, payload }). - Hintergrund entschlüsselt Token und überprüft
requestHash === base64url(SHA256(payload)). - Einschränken Sie die Wiederholungsprävention (einmalig + TTL) und die Integritätsurteilsrichtlinie.
Android-Schema
Abschnitt mit Titel “Android-Schema”sequenceDiagram participant App as Android App participant Plugin as AppAttest plugin participant PlaySDK as Play Integrity SDK participant BE as Backend participant Google as decodeIntegrityToken API
App->>Plugin: prepare(cloudProjectNumber) Plugin->>PlaySDK: prepareIntegrityToken() PlaySDK-->>Plugin: provider handle (keyId)
BE->>App: one-time challenge App->>Plugin: createAttestation(keyId, challenge) Plugin->>PlaySDK: requestStandardIntegrityToken(requestHash) PlaySDK-->>Plugin: integrity token Plugin-->>App: token + platform + format + keyId App->>BE: token + challenge + keyId BE->>Google: decodeIntegrityToken(token) Google-->>BE: decoded payload BE->>BE: verify requestHash + app identity + verdicts
BE->>App: one-time payload App->>Plugin: createAssertion(keyId, payload) Plugin->>PlaySDK: requestStandardIntegrityToken(requestHash) PlaySDK-->>Plugin: integrity token App->>BE: token + payload + keyId BE->>Google: decodeIntegrityToken(token) Google-->>BE: decoded payload BE->>BE: verify requestHash + replay policyMinimalvertrag für den Hintergrundlastenfluss
Abschnitt mit dem Titel “Minimal backend payload contract”Registrierung:
{ "platform": "android", "format": "google-play-integrity-standard", "keyId": "string", "challenge": "string", "token": "string"}Behauptung:
{ "platform": "android", "format": "google-play-integrity-standard", "keyId": "string", "payload": "string", "token": "string"}Weitergehen von Android Setup & Backend-Verifizierung
Abschnitt mit dem Titel “Weitergehen von Android Setup & Backend-Verifizierung”Wenn Sie Capgo verwenden Android Setup & Backend-Verifizierung zur Planung von Sicherheit und Compliance, verbinden Sie es mit Verwenden Sie @capgo/capacitor-app-attest für die native Fähigkeit in Verwenden Sie @capgo/capacitor-app-attest Verschlüsselung Verschlüsselung für die Implementierungsdetails Kongruenz Kongruenz für die Implementierungsdetails Capgo Sicherheits-Scanner Capgo Sicherheits-Scanner für den Produktworkflow und Capgo Sicherheit Capgo Sicherheit für den Produktworkflow.