BindingMigration
Manages the migration of device binding data from the Legacy SDK to the new SDK format.
This object orchestrates a multi-step migration process that transfers:
Biometric authentication keys
Application PIN keys
User key metadata
The migration runs automatically during app initialization via androidx.startup.Initializer and can also be triggered manually by calling start.
Migration Steps
The migration executes three sequential steps:
Step 1 - Migration Preparation: Check if migration is required and prepare the necessary state which required for subsequent steps, including loading existing keys from the Legacy SDK.
Step 3 - User Key Metadata: Migrates user key metadata (UserKey objects) from the Legacy SDK's repository to the new storage system, ensuring continuity of device bindings.
Step 2 - Application PIN Keys: Migrates application PIN keys from the Legacy SDK's encrypted SharedPreferences to the new DataStore-based storage with BouncyCastle encryption.
Usage
Automatic migration (recommended):
// Migration starts automatically when the app initializes
// via MigrationInitializer in the manifestManual migration:
// Trigger migration programmatically
BindingMigration.start(context)Progress Monitoring
The migration emits progress updates through a Flow that can be observed:
com.pingidentity.migration.MigrationProgress.Started: Migration has begun
com.pingidentity.migration.MigrationProgress.InProgress: Step is executing
com.pingidentity.migration.MigrationProgress.StepCompleted: Step finished successfully
com.pingidentity.migration.MigrationProgress.Success: All steps completed
com.pingidentity.migration.MigrationProgress.Error: Migration failed