generate_signin_key

pub package License: MIT

Dart Flutter Android

A powerful and simple command-line tool for Flutter and Android developers to quickly generate, view, and save Android signing reports (SHA-1, SHA-256, MD5). No more navigating into the android folder or remembering complex Gradle commands!


🚀 Features

  • Auto-Detection: Automatically finds the android directory in your project root.
  • Gradle Integration: Executes the ./gradlew signingReport task seamlessly.
  • Key Generation: Easily generate a new release keystore (.jks) using keytool with interactive prompts.
  • Smart Discovery: Automatically locates keytool in common paths (Android Studio, JAVA_HOME, etc.) if not in your PATH.
  • Multiple Output Formats: View results in the terminal or save them to a file.
  • Clean Build: Option to run gradlew clean before generating keys to ensure accuracy.
  • Cross-Platform: Works perfectly on Windows, macOS, and Linux.
  • Real-time Streaming: See the Gradle progress as it happens.

📦 Installation

As a Dev Dependency

Add this to your project's pubspec.yaml:

dev_dependencies:
  generate_signin_key: ^1.1.0

Global Installation

Install it globally to use it in any project:

dart pub global activate generate_signin_key

🛠️ Usage

Quick Start

Run this command in the root of your Flutter or Android project:

dart run generate_signin_key

Options & Flags

Option Shorthand Description Example
--new -n Generate a new release keystore. --new
--keyexport Export keystore credentials to a file. --keyexport data.txt
--run -r Run a key report after generation. --run
--output -o Save the report to a specific file. --output keys.txt
--clean -c Run gradlew clean before the report. --clean
--help -h Show the help menu. --help

Detailed Examples

Generate a new release keystore, export credentials, and view keys:

dart run generate_signin_key --new --keyexport release_info.txt --run -o keys.txt

Generate a new release keystore:

dart run generate_signin_key --new

Save to a custom path:

dart run generate_signin_key --output ./logs/signing_keys.txt

Perform a clean build and view report:

dart run generate_signin_key -c

Run using global activation:

generate_signin_key

📖 How it works

  1. The tool checks for an android directory in your current working directory.
  2. It identifies the appropriate Gradle wrapper (gradlew or gradlew.bat).
  3. It grants execution permissions (on Unix systems) and runs the signingReport task.
  4. It captures and streams the output, optionally writing it to a file if requested.

⚠️ Security Warning

DO NOT upload your keystore files (.jks), key.properties, or the exported credential files to GitHub or any public repository.

  • Always add these files to your .gitignore.
  • If you lose your release key, you will NOT be able to update your app on the Google Play Store.
  • Keep a secure backup of your keys in a password manager or physical vault.

🤝 Contributing

Contributions are welcome! If you find a bug or have a feature request, please open an issue or submit a pull request.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

💖 Sponsors

If you find this tool helpful, consider supporting its development!

Sponsor

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.


Developed with ❤️ by KANAGARAJ M