Skip to content
Skills Library
Security · Review & audit

android-legacy-security

/android-legacy-security

Harden Intent handling, WebView configuration, and FileProvider access in Android apps. Use when securing Intent extras, configuring WebViews, or exposing files via FileProvider; defer manifest export flags and generic Bundle typing to focused Android security guidance.

Licence
MIT
Last repository change
22.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
3
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 22.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Harden Intent handling, WebView configuration, and FileProvider access in Android apps. Use when securing Intent extras, configuring WebViews, or exposing files via FileProvider; defer manifest export flags and generic Bundle typing to focused Android security guidance.

Original author description

Harden Intent handling, WebView configuration, and FileProvider access in Android apps. Use when securing Intent extras, configuring WebViews, or exposing files via FileProvider; defer manifest export flags and generic Bundle typing to focused Android security guidance.

How it works

  1. Priority: P0 (CRITICAL)
  2. 1. Secure Intents and Components
  3. 2. Lock Down WebViews
  4. 3. Protect Storage and Files
  5. Anti-Patterns
  6. References
Original SKILL.md headings · 35 lines, 180 words
SKILL.md preview
---
name: android-legacy-security
description: Harden Intent handling, WebView configuration, and FileProvider access in Android apps. Use when securing Intent extras, configuring WebViews, or exposing files via FileProvider; defer manifest export flags and generic Bundle typing to focused Android security guidance.
metadata:
  triggers:
    files:
    - '**/*Activity.kt'
    - '**/*WebView*.kt'
    - 'AndroidManifest.xml'
    keywords:
    - Intent
    - WebView
    - FileProvider
    - javaScriptEnabled
---
# Android Legacy Security Standards

## **Priority: P0 (CRITICAL)**

## 1. Secure Intents and Components

- Set `android:exported="false"` for all internal Activities/Services unless needed for deep links.
- Verify `resolveActivity` before starting implicit intents.
- Treat all incoming Intent extras as untrusted — validate all schema/data types.

See [hardening examples](references/implementation.md) for manifest and component restrictions.

## 2. Lock Down WebViews

- Default to `javaScriptEnabled = false`. Use `WebViewClient` and `WebChromeClient` to restrict navigation.
- Disable `allowFileAccess` and `allowFileAccessFromFileURLs` to prevent local file theft via XSS.
- If using `@JavascriptInterface` (API 17+), strictly limit exposed API surface.

See [hardening examples](references/implementation.md) for WebView lockdown patterns.

## 3. Protect Storage and Files

- **NEVER expose `file://` URIs**. Use `FileProvider` to generate `content://` URIs with temporary permissions.
- Use `EncryptedSharedPreferences` for auth tokens and PII. Never use legacy public-read file modes.
- Use `NetworkSecurityConfig` to disable `cleartextTrafficPermitted` and implement certificate pinning.

## Anti-Patterns

- **No Implicit Intents Internally**: Use explicit intents with component class name.
- **No Public Read Modes**: Never expose SharedPreferences or files with global read access.

## References

- [Hardening Examples](references/implementation.md)
Files in this package (3)
  • SKILL.md 2 KB
  • evals/evals.json 3 KB
  • references/implementation.md 2 KB

Versions

The database has no other skills named android-legacy-security.

Database snapshot: 13.11.2026 · package version 5d8cc462d359 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 95android-intent-security
    Best practices for Android Intent security. Use this skill when auditing component configurations in AndroidManifest.xml activities, services, receivers) or source code handling incoming Intents (getIntent, getParcelableExtra) to prevent Intent Redirection and unauthorized access.
  • 90kotlin-android-security-privacy
    Use this skill to statically review an Android app's security and privacy posture against OWASP MASVS: exported components and intent surfaces, deep-link/App Links validation, WebView exposure, cleartext traffic and network-security-config, local storage and secrets…
  • 95android-intent-security
    Best practices for Android Intent security. Use this skill when auditing component configurations in AndroidManifest.xml activities, services, receivers) or source code handling incoming Intents (getIntent, getParcelableExtra) to prevent Intent Redirection and unauthorized access.
  • 98android-webview-app
    在本机给安卓打「WebView 壳 App」并装到真机:Gradle 构建、签名发版、file:// 路由坑、长按去浏览器感、自适应图标、本地资源打包、以及「电脑端数据热更新到手机」的模式。当要把一个 HTML 单页做成 APK、要改安卓壳的 Java、要装包到手机验证、或 APK 里出现「返回键退桌面 / 长按能选中文字 / 图标黑方块 / 图片 404 / 改了网页但装机没变」这类症状时使用。
  • 100watchdog-go-mobile-app
    On-demand mobile audit (Android/iOS/Flutter/React Native: pinning, storage, deep links, WebViews, bridges). Use for /watchdog-go-mobile-app. Defensive use only.
  • 100kotlin-security
    Kotlin application security for backend and Android: vulnerability review and secure implementation patterns. USE WHEN: securing Kotlin applications (backend/Android), reviewing code for vulnerabilities, or implementing security best practices DO NOT USE FOR: code quality issues…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.