diff --git a/README.md b/README.md index 5c35c3a..51dffd2 100644 --- a/README.md +++ b/README.md @@ -132,6 +132,16 @@ To run just the linting: tox -e lint ``` +### Android App Debugging + +If you want to debug requests via the Android app, the following general approach works well for me. + +1. Install [HTTP Toolkit](https://httptoolkit.tech/) on your computer. +2. Set up Android Studio so that you can use an emulator through it. +3. Start Android Studio emulator and use HTTP Toolkit to connect to it via ADB. Make sure to set up the HTTPS request intercepting. +4. Install Duke Energy APK on the emulator. You can download an `xapk` file from a site like APKPure. To install an `xapk` file on an emulator, extract the `xapk` file using something like WinRAR and drag the inside `apk` file to the emulator. +5. Start Duke Energy app on the emulator and logs should now be requested in your HTTP Toolkit app. + [black]: https://github.com/psf/black [black-shield]: https://img.shields.io/badge/code%20style-black-000000.svg?style=for-the-badge [commits-shield]: https://img.shields.io/github/commit-activity/y/mjmeli/pyduke-energy.svg?style=for-the-badge diff --git a/setup.cfg b/setup.cfg index 911b767..a2232eb 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = pyduke-energy -version = 1.0.0 +version = 1.0.1 author = Michael Meli author_email = mjmeli94@gmail.com description = Python Wrapper for unofficial Duke Energy REST API @@ -37,7 +37,7 @@ test = pytest-timeout~=2.1.0 black==22.3.0 flake8==4.0.1 - pylint==2.13.3 + pylint==2.13.9 pydocstyle==6.1.1 isort~=5.10.1 diff --git a/src/pyduke_energy/const.py b/src/pyduke_energy/const.py index faddd8c..82166d7 100644 --- a/src/pyduke_energy/const.py +++ b/src/pyduke_energy/const.py @@ -5,7 +5,7 @@ IOT_API_BASE_URL = "https://app-core1.de-iot.io/rest/cloud/" FASTPOLL_ENDPOINT = "smartmeter/fastpoll/start" OAUTH_ENDPOINT = "auth/oauth2/token" -BASIC_AUTH = "Basic UzdmNXFQR2MwcnpVZkJmcVNPak9ycGczZWtSZ3ZHSng6bW1nS2pyY1RQRHptOERtVw==" # hard-coded from Android app +BASIC_AUTH = "Basic NEdtR3J1M085TEFIV3BMNjVjbWpyZDhtQ1VKZU5XTVo6OWFyZVZoZlM3R2N4UmgzWA==" # hard-coded from Android app SMARTMETER_AUTH_ENDPOINT = "smartmeter/v1/auth" ACCT_ENDPOINT = "auth/account-list" ACCT_DET_ENDPOINT = "auth/account-details"