android-native
БесплатноБез исполняемых скриптовНе проверенAndroid native platform APIs beyond UI: Activity/Fragment lifecycle, Android Keystore (hardware-backed key storage), BiometricPrompt…
от claude-dev-suite★ 51 звезда на GitHubОб этом скилле
Android Native Platform APIs
References: keystore-biometric.md for Keystore (KeyGenParameterSpec, StrongBox, attestation), BiometricPrompt with crypto object binding, EncryptedSharedPreferences, certificate pinning. nfc-services.md for NFC (NDEF reading/writing, HCE for payment-style apps), Foreground Services, WorkManager.
Deep Knowledge: Use
mcp__documentation__fetch_docswith technology:android.
Activity Lifecycle (Modern)
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
enableEdgeToEdge()
setContent { App() }
lifecycleScope.launch {
repeatOnLifecycle(Lifecycle.State.STARTED) {
viewModel.events.collect { handle(it) }
}
}
}
}
Key callbacks (rarely overridden in Compose-first apps):
onCreate(savedInstanceState)— initial setuponStart/onStop— visible/invisibleonResume/onPause— focused/unfocusedonDestroy— final cleanuponSaveInstanceState(outState)— survive process death
For Compose: prefer LifecycleResumeEffect, LifecycleEventEffect over manual lifecycle observers.
Permissions
AndroidManifest.xml:
<manifest>
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.USE_BIOMETRIC" />
<uses-permission android:name="android.permission.NFC" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-feature android:name="android.hardware.camera" android:required="false" />
</manifest>
Runtime requests via Activity Result Contracts (see mobile/jetpack-compose/quick-ref/interop.md).
Android Keystore (Hardware-Backed Keys)
The Android Keystore stores cryptographic keys in a container that prevents extraction from the device. On supported hardware (StrongBox-equipped devices), keys live in a tamper-resistant secure element.
Generate AES key for symmetric encryption
fun generateAesKey(alias: String, requireAuth: Boolean = false): SecretKey {
val keyGen = KeyGenerator.getInstance(KeyProperties.KEY_ALGORITHM_AES, "AndroidKeyStore")
val spec = KeyGenParameterSpec.Builder(
alias,
KeyProperties.PURPOSE_ENCRYPT or KeyProperties.PURPOSE_DECRYPT,
)
.setBlockModes(KeyProperties.BLOCK_MODE_GCM)
.setEncryptionPaddings(KeyProperties.ENCRYPTION_PADDING_NONE)
.setKeySize(256)
.setUserAuthenticationRequired(requireAuth) // gate by biometric
.setUserAuthenticationParameters(
0, // 0 = each use
KeyProperties.AUTH_BIOMETRIC_STRONG,
)
.setIsStrongBoxBacked(true) // hardware secure element
.setRandomizedEncryptionRequired(true)
.build()
keyGen.init(spec)
return keyGen.generateKey()
}
Encrypt / Decrypt with GCM
fun encryptAesGcm(alias: String, plaintext: ByteArray): ByteArray {
val key = (KeyStore.getInstance("AndroidKeyStore").apply { load(null) }
.getEntry(alias, null) as KeyStore.SecretKeyEntry).secretKey
val cipher = Cipher.getInstance("AES/GCM/NoPadding")
cipher.init(Cipher.ENCRYPT_MODE, key)
val iv = cipher.iv // 12 bytes for GCM
val ciphertext = cipher.doFinal(plaintext)
return iv + ciphertext // prepend IV
}
fun decryptAesGcm(alias: String, blob: ByteArray): ByteArray {
val key = (KeyStore.getInstance("AndroidKeyStore").apply { load(null) }
.getEntry(alias, null) as KeyStore.SecretKeyEntry).secretKey
val iv = blob.sliceArray(0..11)
val ciphertext = blob.sliceArray(12 until blob.size)
val cipher = Cipher.getInstance("AES/GCM/NoPadding")
cipher.init(Cipher.DECRYPT_MODE, key, GCMParameterSpec(128, iv))
return cipher.doFinal(ciphertext)
}
Generate EC key for signing
fun generateSigningKey(alias: String, requireAuth: Boolean = true): KeyPair {
val keyGen = KeyPairGenerator.getInstance(KeyProperties.KEY_ALGORITHM_EC, "AndroidKeyStore")
val spec = KeyGenParameterSpec.Builder(
alias,
KeyProperties.PURPOSE_SIGN or KeyProperties.PURPOSE_VERIFY,
)
.setAlgorithmParameterSpec(ECGenParameterSpec("secp256r1")) // P-256
.setDigests(KeyProperties.DIGEST_SHA256)
.setUserAuthenticationRequired(requireAuth)
.setIsStrongBoxBacked(true)
.setAttestationChallenge("challenge-bytes".toByteArray()) // for remote attestation
.build()
keyGen.initialize(spec)
return keyGen.generateKeyPair()
}
For wallet apps: Keystore P-256 keys are NOT secp256k1 (Bitcoin) — use Keystore for WRA
Установить android-native в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadGrepGlobWriteEditВложенные файлы
FAQ
Что делает скилл android-native?
Android native platform APIs beyond UI: Activity/Fragment lifecycle, Android Keystore (hardware-backed key storage), BiometricPrompt, EncryptedSharedPreferences, WorkManager, NFC (NDEF + HCE), Foreground Services, broadcast receivers, ContentProviders, Intents, FileProvider, App Links, ProGuard/R8 rules, permissions model. USE WHEN: user mentions "Android Keystore", "KeyGenParameterSpec", "BiometricPrompt", "EncryptedSharedPreferences", "WorkManager", "NFC", "HCE", "Foreground Service", "BroadcastReceiver", "ContentProvider", "App Links", "FileProvider", "ProGuard", "R8", "Activity lifecycle" DO NOT USE FOR: UI with Jetpack Compose - use `mobile/jetpack-compose` DO NOT USE FOR: Kotlin language patterns - use `languages/kotlin` DO NOT USE FOR: KMP setup - use `mobile/kotlin-multiplatform` DO NOT USE FOR: SQLCipher - use `databases/sqlcipher`
Как установить скилл android-native?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл android-native запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
frontend-design
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making…
от Anthropicwebapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing…
от Anthropicbrand-guidelines
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand…
от Anthropicweb-artifacts-builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use…
от Anthropic