{ "info": { "author": "Dainis Gorbunovs", "author_email": "dgdev@protonmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "# DeStringCare\n## What is it?\nIt is a tool for extracting StringCare obfuscated secrets in Android apk files.\nSome of these StringCare protected secrets may contain API addresses and API keys.\n\n*Warning*: It is not recommended to store important API keys on the client-side, especially the keys to third party services.\nA better approach is to have your own API service, and create unique API keys for each app user.\nThis allows to revoke API keys and banning user if necessary.\n\n## Installation\n```bash\npip install DeStringCare\n```\n\n## Usage\nusage: `destringcare.py [-h] [-r] [-o] apk [replaced]`\n\nExtract StringCare secrets from an Android APK.\n\npositional arguments:\n* `apk` - Path to the apk\n* `replaced` - Path to the replaced values\n\noptional arguments:\n* `-h`, `--help` show this help message and exit\n* `-r`, `--resign` Resign and save xml file\n* `-o`, `--other` Include a list of other secrets\n\nExample:\n```bash\ndestringcare --resign Appname_v1.0.2494.apk\n```\n\n### Replace values\nCreate `mapped.json`\n```json\n{\n \"firebase_database_url\": \"https://some-path.somewhere.io\",\n \"google_storage_bucket\": \"another-path.appspot.com\"\n}\n```\n\nThen run `destringcare` with the additional argument:\n```bash\ndestringcare --resign Appname_v1.0.2494.apk mapped.json\n```\n\n### Print other extra properties\nSome common property keys may not be encoded by Stringcare.\nThese may be in plaintext and thus included in the output.\n\n```bash\ndestringcare --other Appname_v1.0.2494.apk\n```\n\n## How to use it? Where to get apk?\n1. First download a Android apk.\n * Use a website like https://apkpure.com/ (beware that the app may be tampered with, and so not recommended).\n * Use [GPlayCli](https://github.com/matlink/gplaycli) / [GPlayWeb](https://github.com/matlink/gplayweb) to download using your own Gmail credentials.\n * Use `adb` tool which pulls the `apk` from your Android device or emulator.\n 1. Download the app via Google Play store to your Android device or emulator.\n 2. List packages and find the app you want.\n ```bash\n adb shell pm list packages\n ```\n 3. Print path to the apk file.\n ```bash\n adb shell pm path\n ```\n 4. Pull the apk file.\n ```bash\n adb pull /full/path/to/the.apk\n ```\n\n2. Extract the StringCare secrets.\n ```bash\n destringcare Appname_v1.0.2494.apk\n ```\n\n You will get an output as JSON file:\n ```json\n {\n \"mixpanel_api_key\": \"7b23daa71cdbb9e6d07f29a36de960f3\"\n }\n ```\n\n## How to resign StringCare secrets?\n```bash\ndestringcare --resign Appname_v1.0.2494.apk\n```\n\nIt loads the first key from the keystore file `~/.android/debug.keystore`.\n\nThen it reencrypts the apk secrets and saves it as an xml file in `resigned-strings.xml`.\n\nResigning the StringCare secrets with your own key allows you to repackage the application and use it in your Android device.\nYou would need to replace the original `strings.xml` with `resigned-strings.xml` file.\n\n\n## Where the resigned version can be used?\nUsing `apktool` it is possible to decode an application and to repackage it later again.\n\nAs it is necessary to resign the application in order for it to work in Android,\nit will be also necessary to update the StringCare protected file with a new signing key.\n\nTypical workflow:\n1. Decode the apk using `apktool` into `apk` directory.\n ```bash\n apktool d Appname_v1.0.2494.apk -o apk\n ```\n\n2. Run `DeStringCare` to extract the `strings.xml` with secrets and resign it.\n ```bash\n destringcare --resign Appname_v1.0.2494.apk\n ```\n\n3. Replace StringCare protected xml file at path `apk/res/values/strings.xml`.\n\n It may contain a line like the following:\n ```xml\n 367E864309B5E7E3E6642483AF380497...\n ```\n\n4. Rebuild the apk.\n ```bash\n apktool b -d apk -o app-unsigned.apk\n ```\n\n5. Resign the apk.\n ```bash\n jarsigner -verbose -sigalg MD5withRSA -digestalg SHA1 -keystore ~/.android/debug.keystore -storepass android app-unsigned.apk androiddebugkey\n ```\n\n6. Zipaligning the apk.\n ```bash\n zipalign -v 4 app-unsigned.apk app.apk\n ```\n\n## How to contribute?\nIf you have questions or enhancement ideas, **open an issue**.\n\nIf you have made improvements to the code, create a **merge request**.\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/DainisGorbunovs/DeStringCare", "keywords": "StringCare,destringcare,decrypt,apk,secrets", "license": "", "maintainer": "", "maintainer_email": "", "name": "DeStringCare", "package_url": "https://pypi.org/project/DeStringCare/", "platform": "", "project_url": "https://pypi.org/project/DeStringCare/", "project_urls": { "Homepage": "https://github.com/DainisGorbunovs/DeStringCare" }, "release_url": "https://pypi.org/project/DeStringCare/0.0.5/", "requires_dist": [ "cryptography", "pycryptodomex", "pyOpenSSL", "pyjks", "pyaxmlparser" ], "requires_python": "", "summary": "DeStringCare for extracting Android apk secrets", "version": "0.0.5" }, "last_serial": 5609539, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "0fdc489b6ae3901269ae594df4e13902", "sha256": "6ec2938d80bcdfcbcf5f0d0e4c6b0424f3f337d8e8eb328cce1f8879c0c0dab2" }, "downloads": -1, "filename": "DeStringCare-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "0fdc489b6ae3901269ae594df4e13902", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5235, "upload_time": "2019-05-18T17:33:54", "url": "https://files.pythonhosted.org/packages/d2/1b/fb116870cbbdd3f9c0b785327a427bc36215c18b9aa7a1843bd993c295ba/DeStringCare-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9f0b78a6c629b5a650a809f6482f0db1", "sha256": "e676b2d2022eaab2675e72c2e49763e24abf039b5e11f0b3c33e7733ea28790e" }, "downloads": -1, "filename": "DeStringCare-0.0.1.tar.gz", "has_sig": false, "md5_digest": "9f0b78a6c629b5a650a809f6482f0db1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4506, "upload_time": "2019-05-18T17:33:57", "url": "https://files.pythonhosted.org/packages/d1/7c/78f27d75ca69c1f4e664b70883de5a52b2f8118c0b1f94a80e636368cf01/DeStringCare-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "947c0c3f313a022658dd4780303d54e3", "sha256": "fc7b608c2161c817a78ae48912b49d2a08e019d620a565882dffc360c4710cf8" }, "downloads": -1, "filename": "DeStringCare-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "947c0c3f313a022658dd4780303d54e3", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6124, "upload_time": "2019-06-01T13:13:12", "url": "https://files.pythonhosted.org/packages/6d/96/fc0965d3afb2de1028a7fb9c05572c854072ffe6adcd866d09d65275fc6d/DeStringCare-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7434c587b3a1a2777d0c02e17e23ba80", "sha256": "ab5b184daa201cade76347bd9beccd40dbe5d152a34875e3497551658bbde16e" }, "downloads": -1, "filename": "DeStringCare-0.0.2.tar.gz", "has_sig": false, "md5_digest": "7434c587b3a1a2777d0c02e17e23ba80", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5276, "upload_time": "2019-06-01T13:13:14", "url": "https://files.pythonhosted.org/packages/ab/a1/6045b9b9b11c7f0859c38325defc0eed497a3dd592ddb203b259ba9b2367/DeStringCare-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "9c33289d4ce8e46c0bf3addcf5d3be1b", "sha256": "df70593ea1c487afd0dcd2bc222e1f94f51ea1372e3e9e5bdc2171cf9dd84a03" }, "downloads": -1, "filename": "DeStringCare-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "9c33289d4ce8e46c0bf3addcf5d3be1b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6021, "upload_time": "2019-06-08T13:10:21", "url": "https://files.pythonhosted.org/packages/8a/55/0b8754c1eaa27e5a840e36f22486231fe414185380b13770fab26826b8b0/DeStringCare-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "231d025771883caf60da41c246a42e6a", "sha256": "38fe3dd2ddc9520fbdf73ff01040e50567cb65188c124770a00007da6bc75f18" }, "downloads": -1, "filename": "DeStringCare-0.0.3.tar.gz", "has_sig": false, "md5_digest": "231d025771883caf60da41c246a42e6a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5414, "upload_time": "2019-06-08T13:10:23", "url": "https://files.pythonhosted.org/packages/c8/cf/c1fbac998b155292e32c219b6f498a3d7351e52f4e871f12ea850b1ee3e8/DeStringCare-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "04457b0f7cd4a3813e0e58698499c93c", "sha256": "e34f35253f9aa3c8284b5a72e70657775c510796ee126c62a46cabf03ae2bf84" }, "downloads": -1, "filename": "DeStringCare-0.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "04457b0f7cd4a3813e0e58698499c93c", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6969, "upload_time": "2019-06-19T22:13:13", "url": "https://files.pythonhosted.org/packages/82/5b/fc1f1a67012d7d209b6bb8fb5281ef87cbfff42b8ce411987733e8cb5ede/DeStringCare-0.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "81efef769a99f8db08651ae14a4bc863", "sha256": "1f0832c14371b55a026b0b0ad73131b254bb68e0b1214f4c1e1ad4c840d658d4" }, "downloads": -1, "filename": "DeStringCare-0.0.4.tar.gz", "has_sig": false, "md5_digest": "81efef769a99f8db08651ae14a4bc863", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6320, "upload_time": "2019-06-19T22:13:15", "url": "https://files.pythonhosted.org/packages/9f/90/2c7d84726ad2701d10e9dc9464bd4fc8c2d491fe731caad214ce90db8959/DeStringCare-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "3bf5332106a9e299b2b927163f1e3024", "sha256": "7cf5191cf19859efb04e29a9cd97cb4152063fa1d59fab622943830e87b11d95" }, "downloads": -1, "filename": "DeStringCare-0.0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "3bf5332106a9e299b2b927163f1e3024", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6973, "upload_time": "2019-07-30T19:00:48", "url": "https://files.pythonhosted.org/packages/39/8c/c5978fb2526d75f3c163ec8ec450e22510e2bb7582dbe0bd275530187770/DeStringCare-0.0.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "038f86f6cbad0a3ea00efc1b2f9fd7c3", "sha256": "ebf790c0ce97813d17f3c52dd74327e0aafb61d4c0064e4d72eb9e7d11ff04b3" }, "downloads": -1, "filename": "DeStringCare-0.0.5.tar.gz", "has_sig": false, "md5_digest": "038f86f6cbad0a3ea00efc1b2f9fd7c3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6333, "upload_time": "2019-07-30T19:00:49", "url": "https://files.pythonhosted.org/packages/17/d4/7737e1fdaa822cd64a916200f30dbc1ff96f23e497680af4220d682e6c16/DeStringCare-0.0.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3bf5332106a9e299b2b927163f1e3024", "sha256": "7cf5191cf19859efb04e29a9cd97cb4152063fa1d59fab622943830e87b11d95" }, "downloads": -1, "filename": "DeStringCare-0.0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "3bf5332106a9e299b2b927163f1e3024", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6973, "upload_time": "2019-07-30T19:00:48", "url": "https://files.pythonhosted.org/packages/39/8c/c5978fb2526d75f3c163ec8ec450e22510e2bb7582dbe0bd275530187770/DeStringCare-0.0.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "038f86f6cbad0a3ea00efc1b2f9fd7c3", "sha256": "ebf790c0ce97813d17f3c52dd74327e0aafb61d4c0064e4d72eb9e7d11ff04b3" }, "downloads": -1, "filename": "DeStringCare-0.0.5.tar.gz", "has_sig": false, "md5_digest": "038f86f6cbad0a3ea00efc1b2f9fd7c3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6333, "upload_time": "2019-07-30T19:00:49", "url": "https://files.pythonhosted.org/packages/17/d4/7737e1fdaa822cd64a916200f30dbc1ff96f23e497680af4220d682e6c16/DeStringCare-0.0.5.tar.gz" } ] }