Command line tool to print MD5 / SHA1 / SHA256 fingerprints of Android APK package.
# Why we need it? #
keytool no longer print MD5 after java8.
But sometimes we do need the MD5 for example, in WeChat and AliPay developer console.
Some alternative tools do not work well:
1. Gen_Signature_Android.apk, need to be install to Android device, sometimes refused by Android device.
2. jadx, a powerful to decompile APK, we can view details of APK package, but it's too heavy.
To view the fingerprints, a very tiny command line tool will be enough.
# Installation #
Please make sure your Python is v3.7 or above.
```bash
python3 --version
python3 -m pip install apk-signature
```
Or, clone from GitHub:
```bash
git clone https://github.com/floatinghotpot/apk-signature.git
cd apk-signature
python3 -m pip install -e .
```
# How To Use #
```bash
apk-signature <path_to_apk_file>
```
Example:
```bash
apk-signature myapp.apk
```
# How It Works #
Here are the steps that the tool actualy runs:
```bash
# unzip the IPA file to tmp folder
mkdir ./tmp
unzip <path_to_apk_file> -d ./tmp
# run openssl to extract certificate file from CERT.RSA
openssl pkcs7 -inform DER -in ./tmp/META-INF/CERT.RSA -print_certs -out ./tmp/CERT.cert
# print the fingerprints in upper case
openssl x509 -in ./tmp/CERT.cert -fingerprint -noout -md5
openssl x509 -in ./tmp/CERT.cert -fingerprint -noout -sha1
openssl x509 -in ./tmp/CERT.cert -fingerprint -noout -sha256
# print the fingterprints in lower case
openssl x509 -in ./tmp/CERT.cert -outform DER | openssl dgst -md5
openssl x509 -in ./tmp/CERT.cert -outform DER | openssl dgst -sha1
openssl x509 -in ./tmp/CERT.cert -outform DER | openssl dgst -sha256
# clean up the tmp folder
rm -r ./tmp
```
# Dependency #
It will call openssl, so make sure it's installed first.
If not installed, install it with Homebrew:
```bash
brew install openssl
```
# Credits #
A simple tool created by Raymond Xie, to print the MD5/SHA1/SHA256 signature of APK package with command line.
Any comments are welcome.
Raw data
{
"_id": null,
"home_page": "https://github.com/floatinghotpot/apk-signature",
"name": "apk-signature",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "",
"keywords": "ios,installer",
"author": "Liming Xie",
"author_email": "liming.xie@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/fe/aa/d1ba736db1bc88097c612a62d64f9146131e16b1203a63939e3af90303d1/apk-signature-1.0.0.tar.gz",
"platform": "any",
"description": "\nCommand line tool to print MD5 / SHA1 / SHA256 fingerprints of Android APK package.\n\n# Why we need it? #\n\nkeytool no longer print MD5 after java8.\n\nBut sometimes we do need the MD5 for example, in WeChat and AliPay developer console.\n\nSome alternative tools do not work well:\n\n1. Gen_Signature_Android.apk, need to be install to Android device, sometimes refused by Android device.\n\n2. jadx, a powerful to decompile APK, we can view details of APK package, but it's too heavy.\n\nTo view the fingerprints, a very tiny command line tool will be enough.\n\n# Installation #\n\nPlease make sure your Python is v3.7 or above.\n\n```bash\npython3 --version\npython3 -m pip install apk-signature\n```\n\nOr, clone from GitHub:\n```bash\ngit clone https://github.com/floatinghotpot/apk-signature.git\ncd apk-signature\npython3 -m pip install -e .\n```\n\n# How To Use #\n\n```bash\napk-signature <path_to_apk_file>\n```\n\nExample:\n```bash\napk-signature myapp.apk\n```\n\n# How It Works #\n\nHere are the steps that the tool actualy runs:\n\n```bash\n# unzip the IPA file to tmp folder\nmkdir ./tmp\nunzip <path_to_apk_file> -d ./tmp\n\n# run openssl to extract certificate file from CERT.RSA\nopenssl pkcs7 -inform DER -in ./tmp/META-INF/CERT.RSA -print_certs -out ./tmp/CERT.cert\n\n# print the fingerprints in upper case\nopenssl x509 -in ./tmp/CERT.cert -fingerprint -noout -md5\nopenssl x509 -in ./tmp/CERT.cert -fingerprint -noout -sha1\nopenssl x509 -in ./tmp/CERT.cert -fingerprint -noout -sha256\n\n# print the fingterprints in lower case\nopenssl x509 -in ./tmp/CERT.cert -outform DER | openssl dgst -md5\nopenssl x509 -in ./tmp/CERT.cert -outform DER | openssl dgst -sha1\nopenssl x509 -in ./tmp/CERT.cert -outform DER | openssl dgst -sha256\n\n# clean up the tmp folder\nrm -r ./tmp\n```\n\n# Dependency #\n\nIt will call openssl, so make sure it's installed first.\n\nIf not installed, install it with Homebrew:\n```bash\nbrew install openssl\n```\n\n# Credits #\n\nA simple tool created by Raymond Xie, to print the MD5/SHA1/SHA256 signature of APK package with command line.\n\nAny comments are welcome.\n",
"bugtrack_url": null,
"license": "GPLv3+",
"summary": "install IPA package to iOS device with command line",
"version": "1.0.0",
"project_urls": {
"Download": "https://github.com/floatinghotpot/apk-signature",
"Homepage": "https://github.com/floatinghotpot/apk-signature"
},
"split_keywords": [
"ios",
"installer"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "bf52bfc77e0f4b5e7bfdf76e8bdc767de84dfaad8af89391d7f8bfec588e2bef",
"md5": "6bf942833a80c9e60fd8fd0870708429",
"sha256": "bcccdff18af0793305e552ab8059a1e9dfb9240755513a12ece4e7af71e43c8d"
},
"downloads": -1,
"filename": "apk_signature-1.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "6bf942833a80c9e60fd8fd0870708429",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 4233,
"upload_time": "2024-02-22T14:12:10",
"upload_time_iso_8601": "2024-02-22T14:12:10.136294Z",
"url": "https://files.pythonhosted.org/packages/bf/52/bfc77e0f4b5e7bfdf76e8bdc767de84dfaad8af89391d7f8bfec588e2bef/apk_signature-1.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "feaad1ba736db1bc88097c612a62d64f9146131e16b1203a63939e3af90303d1",
"md5": "ca426b6cf8d692c161138abdbb4fa155",
"sha256": "e61b7be5b76d77e583b1ec050075776a6f0953724cf5d92ab55ec5efa66fac92"
},
"downloads": -1,
"filename": "apk-signature-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "ca426b6cf8d692c161138abdbb4fa155",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 5266,
"upload_time": "2024-02-22T14:12:13",
"upload_time_iso_8601": "2024-02-22T14:12:13.172426Z",
"url": "https://files.pythonhosted.org/packages/fe/aa/d1ba736db1bc88097c612a62d64f9146131e16b1203a63939e3af90303d1/apk-signature-1.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-02-22 14:12:13",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "floatinghotpot",
"github_project": "apk-signature",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "apk-signature"
}