Skip to content
This repository has been archived by the owner on Jul 12, 2023. It is now read-only.

Commit

Permalink
update basic auth digest used on the initial oauth login request
Browse files Browse the repository at this point in the history
  • Loading branch information
mjmeli committed May 24, 2022
1 parent 481a72f commit ce2f0e5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = pyduke-energy
version = 1.0.0
version = 1.0.1
author = Michael Meli
author_email = [email protected]
description = Python Wrapper for unofficial Duke Energy REST API
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/pyduke_energy/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit ce2f0e5

Please sign in to comment.