android-security

Implement encrypted storage, biometric authentication, and TLS pinning for Android apps.

8|1|Updated Mar 30, 2026
One-click install
npx skills add https://github.com/drewid74/ai_skills --skill android-security-drewid74
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: android-security
Source: https://github.com/drewid74/ai_skills/tree/main/android-security
Command: npx skills add https://github.com/drewid74/ai_skills --skill android-security-drewid74

SYSTEM DOCUMENTATION & REQUIREMENTS

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.

Frequently Asked Questions about android-security

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement encrypted local storage in Android for sensitive data?

To implement encrypted local storage in Android, use EncryptedSharedPreferences for key/value pairs and EncryptedFile for sensitive files. Both utilize Android KeyStore-backed key generation to ensure data at rest remains cryptographically secure.

How do I set up biometric login using BiometricPrompt and passkeys?

Biometric login and passkey flows are implemented using BiometricPrompt and Credential Manager. These platform APIs handle secure user authentication by leveraging device biometrics and modern passkey standards without exposing raw secrets.

What is the best way to prevent MITM attacks with OkHttp certificate pinning?

Prevent MITM attacks with OkHttp certificate pinning by configuring OkHttp CertificatePinner or applying declarative Network Security Config. These methods harden network trust by restricting trusted TLS certificates for API clients.

How do I verify app authenticity with the Play Integrity API in production?

Verify app authenticity in production by integrating the Play Integrity API to request and verify server-validated attestation tokens. This confirms your app is genuine, unmodified, and installed from a trusted source.

How do I generate non-exportable keys using the Android Keystore?

Generate non-exportable cryptographic keys using the Android Keystore. It securely manages key generation and storage within the device's hardware-backed trusted execution environment, preventing key extraction.

How do I prevent secrets leakage when using R8 ProGuard?

Prevent secrets leakage during code shrinking by tuning R8 ProGuard rules specifically for security libraries. Proper configuration ensures cryptographic implementations and key management logic remain intact without exposing sensitive data.