generate_signin_key
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
androiddirectory in your project root. - Gradle Integration: Executes the
./gradlew signingReporttask seamlessly. - Key Generation: Easily generate a new release keystore (
.jks) usingkeytoolwith interactive prompts. - Smart Discovery: Automatically locates
keytoolin 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 cleanbefore 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
- The tool checks for an
androiddirectory in your current working directory. - It identifies the appropriate Gradle wrapper (
gradleworgradlew.bat). - It grants execution permissions (on Unix systems) and runs the
signingReporttask. - 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.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
💖 Sponsors
If you find this tool helpful, consider supporting its development!
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
Developed with ❤️ by KANAGARAJ M