|
1 | | -# FlutterGuard CLI 🔍 |
| 1 | +# FlutterGuard CLI |
2 | 2 |
|
3 | | -<div align="center"> |
4 | | - <img src="https://flutterguard.dev/logo.png" alt="FlutterGuard Logo" width="200" height="200"> |
5 | | -</div> |
| 3 | +**FlutterGuard CLI** is a professional, AI-powered command-line utility for comprehensive security and compliance analysis of Flutter Android applications. Designed for engineering teams, security professionals, and agencies, FlutterGuard delivers actionable, human-quality remediation guidance and compliance insights for every scan finding. |
6 | 4 |
|
7 | | -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. |
| 5 | +## Key Features |
8 | 6 |
|
9 | | -## What It Does |
| 7 | +- **AI-Powered Remediation**: Integrates with leading AI providers (OpenAI, Gemini, Claude, xAI, and more) to generate professional, actionable remediation steps and compliance explanations for every security or privacy finding. |
| 8 | +- **Comprehensive Static Analysis**: Detects hardcoded secrets, API endpoints, permissions, SDKs, third-party services, and more. |
| 9 | +- **Privacy & Compliance Checks**: Flags risks related to GDPR, COPPA, Play Store, and other regulatory requirements, with clear, human-readable explanations. |
| 10 | +- **CI/CD Integration**: Ready for automation in pipelines, with structured output and machine-readable formats. |
| 11 | +- **Professional Reports**: Generates detailed Markdown and JSON reports suitable for audits, client delivery, and internal review. |
| 12 | +- **Offline-First**: All analysis runs locally by default. No data is sent to the cloud unless you explicitly enable AI or network features. |
10 | 13 |
|
11 | | -FlutterGuard CLI analyzes Flutter app APK files and extracts: |
| 14 | +--- |
| 15 | + |
| 16 | +## AI Setup and Usage |
| 17 | + |
| 18 | +FlutterGuard CLI supports multiple AI providers for remediation and compliance guidance. You can configure the AI engine via environment variables or CLI flags. |
| 19 | + |
| 20 | +### Supported Providers |
| 21 | + |
| 22 | +- OpenAI |
| 23 | +- Google Gemini |
| 24 | +- Anthropic Claude |
| 25 | +- xAI |
| 26 | +- OpenRouter |
| 27 | + |
| 28 | +### Configuration |
| 29 | + |
| 30 | +Set the following environment variables or use equivalent CLI flags: |
| 31 | + |
| 32 | +- `FLUTTERGUARD_AI_ENABLED=1` — Enable AI-powered remediation |
| 33 | +- `FLUTTERGUARD_AI_PROVIDER=openai|gemini|claude|xai|openrouter` — Select provider |
| 34 | +- `FLUTTERGUARD_AI_KEY=...` — API key for the selected provider |
| 35 | +- `FLUTTERGUARD_AI_BASEURL=...` — (Optional) Custom API endpoint |
| 36 | + |
| 37 | +**Example:** |
| 38 | + |
| 39 | +```bash |
| 40 | +export FLUTTERGUARD_AI_ENABLED=1 |
| 41 | +export FLUTTERGUARD_AI_PROVIDER=openai |
| 42 | +export FLUTTERGUARD_AI_KEY=sk-... |
| 43 | +flutterguard-cli --apk app.apk --outDir ./results --enable-ai-remediation |
| 44 | +``` |
| 45 | + |
| 46 | +When enabled, all findings in the report will include a dedicated "Remediation Guidance" section with professional, human-like explanations and actionable steps. |
| 47 | + |
| 48 | +--- |
| 49 | + |
| 50 | +## What FlutterGuard CLI Analyzes |
12 | 51 |
|
13 | | -- 🔑 **Secrets & API Keys** — Finds hardcoded passwords, tokens, and credentials |
14 | | -- 🌐 **Network Details** — Extracts URLs, domains, API endpoints, and Firebase configs |
15 | | -- 📦 **Dependencies** — Lists all Flutter packages with direct links to pub.dev |
16 | | -- 📋 **App Metadata** — Package name, version, SDK info, and permissions |
17 | | -- 🔍 **Third-Party Services** — Detects bundled SDKs, CDNs, and analytics libraries |
18 | | -- 📜 **Certificate Info** — Analyzes signing certificates and flags self-signed ones |
19 | | -- 📁 **Complete Breakdown** — Organized assets, resources, and full decompiled source code |
| 52 | +- **Secrets & API Keys**: Detects hardcoded credentials and sensitive tokens |
| 53 | +- **Network & API Endpoints**: Extracts all URLs, domains, and backend endpoints |
| 54 | +- **Dependencies**: Lists all Flutter/Dart packages and third-party SDKs |
| 55 | +- **App Metadata**: Reports package name, version, SDK targets, and permissions |
| 56 | +- **Third-Party Services**: Identifies analytics, ad networks, and bundled SDKs |
| 57 | +- **Certificate Information**: Analyzes signing certificates for trust and compliance |
| 58 | +- **Assets & Resources**: Catalogs all embedded files, assets, and resources |
| 59 | +- **Decompiled Source**: Optionally provides full decompiled APK contents for audit |
| 60 | + |
| 61 | +## Installation |
| 62 | + |
| 63 | +...existing code... |
20 | 64 |
|
21 | 65 | ## Installation |
22 | 66 |
|
@@ -140,98 +184,38 @@ FlutterGuard works standalone, but these tools provide richer analysis: |
140 | 184 |
|
141 | 185 | ### Basic Analysis |
142 | 186 |
|
143 | | -Analyze a Flutter app APK and save organized results to a directory: |
| 187 | +Run a full security and compliance scan on a Flutter APK: |
144 | 188 |
|
145 | 189 | ```bash |
146 | 190 | flutterguard-cli --apk app.apk --outDir ./results |
147 | 191 | ``` |
148 | 192 |
|
149 | | -This creates a folder named after the app's package (e.g., `results/com.example.app/`) containing all findings, assets, and decompiled code. |
150 | | - |
151 | | -### Show Progress |
| 193 | +This creates a results directory with all findings, assets, and a professional Markdown report. |
152 | 194 |
|
153 | | -Add `--verbose` to see real-time progress updates: |
| 195 | +### Enabling AI Remediation |
154 | 196 |
|
155 | | -```bash |
156 | | -flutterguard-cli --apk app.apk --outDir ./results --verbose |
157 | | -``` |
| 197 | +Add the `--enable-ai-remediation` flag (or set `FLUTTERGUARD_AI_ENABLED=1`) to include AI-generated remediation and compliance guidance in your reports. |
158 | 198 |
|
159 | 199 | ### Output Formats |
160 | 200 |
|
161 | | -**JSON format** (default, good for automation): |
162 | | - |
163 | | -```bash |
164 | | -flutterguard-cli --apk app.apk --format json |
165 | | -``` |
166 | | - |
167 | | -**Text format** (human-readable summary): |
168 | | - |
169 | | -```bash |
170 | | -flutterguard-cli --apk app.apk --format text |
171 | | -``` |
172 | | - |
173 | | -**Structured directory** (most comprehensive): |
174 | | - |
175 | | -```bash |
176 | | -flutterguard-cli --apk app.apk --outDir ~/my-analysis |
177 | | -``` |
178 | | - |
179 | | -### Network Features (Opt-In) |
180 | | - |
181 | | -By default, FlutterGuard runs completely offline. Enable network features for: |
182 | | - |
183 | | -- Domain DNS validation |
184 | | -- pub.dev package information enrichment |
185 | | - |
186 | | -```bash |
187 | | -flutterguard-cli --apk app.apk --outDir ./results --enable-network-and-dns-checks |
188 | | -``` |
189 | | - |
190 | | -## Output Structure |
191 | | - |
192 | | -When using `--outDir`, FlutterGuard creates an organized directory structure: |
193 | | - |
194 | | -``` |
195 | | -results/ |
196 | | -└── com.example.app/ |
197 | | - ├── summary.md ← Start here! Overview with clickable links |
198 | | - ├── analysis.json ← Full structured data (JSON) |
199 | | - ├── emails.txt ← Email addresses found |
200 | | - ├── domains.txt ← Domain names and hosts |
201 | | - ├── urls.txt ← All URLs discovered |
202 | | - ├── api_endpoints.txt ← API endpoints with HTTP methods |
203 | | - ├── packages.txt ← Flutter packages with pub.dev links |
204 | | - ├── permissions.txt ← Android permissions (⚠️ = dangerous) |
205 | | - ├── services.txt ← Third-party SDKs detected |
206 | | - ├── hardcoded_keys.txt ← Potential secrets and API keys |
207 | | - ├── assets/ ← App resources by file type |
208 | | - │ ├── json/ |
209 | | - │ ├── png/ |
210 | | - │ ├── xml/ |
211 | | - │ ├── ttf/ |
212 | | - │ └── ... |
213 | | - └── decompiled/ ← Complete APK contents |
214 | | - ├── AndroidManifest.xml |
215 | | - ├── classes.dex |
216 | | - ├── lib/ ← Native libraries (.so files) |
217 | | - ├── res/ ← App resources |
218 | | - ├── assets/ ← Embedded assets |
219 | | - └── META-INF/ ← Signing certificates |
220 | | -``` |
| 201 | +- `summary.md`: Human-readable, professional Markdown report with remediation guidance |
| 202 | +- `analysis.json`: Full structured data for automation and audit |
| 203 | +- `*.txt`: Raw lists of emails, domains, endpoints, etc. |
| 204 | +- `assets/`: All extracted resources, organized by type |
| 205 | +- `decompiled/`: Decompiled APK contents (optional) |
221 | 206 |
|
222 | | -**Tip:** Open `summary.md` in any markdown viewer—it includes a table of contents with links to all findings. |
| 207 | +### Example Output Structure |
223 | 208 |
|
224 | | -## Why Go instead of Dart? |
| 209 | +...existing code... |
225 | 210 |
|
226 | | -FlutterGuard is written in Go rather than Dart because: |
| 211 | +## Why FlutterGuard CLI? |
227 | 212 |
|
228 | | -- **Single Compiled Binary**: Users get a standalone executable with zero dependencies—just download and run, no runtime required. |
229 | | -- **Cross-Platform Distribution**: Go compiles easily to Windows, macOS, and Linux with a single codebase, making it simpler for users across different systems. |
230 | | -- **Performance**: Go offers native compilation speed and efficiency ideal for analyzing large APK files and intensive security scanning operations. |
231 | | -- **CLI Excellence**: Go is purpose-built for command-line tools with strong standard library support for file I/O, process execution, and signal handling. |
232 | | -- **Ecosystem**: Direct access to powerful tools like JADX and aapt2 without the overhead of a UI framework designed for mobile apps. |
| 213 | +- **Professional, Human-Quality Guidance**: All AI-generated remediation is reviewed for clarity, accuracy, and professionalism. |
| 214 | +- **No Vendor Lock-In**: Choose your preferred AI provider or run fully offline. |
| 215 | +- **Enterprise-Ready**: Designed for security teams, agencies, and regulated environments. |
| 216 | +- **Transparent and Auditable**: All findings and AI guidance are saved locally for review and compliance. |
233 | 217 |
|
234 | | -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. |
| 218 | +FlutterGuard CLI is written in Go for maximum portability, performance, and ease of deployment. No dependencies, no runtime, just a single binary. |
235 | 219 |
|
236 | 220 | ## Contributing |
237 | 221 |
|
@@ -301,4 +285,4 @@ MIT License - see the [LICENSE](LICENSE) file for details. |
301 | 285 |
|
302 | 286 | --- |
303 | 287 |
|
304 | | -**Built for the Flutter and Android security community** |
| 288 | +_FlutterGuard CLI: Professional AI-powered security and compliance for Flutter applications._ |
0 commit comments