security
Skill15 starsChanged 9 months agoMITView on GitHub
Android app security for AI agents. Use this skill whenever implementing secure data storage, EncryptedSharedPreferences, EncryptedFile, Android Keystore, ProGuard/R8 code obfuscation, certificate pinning, network security config, root detection, SSL/TLS, token storage, preventing reverse engineering, securing API keys, BuildConfig secrets, environment variables, cleartext traffic, backup rules, screenshot prevention, overlay attack prevention, or any Android security hardening. Always apply when handling user credentials, payments, or PII.
- Reads credentials
78 other projects use a version of this.
Adopted by
Most recently taken up by
- AllThingsSmitty/proven-skillstheir own version, first seen Oct 6, 2026
- MarvelCollin/agent-skillstheir own version, first seen Oct 5, 2026
- muon-m2/magento2-toolstheir own version, first seen Oct 4, 2026
- flavien-ia/hypervibe-harnesstheir own version, first seen Oct 4, 2026
- AIBiz-Automatyzacje/claude-code-startertheir own version, first seen Oct 4, 2026
- lgzarturo/codeconductortheir own version, first seen Sep 30, 2026
Used with
Projects with it also use cost-reducer, trigger-dev and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
daianepepes-labSkillcost-reducer
Analyze and reduce costs across cloud infrastructure, code, and services. Use when asked to cut costs, optimize spending, reduce bills, or improve cost efficiency.
Also in 5 projects that use this
xfstudioSkilltrigger-dev
Trigger.dev expert for background jobs, AI workflows, and reliable async execution with excellent developer experience and TypeScript-first design. Use when: trigger.dev, trigger dev, background task, ai background job, long running task.
Also in 4 projects that use this
ffsshhttiikkSkillscalability
Core foundational concepts and principles for Scalability
Also in 4 projects that use this
daianepepes-labSkillself-healing
Detect, diagnose, and automatically fix recurring errors, memory issues, and system degradation. Use when a system has recurring failures, memory leaks, performance degradation, or needs automatic recovery mechanisms.
Also in 5 projects that use this
xfstudioSkillcustomer-support
Elite AI-powered customer support specialist mastering
Also in 4 projects that use this
ffsshhttiikkSkillcicd
Continuous integration and delivery pipelines
Also in 4 projects that use this
- +1 more from daianepepes-lab
Other versions78 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 78
- parcadei/Continuous-Claude-v3★ 3.9ksame name
- BankrBot/skills★ 1.2ksame name
- rshankras/claude-code-apple-skills★ 777same name
- alinaqi/maggy★ 707same name
- boshu2/agentops★ 447same name
- notque/vexjoy-agent★ 424same name
- nth5693/gemini-kit★ 373same name
- telagod/code-abyss★ 242same name
- garagon/nanostack★ 207same name
- TheBeardedBearSAS/claude-craft★ 106same name
68 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository27 other files it gives its agents.
- AGENTS.mdAGENTS.md
- accessibilitySkill
- adaptive-uiSkill
- android-architectureSkill
- android-setupSkill
- android-testingSkill
- biometricsSkill
- ci-cd-androidSkill
- compose-animationSkill
- compose-navigationSkill
- compose-uiSkill
- datastoreSkill
- design-systemSkill
- design-tokensSkill
- firebaseSkill
- gradleSkill
- hilt-diSkill
- kotlin-patternsSkill
- material3Skill
- notificationsSkill
- offline-firstSkill
- performanceSkill
- permissionsSkill
- play-store-releaseSkill
- retrofitSkill
- room-databaseSkill
- supabase-androidSkill
The file
Files
Android Security
Rule 1: Never store secrets in source code or BuildConfig
// ❌ Never — committed to git, visible in APK
const val API_KEY = "sk-1234567890abcdef"
buildConfigField("String", "API_KEY", "\"sk-1234567890abcdef\"")
// ✅ Use local.properties (gitignored) + build script injection
// local.properties (never commit this file)
// API_KEY=sk-1234567890abcdef
// build.gradle.kts
val apiKey = gradleLocalProperties(rootDir, providers).getProperty("API_KEY") ?: ""
buildConfigField("String", "API_KEY", "\"$apiKey\"")
// ✅ Better: use server-side proxy — never expose API keys in app at all
// Client → Your backend → Third-party APIRule 2: Encrypted storage for sensitive data
// ✅ EncryptedSharedPreferences for tokens, session data
class SecureStorageImpl @Inject constructor(
@ApplicationContext context: Context
) : SecureStorage {
private val masterKey = MasterKey.Builder(context)
.setKeyScheme(MasterKey.KeyScheme.AES256_GCM)
.build()
private val encryptedPrefs = EncryptedSharedPreferences.create(
context,
"secure_prefs",
masterKey,
EncryptedSharedPreferences.PrefKeyEncryptionScheme.AES256_SIV,
EncryptedSharedPreferences.PrefValueEncryptionScheme.AES256_GCM
)
override fun saveToken(token: String) {
encryptedPrefs.edit().putString("auth_token", token).apply()
}
override fun getToken(): String? = encryptedPrefs.getString("auth_token", null)
override fun clearAll() = encryptedPrefs.edit().clear().apply()
}Rule 3: Network Security Config
<!-- res/xml/network_security_config.xml -->
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<!-- Block all cleartext traffic in production -->
<base-config cleartextTrafficPermitted="false">
<trust-anchors>
<certificates src="system" />
</trust-anchors>
</base-config>
<!-- Allow cleartext only for debug -->
<debug-overrides>
<trust-anchors>
<certificates src="system" />
<certificates src="user" /> <!-- allow Charles/mitmproxy in debug -->
</trust-anchors>
</debug-overrides>
</network-security-config><!-- AndroidManifest.xml -->
<application
android:networkSecurityConfig="@xml/network_security_config"
android:usesCleartextTraffic="false">Rule 4: Certificate pinning
// ✅ OkHttp certificate pinning for high-security apps
val certificatePinner = CertificatePinner.Builder()
.add("api.myapp.com", "sha256/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=") // leaf
.add("api.myapp.com", "sha256/BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB=") // backup
.build()
OkHttpClient.Builder()
.certificatePinner(certificatePinner)
.build()Rule 5: Prevent screenshots and screen recording
// ✅ Prevent screenshots on sensitive screens (banking, passwords)
@Composable
fun SecureScreen(content: @Composable () -> Unit) {
val activity = LocalContext.current as? Activity
DisposableEffect(Unit) {
activity?.window?.addFlags(WindowManager.LayoutParams.FLAG_SECURE)
onDispose {
activity?.window?.clearFlags(WindowManager.LayoutParams.FLAG_SECURE)
}
}
content()
}Rule 6: Backup rules — exclude sensitive files
<!-- res/xml/backup_rules.xml -->
<?xml version="1.0" encoding="utf-8"?>
<full-backup-content>
<exclude domain="sharedpref" path="secure_prefs.xml" />
<exclude domain="database" path="app_database" />
<exclude domain="file" path="." />
</full-backup-content>
<!-- AndroidManifest.xml -->
<application
android:allowBackup="false"
android:dataExtractionRules="@xml/backup_rules">Common Mistakes
❌ Storing tokens in plain SharedPreferences — use EncryptedSharedPreferences
❌ API keys in BuildConfig — visible by decompiling APK
❌ android:allowBackup="true" without backup rules — sensitive DB backed up to Google
❌ android:usesCleartextTraffic="true" in production — all traffic unencrypted
❌ Logging tokens or PII in debug — Log.d("token", userToken) visible in logcat
❌ No root detection for banking/payment apps — use Play Integrity API
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

