aibot88/sec_skill_store/android-security
Claude Code and agent skill by aibot88/sec_skill_store
- community
Checking that the SKILL.md file is still in the repository.
Android security fundamentals: encrypted storage (EncryptedSharedPreferences, EncryptedFile), biometric authentication (BiometricPrompt, Credential Manager), network certificate pinning, SafetyNet/Play Integrity API, KeyStore-backed key generation, and secure data handling patterns. Use this when: storing sensitive data locally, implementing biometric login, pinning TLS certificates, protecting API keys, integrating Play Integrity attestation, generating cryptographic keys in Android KeyStore,…
Install
npx vskill@latest install aibot88/sec_skill_store/android-securitySKILL.md
The same SKILL.md was published earlier as aibot88/sec_skill_store/android-security.
Lineage: Built upon and expanded from the official Android group skills repository atgithub.com/android/skills. That repo covers areas whereevaluations show LLMs underperform on standard Android patterns. This skill extends thatfoundation into Android security patterns — an area the official set does not cover.
Overview
Android security mistakes cluster around three areas:
- Storage: plaintext SharedPreferences for tokens/keys
- Authentication: rolling custom biometric flows instead of using platform APIs
- Network: missing or mis-implemented certificate pinning
This skill covers the correct platform-provided solution for each.
Encrypted Storage
EncryptedSharedPreferences
Use exactly like SharedPreferences — the encryption is transparent:
Never store tokens in regular SharedPreferences — the file is readable on rooted devices and in ADB backups if android:allowBackup="true".
EncryptedFile
For encrypting arbitrary files (e.g., exported data, cached sensitive content):
Android KeyStore — Cryptographic Keys
Generate keys that never leave the secure hardware enclave:
Biometric Authentication
BiometricPrompt (Activity/Fragment)
Check availability before showing the prompt:
Credential Manager (Passkeys + Biometric, API 34+)
For passkey/FIDO2 flows on Android 14+:
Certificate Pinning (OkHttp)
Pin by certificate public key hash, not the leaf certificate (leaf rotates; public key stays stable):
Always pin at least 2 keys: the current leaf and an intermediate/backup. If you pin only the leaf and it rotates before you ship an update, all existing installs are bricked.
Network Security Config
Restrict cleartext traffic and add certificate trust anchors declaratively:
Play Integrity API
Attest that the app is genuine and running on an unmodified device:
The token is verified server-side via the Play Integrity API — never trust the device's own assertion of its integrity.
Secrets — Never in Code or Resources
API keys, client secrets, and tokens must never appear in:
- Source files (hardcoded strings)
res/values/strings.xmllocal.propertiescommitted to gitBuildConfigfields generated fromlocal.properties(visible in APK)
Safe approaches:
- Runtime fetch: retrieve from your backend after authentication
- Android KeyStore: generate keys on device, never transmit secrets
- Secrets Gradle Plugin: obfuscates BuildConfig fields (raises the bar, not a security guarantee)
ProGuard / R8 Rules for Security Libraries
Anti-Patterns
| Symptom | Root cause | Fix | |
|---|---|---|---|
KeyStoreException: Invalid key after app update | setUserAuthenticationRequired(true) key invalidated on biometric enrollment change | Catch UserNotAuthenticatedException, re-prompt, retry | |
| Biometric prompt doesn't appear | setNegativeButtonText missing for BIOMETRIC_STRONG without DEVICE_CREDENTIAL | Either add negative button or add DEVICE_CREDENTIAL to allowed authenticators | |
| Certificate pinning breaks in production | Pinned leaf cert rotated | Always pin intermediate CA as backup; monitor cert expiry | |
EncryptedSharedPreferences crash on first run | MasterKey not initialized before prefs creation | MasterKey.Builder call must precede EncryptedSharedPreferences.create | |
android:allowBackup="true" leaks prefs | ADB backup captures shared_prefs/ | Set android:allowBackup="false" or use backup rules to exclude sensitive files | |
Play Integrity fails with APP_NOT_INSTALLED | Sideloaded or from unknown source | Expected for dev; in prod, ensure distribution via Play Store |
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/claudskills/android-security/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/aibot88/sec_skill_store/android-security)