Mobile Security
Priority: P0 (CRITICAL)
Implementation Workflow
- Store secrets securely — Use
flutter_secure_storagefor tokens/PII. Never useshared_preferencesfor sensitive data. - Externalize secrets — Never store API keys in Dart code. Use
--dart-defineor.envfiles. - Obfuscate releases — Build
--obfuscate --split-debug-info=./symbols. Deterrent only — move sensitive logic to backend. - Pin certificates —
dio_certificate_pinningfor high-security apps to prevent MITM. - Root detection —
flutter_jailbreak_detectionfor root/jailbreak checks in financial/sensitive apps. - Mask PII — Redact PII (email, phone) from all logs and analytics.
Secure Storage & Release Build Examples
See implementation examples for secure storage usage and obfuscated release build commands.
Reference & Examples
SSL Pinning & Secure Storage: references/REFERENCE.md.
Anti-Patterns
- No Secrets in SharedPreferences: Use
flutter_secure_storagefor tokens and PII - No Hardcoded API Keys: Use
--dart-defineor secure vaults for all secrets - No Unobfuscated Releases: Always build with
--obfuscate --split-debug-info - No PII in Logs: Mask or omit sensitive data from all logs and analytics events
Related Topics
common/security-standards | layer-based-clean-architecture | performance