Compare commits

...
Author SHA1 Message Date
vkamn 5aff2ce580 fix: run deploy jobs with always() and check build results in a step (#3483) 2026-11-17 02:03:55 +09:00
vkamn 41a6757042 fix: gate deploy jobs on always() with explicit build result checks (#3482) 2026-11-17 01:20:54 +09:00
vkamn f0b12257ab chore: minor fixes (#3481)
* fix: distribute TestFlight builds to the test-external group

* chore: bump version
2026-11-16 22:10:45 +09:00
vkamn 762f61cea3 fix: run deploy jobs when prebuilt baking is skipped (#3476) 2026-11-16 12:30:32 +09:00
vkamn 1efeab81b6 fix: stop exposing the XRay server address in VPN routes (#3473) 2026-11-16 00:36:23 +09:00
vkamn a9e6a2222c chore: minor fixes (#3472)
* feat: send TestFlight builds to the external test group

* fix: lock app split tunneling list during active connection

* fix: ignore tun2socks stderr after the process is reset

* fix: leave the start screen when a subscription is restored in background

* chore: pass AGW public keys as base64

* chore: bump version

* chore: configure dev gateway from the dev menu
2026-11-15 23:57:13 +09:00
vkamn 5c732f6edc feat: send TestFlight builds to the external test group (#3467) 2026-11-14 20:59:46 +09:00
vkamn 2bd60309d0 feat: ci release ios (#3465)
* feat: upload Play AABs to the Google Play beta track on version tags

* chore: bump xcode-version

* fix: pass provisioning profiles explicitly when exporting Apple archives
2026-11-14 01:56:40 +09:00
vkamn 0514a5d5b1 chore: remove double build for macos ne and ios (#3464) 2026-11-14 00:11:49 +09:00
vkamn c6af4cc266 chore: upload iOS and macOS NE builds to TestFlight on version tags (#3463) 2026-11-14 00:06:56 +09:00
vkamn 62a8a79931 feat: ci release ios (#3462)
* feat: upload iOS and macOS NE builds to TestFlight on version tags

* chore: bump version
2026-11-13 23:40:12 +09:00
31 changed files with 461 additions and 193 deletions

No files matched your search

@@ -14,7 +14,6 @@ runs:
- name: Setup provisioning profile
shell: bash
run: |
PROFILES_DIR="$HOME/Library/MobileDevice/Provisioning Profiles"
TEMP_FILE=$(mktemp)
echo "${{ inputs.provisioning_profile_base64 }}" | base64 --decode > "$TEMP_FILE"
@@ -26,6 +25,12 @@ runs:
exit 1
fi
mkdir -p "$PROFILES_DIR"
mv "$TEMP_FILE" "$PROFILES_DIR/$PROFILE_UUID.mobileprovision"
echo "Installed profile: $PROFILE_UUID"
PROFILE_EXTENSION=mobileprovision
grep -aq "<string>OSX</string>" "$TEMP_FILE" && PROFILE_EXTENSION=provisionprofile
for PROFILES_DIR in "$HOME/Library/MobileDevice/Provisioning Profiles" "$HOME/Library/Developer/Xcode/UserData/Provisioning Profiles"; do
mkdir -p "$PROFILES_DIR"
cp "$TEMP_FILE" "$PROFILES_DIR/$PROFILE_UUID.$PROFILE_EXTENSION"
done
rm -f "$TEMP_FILE"
echo "Installed profile: $PROFILE_UUID.$PROFILE_EXTENSION"
+195 -58
View File
@@ -73,12 +73,12 @@ jobs:
env:
QT_VERSION: 6.10.1
QIF_VERSION: 4.7
PROD_AGW_PUBLIC_KEY: ${{ secrets.PROD_AGW_PUBLIC_KEY }}
PROD_AGW_PUBLIC_KEY_B64: ${{ secrets.PROD_AGW_PUBLIC_KEY_B64 }}
PROD_S3_ENDPOINT: ${{ secrets.PROD_S3_ENDPOINT }}
FALLBACK_S3_ENDPOINT: ${{ secrets.FALLBACK_S3_ENDPOINT }}
DEV_AGW_PUBLIC_KEY: ${{ secrets.DEV_AGW_PUBLIC_KEY }}
DEV_AGW_ENDPOINT: ${{ secrets.DEV_AGW_ENDPOINT }}
DEV_S3_ENDPOINT: ${{ secrets.DEV_S3_ENDPOINT }}
SANDBOX_AGW_PUBLIC_KEY_B64: ${{ secrets.SANDBOX_AGW_PUBLIC_KEY_B64 }}
SANDBOX_AGW_ENDPOINT: ${{ secrets.SANDBOX_AGW_ENDPOINT }}
SANDBOX_S3_ENDPOINT: ${{ secrets.SANDBOX_S3_ENDPOINT }}
FREE_V2_ENDPOINT: ${{ secrets.FREE_V2_ENDPOINT }}
PREM_V1_ENDPOINT: ${{ secrets.PREM_V1_ENDPOINT }}
@@ -188,12 +188,12 @@ jobs:
env:
QT_VERSION: 6.10.1
QIF_VERSION: 4.7
PROD_AGW_PUBLIC_KEY: ${{ secrets.PROD_AGW_PUBLIC_KEY }}
PROD_AGW_PUBLIC_KEY_B64: ${{ secrets.PROD_AGW_PUBLIC_KEY_B64 }}
PROD_S3_ENDPOINT: ${{ secrets.PROD_S3_ENDPOINT }}
FALLBACK_S3_ENDPOINT: ${{ secrets.FALLBACK_S3_ENDPOINT }}
DEV_AGW_PUBLIC_KEY: ${{ secrets.DEV_AGW_PUBLIC_KEY }}
DEV_AGW_ENDPOINT: ${{ secrets.DEV_AGW_ENDPOINT }}
DEV_S3_ENDPOINT: ${{ secrets.DEV_S3_ENDPOINT }}
SANDBOX_AGW_PUBLIC_KEY_B64: ${{ secrets.SANDBOX_AGW_PUBLIC_KEY_B64 }}
SANDBOX_AGW_ENDPOINT: ${{ secrets.SANDBOX_AGW_ENDPOINT }}
SANDBOX_S3_ENDPOINT: ${{ secrets.SANDBOX_S3_ENDPOINT }}
FREE_V2_ENDPOINT: ${{ secrets.FREE_V2_ENDPOINT }}
PREM_V1_ENDPOINT: ${{ secrets.PREM_V1_ENDPOINT }}
@@ -335,12 +335,12 @@ jobs:
QT_VERSION: 6.10.1
KEYCHAIN_PASSWORD: ""
PROD_AGW_PUBLIC_KEY: ${{ secrets.PROD_AGW_PUBLIC_KEY }}
PROD_AGW_PUBLIC_KEY_B64: ${{ secrets.PROD_AGW_PUBLIC_KEY_B64 }}
PROD_S3_ENDPOINT: ${{ secrets.PROD_S3_ENDPOINT }}
FALLBACK_S3_ENDPOINT: ${{ secrets.FALLBACK_S3_ENDPOINT }}
DEV_AGW_PUBLIC_KEY: ${{ secrets.DEV_AGW_PUBLIC_KEY }}
DEV_AGW_ENDPOINT: ${{ secrets.DEV_AGW_ENDPOINT }}
DEV_S3_ENDPOINT: ${{ secrets.DEV_S3_ENDPOINT }}
SANDBOX_AGW_PUBLIC_KEY_B64: ${{ secrets.SANDBOX_AGW_PUBLIC_KEY_B64 }}
SANDBOX_AGW_ENDPOINT: ${{ secrets.SANDBOX_AGW_ENDPOINT }}
SANDBOX_S3_ENDPOINT: ${{ secrets.SANDBOX_S3_ENDPOINT }}
FREE_V2_ENDPOINT: ${{ secrets.FREE_V2_ENDPOINT }}
PREM_V1_ENDPOINT: ${{ secrets.PREM_V1_ENDPOINT }}
@@ -377,7 +377,7 @@ jobs:
- name: 'Setup xcode'
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '26.0'
xcode-version: '26.4'
- name: 'Install desktop Qt'
uses: jurplel/install-qt-action@v3
@@ -417,12 +417,24 @@ jobs:
APPSTORE_CONNECT_KEY_ID: ${{ secrets.APPSTORE_CONNECT_KEY_ID }}
APPSTORE_CONNECT_ISSUER_ID: ${{ secrets.APPSTORE_CONNECT_ISSUER_ID }}
APPSTORE_CONNECT_PRIVATE_KEY: ${{ secrets.APPSTORE_CONNECT_PRIVATE_KEY }}
CONFIGURE_ONLY: ${{ startsWith(github.ref, 'refs/tags/') && 'true' || '' }}
shell: bash
run: |
sh deploy/build.sh -t ios | \
sed -e '/-Xcc -DPROD_AGW_PUBLIC_KEY/,/-Xcc/ { /-Xcc/!d; }' -e '/-Xcc -DPROD_AGW_PUBLIC_KEY/d' | \
sed -e '/-Xcc -DDEV_AGW_PUBLIC_KEY/,/-Xcc/ { /-Xcc/!d; }' -e '/-Xcc -DDEV_AGW_PUBLIC_KEY/d' | \
sed -e '/-DPROD_AGW_PUBLIC_KEY/,/-D/ { /-D/!d; }' -e '/-DPROD_AGW_PUBLIC_KEY/d' | \
sed -e '/-DDEV_AGW_PUBLIC_KEY/,/-D/ { /-D/!d; }' -e '/-DDEV_AGW_PUBLIC_KEY/d'
sh deploy/build.sh -t ios | sed -f deploy/hide_secrets.sed
- name: 'Archive for App Store'
if: startsWith(github.ref, 'refs/tags/')
working-directory: deploy
shell: bash
run: fastlane ios archive 2>&1 | sed -f hide_secrets.sed
- name: 'Upload App Store package'
if: startsWith(github.ref, 'refs/tags/')
uses: actions/upload-artifact@v7
with:
path: deploy/build/ios/AmneziaVPN.ipa
archive: false
retention-days: 7
# ------------------------------------------------------
@@ -483,12 +495,12 @@ jobs:
QT_VERSION: 6.10.1
KEYCHAIN_PASSWORD: ""
PROD_AGW_PUBLIC_KEY: ${{ secrets.PROD_AGW_PUBLIC_KEY }}
PROD_AGW_PUBLIC_KEY_B64: ${{ secrets.PROD_AGW_PUBLIC_KEY_B64 }}
PROD_S3_ENDPOINT: ${{ secrets.PROD_S3_ENDPOINT }}
FALLBACK_S3_ENDPOINT: ${{ secrets.FALLBACK_S3_ENDPOINT }}
DEV_AGW_PUBLIC_KEY: ${{ secrets.DEV_AGW_PUBLIC_KEY }}
DEV_AGW_ENDPOINT: ${{ secrets.DEV_AGW_ENDPOINT }}
DEV_S3_ENDPOINT: ${{ secrets.DEV_S3_ENDPOINT }}
SANDBOX_AGW_PUBLIC_KEY_B64: ${{ secrets.SANDBOX_AGW_PUBLIC_KEY_B64 }}
SANDBOX_AGW_ENDPOINT: ${{ secrets.SANDBOX_AGW_ENDPOINT }}
SANDBOX_S3_ENDPOINT: ${{ secrets.SANDBOX_S3_ENDPOINT }}
FREE_V2_ENDPOINT: ${{ secrets.FREE_V2_ENDPOINT }}
PREM_V1_ENDPOINT: ${{ secrets.PREM_V1_ENDPOINT }}
@@ -631,19 +643,14 @@ jobs:
env:
QT_VERSION: 6.10.1
KEYCHAIN_PASSWORD: ""
MAC_TEAM_ID: ${{ secrets.MAC_TEAM_ID }}
MAC_APP_CERT_CERT: ${{ secrets.MAC_APP_CERT_CERT }}
MAC_SIGNER_ID: ${{ secrets.MAC_SIGNER_ID }}
MAC_APP_CERT_PW: ${{ secrets.MAC_APP_CERT_PW }}
PROD_AGW_PUBLIC_KEY: ${{ secrets.PROD_AGW_PUBLIC_KEY }}
PROD_AGW_PUBLIC_KEY_B64: ${{ secrets.PROD_AGW_PUBLIC_KEY_B64 }}
PROD_S3_ENDPOINT: ${{ secrets.PROD_S3_ENDPOINT }}
FALLBACK_S3_ENDPOINT: ${{ secrets.FALLBACK_S3_ENDPOINT }}
DEV_AGW_PUBLIC_KEY: ${{ secrets.DEV_AGW_PUBLIC_KEY }}
DEV_AGW_ENDPOINT: ${{ secrets.DEV_AGW_ENDPOINT }}
DEV_S3_ENDPOINT: ${{ secrets.DEV_S3_ENDPOINT }}
SANDBOX_AGW_PUBLIC_KEY_B64: ${{ secrets.SANDBOX_AGW_PUBLIC_KEY_B64 }}
SANDBOX_AGW_ENDPOINT: ${{ secrets.SANDBOX_AGW_ENDPOINT }}
SANDBOX_S3_ENDPOINT: ${{ secrets.SANDBOX_S3_ENDPOINT }}
FREE_V2_ENDPOINT: ${{ secrets.FREE_V2_ENDPOINT }}
PREM_V1_ENDPOINT: ${{ secrets.PREM_V1_ENDPOINT }}
@@ -654,13 +661,37 @@ jobs:
submodules: 'true'
fetch-depth: 10
- uses: ./.github/actions/apple-setup-provisioning-profile
- uses: ./.github/actions/apple-setup-keychain
id: setup-keychain
with:
provisioning_profile_base64: ${{ secrets.MAC_APP_PROVISIONING_PROFILE }}
keychain-password: ${{ env.KEYCHAIN_PASSWORD }}
- uses: ./.github/actions/apple-setup-provisioning-profile
- name: 'Install signing certificate'
uses: ./.github/actions/apple-install-cert
with:
provisioning_profile_base64: ${{ secrets.MAC_NE_PROVISIONING_PROFILE }}
keychain-path: ${{ steps.setup-keychain.outputs.keychain-path }}
keychain-password: ${{ env.KEYCHAIN_PASSWORD }}
cert-base64: ${{ secrets.IOS_SIGNING_CERT_BASE64 }}
cert-password: ${{ secrets.IOS_SIGNING_CERT_PASSWORD }}
- name: 'Install installer certificate'
if: startsWith(github.ref, 'refs/tags/')
uses: ./.github/actions/apple-install-cert
with:
keychain-path: ${{ steps.setup-keychain.outputs.keychain-path }}
keychain-password: ${{ env.KEYCHAIN_PASSWORD }}
cert-base64: ${{ secrets.MAC_APPSTORE_INSTALLER_CERT_BASE64 }}
cert-password: ${{ secrets.MAC_APPSTORE_INSTALLER_CERT_PASSWORD }}
- name: 'Install app provisioning profile'
uses: ./.github/actions/apple-setup-provisioning-profile
with:
provisioning_profile_base64: ${{ secrets.APPSTORE_CONNECT_MAC_PROVISIONING }}
- name: 'Install NE provisioning profile'
uses: ./.github/actions/apple-setup-provisioning-profile
with:
provisioning_profile_base64: ${{ secrets.APPSTORE_CONNECT_MAC_NE_PROVISIONING }}
- name: 'Setup xcode'
uses: maxim-lobanov/setup-xcode@v1
@@ -679,18 +710,6 @@ jobs:
set-env: 'true'
extra: '--base ${{ env.QT_MIRROR }}'
- name: 'Install go'
uses: actions/setup-go@v5
with:
go-version: '1.24'
cache: false
- name: 'Setup gomobile'
run: |
export PATH=$PATH:~/go/bin
go install golang.org/x/mobile/cmd/gomobile@latest
gomobile init
- name: 'Setup python'
uses: actions/setup-python@v6
with:
@@ -700,15 +719,32 @@ jobs:
run: pip install "conan==2.28.0"
- name: 'Build project'
run: |
export QT_BIN_DIR="${{ runner.temp }}/Qt/${{ env.QT_VERSION }}/macos/bin"
bash deploy/build_macos_ne.sh
env:
QT_INSTALL_DIR: ${{ runner.temp }}
CONFIGURE_ONLY: ${{ startsWith(github.ref, 'refs/tags/') && 'true' || '' }}
shell: bash
run: deploy/build.sh -t macos-ne | sed -f deploy/hide_secrets.sed
- name: 'Upload unpacked artifact'
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
uses: actions/upload-artifact@v4
with:
name: AmneziaVPN_MacOS_unpacked
path: deploy/build/client/AmneziaVPN.app
path: deploy/build/client/Release/AmneziaVPN.app
retention-days: 7
- name: 'Archive for App Store'
if: startsWith(github.ref, 'refs/tags/')
working-directory: deploy
shell: bash
run: fastlane mac archive 2>&1 | sed -f hide_secrets.sed
- name: 'Upload App Store package'
if: startsWith(github.ref, 'refs/tags/')
uses: actions/upload-artifact@v7
with:
path: deploy/build/osx/AmneziaVPN.pkg
archive: false
retention-days: 7
# ------------------------------------------------------
@@ -806,12 +842,12 @@ jobs:
APP_ANDROID_VERSION_CODE_OFFSET: ${{ matrix.version_code_offset }}
CMAKE_C_COMPILER_LAUNCHER: ccache
CMAKE_CXX_COMPILER_LAUNCHER: ccache
PROD_AGW_PUBLIC_KEY: ${{ secrets.PROD_AGW_PUBLIC_KEY }}
PROD_AGW_PUBLIC_KEY_B64: ${{ secrets.PROD_AGW_PUBLIC_KEY_B64 }}
PROD_S3_ENDPOINT: ${{ secrets.PROD_S3_ENDPOINT }}
FALLBACK_S3_ENDPOINT: ${{ secrets.FALLBACK_S3_ENDPOINT }}
DEV_AGW_PUBLIC_KEY: ${{ secrets.DEV_AGW_PUBLIC_KEY }}
DEV_AGW_ENDPOINT: ${{ secrets.DEV_AGW_ENDPOINT }}
DEV_S3_ENDPOINT: ${{ secrets.DEV_S3_ENDPOINT }}
SANDBOX_AGW_PUBLIC_KEY_B64: ${{ secrets.SANDBOX_AGW_PUBLIC_KEY_B64 }}
SANDBOX_AGW_ENDPOINT: ${{ secrets.SANDBOX_AGW_ENDPOINT }}
SANDBOX_S3_ENDPOINT: ${{ secrets.SANDBOX_S3_ENDPOINT }}
FREE_V2_ENDPOINT: ${{ secrets.FREE_V2_ENDPOINT }}
PREM_V1_ENDPOINT: ${{ secrets.PREM_V1_ENDPOINT }}
@@ -1659,13 +1695,21 @@ jobs:
# ------------------------------------------------------
Pre-Release:
if: startsWith(github.ref, 'refs/tags/')
needs: [Build-Linux-Ubuntu, Build-MacOS, Build-Android]
if: ${{ always() && startsWith(github.ref, 'refs/tags/') }}
needs: [Build-Linux-Ubuntu, Build-Windows, Build-iOS, Build-MacOS, Build-MacOS-NE, Build-Android]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: 'Check builds'
working-directory: .
env:
NEEDS: ${{ toJSON(needs) }}
run: |
jq -c 'map_values(.result)' <<< "$NEEDS"
jq -e 'all(.[]; .result == "success" or .result == "skipped")' <<< "$NEEDS"
- name: 'Get release notes template'
uses: actions/checkout@v4
with:
@@ -1702,3 +1746,96 @@ jobs:
gh release create "$TAG" dist/* --repo "$GITHUB_REPOSITORY" \
--title "$TAG" --notes-file release-notes.md --draft --prerelease --verify-tag
fi
# ------------------------------------------------------
TestFlight:
if: ${{ always() && startsWith(github.ref, 'refs/tags/') }}
needs: [Build-Linux-Ubuntu, Build-Windows, Build-iOS, Build-MacOS, Build-MacOS-NE, Build-Android]
runs-on: macos-26
env:
APPSTORE_CONNECT_KEY_ID: ${{ secrets.APPSTORE_CONNECT_KEY_ID }}
APPSTORE_CONNECT_ISSUER_ID: ${{ secrets.APPSTORE_CONNECT_ISSUER_ID }}
APPSTORE_CONNECT_PRIVATE_KEY: ${{ secrets.APPSTORE_CONNECT_PRIVATE_KEY }}
defaults:
run:
working-directory: deploy
shell: bash
steps:
- name: 'Check builds'
working-directory: .
env:
NEEDS: ${{ toJSON(needs) }}
run: |
jq -c 'map_values(.result)' <<< "$NEEDS"
jq -e 'all(.[]; .result == "success" or .result == "skipped")' <<< "$NEEDS"
- name: 'Get fastlane config'
uses: actions/checkout@v4
with:
sparse-checkout: |
deploy/fastlane
deploy/hide_secrets.sed
sparse-checkout-cone-mode: false
- name: 'Download iOS package'
uses: actions/download-artifact@v8
with:
name: AmneziaVPN.ipa
path: deploy/build/ios
- name: 'Download macOS package'
uses: actions/download-artifact@v8
with:
name: AmneziaVPN.pkg
path: deploy/build/osx
- name: 'Upload iOS build to TestFlight'
run: fastlane ios testflight_upload 2>&1 | sed -f hide_secrets.sed
- name: 'Upload macOS build to TestFlight'
run: fastlane mac testflight_upload 2>&1 | sed -f hide_secrets.sed
# ------------------------------------------------------
Google-Play:
if: ${{ always() && startsWith(github.ref, 'refs/tags/') }}
needs: [Build-Linux-Ubuntu, Build-Windows, Build-iOS, Build-MacOS, Build-MacOS-NE, Build-Android]
runs-on: ubuntu-24.04
defaults:
run:
working-directory: deploy
shell: bash
steps:
- name: 'Check builds'
working-directory: .
env:
NEEDS: ${{ toJSON(needs) }}
run: |
jq -c 'map_values(.result)' <<< "$NEEDS"
jq -e 'all(.[]; .result == "success" or .result == "skipped")' <<< "$NEEDS"
- name: 'Get fastlane config'
uses: actions/checkout@v4
with:
sparse-checkout: |
deploy/fastlane
deploy/hide_secrets.sed
sparse-checkout-cone-mode: false
- name: 'Download Play AABs'
uses: actions/download-artifact@v8
with:
pattern: 'AmneziaVPN_*_play.aab'
path: deploy/build/android
merge-multiple: true
- name: 'Upload to Google Play beta'
env:
GOOGLE_PLAY_SERVICE_ACCOUNT_JSON: ${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT_JSON }}
run: fastlane android play_upload 2>&1 | sed -f hide_secrets.sed
+4 -4
View File
@@ -15,12 +15,12 @@ jobs:
env:
QT_VERSION: 6.4.1
QIF_VERSION: 4.5
PROD_AGW_PUBLIC_KEY: ${{ secrets.PROD_AGW_PUBLIC_KEY }}
PROD_AGW_PUBLIC_KEY_B64: ${{ secrets.PROD_AGW_PUBLIC_KEY_B64 }}
PROD_S3_ENDPOINT: ${{ secrets.PROD_S3_ENDPOINT }}
FALLBACK_S3_ENDPOINT: ${{ secrets.FALLBACK_S3_ENDPOINT }}
DEV_AGW_PUBLIC_KEY: ${{ secrets.DEV_AGW_PUBLIC_KEY }}
DEV_AGW_ENDPOINT: ${{ secrets.DEV_AGW_ENDPOINT }}
DEV_S3_ENDPOINT: ${{ secrets.DEV_S3_ENDPOINT }}
SANDBOX_AGW_PUBLIC_KEY_B64: ${{ secrets.SANDBOX_AGW_PUBLIC_KEY_B64 }}
SANDBOX_AGW_ENDPOINT: ${{ secrets.SANDBOX_AGW_ENDPOINT }}
SANDBOX_S3_ENDPOINT: ${{ secrets.SANDBOX_S3_ENDPOINT }}
FREE_V2_ENDPOINT: ${{ secrets.FREE_V2_ENDPOINT }}
PREM_V1_ENDPOINT: ${{ secrets.PREM_V1_ENDPOINT }}
+1 -1
View File
@@ -5,7 +5,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(PROJECT AmneziaVPN)
if(NOT AMNEZIAVPN_VERSION)
set(AMNEZIAVPN_VERSION 5.1.1.0 CACHE STRING "Client app version")
set(AMNEZIAVPN_VERSION 5.1.1.9 CACHE STRING "Client app version")
endif()
set(QT_CREATOR_SKIP_PACKAGE_MANAGER_SETUP ON CACHE BOOL "" FORCE)
+4 -4
View File
@@ -25,13 +25,13 @@ execute_process(
add_definitions(-DGIT_COMMIT_HASH="${GIT_COMMIT_HASH}")
add_definitions(-DPROD_AGW_PUBLIC_KEY="$ENV{PROD_AGW_PUBLIC_KEY}")
add_definitions(-DPROD_AGW_PUBLIC_KEY_B64="$ENV{PROD_AGW_PUBLIC_KEY_B64}")
add_definitions(-DPROD_S3_ENDPOINT="$ENV{PROD_S3_ENDPOINT}")
add_definitions(-DFALLBACK_S3_ENDPOINT="$ENV{FALLBACK_S3_ENDPOINT}")
add_definitions(-DDEV_AGW_PUBLIC_KEY="$ENV{DEV_AGW_PUBLIC_KEY}")
add_definitions(-DDEV_AGW_ENDPOINT="$ENV{DEV_AGW_ENDPOINT}")
add_definitions(-DDEV_S3_ENDPOINT="$ENV{DEV_S3_ENDPOINT}")
add_definitions(-DSANDBOX_AGW_PUBLIC_KEY_B64="$ENV{SANDBOX_AGW_PUBLIC_KEY_B64}")
add_definitions(-DSANDBOX_AGW_ENDPOINT="$ENV{SANDBOX_AGW_ENDPOINT}")
add_definitions(-DSANDBOX_S3_ENDPOINT="$ENV{SANDBOX_S3_ENDPOINT}")
add_definitions(-DFREE_V2_ENDPOINT="$ENV{FREE_V2_ENDPOINT}")
add_definitions(-DPREM_V1_ENDPOINT="$ENV{PREM_V1_ENDPOINT}")
@@ -113,9 +113,6 @@ class Xray : Protocol() {
addRoute(InetNetwork("0.0.0.0", 0))
addRoute(InetNetwork("2000::0", 3))
config.getString("hostName").let {
excludeRoute(InetNetwork(it, 32))
}
config.optString("mtu").let {
if (it.isNotBlank()) setMtu(it.toInt())
+4 -4
View File
@@ -32,14 +32,14 @@ endif()
# -- signing
if(NOT CLIENT_IOS_PROVISIONING_PROFILE_SPECIFIER)
set(CLIENT_IOS_PROVISIONING_PROFILE_SPECIFIER "distr ios.org.amnezia.AmneziaVPN" CACHE STRING "iOS app provisioning profile specifier for release")
set(CLIENT_IOS_PROVISIONING_PROFILE_SPECIFIER "distr ios.org.amnezia.amneziaVPN" CACHE STRING "iOS app provisioning profile specifier for release")
endif()
if(NOT CLIENT_IOS_PROVISIONING_PROFILE_SPECIFIER_DEBUG)
set(CLIENT_IOS_PROVISIONING_PROFILE_SPECIFIER_DEBUG "dev ios.org.amnezia.AmneziaVPN" CACHE STRING "iOS app provisioning profile specifier for debug")
set(CLIENT_IOS_PROVISIONING_PROFILE_SPECIFIER_DEBUG "dev ios.org.amnezia.amneziaVPN" CACHE STRING "iOS app provisioning profile specifier for debug")
endif()
if(NOT CLIENT_IOS_NE_PROVISIONING_PROFILE_SPECIFIER)
set(CLIENT_IOS_NE_PROVISIONING_PROFILE_SPECIFIER "distr ios.org.amnezia.AmneziaVPN" CACHE STRING "iOS network extension provisioning profile specifier for release")
set(CLIENT_IOS_NE_PROVISIONING_PROFILE_SPECIFIER "distr ios.org.amnezia.amneziaVPN.NE" CACHE STRING "iOS network extension provisioning profile specifier for release")
endif()
if(NOT CLIENT_IOS_NE_PROVISIONING_PROFILE_SPECIFIER_DEBUG)
set(CLIENT_IOS_NE_PROVISIONING_PROFILE_SPECIFIER_DEBUG "dev ios.org.amnezia.AmneziaVPN" CACHE STRING "iOS network extension provisioning profile specifier for debug")
set(CLIENT_IOS_NE_PROVISIONING_PROFILE_SPECIFIER_DEBUG "dev ios.org.amnezia.amneziaVPN.NE" CACHE STRING "iOS network extension provisioning profile specifier for debug")
endif()
+1 -1
View File
@@ -24,7 +24,7 @@ endif()
# -- signing
if(NOT CLIENT_MACOS_PROVISIONING_PROFILE_SPECIFIER)
set(CLIENT_MACOS_PROVISIONING_PROFILE_SPECIFIER "distr macos.org.amnezia.AmneziaVPN" CACHE STRING "macOS app provisioning profile specifier for release")
set(CLIENT_MACOS_PROVISIONING_PROFILE_SPECIFIER "distr macos.org.amnezia.amneziaVPN" CACHE STRING "macOS app provisioning profile specifier for release")
endif()
if(NOT CLIENT_MACOS_PROVISIONING_PROFILE_SPECIFIER_DEBUG)
set(CLIENT_MACOS_PROVISIONING_PROFILE_SPECIFIER_DEBUG "dev macos.org.amnezia.AmneziaVPN" CACHE STRING "macOS app provisioning profile specifier for debug")
+7 -1
View File
@@ -156,6 +156,12 @@ message(${QtCore_location})
get_filename_component(QT_BIN_DIR_DETECTED "${QtCore_location}/../../../../../bin" ABSOLUTE)
set(MACDEPLOYQT_ARGS -appstore-compliant -qmldir=${CMAKE_CURRENT_SOURCE_DIR})
if(Qt6_VERSION VERSION_GREATER_EQUAL 6.11)
list(APPEND MACDEPLOYQT_ARGS -no-codesign)
endif()
# $<TARGET_BUNDLE_DIR> points to the build tree; xcodebuild archive builds the bundle elsewhere
add_custom_command(TARGET ${PROJECT} POST_BUILD
COMMAND ${QT_BIN_DIR_DETECTED}/macdeployqt $<TARGET_BUNDLE_DIR:${PROJECT}> -appstore-compliant -qmldir=${CMAKE_CURRENT_SOURCE_DIR} -no-codesign
COMMAND ${QT_BIN_DIR_DETECTED}/macdeployqt \${TARGET_BUILD_DIR}/\${WRAPPER_NAME} ${MACDEPLOYQT_ARGS}
)
@@ -77,11 +77,8 @@ QFuture<QPair<ErrorCode, QJsonArray>> NewsController::fetchNews()
}
QSharedPointer<GatewayController> gatewayController(
new GatewayController(m_appSettingsRepository->getGatewayEndpoint(),
m_appSettingsRepository->isDevGatewayEnv(),
apiDefs::requestTimeoutMsecs,
m_appSettingsRepository->isStrictKillSwitchEnabled(),
m_appSettingsRepository),
new GatewayController(m_appSettingsRepository->gatewayEnvironment(), apiDefs::requestTimeoutMsecs,
m_appSettingsRepository->isStrictKillSwitchEnabled(), m_appSettingsRepository),
&QObject::deleteLater);
// both country codes and service types are arrays here, one entry per gateway stack the user has
@@ -343,7 +343,7 @@ ErrorCode ServicesCatalogController::fillAvailableServices(QJsonObject &services
ErrorCode ServicesCatalogController::executeRequest(const QString &endpoint, const QJsonObject &apiPayload, QByteArray &responseBody)
{
GatewayController gatewayController(m_appSettingsRepository->getGatewayEndpoint(), m_appSettingsRepository->isDevGatewayEnv(), apiDefs::requestTimeoutMsecs,
GatewayController gatewayController(m_appSettingsRepository->gatewayEnvironment(), apiDefs::requestTimeoutMsecs,
m_appSettingsRepository->isStrictKillSwitchEnabled(), m_appSettingsRepository);
return gatewayController.post(endpoint, apiPayload, responseBody);
}
@@ -108,8 +108,8 @@ StorePurchaseController::StorePurchaseController(SecureServersRepository *server
ErrorCode StorePurchaseController::executeRequest(const QString &endpoint, const QJsonObject &apiPayload,
QByteArray &responseBody, bool isTestPurchase)
{
GatewayController gatewayController(m_appSettingsRepository->getGatewayEndpoint(isTestPurchase),
m_appSettingsRepository->isDevGatewayEnv(isTestPurchase), apiDefs::requestTimeoutMsecs,
GatewayController gatewayController(m_appSettingsRepository->gatewayEnvironment(isTestPurchase),
apiDefs::requestTimeoutMsecs,
m_appSettingsRepository->isStrictKillSwitchEnabled(), m_appSettingsRepository);
return gatewayController.post(endpoint, apiPayload, responseBody);
}
@@ -196,7 +196,8 @@ void SubscriptionController::updateApiConfigInJson(QJsonObject &serverConfigJson
ErrorCode SubscriptionController::executeRequest(const QString &endpoint, const QJsonObject &apiPayload, QByteArray &responseBody, bool isTestPurchase)
{
GatewayController gatewayController(m_appSettingsRepository->getGatewayEndpoint(isTestPurchase), m_appSettingsRepository->isDevGatewayEnv(isTestPurchase), apiDefs::requestTimeoutMsecs,
GatewayController gatewayController(m_appSettingsRepository->gatewayEnvironment(isTestPurchase),
apiDefs::requestTimeoutMsecs,
m_appSettingsRepository->isStrictKillSwitchEnabled(), m_appSettingsRepository);
return gatewayController.post(endpoint, apiPayload, responseBody);
}
@@ -811,11 +812,9 @@ QFuture<QPair<ErrorCode, QString>> SubscriptionController::getRenewalLink(const
.addField(apiDefs::key::subscriptionStatus, getSubscriptionStatusForRenewal(apiV2->apiConfig))
.build();
auto gatewayController = QSharedPointer<GatewayController>::create(m_appSettingsRepository->getGatewayEndpoint(isTestPurchase),
m_appSettingsRepository->isDevGatewayEnv(isTestPurchase),
apiDefs::requestTimeoutMsecs,
m_appSettingsRepository->isStrictKillSwitchEnabled(),
m_appSettingsRepository);
auto gatewayController = QSharedPointer<GatewayController>::create(
m_appSettingsRepository->gatewayEnvironment(isTestPurchase), apiDefs::requestTimeoutMsecs,
m_appSettingsRepository->isStrictKillSwitchEnabled(), m_appSettingsRepository);
auto postFuture = gatewayController->postAsync(QString("%1v1/renewal_link"), apiPayload);
auto *watcher = new QFutureWatcher<QPair<ErrorCode, QByteArray>>();
QObject::connect(watcher, &QFutureWatcher<QPair<ErrorCode, QByteArray>>::finished,
+14 -22
View File
@@ -56,9 +56,9 @@ namespace
constexpr QLatin1String endpointListSeparator(", ");
constexpr QLatin1String legacyEndpointPlaceholder("%1");
QStringList splitEndpoints(const char *raw)
QStringList splitEndpoints(const QString &raw)
{
return QString::fromUtf8(raw).split(endpointListSeparator, Qt::SkipEmptyParts);
return raw.split(endpointListSeparator, Qt::SkipEmptyParts);
}
void logAgwTrace(const QString &path, const int code, const QString &trace)
@@ -77,32 +77,24 @@ namespace
}
}
GatewayController::GatewayController(const QString &gatewayEndpoint, const bool isDevEnvironment, const int requestTimeoutMsecs,
const bool isStrictKillSwitchEnabled, SecureAppSettingsRepository *appSettingsRepository,
QObject *parent)
GatewayController::GatewayController(const amnezia::GatewayEnvironment &environment, const int requestTimeoutMsecs,
const bool isStrictKillSwitchEnabled,
SecureAppSettingsRepository *appSettingsRepository, QObject *parent)
: QObject(parent),
m_gatewayEndpoint(gatewayEndpoint),
m_gatewayEndpoint(environment.endpoint),
m_isStrictKillSwitchEnabled(isStrictKillSwitchEnabled),
m_appSettingsRepository(appSettingsRepository)
{
const QByteArray publicKey = isDevEnvironment ? QByteArray(DEV_AGW_PUBLIC_KEY) : QByteArray(PROD_AGW_PUBLIC_KEY);
m_publicKeyMissing = publicKey.isEmpty();
QStringList primaryEndpoints;
QStringList fallbackEndpoints;
if (isDevEnvironment) {
primaryEndpoints = splitEndpoints(DEV_S3_ENDPOINT);
} else {
primaryEndpoints = splitEndpoints(PROD_S3_ENDPOINT);
fallbackEndpoints = splitEndpoints(FALLBACK_S3_ENDPOINT);
}
m_publicKeyMissing = environment.publicKey.isEmpty();
QJsonObject config;
config[agwConfigKey::gatewayEndpoint] = gatewayEndpoint;
config[agwConfigKey::publicKeyPem] = QString::fromUtf8(publicKey);
config[agwConfigKey::s3PrimaryEndpoints] = QJsonArray::fromStringList(primaryEndpoints);
config[agwConfigKey::s3FallbackEndpoints] = QJsonArray::fromStringList(fallbackEndpoints);
config[agwConfigKey::isDevEnvironment] = isDevEnvironment;
config[agwConfigKey::gatewayEndpoint] = environment.endpoint;
config[agwConfigKey::publicKeyPem] = QString::fromUtf8(environment.publicKey);
config[agwConfigKey::s3PrimaryEndpoints] =
QJsonArray::fromStringList(splitEndpoints(environment.primaryProxyStorages));
config[agwConfigKey::s3FallbackEndpoints] =
QJsonArray::fromStringList(splitEndpoints(environment.fallbackProxyStorages));
config[agwConfigKey::isDevEnvironment] = environment.isDev;
config[agwConfigKey::requestTimeoutMsecs] = requestTimeoutMsecs;
config[agwConfigKey::proxyRequestTimeoutMsecs] = apiDefs::proxyRequestTimeoutMsecs;
config[agwConfigKey::proxyStorageTimeoutMsecs] = apiDefs::proxyStorageTimeoutMsecs;
+2 -1
View File
@@ -9,6 +9,7 @@
#include <QString>
#include <QStringList>
#include "core/utils/commonStructs.h"
#include "core/utils/errorCodes.h"
#include "agw.h"
@@ -20,7 +21,7 @@ class GatewayController : public QObject
Q_OBJECT
public:
explicit GatewayController(const QString &gatewayEndpoint, const bool isDevEnvironment, const int requestTimeoutMsecs,
explicit GatewayController(const amnezia::GatewayEnvironment &environment, const int requestTimeoutMsecs,
const bool isStrictKillSwitchEnabled, SecureAppSettingsRepository *appSettingsRepository,
QObject *parent = nullptr);
~GatewayController() override;
+12 -11
View File
@@ -300,19 +300,25 @@ bool SettingsController::isDevModeEnabled() const
return m_isDevModeEnabled;
}
void SettingsController::resetGatewayEndpoint()
QString SettingsController::devGatewayEndpoint() const
{
m_appSettingsRepository->resetGatewayEndpoint();
return m_appSettingsRepository->devGatewayEndpoint();
}
void SettingsController::setGatewayEndpoint(const QString &endpoint)
QString SettingsController::devGatewayProxyStorages() const
{
m_appSettingsRepository->setGatewayEndpoint(endpoint);
return m_appSettingsRepository->devGatewayProxyStorages();
}
QString SettingsController::getGatewayEndpoint() const
QString SettingsController::devGatewayPublicKey() const
{
return m_appSettingsRepository->isDevGatewayEnv() ? "Dev endpoint" : m_appSettingsRepository->getGatewayEndpoint();
return m_appSettingsRepository->devGatewayPublicKey();
}
void SettingsController::setDevGatewayConfig(const QString &endpoint, const QString &proxyStorages,
const QString &publicKey)
{
m_appSettingsRepository->setDevGatewayConfig(endpoint, proxyStorages, publicKey);
}
bool SettingsController::isDevGatewayEnv() const
@@ -323,11 +329,6 @@ bool SettingsController::isDevGatewayEnv() const
void SettingsController::toggleDevGatewayEnv(bool enabled)
{
m_appSettingsRepository->toggleDevGatewayEnv(enabled);
if (enabled) {
m_appSettingsRepository->setDevGatewayEndpoint();
} else {
m_appSettingsRepository->resetGatewayEndpoint();
}
}
bool SettingsController::isHomeAdLabelVisible() const
+4 -3
View File
@@ -76,9 +76,10 @@ public:
QString nextAvailableServerName() const;
bool isDevModeEnabled() const;
void resetGatewayEndpoint();
void setGatewayEndpoint(const QString &endpoint);
QString getGatewayEndpoint() const;
QString devGatewayEndpoint() const;
QString devGatewayProxyStorages() const;
QString devGatewayPublicKey() const;
void setDevGatewayConfig(const QString &endpoint, const QString &proxyStorages, const QString &publicKey);
bool isDevGatewayEnv() const;
void toggleDevGatewayEnv(bool enabled);
+3 -5
View File
@@ -139,11 +139,9 @@ void UpdateController::checkForUpdates()
}
setUpdateCheckRunning(true);
auto gatewayController = QSharedPointer<GatewayController>::create(m_appSettingsRepository->getGatewayEndpoint(),
m_appSettingsRepository->isDevGatewayEnv(),
apiDefs::requestTimeoutMsecs,
m_appSettingsRepository->isStrictKillSwitchEnabled(),
m_appSettingsRepository);
auto gatewayController = QSharedPointer<GatewayController>::create(
m_appSettingsRepository->gatewayEnvironment(), apiDefs::requestTimeoutMsecs,
m_appSettingsRepository->isStrictKillSwitchEnabled(), m_appSettingsRepository);
QJsonObject apiPayload = GatewayPayloadBuilder(m_appSettingsRepository).build();
+4
View File
@@ -174,6 +174,10 @@ ErrorCode XrayProtocol::startTun2Socks()
connect(
m_tun2socksProcess.data(), &IpcProcessInterfaceReplica::readyReadStandardError, this,
[this]() {
if (!m_tun2socksProcess) {
return;
}
auto readAllStandardError = m_tun2socksProcess->readAllStandardError();
if (!readAllStandardError.waitForFinished()) {
qWarning() << "Failed to read output from tun2socks";
@@ -17,14 +17,12 @@
using namespace amnezia;
namespace {
constexpr char gatewayEndpoint[] = "http://gw.amnezia.org:80/";
constexpr char prodGatewayEndpoint[] = "http://gw.amnezia.org:80/";
}
SecureAppSettingsRepository::SecureAppSettingsRepository(SecureQSettings* settings, QObject *parent)
: QObject(parent), m_settings(settings)
{
QString storedEndpoint = value("Conf/gatewayEndpoint", gatewayEndpoint).toString();
m_gatewayEndpoint = storedEndpoint.isEmpty() ? gatewayEndpoint : storedEndpoint;
}
QVariant SecureAppSettingsRepository::value(const QString &key, const QVariant &defaultValue) const
@@ -270,35 +268,46 @@ void SecureAppSettingsRepository::setAppsSplitTunnelingEnabled(bool enabled)
emit appsSplitTunnelingEnabledChanged(enabled);
}
QString SecureAppSettingsRepository::getGatewayEndpoint(bool isTestPurchase) const
GatewayEnvironment SecureAppSettingsRepository::gatewayEnvironment(bool isTestPurchase) const
{
if (isTestPurchase) {
return QString(DEV_AGW_ENDPOINT);
return { SANDBOX_AGW_ENDPOINT, QByteArray::fromBase64(SANDBOX_AGW_PUBLIC_KEY_B64), SANDBOX_S3_ENDPOINT, {}, true };
}
return m_gatewayEndpoint;
if (isDevGatewayEnv()) {
return {
devGatewayEndpoint(), QByteArray::fromBase64(devGatewayPublicKey().toUtf8()), devGatewayProxyStorages(), {}, true
};
}
return { prodGatewayEndpoint, QByteArray::fromBase64(PROD_AGW_PUBLIC_KEY_B64), PROD_S3_ENDPOINT,
FALLBACK_S3_ENDPOINT, false };
}
void SecureAppSettingsRepository::setGatewayEndpoint(const QString &endpoint)
QString SecureAppSettingsRepository::devGatewayEndpoint() const
{
m_gatewayEndpoint = endpoint;
setValue("Conf/gatewayEndpoint", endpoint);
return value("Conf/devGatewayEndpoint").toString();
}
void SecureAppSettingsRepository::resetGatewayEndpoint()
QString SecureAppSettingsRepository::devGatewayProxyStorages() const
{
m_gatewayEndpoint = gatewayEndpoint;
setValue("Conf/gatewayEndpoint", gatewayEndpoint);
return value("Conf/devGatewayProxyStorages").toString();
}
void SecureAppSettingsRepository::setDevGatewayEndpoint()
QString SecureAppSettingsRepository::devGatewayPublicKey() const
{
m_gatewayEndpoint = QString(DEV_AGW_ENDPOINT);
setValue("Conf/gatewayEndpoint", DEV_AGW_ENDPOINT);
return value("Conf/devGatewayPublicKey").toString();
}
bool SecureAppSettingsRepository::isDevGatewayEnv(bool isTestPurchase) const
void SecureAppSettingsRepository::setDevGatewayConfig(const QString &endpoint, const QString &proxyStorages,
const QString &publicKey)
{
return isTestPurchase ? true : value("Conf/devGatewayEnv", false).toBool();
setValue("Conf/devGatewayEndpoint", endpoint);
setValue("Conf/devGatewayProxyStorages", proxyStorages);
setValue("Conf/devGatewayPublicKey", publicKey);
}
bool SecureAppSettingsRepository::isDevGatewayEnv() const
{
return value("Conf/devGatewayEnv", false).toBool();
}
void SecureAppSettingsRepository::toggleDevGatewayEnv(bool enabled)
@@ -57,11 +57,12 @@ public:
bool isAppsSplitTunnelingEnabled() const;
void setAppsSplitTunnelingEnabled(bool enabled);
QString getGatewayEndpoint(bool isTestPurchase = false) const;
void setGatewayEndpoint(const QString &endpoint);
void resetGatewayEndpoint();
void setDevGatewayEndpoint();
bool isDevGatewayEnv(bool isTestPurchase = false) const;
GatewayEnvironment gatewayEnvironment(bool isTestPurchase = false) const;
QString devGatewayEndpoint() const;
QString devGatewayProxyStorages() const;
QString devGatewayPublicKey() const;
void setDevGatewayConfig(const QString &endpoint, const QString &proxyStorages, const QString &publicKey);
bool isDevGatewayEnv() const;
void toggleDevGatewayEnv(bool enabled);
QByteArray readGatewayProxyUrls(const QString &cacheKey) const;
void writeGatewayProxyUrls(const QString &cacheKey, const QByteArray &proxyUrlsEncrypted);
@@ -136,7 +137,6 @@ private:
void setValue(const QString &key, const QVariant &value);
SecureQSettings* m_settings;
QString m_gatewayEndpoint;
};
#endif // SECUREAPPSETTINGSREPOSITORY_H
+9
View File
@@ -39,6 +39,15 @@ namespace amnezia
QString secondaryDns;
};
struct GatewayEnvironment
{
QString endpoint;
QByteArray publicKey;
QString primaryProxyStorages;
QString fallbackProxyStorages;
bool isDev = false;
};
struct SplitTunnelingSettings
{
bool isSitesSplitTunnelingEnabled;
+14 -9
View File
@@ -176,19 +176,24 @@ private slots:
}
}
void testGatewayEndpointSignals() {
QSignalSpy gatewayEndpointChangedSpy(m_coreController->m_settingsUiController, &SettingsUiController::gatewayEndpointChanged);
void testDevGatewaySignals()
{
QSignalSpy devGatewayConfigChangedSpy(m_coreController->m_settingsUiController,
&SettingsUiController::devGatewayConfigChanged);
QSignalSpy devGatewayEnvChangedSpy(m_coreController->m_settingsUiController, &SettingsUiController::devGatewayEnvChanged);
QString initialEndpoint = m_coreController->m_settingsController->getGatewayEndpoint();
QString newEndpoint = "https://test-gateway.example.com";
QString newProxyStorages = "https://storage-1.example.com, https://storage-2.example.com";
QString newPublicKey = "dGVzdC1rZXk=";
m_coreController->m_settingsUiController->setGatewayEndpoint(newEndpoint);
QVERIFY2(gatewayEndpointChangedSpy.count() == 1, "gatewayEndpointChanged signal should be emitted");
QVERIFY2(gatewayEndpointChangedSpy.at(0).at(0).toString() == newEndpoint, "gatewayEndpointChanged should emit correct endpoint");
QVERIFY2(m_coreController->m_settingsController->getGatewayEndpoint() == newEndpoint, "Gateway endpoint should be updated in SettingsController");
QVERIFY2(m_coreController->m_settingsUiController->getGatewayEndpoint() == newEndpoint, "Gateway endpoint should be available in SettingsUiController");
QVERIFY2(m_coreController->m_appSettingsRepository->getGatewayEndpoint() == newEndpoint, "Gateway endpoint should be available in SecureAppSettingsRepository");
m_coreController->m_settingsUiController->saveDevGatewayConfig(newEndpoint, newProxyStorages, newPublicKey);
QVERIFY2(devGatewayConfigChangedSpy.count() == 1, "devGatewayConfigChanged signal should be emitted");
QVERIFY2(m_coreController->m_settingsUiController->getDevGatewayEndpoint() == newEndpoint,
"Dev gateway endpoint should be available in SettingsUiController");
QVERIFY2(m_coreController->m_settingsUiController->getDevGatewayProxyStorages() == newProxyStorages,
"Dev gateway proxy storages should be available in SettingsUiController");
QVERIFY2(m_coreController->m_settingsUiController->getDevGatewayPublicKey() == newPublicKey,
"Dev gateway public key should be available in SettingsUiController");
bool initialDevEnv = m_coreController->m_settingsController->isDevGatewayEnv();
m_coreController->m_settingsUiController->toggleDevGatewayEnv(!initialDevEnv);
+13 -9
View File
@@ -296,21 +296,26 @@ bool SettingsUiController::isDevModeEnabled()
return m_settingsController->isDevModeEnabled();
}
void SettingsUiController::resetGatewayEndpoint()
QString SettingsUiController::getDevGatewayEndpoint()
{
m_settingsController->resetGatewayEndpoint();
emit gatewayEndpointChanged(m_settingsController->getGatewayEndpoint());
return m_settingsController->devGatewayEndpoint();
}
void SettingsUiController::setGatewayEndpoint(const QString &endpoint)
QString SettingsUiController::getDevGatewayProxyStorages()
{
m_settingsController->setGatewayEndpoint(endpoint);
emit gatewayEndpointChanged(endpoint);
return m_settingsController->devGatewayProxyStorages();
}
QString SettingsUiController::getGatewayEndpoint()
QString SettingsUiController::getDevGatewayPublicKey()
{
return m_settingsController->getGatewayEndpoint();
return m_settingsController->devGatewayPublicKey();
}
void SettingsUiController::saveDevGatewayConfig(const QString &endpoint, const QString &proxyStorages,
const QString &publicKey)
{
m_settingsController->setDevGatewayConfig(endpoint, proxyStorages, publicKey);
emit devGatewayConfigChanged();
}
bool SettingsUiController::isDevGatewayEnv()
@@ -321,7 +326,6 @@ bool SettingsUiController::isDevGatewayEnv()
void SettingsUiController::toggleDevGatewayEnv(bool enabled)
{
m_settingsController->toggleDevGatewayEnv(enabled);
emit gatewayEndpointChanged(m_settingsController->getGatewayEndpoint());
emit devGatewayEnvChanged(enabled);
}
+8 -5
View File
@@ -25,7 +25,9 @@ public:
Q_PROPERTY(bool strictKillSwitchEnabled READ isStrictKillSwitchEnabled WRITE toggleStrictKillSwitch NOTIFY strictKillSwitchEnabledChanged)
Q_PROPERTY(bool isDevModeEnabled READ isDevModeEnabled NOTIFY devModeEnabled)
Q_PROPERTY(QString gatewayEndpoint READ getGatewayEndpoint WRITE setGatewayEndpoint NOTIFY gatewayEndpointChanged)
Q_PROPERTY(QString devGatewayEndpoint READ getDevGatewayEndpoint NOTIFY devGatewayConfigChanged)
Q_PROPERTY(QString devGatewayProxyStorages READ getDevGatewayProxyStorages NOTIFY devGatewayConfigChanged)
Q_PROPERTY(QString devGatewayPublicKey READ getDevGatewayPublicKey NOTIFY devGatewayConfigChanged)
Q_PROPERTY(bool isDevGatewayEnv READ isDevGatewayEnv WRITE toggleDevGatewayEnv NOTIFY devGatewayEnvChanged)
Q_PROPERTY(bool isHomeAdLabelVisible READ isHomeAdLabelVisible NOTIFY isHomeAdLabelVisibleChanged)
@@ -90,9 +92,10 @@ public slots:
void enableDevMode();
bool isDevModeEnabled();
void resetGatewayEndpoint();
void setGatewayEndpoint(const QString &endpoint);
QString getGatewayEndpoint();
QString getDevGatewayEndpoint();
QString getDevGatewayProxyStorages();
QString getDevGatewayPublicKey();
void saveDevGatewayConfig(const QString &endpoint, const QString &proxyStorages, const QString &publicKey);
bool isDevGatewayEnv();
void toggleDevGatewayEnv(bool enabled);
@@ -126,7 +129,7 @@ signals:
void onNotificationStateChanged();
void devModeEnabled();
void gatewayEndpointChanged(const QString &endpoint);
void devGatewayConfigChanged();
void devGatewayEnvChanged(bool enabled);
void activityPaused();
+23 -11
View File
@@ -54,14 +54,25 @@ PageType {
Layout.fillWidth: true
headerText: qsTr("Gateway endpoint")
textField.text: SettingsController.gatewayEndpoint
textField.text: SettingsController.devGatewayEndpoint
}
buttonImageSource: textField.text !== "" ? "qrc:/images/controls/refresh-cw.svg" : ""
TextFieldType {
id: gatewayProxyStoragesField
clickedFunc: function() {
SettingsController.resetGatewayEndpoint()
gatewayEndpointField.textField.text = SettingsController.gatewayEndpoint
}
Layout.fillWidth: true
headerText: qsTr("Gateway proxy storages")
textField.text: SettingsController.devGatewayProxyStorages
}
TextFieldType {
id: gatewayPublicKeyField
Layout.fillWidth: true
headerText: qsTr("Gateway public key")
textField.text: SettingsController.devGatewayPublicKey
}
ButtonType {
@@ -72,11 +83,12 @@ PageType {
text: qsTr("Save")
onClicked: {
var trimmed = gatewayEndpointField.textField.text.replace(/^\s+|\s+$/g, '')
gatewayEndpointField.textField.text = trimmed
if (trimmed !== SettingsController.gatewayEndpoint) {
SettingsController.gatewayEndpoint = trimmed
}
SettingsController.saveDevGatewayConfig(gatewayEndpointField.textField.text.trim(),
gatewayProxyStoragesField.textField.text.trim(),
gatewayPublicKeyField.textField.text.trim())
gatewayEndpointField.textField.text = SettingsController.devGatewayEndpoint
gatewayProxyStoragesField.textField.text = SettingsController.devGatewayProxyStorages
gatewayPublicKeyField.textField.text = SettingsController.devGatewayPublicKey
PageController.showNotificationMessage(qsTr("Settings saved"))
}
}
@@ -160,6 +160,8 @@ PageType {
width: listView.width
implicitHeight: appItem.implicitHeight
enabled: root.pageEnabled
ListItemType {
id: appItem
+3
View File
@@ -244,6 +244,9 @@ PageType {
}
function onBackgroundPurchaseCompleted(message) {
if (!root.isTabBarShown) {
PageController.goToPageHome()
}
PageController.showNotificationMessage(message)
}
+3
View File
@@ -35,6 +35,7 @@ while [[ $# -gt 0 ]]; do
--aab) : ${BUILD_AAB=true}; shift ;;
--apk) : ${BUILD_APK=true}; shift ;;
--play) : ${BUILD_PLAY=true}; shift ;;
--configure-only) : ${CONFIGURE_ONLY=true}; shift ;;
--help|-h|?)
echo "Usage: $0 [options]"
echo " Options:"
@@ -49,6 +50,7 @@ while [[ $# -gt 0 ]]; do
echo " --aab - whether to build AAB. only applicable to Android"
echo " --apk - whether to build APK. use with --play. only applicable to Android"
echo " --play - build Play flavor (Google Play Billing). use with --aab or --apk. only applicable to Android"
echo " --configure-only - run CMake configure and skip the build"
exit 0
;;
*) echo "Unknown arg \"$1\". Use $0 -h to get help"; exit 1 ;;
@@ -217,6 +219,7 @@ if [[ -n "$FORCE" ]]; then
fi
run_traced cmake -S "$SOURCE_PATH" -B "$BUILD_PATH" "${args[@]}"
[[ -n "$CONFIGURE_ONLY" ]] && exit 0
run_traced cmake --build "$BUILD_PATH" --config "$CMAKE_BUILD_TYPE" --parallel "$JOBS"
if [[ -n "$BUILD_AAB" ]]; then
+78
View File
@@ -0,0 +1,78 @@
def cmake_cache_value(name)
File.read("../build/CMakeCache.txt")[/^#{name}:\w+=(.*)$/, 1]
end
def archive_build(app_platform, profile_platform)
app_identifier = cmake_cache_value("BUILD_IOS_APP_IDENTIFIER")
build_app(
project: "build/AmneziaVPN.xcodeproj",
scheme: "AmneziaVPN",
configuration: "Release",
export_method: "app-store",
export_options: {
signingStyle: "manual",
provisioningProfiles: {
app_identifier => cmake_cache_value("CLIENT_#{profile_platform}_PROVISIONING_PROFILE_SPECIFIER"),
"#{app_identifier}.network-extension" => cmake_cache_value("CLIENT_#{profile_platform}_NE_PROVISIONING_PROFILE_SPECIFIER")
}
},
output_directory: "build/#{app_platform}",
output_name: "AmneziaVPN"
)
end
def authorize_app_store_connect
key = ENV.fetch("APPSTORE_CONNECT_PRIVATE_KEY")
app_store_connect_api_key(
key_id: ENV.fetch("APPSTORE_CONNECT_KEY_ID"),
issuer_id: ENV.fetch("APPSTORE_CONNECT_ISSUER_ID"),
key_content: key,
is_key_content_base64: !key.include?("PRIVATE KEY")
)
end
def upload_to_external_testers(package)
authorize_app_store_connect
upload_to_testflight(
**package,
distribute_external: true,
groups: ["test-external"],
changelog: "Improve stability"
)
end
platform :ios do
lane :archive do
archive_build("ios", "IOS")
end
lane :testflight_upload do
upload_to_external_testers(ipa: "build/ios/AmneziaVPN.ipa")
end
end
platform :mac do
lane :archive do
archive_build("osx", "MACOS")
end
lane :testflight_upload do
upload_to_external_testers(app_platform: "osx", pkg: "build/osx/AmneziaVPN.pkg")
end
end
platform :android do
lane :play_upload do
upload_to_play_store(
package_name: "org.amnezia.vpn",
track: "beta",
release_status: "draft",
aab_paths: Dir["../build/android/*_play.aab"].map { |path| File.expand_path(path) },
json_key_data: ENV.fetch("GOOGLE_PLAY_SERVICE_ACCOUNT_JSON"),
skip_upload_metadata: true,
skip_upload_changelogs: true,
skip_upload_images: true,
skip_upload_screenshots: true
)
end
end
+2
View File
@@ -0,0 +1,2 @@
s/\(_ENDPOINT\\\{0,1\}=\\\{0,1\}"\)[^"]*/\1***/g
s/\(_AGW_PUBLIC_KEY_B64[\\"=]*\)[A-Za-z0-9+\/=]*/\1***/g