mirror of
https://github.com/zoffline/zwift-offline.git
synced 2026-07-28 14:47:12 -07:00
Deprecate uploading to Garmin Connect
Add note about non-rooted Android 15 and later
This commit is contained in:
@@ -24,7 +24,7 @@ jobs:
|
||||
pathInArchive: "upx-4.2.2-win64/upx.exe"
|
||||
|
||||
- run: pip install -r requirements.txt
|
||||
- run: pip install pyinstaller garth
|
||||
- run: pip install pyinstaller garth==0.6.3
|
||||
- run: pyinstaller standalone.spec
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ WORKDIR /usr/src/app/zwift-offline
|
||||
COPY . .
|
||||
|
||||
RUN pip install --no-cache-dir --root-user-action=ignore -r requirements.txt
|
||||
RUN pip install --no-cache-dir --root-user-action=ignore garth
|
||||
RUN pip install --no-cache-dir --root-user-action=ignore garth==0.6.3
|
||||
|
||||
RUN chmod 777 storage
|
||||
|
||||
|
||||
@@ -152,6 +152,7 @@ to generate your own certificates and do the same.
|
||||
* Patch after every installation or update:
|
||||
* Install/update Zwift from Google play, but do not start it yet.
|
||||
* If you have already started it go to `Android Settings > Applications > Zwift` and clear data or uninstall and reinstall the app.
|
||||
* __NOTE:__ ZofflineObb doesn't work on Android 15 and later versions. As a workaround, you can patch the OBB file on Windows. See [#505](https://github.com/zoffline/zwift-offline/issues/505) for details.
|
||||
* Open the `ZofflineObb` app and run it (allow access to storage)
|
||||
* Wait for process to finish (5-10min)
|
||||
* Run Zwift, hopefully it verifies download and runs
|
||||
@@ -234,12 +235,9 @@ To obtain your current profile:
|
||||
|
||||
<details><summary>Garmin Connect</summary>
|
||||
|
||||
* If running from source, install garth: ``pip install garth``
|
||||
* If needed, create a file ``garmin_domain.txt`` in the ``storage`` directory containing the domain
|
||||
* For China use ``garmin.cn``
|
||||
* Use the "Settings - Garmin" button in the launcher window to enter your credentials (if using Android, access ``https://<zoffline_ip>/garmin/zoffline/``).
|
||||
* If your account has multi-factor authentication, run the script ``garmin_auth.py`` and move the resulting ``garth`` folder (saved in whatever directory you ran ``garmin_auth.py`` in) into the ``storage/1`` directory.
|
||||
* Or, if using the Windows zoffline.exe version without Python installed you can run ``garmin_auth.exe`` obtained from https://github.com/oldnapalm/zoffline-helper/releases/latest instead.
|
||||
* __NOTE:__ Garmin Connect login is no longer supported ([matin/garth#222](https://github.com/matin/garth/discussions/222)).
|
||||
* Use [this script](https://gist.github.com/coleman8er/5c8e192d2aa3c8a3a6220c5702e8a5e6) to login and save tokens.
|
||||
* Move the resulting ``oauth1_token.json`` and ``oauth2_token.json`` from `~/.garth` (`C:\Users\<username>\.garth`) to `storage/1/garth`.
|
||||
|
||||
</details>
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
<a href="{{ url_for('power_curves', username=username) }}" class="btn btn-sm btn-secondary">Power curves</a>
|
||||
<a href="{{ url_for('profile', username=username) }}" class="btn btn-sm btn-secondary">Zwift</a>
|
||||
<a href="{{ url_for('strava', username=username) }}" class="btn btn-sm btn-secondary">Strava</a>
|
||||
<a href="{{ url_for('garmin', username=username) }}" class="btn btn-sm btn-secondary">Garmin</a>
|
||||
<a href="{{ url_for('intervals', username=username) }}" class="btn btn-sm btn-secondary">Intervals</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
import sys
|
||||
import getpass
|
||||
import garth
|
||||
|
||||
domain = input("Garmin domain [garmin.com]: ") or 'garmin.com'
|
||||
username = input("Username (e-mail): ")
|
||||
if not sys.stdin.isatty(): # This terminal cannot support input without displaying text
|
||||
print(f'*WARNING* The current shell ({os.name}) cannot support hidden text entry.')
|
||||
print(f'Your password entry WILL BE VISIBLE.')
|
||||
print(f'If you are running a bash shell under windows, try executing this program via winpty:')
|
||||
print(f'>winpty python {sys.argv[0]}')
|
||||
password = input("Password (will be shown): ")
|
||||
else:
|
||||
password = getpass.getpass("Password: ")
|
||||
|
||||
garth.configure(domain=domain)
|
||||
try:
|
||||
garth.login(username, password)
|
||||
garth.save('./garth')
|
||||
except Exception as e:
|
||||
print(e)
|
||||
+4
-15
@@ -2344,22 +2344,11 @@ def garmin_upload(player_id, activity):
|
||||
if garth.client.oauth2_token.expired:
|
||||
garth.client.refresh_oauth2()
|
||||
garth.save(tokens_dir)
|
||||
except:
|
||||
garmin_credentials = '%s/%s/garmin_credentials.bin' % (STORAGE_DIR, player_id)
|
||||
if not os.path.exists(garmin_credentials):
|
||||
logger.info("garmin_credentials.bin missing, skip Garmin activity update")
|
||||
return
|
||||
username, password = decrypt_credentials(garmin_credentials)
|
||||
try:
|
||||
garth.login(username, password)
|
||||
garth.save(tokens_dir)
|
||||
except Exception as exc:
|
||||
logger.warning("Garmin login failed: %s" % repr(exc))
|
||||
return
|
||||
except Exception as exc:
|
||||
logger.warning("garmin_upload: %s" % repr(exc))
|
||||
return
|
||||
try:
|
||||
requests.post('https://connectapi.%s/upload-service/upload' % GARMIN_DOMAIN,
|
||||
files={"file": (activity.fit_filename, BytesIO(activity.fit))},
|
||||
headers={'authorization': str(garth.client.oauth2_token)})
|
||||
garth.client.post("connectapi", "/upload-service/upload", api=True, files={"file": (activity.fit_filename, BytesIO(activity.fit))})
|
||||
except Exception as exc:
|
||||
logger.warning("Garmin upload failed. No internet? %s" % repr(exc))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user