Skip to content

flutterguard/flutterguard-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

32 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