Skip to content

Commit

Permalink
Merge branch 'zoffline:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
daktak authored Jan 30, 2024
2 parents 83c3804 + 66afc6c commit b90e69d
Show file tree
Hide file tree
Showing 29 changed files with 1,585 additions and 1,397 deletions.
30 changes: 24 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,42 @@ on:
push:
branches:
- 'master'
tags:
- "*"

jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ secrets.DOCKERHUB_USERNAME }}/zoffline
tags: |
type=ref,event=tag
type=raw,value=latest,enable={{is_default_branch}}
- name: Build and push
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ secrets.DOCKERHUB_USERNAME }}/zoffline:latest
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
12 changes: 6 additions & 6 deletions .github/workflows/pyinstaller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@ jobs:
fail-fast: false

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.11'

- uses: engineerd/[email protected].8
- uses: engineerd/[email protected].10
with:
name: "upx.exe"
url: "https://github.com/upx/upx/releases/download/v4.1.0/upx-4.1.0-win64.zip"
pathInArchive: "upx-4.1.0-win64/upx.exe"
url: "https://github.com/upx/upx/releases/download/v4.2.1/upx-4.2.1-win64.zip"
pathInArchive: "upx-4.2.1-win64/upx.exe"

- run: pip install -r requirements.txt
- run: pip install pyinstaller garth
- run: pyinstaller standalone.spec

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
path: dist/*
50 changes: 15 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ zoffline can be installed on the same machine as Zwift or another local machine.
<details><summary>Windows Instructions</summary>

* Install Zwift
* If your Zwift version is 1.0.122036, you're all set.
* If your Zwift version is 1.0.124632, you're all set.
* If Zwift is not installed, install it before installing zoffline.
* If your Zwift version is newer than 1.0.122036 and zoffline is running from source: copy ``C:\Program Files (x86)\Zwift\Zwift_ver_cur.xml`` to zoffline's ``cdn/gameassets/Zwift_Updates_Root/`` overwriting the existing file.
* If your Zwift version is newer than 1.0.122036 and zoffline is not running from source: wait for zoffline to be updated.
* If your Zwift version is newer than 1.0.124632 and zoffline is running from source: copy ``C:\Program Files (x86)\Zwift\Zwift_ver_cur.xml`` to zoffline's ``cdn/gameassets/Zwift_Updates_Root/`` overwriting the existing file.
* If your Zwift version is newer than 1.0.124632 and zoffline is not running from source: wait for zoffline to be updated.
* __NOTE:__ instead of performing the steps below you can instead just run the __configure_client__ script from https://github.com/zoffline/zwift-offline/releases/tag/zoffline_helper
* On your Windows machine running Zwift, copy the following files in this repo to a known location:
* [ssl/cert-zwift-com.p12](https://github.com/zoffline/zwift-offline/raw/master/ssl/cert-zwift-com.p12)
Expand All @@ -124,9 +124,9 @@ to generate your own certificates and do the same.
<details><summary>macOS Instructions</summary>

* Install Zwift
* If your Zwift version is 1.0.122036, you're all set.
* If your Zwift version is 1.0.124632, you're all set.
* If Zwift is not installed, install it before installing zoffline.
* If your Zwift version is newer than 1.0.122036: copy ``~/Library/Application Support/Zwift/ZwiftMac_ver_cur.xml`` to zoffline's ``cdn/gameassets/Zwift_Updates_Root/`` overwriting the existing file.
* If your Zwift version is newer than 1.0.124632: copy ``~/Library/Application Support/Zwift/ZwiftMac_ver_cur.xml`` to zoffline's ``cdn/gameassets/Zwift_Updates_Root/`` overwriting the existing file.
* On your Mac machine running Zwift, copy the following files in this repo to a known location:
* [ssl/cert-zwift-com.p12](https://github.com/zoffline/zwift-offline/raw/master/ssl/cert-zwift-com.p12)
* [ssl/cert-zwift-com.pem](https://github.com/zoffline/zwift-offline/raw/master/ssl/cert-zwift-com.pem)
Expand All @@ -136,24 +136,6 @@ to generate your own certificates and do the same.
* If you're prompted for a password, just leave it blank. There is no password.
* Using a text editor open ``~/Library/Application Support/Zwift/data/cacert.pem``
* Append the contents of the SSL certificate ``ssl/cert-zwift-com.pem`` to cacert.pem (only the certificate and not the included private key)
* Using a text editor (with admin privileges) open ``/Applications/Zwift.app/Contents/Info.plist``
* Insert in the main dict:
```
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>zwift.com</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSIncludesSubdomains</key>
<true/>
</dict>
</dict>
</dict>
```
* Run ``sudo codesign --force --deep --sign - /Applications/Zwift.app`` in terminal. See https://github.com/zoffline/zwift-offline/issues/132 for extra details.
* Using a text editor (with admin privileges) open ``/etc/hosts``
* Append this line: ``<zoffline ip> us-or-rly101.zwift.com secure.zwift.com cdn.zwift.com launcher.zwift.com``
<br />(Where ``<zoffline ip>`` is the ip address of the machine running zoffline. If
Expand All @@ -169,28 +151,28 @@ to generate your own certificates and do the same.

* Install required apps:
* Download and install ``ZofflineObb.apk`` from [here](https://github.com/Argon2000/ZofflineObbAndroid/releases/latest)
* Download "Gaming VPN" from Google Play ([link](https://play.google.com/store/apps/details?id=com.gamingvpn))
* Download and install ``app-Github-release.apk`` from [here](https://github.com/x-falcon/Virtual-Hosts/releases/latest)
* Create a `hosts.txt` file to use with the app (you could use a text editor app or create it online with an online tool such as [this](https://passwordsgenerator.net/text-editor/)). The file must look like this (replace ``<zoffline ip>`` with the IP address of the machine running zoffline):
```
<zoffline ip> us-or-rly101.zwift.com
<zoffline ip> secure.zwift.com
<zoffline ip> cdn.zwift.com
```
* Run `Host Changer`, select created `hosts.txt` file and press the button
* Optionally, instead of using the "Host Changer" app, you can create a ``fake-dns.txt`` file in the ``storage`` directory and set the "DNS 1" of your phone Wi-Fi connection to the IP address of the PC running zoffline
* Note: If you know what you're doing and have a capable enough router you can adjust your router to alter these DNS records instead of using the "Host Changer" app or changing your phone DNS.
* Run "Virtual Hosts", select the created `hosts.txt` file, fully close (touch the "overview" button and swipe up) the app and run it again
* Optionally, instead of using the "Virtual Hosts" app, you can create a ``fake-dns.txt`` file in the ``storage`` directory and set the "DNS 1" of your phone Wi-Fi connection to the IP address of the PC running zoffline
* Note: If you know what you're doing and have a capable enough router you can adjust your router to alter these DNS records instead of using the "Virtual Hosts" app or changing your phone DNS.
* 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.
* 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
* Play Zwift:
* Host Changer button must be ON
* Virtual Hosts button must be ON
* Start Zwift and sign in using any email/password
* If multiplayer is enabled, access `https://<zoffline ip>/signup/` to sign up and import your files. (You must accept an invalid certificate alert).

Why: We need to redirect Zwift to use zoffline (this is done by the Host Changer app) and convince Zwift to
Why: We need to redirect Zwift to use zoffline (this is done by the Virtual Hosts app) and convince Zwift to
accept zoffline's self signed certificates for Zwift's domain names (this is done by the patch tool ZofflineObb).

</details>
Expand Down Expand Up @@ -296,24 +278,22 @@ To enable support for multiple users perform the steps below:

### Step 7 [OPTIONAL]: Install Zwift Companion App

Create a ``server-ip.txt`` file in the ``storage`` directory containing the IP address of the PC running zoffline.
<details><summary>Android (non-rooted device)</summary>

* Install apk-mitm (https://github.com/shroudedcode/apk-mitm)
* Copy the file [ssl/cert-zwift-com.pem](https://github.com/zoffline/zwift-offline/raw/master/ssl/cert-zwift-com.pem) in this repo and the Zwift Companion apk (e.g. ``zca.apk``) to a known location
* Open Command Prompt, cd to that location and run
* ``apk-mitm --certificate cert-zwift-com.pem zca.apk``
* Copy ``zca-patched.apk`` to your phone and install it
* Download "Gaming VPN" from Google Play ([link](https://play.google.com/store/apps/details?id=com.gamingvpn))
* Download and install ``app-Github-release.apk`` from [here](https://github.com/x-falcon/Virtual-Hosts/releases/latest)
* Create a ``hosts.txt`` file to use with the app (you could use a text editor app or create it online with an online tool such as [this](https://passwordsgenerator.net/text-editor/)). The file must look like this (replace ``<zoffline ip>`` with the IP address of the machine running zoffline):
```
<zoffline ip> us-or-rly101.zwift.com
<zoffline ip> secure.zwift.com
```
* Run "Host Changer", select created ``hosts.txt`` file and press the button
* Optionally, instead of using the "Host Changer" app, you can create a ``fake-dns.txt`` file in the ``storage`` directory and set the "DNS 1" of your phone Wi-Fi connection to the IP address of the PC running zoffline
* Note: If you know what you're doing and have a capable enough router you can adjust your router to alter these DNS records instead of using the "Host Changer" app or changing your phone DNS.
* Run "Virtual Hosts", select the created ``hosts.txt`` file, fully close (touch the "overview" button and swipe up) the app and run it again
* Optionally, instead of using the "Virtual Hosts" app, you can create a ``fake-dns.txt`` file in the ``storage`` directory and set the "DNS 1" of your phone Wi-Fi connection to the IP address of the PC running zoffline
* Note: If you know what you're doing and have a capable enough router you can adjust your router to alter these DNS records instead of using the "Virtual Hosts" app or changing your phone DNS.

</details>

Expand Down
Loading

0 comments on commit b90e69d

Please sign in to comment.