android-key-tools
v1.0.3
Published
Multi-tool CLI for Android Keystore fingerprints (SHA-1/SHA-256) and extracting from installed APKs.
Maintainers
Readme
🔑 Android Key Tools (Android Certificate Doctor)
A multi-tool CLI for Android developers to easily extract SHA-1 and SHA-256 fingerprints from keystores, installed APKs, and google-services.json. Perfect for quickly configuring Firebase, Google Maps Platform, OAuth 2.0, or App Links.
✨ Features
This interactive CLI tool allows you to:
- 📱 Extract from Installed APK: Automatically detects connected devices via
adb, pulls an installed APK by its package name, and reads its certificate fingerprints usingapksigner. - 🐛 Print Debug Keystore Fingerprints: Quickly reads the default
~/.android/debug.keystoreand prints its SHA-1/SHA-256 fingerprints without needing to remember the complexkeytoolcommand. - 🔐 Print Custom/Production Keystore Fingerprints: Prompts for a path to any
.jksor.keystorefile, and parses its fingerprints securely usingkeytool. - 📋 List all Aliases (Keys): Quickly lists the names of all aliases available in a given keystore.
- 🔍 Check google-services.json: Analyzes your local
google-services.jsonto list all registered certificate fingerprints and automatically cross-references them when extracting keys.
Bonus: The tool automatically verifies if the fingerprints it extracts are properly registered in your
google-services.json!
🚀 Installation
You can run it directly using npx (recommended):
npx android-key-toolsOr install it globally:
npm install -g android-key-tools🛠️ Requirements
adbavailable in your PATH or connected Android device (for extracting from APKs).- Android SDK installed (
apksigneris automatically located if Android SDK is in default locations). - Java /
keytoolinstalled in your PATH (for keystore operations).
🎮 Usage
Simply run android-key-tools in your terminal. You'll be greeted with an interactive menu:
--- Android Certificate Doctor ---
1) Extract SHA-1/SHA-256 from an APK installed on a connected device
2) Print SHA-1/SHA-256 for the default Android Debug Keystore
3) Print SHA-1/SHA-256 for a custom/production Keystore
4) List all aliases (keys) in a Keystore
5) Check registered fingerprints in google-services.json
6) ExitSelect the desired option by entering its number and following the prompts.
📦 Publishing to npm
To publish this package to the public npm registry, follow these steps:
- Create an npm account on npmjs.com.
- Run
npm loginin your terminal and authenticate. - Run
npm publishin the root of this project.
Note: if the name android-key-tools is already taken on npm, you will need to rename the package in package.json to something else (e.g., @yourusername/android-key-tools) before publishing.
Made for Android developers to save time and sanity.
