Chiffrement
This Documentation explains how to Migrer to the Chiffrement v2 system. Learn more À propos the Chiffrement v2 system in the blog post.
1. Créer Key Pair
Section titled “1. Créer Key Pair”npx @capgo/cli key createStore the private key securely. Never commit it to source control or share it with untrusted parties.
This Commande:
- Creates a Nouveau key pair in your Application
- Removes the old key from your Capacitor config
- Keeps old key files for backward compatibility
2. Mise à jour Capacitor Config
Section titled “2. Mise à jour Capacitor Config”When prompted “Do you want to setup encryption with the new channel in order to support old apps and facilitate the migration?”, select yes. This adds a new defaultChannel option to your Capacitor config.
import { CapacitorConfig } from '@capacitor/cli';
const config: CapacitorConfig = { appId: 'com.example.app', appName: 'Example App', plugins: { CapacitorUpdater: { // ... other options defaultChannel: 'encryption_v2' // New apps will use this channel } }};
export default config;3. Télécharger Bundle to Nouveau Canal
Section titled “3. Télécharger Bundle to Nouveau Canal”npx @capgo/cli bundle upload --channel encryption_v24. Activer Self-Assignment
Section titled “4. Activer Self-Assignment”Required for the defaultChannel option to work
npx @capgo/cli channel set encryption_v2 --self-assign5. Télécharger to Old Canal
Section titled “5. Télécharger to Old Canal”npx @capgo/cli bundle upload --channel productionCapacitor config is never uploaded to Capgo
6. Cleanup (After 3-4 Months)
Section titled “6. Cleanup (After 3-4 Months)”Once all Utilisateurs have updated their apps:
- Remove
defaultChannelfrom your Capacitor config - Supprimer the old Canal:
npx @capgo/cli channel delete encryption_v2Apps using encryption_v2 as default will switch to production channel after deletion