Skip to content

flutterguard/flutterguard-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

29 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

FlutterGuard CLI πŸ”

FlutterGuard Logo

A powerful command-line tool for analyzing Flutter Android apps to discover security issues, secrets, API endpoints, and more. FlutterGuard runs completely offline on your machineβ€”no cloud services, no tracking, just local analysis.

What It Does

FlutterGuard CLI analyzes Flutter app APK files and extracts:

  • πŸ”‘ Secrets & API Keys β€” Finds hardcoded passwords, tokens, and credentials
  • 🌐 Network Details β€” Extracts URLs, domains, API endpoints, and Firebase configs
  • πŸ“¦ Dependencies β€” Lists all Flutter packages with direct links to pub.dev
  • πŸ“‹ App Metadata β€” Package name, version, SDK info, and permissions
  • πŸ” Third-Party Services β€” Detects bundled SDKs, CDNs, and analytics libraries
  • πŸ“œ Certificate Info β€” Analyzes signing certificates and flags self-signed ones
  • πŸ“ Complete Breakdown β€” Organized assets, resources, and full decompiled source code

Installation

Quick Install (Recommended)

One-line install for Linux/macOS:

curl -sSL https://raw.githubusercontent.com/flutterguard/flutterguard-cli/main/install.sh | bash

One-line install for Windows (PowerShell):

irm https://raw.githubusercontent.com/flutterguard/flutterguard-cli/main/install.ps1 | iex

The script will automatically detect your OS/architecture, download the latest release, and install it to your PATH.


Manual Installation

Option 1: Download Pre-Built Binary

Step 1: Download from Releases:

Platform Download Link
Linux (x64) flutterguard-cli-linux-amd64
Linux (ARM64) flutterguard-cli-linux-arm64
macOS (Intel) flutterguard-cli-darwin-amd64
macOS (Apple Silicon) flutterguard-cli-darwin-arm64
Windows (x64) flutterguard-cli-windows-amd64.exe

Step 2: Install it on your system:

Linux/macOS:

# Make executable
chmod +x flutterguard-cli-*

# Install to PATH
sudo mv flutterguard-cli-* /usr/local/bin/flutterguard-cli

# Verify
flutterguard-cli --version

Windows:

  1. Rename the downloaded file to flutterguard-cli.exe
  2. Move it to a directory in your PATH (e.g., C:\Windows\System32)
  3. Or keep it anywhere and add that directory to your PATH
# Verify
flutterguard-cli.exe --version
Option 2: Build From Source

Requirements:

Steps:

# Clone the repository
git clone https://github.com/flutterguard/flutterguard-cli.git
cd flutterguard-cli

# Build
go build -o flutterguard-cli

# Install (optional)
sudo mv flutterguard-cli /usr/local/bin/

# Verify
flutterguard-cli --version
Option 3: Package Managers (Coming Soon)

We're working on adding support for popular package managers:

  • Homebrew (macOS/Linux): brew install flutterguard-cli
  • Snap (Linux): snap install flutterguard-cli
  • Chocolatey (Windows): choco install flutterguard-cli
  • AUR (Arch Linux): yay -S flutterguard-cli
  • Scoop (Windows): scoop install flutterguard-cli

Stay tuned for updates!

Optional Tools for Enhanced Analysis

FlutterGuard works standalone, but these tools provide richer analysis:

  • AAPT2 β€” Enhanced APK metadata extraction
    • Linux: sudo apt install aapt
    • macOS: Included with Android SDK
    • Windows: Download from Android SDK
  • JADX β€” Advanced Java decompilation
  • OpenSSL β€” Detailed certificate inspection (usually pre-installed on Linux/macOS)

Usage

Basic Analysis

Analyze a Flutter app APK and save organized results to a directory:

flutterguard-cli --apk app.apk --outDir ./results

This creates a folder named after the app's package (e.g., results/com.example.app/) containing all findings, assets, and decompiled code.

Show Progress

Add --verbose to see real-time progress updates:

flutterguard-cli --apk app.apk --outDir ./results --verbose

Output Formats

JSON format (default, good for automation):

flutterguard-cli --apk app.apk --format json

Text format (human-readable summary):

flutterguard-cli --apk app.apk --format text

Structured directory (most comprehensive):

flutterguard-cli --apk app.apk --outDir ~/my-analysis

