EN | RU
flutter_secure_storage_aurora
Original README
Description
A Flutter plugin for secure storage of sensitive data on Aurora OS. This plugin provides AES-encrypted storage with flexible directory options and implements the flutter_secure_storage platform interface.
❗ ️Warning❗ ️
In version 5.4.0, the default storage location was changed from AuroraStorageDirectory.cache to AuroraStorageDirectory.documents. This change leads to the unavailability of the previous private storage. It is solved by manually migrating the storage file or changing the storage location using setStorageDirectory.
Usage example:
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
import 'package:flutter_secure_storage_aurora/flutter_secure_storage_aurora.dart';
// Set encryption secret key (required)
FlutterSecureStorageAurora.setSecret('your-secret-key-here');
// Optionally set custom storage directory (defaults to support)
FlutterSecureStorageAurora.setStorageDirectory(AuroraStorageDirectory.documents);
// Use standard flutter_secure_storage API
final storage = FlutterSecureStorage();
// Write encrypted data
await storage.write(key: 'auth_token', value: 'user_token_here');
// Read encrypted data
String? token = await storage.read(key: 'auth_token');
// Check if key exists
bool exists = await storage.containsKey(key: 'auth_token');
// Delete specific key
await storage.delete(key: 'auth_token');
// Delete all data
await storage.deleteAll();
// Read all stored data
Map<String, String> allData = await storage.readAll();
Contents
- Installation and build
- Detailed description
- Compatibility
- Terms of use and participation in development
Installation and build
Add the plugin to your target application dependencies in the pubspec.yaml file:
dependencies:
flutter_secure_storage: ^9.0.0
flutter_secure_storage_aurora:
git:
url:https://developer.auroraos.ru/git/flutter/flutter-community-plugins/flutter_secure_storage_aurora.git
Detailed description
Static Methods
FlutterSecureStorageAurora.setSecret(String secret)
Sets the encryption secret key. Required before using the storage.
FlutterSecureStorageAurora.setSecret('your-32-character-secret-key');
FlutterSecureStorageAurora.setStorageDirectory(AuroraStorageDirectory directory)
Sets the default storage directory for all operations.
FlutterSecureStorageAurora.setStorageDirectory(AuroraStorageDirectory.documents);
FlutterSecureStorageAurora.getCurrentStorageDirectory()
Returns the currently configured storage directory.
Per-Operation Configuration
You can override the default storage directory for specific operations:
await storage.write(
key: 'temp_data',
value: 'temporary_value',
options: {'auroraStorageDirectory': 'cache'},
);
Storage Directories
| Directory | Purpose | Enum Value |
|---|---|---|
| Support | Persistent app data (default) | AuroraStorageDirectory.support |
| Documents | User-generated documents | AuroraStorageDirectory.documents |
| Cache | Temporary cached data | AuroraStorageDirectory.cache |
| Temporary | System-cleared temporary data | AuroraStorageDirectory.temporary |
| Downloads | User downloads | AuroraStorageDirectory.downloads |
Compatibility
The plugin works correctly starting from Aurora OS version 5.0.0.
Terms of Use and Participation
The project source code is provided under the license that allows its use in third-party applications.
To participate in project development, please read the contributor agreement. If you plan to contribute your own source code to the project, you will need to accept the CLA agreement.
For information about contributors see AUTHORS.
Code of conduct is a current set of rules of the Open Mobile Platform which informs you how we expect the members of the community will interact while contributing and communicating.