What problem does it solve?
Prevents common Android security failures that expose sensitive data, break authentication, or allow network interception by replacing ad-hoc implementations with correct platform-provided cryptography and security primitives.
Core Features & Use Cases
- Encrypted storage: Securely store secrets using EncryptedSharedPreferences for key/value data and EncryptedFile for sensitive files (like exported data or protected caches).
- Strong authentication: Implement biometric login using BiometricPrompt and support modern passkeys/biometrics flows with Credential Manager.
- Network protection: Reduce MITM risk with OkHttp certificate pinning and optional declarative hardening using Network Security Config.
- Integrity & key management: Use Android KeyStore for non-exportable key generation and integrate Play Integrity API to attest app authenticity, plus practical guidance for avoiding secrets leakage and tuning R8/ProGuard for security libraries.
Quick Start
Use android-security to design secure local storage, biometric/passkey authentication, and TLS hardening for your Android app while generating KeyStore-backed keys and adding Play Integrity verification where needed.