FlutterGuard CLI is a static analysis tool for Flutter Android APKs. It extracts security-relevant signals from application binaries and produces a structured report that can be used by engineering, security, compliance, and audit teams.
The tool is designed to be practical in real workflows:
- Local-first analysis
- Deterministic output location and structure
- Optional AI summary generation for risk triage
- Suitable for manual review, CI, and downstream automation
- What It Analyzes
- Installation
- Quick Start
- Command Reference
- AI Remediation and OpenRouter
- Output Structure and Expected Results
- Common Workflows
- Error Handling and Troubleshooting
- Development
- Contributing
- License
FlutterGuard performs static APK analysis and reports findings across:
- Application metadata (package name, version, SDK targets)
- Permissions and dangerous permission counts
- URLs, domains, API endpoints, and network behavior hints
- Hardcoded keys/secrets and configuration artifacts
- Third-party packages, services, and SDK privacy impact indicators
- Firebase and platform integration traces
- SQL and local data storage indicators
- Decompilation strategy/attempt metadata
- Extracted files and visual resources for inspection
Requirements:
- Go 1.24+
- Git
git clone https://github.com/flutterguard/flutterguard-cli.git
cd flutterguard-cli
go build -o build/flutterguard-cli .
./build/flutterguard-cli --versionLinux/macOS:
curl -sSL https://raw.githubusercontent.com/flutterguard/flutterguard-cli/main/install.sh | bashWindows PowerShell:
irm https://raw.githubusercontent.com/flutterguard/flutterguard-cli/main/install.ps1 | iexFlutterGuard works without external tooling, but these can enrich analysis quality:
aapt2for richer APK metadata extractionjadxfor improved decompilation in some casesopensslfor certificate inspection details
Run analysis for an APK:
flutterguard-cli --apk app-release.apk --outDir ./resultsIf --outDir is omitted, FlutterGuard writes to ./results by default.
Basic syntax:
flutterguard-cli --apk <path-to-apk> [flags]Required flag:
--apk: Path to the APK file to analyze
General flags:
--outDir: Base output directory (default:results)--verbose: Enable verbose execution output--enable-network-and-dns-checks: Enable network-backed enrichment checks--format:json|text(retained for CLI compatibility; structured report output is generated in all cases)--version: Print version and exit
AI flags:
--ai-remediation: Enable AI summary generation--ai-provider:openai|openrouter|xai|gemini|claude--ai-key: API key for selected provider (orFLUTTERGUARD_AI_KEY)--ai-baseurl: Optional custom API base URL--ai-model: Optional model override
OpenRouter is supported through an OpenAI-compatible API workflow.
export FLUTTERGUARD_AI_KEY="your_openrouter_api_key"
flutterguard-cli \
--apk "apks/app-arm64-v8a-release.apk" \
--outDir "./results" \
--ai-remediation \
--ai-provider openrouter \
--ai-baseurl "https://openrouter.ai/api/v1" \
--ai-model "openai/gpt-4o-mini" \
--verboseNotes:
- If
--ai-remediationis enabled but--ai-keyis missing, the CLI fails fast with a clear error. - Provider defaults are auto-filled when possible (
--ai-baseurland--ai-model). geminiandclaudeare accepted as provider values but currently return a not-implemented error at runtime.
For each scan, FlutterGuard creates:
results/{apk_name}/
Inside that folder:
results.json: Full machine-readable analysis reportfiles/: Extracted file artifacts (config/content/env/decompiled zip when present)resources/: Extracted visual and media resourcesai_summary.json: AI summary metadata and text (only when AI remediation is enabled)ai_summary.md: Human-readable AI summary (only when AI remediation is enabled)
Expected behavior:
- Each run resets the target
{apk_name}report folder before writing fresh results. results.jsonis always produced on successful analysis.- If AI is enabled and AI provider call fails, fallback summary content is still written, and error context is captured in
ai_summary.json.
flutterguard-cli --apk "apks/app-x86_64-release.apk" --outDir "./results"flutterguard-cli \
--apk "apks/app-arm64-v8a-release.apk" \
--outDir "./results" \
--enable-network-and-dns-checksexport FLUTTERGUARD_AI_KEY="your_openai_key"
flutterguard-cli \
--apk "apks/app-arm64-v8a-release.apk" \
--outDir "./results" \
--ai-remediation \
--ai-provider openai \
--ai-model gpt-4o-miniflutterguard-cli \
--apk "apks/app-arm64-v8a-release(1).apk" \
--outDir "./results"FlutterGuard surfaces explicit errors for common workflow issues:
- APK path does not exist
- APK path points to a directory instead of a file
- Unsupported
--ai-provider - Missing API key when
--ai-remediationis enabled - Unsupported or failing AI provider response
- File copy/write failures in output directories
Quick checks:
flutterguard-cli --version
go test ./...If you suspect stale output, remove the scan folder and rerun:
rm -rf "results/app-arm64-v8a-release"
flutterguard-cli --apk "apks/app-arm64-v8a-release.apk" --outDir "./results"Build:
go build -o build/flutterguard-cli .Test:
go test ./...Format:
gofmt -w $(find . -name '*.go' -not -path './vendor/*')Contributions are welcome. Please open an issue or pull request with:
- Clear problem statement
- Reproduction steps
- Proposed fix and rationale
- Test coverage for behavior changes
Before opening a PR:
go test ./...
go vet ./...MIT License. See LICENSE.