Network Features (Opt-In)

By default, FlutterGuard runs completely offline. Enable network features for:

  • Domain DNS validation
  • pub.dev package information enrichment
flutterguard-cli --apk app.apk --outDir ./results --enable-network-and-dns-checks

Output Structure

When using --outDir, FlutterGuard creates an organized directory structure:

results/
└── com.example.app/
    β”œβ”€β”€ summary.md               ← Start here! Overview with clickable links
    β”œβ”€β”€ analysis.json            ← Full structured data (JSON)
    β”œβ”€β”€ emails.txt               ← Email addresses found
    β”œβ”€β”€ domains.txt              ← Domain names and hosts
    β”œβ”€β”€ urls.txt                 ← All URLs discovered
    β”œβ”€β”€ api_endpoints.txt        ← API endpoints with HTTP methods
    β”œβ”€β”€ packages.txt             ← Flutter packages with pub.dev links
    β”œβ”€β”€ permissions.txt          ← Android permissions (⚠️ = dangerous)
    β”œβ”€β”€ services.txt             ← Third-party SDKs detected
    β”œβ”€β”€ hardcoded_keys.txt       ← Potential secrets and API keys
    β”œβ”€β”€ assets/                  ← App resources by file type
    β”‚   β”œβ”€β”€ json/
    β”‚   β”œβ”€β”€ png/
    β”‚   β”œβ”€β”€ xml/
    β”‚   β”œβ”€β”€ ttf/
    β”‚   └── ...
    └── decompiled/              ← Complete APK contents
        β”œβ”€β”€ AndroidManifest.xml
        β”œβ”€β”€ classes.dex
        β”œβ”€β”€ lib/                 ← Native libraries (.so files)
        β”œβ”€β”€ res/                 ← App resources
        β”œβ”€β”€ assets/              ← Embedded assets
        └── META-INF/            ← Signing certificates

Tip: Open summary.md in any markdown viewerβ€”it includes a table of contents with links to all findings.

Why Go instead of Dart?

FlutterGuard is written in Go rather than Dart because:

  • Single Compiled Binary: Users get a standalone executable with zero dependenciesβ€”just download and run, no runtime required.
  • Cross-Platform Distribution: Go compiles easily to Windows, macOS, and Linux with a single codebase, making it simpler for users across different systems.
  • Performance: Go offers native compilation speed and efficiency ideal for analyzing large APK files and intensive security scanning operations.
  • CLI Excellence: Go is purpose-built for command-line tools with strong standard library support for file I/O, process execution, and signal handling.
  • Ecosystem: Direct access to powerful tools like JADX and aapt2 without the overhead of a UI framework designed for mobile apps.

While Dart excels at building Flutter mobile and web apps, Go is the better choice for a developer tool that needs to be lightweight, fast, and dependency-free.

Contributing

Contributions are welcome! Whether it's bug fixes, new features, or documentation improvements.

Development Setup

# Fork and clone the repository
git clone https://github.com/YOUR_USERNAME/flutterguard-cli.git
cd flutterguard-cli

# Download dependencies
go mod download

# Build the project
go build -o build/flutterguard-cli

# Run tests
go test ./...

Areas for Contribution

  • πŸ” New detection patterns for secrets and suspicious code
  • πŸ› οΈ Integration with additional analysis tools
  • πŸ“Š New report formats (HTML, PDF, CSV)
  • πŸ› Bug fixes and performance improvements
  • πŸ“š Documentation and examples
  • 🌍 Internationalization support

Submitting Changes

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes with clear commit messages
  4. Add tests for new functionality
  5. Run go test ./... and go vet ./...
  6. Submit a pull request with a clear description

Code Guidelines

  • Follow standard Go formatting (gofmt, go vet)
  • Use descriptive names for functions and variables
  • Comment exported functions and complex logic
  • Keep functions focused and reasonably sized
  • Write tests for new features

Reporting Issues

Found a bug? Open an issue with:

  • Description of what you tried to do
  • What happened vs. what you expected
  • Your OS, Go version, and FlutterGuard version
  • Steps to reproduce (if possible)

License

MIT License - see the LICENSE file for details.

Acknowledgments

  • JADX - Dex to Java decompiler
  • Cobra - CLI framework
  • Android SDK Tools - APK analysis utilities

Built for the Flutter and Android security community