revert PacketTunnelXray
112
.github/workflows/deploy.yml
vendored
|
|
@ -295,69 +295,69 @@ jobs:
|
||||||
retention-days: 7
|
retention-days: 7
|
||||||
|
|
||||||
# ------------------------------------------------------
|
# ------------------------------------------------------
|
||||||
Build-MacOS-NE:
|
# Build-MacOS-NE:
|
||||||
runs-on: macos-latest
|
# runs-on: macos-latest
|
||||||
|
|
||||||
env:
|
# env:
|
||||||
QT_VERSION: 6.4.3
|
# QT_VERSION: 6.4.3
|
||||||
QIF_VERSION: 4.6
|
# QIF_VERSION: 4.6
|
||||||
QT_MIRROR: https://mirrors.ocf.berkeley.edu/qt/
|
# QT_MIRROR: https://mirrors.ocf.berkeley.edu/qt/
|
||||||
PROD_AGW_PUBLIC_KEY: ${{ secrets.PROD_AGW_PUBLIC_KEY }}
|
# PROD_AGW_PUBLIC_KEY: ${{ secrets.PROD_AGW_PUBLIC_KEY }}
|
||||||
DEV_AGW_PUBLIC_KEY: ${{ secrets.DEV_AGW_PUBLIC_KEY }}
|
# DEV_AGW_PUBLIC_KEY: ${{ secrets.DEV_AGW_PUBLIC_KEY }}
|
||||||
|
|
||||||
steps:
|
# steps:
|
||||||
- name: 'Setup Xcode'
|
# - name: 'Setup Xcode'
|
||||||
uses: maxim-lobanov/setup-xcode@v1
|
# uses: maxim-lobanov/setup-xcode@v1
|
||||||
with:
|
# with:
|
||||||
xcode-version: '14.3.1'
|
# xcode-version: '14.3.1'
|
||||||
|
|
||||||
- name: 'Install desktop Qt'
|
# - name: 'Install desktop Qt'
|
||||||
uses: jurplel/install-qt-action@v3
|
# uses: jurplel/install-qt-action@v3
|
||||||
with:
|
# with:
|
||||||
version: ${{ env.QT_VERSION }}
|
# version: ${{ env.QT_VERSION }}
|
||||||
host: 'mac'
|
# host: 'mac'
|
||||||
target: 'desktop'
|
# target: 'desktop'
|
||||||
modules: 'qtremoteobjects qt5compat qtshadertools qtmultimedia'
|
# modules: 'qtremoteobjects qt5compat qtshadertools qtmultimedia'
|
||||||
arch: 'clang_64'
|
# arch: 'clang_64'
|
||||||
dir: ${{ runner.temp }}
|
# dir: ${{ runner.temp }}
|
||||||
set-env: 'true'
|
# set-env: 'true'
|
||||||
extra: '--base ${{ env.QT_MIRROR }}'
|
# extra: '--base ${{ env.QT_MIRROR }}'
|
||||||
- name: 'Install Qt Installer Framework ${{ env.QIF_VERSION }}'
|
# - name: 'Install Qt Installer Framework ${{ env.QIF_VERSION }}'
|
||||||
run: |
|
# run: |
|
||||||
mkdir -pv ${{ runner.temp }}/Qt/Tools/QtInstallerFramework
|
# mkdir -pv ${{ runner.temp }}/Qt/Tools/QtInstallerFramework
|
||||||
wget https://qt.amzsvc.com/tools/ifw/${{ env.QIF_VERSION }}.zip
|
# wget https://qt.amzsvc.com/tools/ifw/${{ env.QIF_VERSION }}.zip
|
||||||
unzip ${{ env.QIF_VERSION }}.zip -d ${{ runner.temp }}/Qt/Tools/QtInstallerFramework/
|
# unzip ${{ env.QIF_VERSION }}.zip -d ${{ runner.temp }}/Qt/Tools/QtInstallerFramework/
|
||||||
- name: 'Install Go'
|
# - name: 'Install Go'
|
||||||
uses: actions/setup-go@v5
|
# uses: actions/setup-go@v5
|
||||||
with:
|
# with:
|
||||||
go-version: '1.22.1'
|
# go-version: '1.22.1'
|
||||||
cache: false
|
# cache: false
|
||||||
|
|
||||||
- name: 'Get sources'
|
# - name: 'Get sources'
|
||||||
uses: actions/checkout@v4
|
# uses: actions/checkout@v4
|
||||||
with:
|
# with:
|
||||||
submodules: 'true'
|
# submodules: 'true'
|
||||||
fetch-depth: 10
|
# fetch-depth: 10
|
||||||
|
|
||||||
- name: 'Install dependencies'
|
# - name: 'Install dependencies'
|
||||||
run: pip install jsonschema jinja2
|
# run: pip install jsonschema jinja2
|
||||||
|
|
||||||
- name: 'Set execute permissions for deploy script'
|
# - name: 'Set execute permissions for deploy script'
|
||||||
run: chmod +x deploy/build_macos_ne.sh
|
# run: chmod +x deploy/build_macos_ne.sh
|
||||||
|
|
||||||
- name: 'Build and deploy macOS NE'
|
# - name: 'Build and deploy macOS NE'
|
||||||
run: |
|
# run: |
|
||||||
export QT_BIN_DIR="${{ runner.temp }}/Qt/${{ env.QT_VERSION }}/macos/bin"
|
# export QT_BIN_DIR="${{ runner.temp }}/Qt/${{ env.QT_VERSION }}/macos/bin"
|
||||||
export QIF_BIN_DIR="${{ runner.temp }}/Qt/Tools/QtInstallerFramework/${{ env.QIF_VERSION }}/bin"
|
# export QIF_BIN_DIR="${{ runner.temp }}/Qt/Tools/QtInstallerFramework/${{ env.QIF_VERSION }}/bin"
|
||||||
export QT_MACOS_ROOT_DIR="${{ runner.temp }}/Qt/${{ env.QT_VERSION }}/macos"
|
# export QT_MACOS_ROOT_DIR="${{ runner.temp }}/Qt/${{ env.QT_VERSION }}/macos"
|
||||||
bash deploy/build_macos_ne.sh
|
# bash deploy/build_macos_ne.sh
|
||||||
env:
|
# env:
|
||||||
APPSTORE_CONNECT_KEY_ID: ${{ secrets.APPSTORE_CONNECT_KEY_ID }}
|
# APPSTORE_CONNECT_KEY_ID: ${{ secrets.APPSTORE_CONNECT_KEY_ID }}
|
||||||
APPSTORE_CONNECT_ISSUER_ID: ${{ secrets.APPSTORE_CONNECT_ISSUER_ID }}
|
# APPSTORE_CONNECT_ISSUER_ID: ${{ secrets.APPSTORE_CONNECT_ISSUER_ID }}
|
||||||
APPSTORE_CONNECT_PRIVATE_KEY: ${{ secrets.APPSTORE_CONNECT_PRIVATE_KEY }}
|
# APPSTORE_CONNECT_PRIVATE_KEY: ${{ secrets.APPSTORE_CONNECT_PRIVATE_KEY }}
|
||||||
MAC_TRUST_CERT_BASE64: ${{ secrets.IOS_TRUST_CERT_BASE64 }}
|
# MAC_TRUST_CERT_BASE64: ${{ secrets.IOS_TRUST_CERT_BASE64 }}
|
||||||
MAC_SIGNING_CERT_BASE64: ${{ secrets.IOS_SIGNING_CERT_BASE64 }}
|
# MAC_SIGNING_CERT_BASE64: ${{ secrets.IOS_SIGNING_CERT_BASE64 }}
|
||||||
MAC_SIGNING_CERT_PASSWORD: ${{ secrets.IOS_SIGNING_CERT_PASSWORD }}
|
# MAC_SIGNING_CERT_PASSWORD: ${{ secrets.IOS_SIGNING_CERT_PASSWORD }}
|
||||||
# ------------------------------------------------------
|
# ------------------------------------------------------
|
||||||
|
|
||||||
Build-Android:
|
Build-Android:
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ set_target_properties(${PROJECT} PROPERTIES
|
||||||
MACOSX_BUNDLE_LONG_VERSION_STRING "${APPLE_PROJECT_VERSION}-${CMAKE_PROJECT_VERSION_TWEAK}"
|
MACOSX_BUNDLE_LONG_VERSION_STRING "${APPLE_PROJECT_VERSION}-${CMAKE_PROJECT_VERSION_TWEAK}"
|
||||||
MACOSX_BUNDLE_SHORT_VERSION_STRING "${APPLE_PROJECT_VERSION}"
|
MACOSX_BUNDLE_SHORT_VERSION_STRING "${APPLE_PROJECT_VERSION}"
|
||||||
XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "${BUILD_IOS_APP_IDENTIFIER}"
|
XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "${BUILD_IOS_APP_IDENTIFIER}"
|
||||||
XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS "${CMAKE_CURRENT_SOURCE_DIR}/macos/app/main.entitlements"
|
XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS "${CMAKE_CURRENT_SOURCE_DIR}/ios/app/main.entitlements"
|
||||||
XCODE_ATTRIBUTE_MARKETING_VERSION "${APPLE_PROJECT_VERSION}"
|
XCODE_ATTRIBUTE_MARKETING_VERSION "${APPLE_PROJECT_VERSION}"
|
||||||
XCODE_ATTRIBUTE_CURRENT_PROJECT_VERSION "${CMAKE_PROJECT_VERSION_TWEAK}"
|
XCODE_ATTRIBUTE_CURRENT_PROJECT_VERSION "${CMAKE_PROJECT_VERSION_TWEAK}"
|
||||||
XCODE_ATTRIBUTE_PRODUCT_NAME "AmneziaVPN"
|
XCODE_ATTRIBUTE_PRODUCT_NAME "AmneziaVPN"
|
||||||
|
|
@ -116,13 +116,13 @@ target_sources(${PROJECT} PRIVATE
|
||||||
)
|
)
|
||||||
|
|
||||||
target_sources(${PROJECT} PRIVATE
|
target_sources(${PROJECT} PRIVATE
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/macos/app/Media.xcassets
|
${CMAKE_CURRENT_SOURCE_DIR}/ios/app/Media.xcassets
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/macos/app/PrivacyInfo.xcprivacy
|
${CMAKE_CURRENT_SOURCE_DIR}/ios/app/PrivacyInfo.xcprivacy
|
||||||
)
|
)
|
||||||
|
|
||||||
set_property(TARGET ${PROJECT} APPEND PROPERTY RESOURCE
|
set_property(TARGET ${PROJECT} APPEND PROPERTY RESOURCE
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/macos/app/Media.xcassets
|
${CMAKE_CURRENT_SOURCE_DIR}/ios/app/Media.xcassets
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/macos/app/PrivacyInfo.xcprivacy
|
${CMAKE_CURRENT_SOURCE_DIR}/ios/app/PrivacyInfo.xcprivacy
|
||||||
)
|
)
|
||||||
|
|
||||||
add_subdirectory(macos/networkextension)
|
add_subdirectory(macos/networkextension)
|
||||||
|
|
|
||||||
|
Before Width: | Height: | Size: 4.5 KiB |
|
Before Width: | Height: | Size: 46 KiB |
|
Before Width: | Height: | Size: 5.1 KiB |
|
Before Width: | Height: | Size: 5.3 KiB |
|
Before Width: | Height: | Size: 6.5 KiB |
|
Before Width: | Height: | Size: 6.7 KiB |
|
Before Width: | Height: | Size: 7.4 KiB |
|
Before Width: | Height: | Size: 7.9 KiB |
|
Before Width: | Height: | Size: 767 B |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 3.9 KiB |
|
|
@ -1,290 +0,0 @@
|
||||||
{
|
|
||||||
"images" : [
|
|
||||||
{
|
|
||||||
"filename" : "40.png",
|
|
||||||
"idiom" : "iphone",
|
|
||||||
"scale" : "2x",
|
|
||||||
"size" : "20x20"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename" : "60.png",
|
|
||||||
"idiom" : "iphone",
|
|
||||||
"scale" : "3x",
|
|
||||||
"size" : "20x20"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename" : "29.png",
|
|
||||||
"idiom" : "iphone",
|
|
||||||
"scale" : "1x",
|
|
||||||
"size" : "29x29"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename" : "58.png",
|
|
||||||
"idiom" : "iphone",
|
|
||||||
"scale" : "2x",
|
|
||||||
"size" : "29x29"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename" : "87.png",
|
|
||||||
"idiom" : "iphone",
|
|
||||||
"scale" : "3x",
|
|
||||||
"size" : "29x29"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename" : "80.png",
|
|
||||||
"idiom" : "iphone",
|
|
||||||
"scale" : "2x",
|
|
||||||
"size" : "40x40"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename" : "120.png",
|
|
||||||
"idiom" : "iphone",
|
|
||||||
"scale" : "3x",
|
|
||||||
"size" : "40x40"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename" : "57.png",
|
|
||||||
"idiom" : "iphone",
|
|
||||||
"scale" : "1x",
|
|
||||||
"size" : "57x57"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename" : "114.png",
|
|
||||||
"idiom" : "iphone",
|
|
||||||
"scale" : "2x",
|
|
||||||
"size" : "57x57"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename" : "120.png",
|
|
||||||
"idiom" : "iphone",
|
|
||||||
"scale" : "2x",
|
|
||||||
"size" : "60x60"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename" : "180.png",
|
|
||||||
"idiom" : "iphone",
|
|
||||||
"scale" : "3x",
|
|
||||||
"size" : "60x60"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename" : "20.png",
|
|
||||||
"idiom" : "ipad",
|
|
||||||
"scale" : "1x",
|
|
||||||
"size" : "20x20"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename" : "40.png",
|
|
||||||
"idiom" : "ipad",
|
|
||||||
"scale" : "2x",
|
|
||||||
"size" : "20x20"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename" : "29.png",
|
|
||||||
"idiom" : "ipad",
|
|
||||||
"scale" : "1x",
|
|
||||||
"size" : "29x29"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename" : "58.png",
|
|
||||||
"idiom" : "ipad",
|
|
||||||
"scale" : "2x",
|
|
||||||
"size" : "29x29"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename" : "40.png",
|
|
||||||
"idiom" : "ipad",
|
|
||||||
"scale" : "1x",
|
|
||||||
"size" : "40x40"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename" : "80.png",
|
|
||||||
"idiom" : "ipad",
|
|
||||||
"scale" : "2x",
|
|
||||||
"size" : "40x40"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename" : "50.png",
|
|
||||||
"idiom" : "ipad",
|
|
||||||
"scale" : "1x",
|
|
||||||
"size" : "50x50"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename" : "100.png",
|
|
||||||
"idiom" : "ipad",
|
|
||||||
"scale" : "2x",
|
|
||||||
"size" : "50x50"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename" : "72.png",
|
|
||||||
"idiom" : "ipad",
|
|
||||||
"scale" : "1x",
|
|
||||||
"size" : "72x72"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename" : "144.png",
|
|
||||||
"idiom" : "ipad",
|
|
||||||
"scale" : "2x",
|
|
||||||
"size" : "72x72"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename" : "76.png",
|
|
||||||
"idiom" : "ipad",
|
|
||||||
"scale" : "1x",
|
|
||||||
"size" : "76x76"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename" : "152.png",
|
|
||||||
"idiom" : "ipad",
|
|
||||||
"scale" : "2x",
|
|
||||||
"size" : "76x76"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename" : "167.png",
|
|
||||||
"idiom" : "ipad",
|
|
||||||
"scale" : "2x",
|
|
||||||
"size" : "83.5x83.5"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename" : "1024.png",
|
|
||||||
"idiom" : "ios-marketing",
|
|
||||||
"scale" : "1x",
|
|
||||||
"size" : "1024x1024"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"idiom" : "watch",
|
|
||||||
"role" : "notificationCenter",
|
|
||||||
"scale" : "2x",
|
|
||||||
"size" : "24x24",
|
|
||||||
"subtype" : "38mm"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"idiom" : "watch",
|
|
||||||
"role" : "notificationCenter",
|
|
||||||
"scale" : "2x",
|
|
||||||
"size" : "27.5x27.5",
|
|
||||||
"subtype" : "42mm"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"idiom" : "watch",
|
|
||||||
"role" : "companionSettings",
|
|
||||||
"scale" : "2x",
|
|
||||||
"size" : "29x29"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"idiom" : "watch",
|
|
||||||
"role" : "companionSettings",
|
|
||||||
"scale" : "3x",
|
|
||||||
"size" : "29x29"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"idiom" : "watch",
|
|
||||||
"role" : "notificationCenter",
|
|
||||||
"scale" : "2x",
|
|
||||||
"size" : "33x33",
|
|
||||||
"subtype" : "45mm"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"idiom" : "watch",
|
|
||||||
"role" : "appLauncher",
|
|
||||||
"scale" : "2x",
|
|
||||||
"size" : "40x40",
|
|
||||||
"subtype" : "38mm"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"idiom" : "watch",
|
|
||||||
"role" : "appLauncher",
|
|
||||||
"scale" : "2x",
|
|
||||||
"size" : "44x44",
|
|
||||||
"subtype" : "40mm"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"idiom" : "watch",
|
|
||||||
"role" : "appLauncher",
|
|
||||||
"scale" : "2x",
|
|
||||||
"size" : "46x46",
|
|
||||||
"subtype" : "41mm"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"idiom" : "watch",
|
|
||||||
"role" : "appLauncher",
|
|
||||||
"scale" : "2x",
|
|
||||||
"size" : "50x50",
|
|
||||||
"subtype" : "44mm"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"idiom" : "watch",
|
|
||||||
"role" : "appLauncher",
|
|
||||||
"scale" : "2x",
|
|
||||||
"size" : "51x51",
|
|
||||||
"subtype" : "45mm"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"idiom" : "watch",
|
|
||||||
"role" : "appLauncher",
|
|
||||||
"scale" : "2x",
|
|
||||||
"size" : "54x54",
|
|
||||||
"subtype" : "49mm"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"idiom" : "watch",
|
|
||||||
"role" : "quickLook",
|
|
||||||
"scale" : "2x",
|
|
||||||
"size" : "86x86",
|
|
||||||
"subtype" : "38mm"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"idiom" : "watch",
|
|
||||||
"role" : "quickLook",
|
|
||||||
"scale" : "2x",
|
|
||||||
"size" : "98x98",
|
|
||||||
"subtype" : "42mm"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"idiom" : "watch",
|
|
||||||
"role" : "quickLook",
|
|
||||||
"scale" : "2x",
|
|
||||||
"size" : "108x108",
|
|
||||||
"subtype" : "44mm"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"idiom" : "watch",
|
|
||||||
"role" : "quickLook",
|
|
||||||
"scale" : "2x",
|
|
||||||
"size" : "117x117",
|
|
||||||
"subtype" : "45mm"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"idiom" : "watch",
|
|
||||||
"role" : "quickLook",
|
|
||||||
"scale" : "2x",
|
|
||||||
"size" : "129x129",
|
|
||||||
"subtype" : "49mm"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"idiom" : "watch-marketing",
|
|
||||||
"scale" : "1x",
|
|
||||||
"size" : "1024x1024"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"idiom" : "car",
|
|
||||||
"scale" : "2x",
|
|
||||||
"size" : "60"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"idiom" : "car",
|
|
||||||
"scale" : "3x",
|
|
||||||
"size" : "60"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"idiom" : "watch",
|
|
||||||
"role" : "longLook",
|
|
||||||
"scale" : "2x",
|
|
||||||
"size" : "44x44",
|
|
||||||
"subtype" : "42mm"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"info" : {
|
|
||||||
"author" : "xcode",
|
|
||||||
"version" : 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
{
|
|
||||||
"info" : {
|
|
||||||
"author" : "xcode",
|
|
||||||
"version" : 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,33 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
||||||
<plist version="1.0">
|
|
||||||
<dict>
|
|
||||||
<key>NSPrivacyAccessedAPITypes</key>
|
|
||||||
<array>
|
|
||||||
<dict>
|
|
||||||
<key>NSPrivacyAccessedAPIType</key>
|
|
||||||
<string>NSPrivacyAccessedAPICategoryFileTimestamp</string>
|
|
||||||
<key>NSPrivacyAccessedAPITypeReasons</key>
|
|
||||||
<array>
|
|
||||||
<string>C617.1</string>
|
|
||||||
</array>
|
|
||||||
</dict>
|
|
||||||
<dict>
|
|
||||||
<key>NSPrivacyAccessedAPIType</key>
|
|
||||||
<string>NSPrivacyAccessedAPICategoryUserDefaults</string>
|
|
||||||
<key>NSPrivacyAccessedAPITypeReasons</key>
|
|
||||||
<array>
|
|
||||||
<string>1C8F.1</string>
|
|
||||||
</array>
|
|
||||||
</dict>
|
|
||||||
<dict>
|
|
||||||
<key>NSPrivacyAccessedAPIType</key>
|
|
||||||
<string>NSPrivacyAccessedAPICategorySystemBootTime</string>
|
|
||||||
<key>NSPrivacyAccessedAPITypeReasons</key>
|
|
||||||
<array>
|
|
||||||
<string>35F9.1</string>
|
|
||||||
</array>
|
|
||||||
</dict>
|
|
||||||
</array>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
|
||||||
|
Before Width: | Height: | Size: 583 KiB |
|
|
@ -1,20 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
||||||
<plist version="1.0">
|
|
||||||
<dict>
|
|
||||||
<key>com.apple.developer.networking.networkextension</key>
|
|
||||||
<array>
|
|
||||||
<string>packet-tunnel-provider</string>
|
|
||||||
</array>
|
|
||||||
<key>com.apple.security.application-groups</key>
|
|
||||||
<array>
|
|
||||||
<string>group.org.amnezia.AmneziaVPN</string>
|
|
||||||
</array>
|
|
||||||
<key>com.apple.security.files.user-selected.read-write</key>
|
|
||||||
<true/>
|
|
||||||
<key>keychain-access-groups</key>
|
|
||||||
<array>
|
|
||||||
<string>$(AppIdentifierPrefix)group.org.amnezia.AmneziaVPN</string>
|
|
||||||
</array>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
|
||||||
|
|
@ -3,185 +3,185 @@ import NetworkExtension
|
||||||
import WireGuardKitGo
|
import WireGuardKitGo
|
||||||
|
|
||||||
enum XrayErrors: Error {
|
enum XrayErrors: Error {
|
||||||
case noXrayConfig
|
case noXrayConfig
|
||||||
case xrayConfigIsWrong
|
case xrayConfigIsWrong
|
||||||
case cantSaveXrayConfig
|
case cantSaveXrayConfig
|
||||||
case cantParseListenAndPort
|
case cantParseListenAndPort
|
||||||
case cantSaveHevSocksConfig
|
case cantSaveHevSocksConfig
|
||||||
}
|
}
|
||||||
|
|
||||||
extension Constants {
|
extension Constants {
|
||||||
static let cachesDirectory: URL = {
|
static let cachesDirectory: URL = {
|
||||||
if let cachesDirectoryURL = FileManager.default.urls(for: .cachesDirectory,
|
if let cachesDirectoryURL = FileManager.default.urls(for: .cachesDirectory,
|
||||||
in: .userDomainMask).first {
|
in: .userDomainMask).first {
|
||||||
return cachesDirectoryURL
|
return cachesDirectoryURL
|
||||||
} else {
|
} else {
|
||||||
fatalError("Unable to retrieve caches directory.")
|
fatalError("Unable to retrieve caches directory.")
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|
||||||
extension PacketTunnelProvider {
|
extension PacketTunnelProvider {
|
||||||
func startXray(completionHandler: @escaping (Error?) -> Void) {
|
func startXray(completionHandler: @escaping (Error?) -> Void) {
|
||||||
|
|
||||||
// Xray configuration
|
// Xray configuration
|
||||||
guard let protocolConfiguration = self.protocolConfiguration as? NETunnelProviderProtocol,
|
guard let protocolConfiguration = self.protocolConfiguration as? NETunnelProviderProtocol,
|
||||||
let providerConfiguration = protocolConfiguration.providerConfiguration,
|
let providerConfiguration = protocolConfiguration.providerConfiguration,
|
||||||
let configData = providerConfiguration[Constants.xrayConfigKey] as? Data else {
|
let configData = providerConfiguration[Constants.xrayConfigKey] as? Data else {
|
||||||
xrayLog(.error, message: "Can't get xray configuration")
|
xrayLog(.error, message: "Can't get xray configuration")
|
||||||
completionHandler(XrayErrors.noXrayConfig)
|
completionHandler(XrayErrors.noXrayConfig)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tunnel settings
|
// Tunnel settings
|
||||||
let ipv6Enabled = false
|
let ipv6Enabled = false
|
||||||
let hideVPNIcon = false
|
let hideVPNIcon = false
|
||||||
|
|
||||||
let settings = NEPacketTunnelNetworkSettings(tunnelRemoteAddress: "254.1.1.1")
|
let settings = NEPacketTunnelNetworkSettings(tunnelRemoteAddress: "254.1.1.1")
|
||||||
settings.mtu = 9000
|
settings.mtu = 9000
|
||||||
|
|
||||||
settings.ipv4Settings = {
|
settings.ipv4Settings = {
|
||||||
let settings = NEIPv4Settings(addresses: ["198.18.0.1"], subnetMasks: ["255.255.0.0"])
|
let settings = NEIPv4Settings(addresses: ["198.18.0.1"], subnetMasks: ["255.255.0.0"])
|
||||||
settings.includedRoutes = [NEIPv4Route.default()]
|
settings.includedRoutes = [NEIPv4Route.default()]
|
||||||
return settings
|
return settings
|
||||||
}()
|
}()
|
||||||
|
|
||||||
settings.ipv6Settings = {
|
settings.ipv6Settings = {
|
||||||
guard ipv6Enabled else {
|
guard ipv6Enabled else {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
let settings = NEIPv6Settings(addresses: ["fd6e:a81b:704f:1211::1"], networkPrefixLengths: [64])
|
let settings = NEIPv6Settings(addresses: ["fd6e:a81b:704f:1211::1"], networkPrefixLengths: [64])
|
||||||
settings.includedRoutes = [NEIPv6Route.default()]
|
settings.includedRoutes = [NEIPv6Route.default()]
|
||||||
if hideVPNIcon {
|
if hideVPNIcon {
|
||||||
settings.excludedRoutes = [NEIPv6Route(destinationAddress: "::", networkPrefixLength: 128)]
|
settings.excludedRoutes = [NEIPv6Route(destinationAddress: "::", networkPrefixLength: 128)]
|
||||||
}
|
}
|
||||||
return settings
|
return settings
|
||||||
}()
|
}()
|
||||||
|
|
||||||
do {
|
do {
|
||||||
let xrayConfig = try JSONDecoder().decode(XrayConfig.self,
|
let xrayConfig = try JSONDecoder().decode(XrayConfig.self,
|
||||||
from: configData)
|
from: configData)
|
||||||
|
|
||||||
var dnsArray = [String]()
|
var dnsArray = [String]()
|
||||||
if let dns1 = xrayConfig.dns1 {
|
if let dns1 = xrayConfig.dns1 {
|
||||||
dnsArray.append(dns1)
|
dnsArray.append(dns1)
|
||||||
}
|
}
|
||||||
if let dns2 = xrayConfig.dns2 {
|
if let dns2 = xrayConfig.dns2 {
|
||||||
dnsArray.append(dns2)
|
dnsArray.append(dns2)
|
||||||
}
|
}
|
||||||
|
|
||||||
settings.dnsSettings = !dnsArray.isEmpty
|
settings.dnsSettings = !dnsArray.isEmpty
|
||||||
? NEDNSSettings(servers: dnsArray)
|
? NEDNSSettings(servers: dnsArray)
|
||||||
: NEDNSSettings(servers: ["1.1.1.1"])
|
: NEDNSSettings(servers: ["1.1.1.1"])
|
||||||
|
|
||||||
let xrayConfigData = xrayConfig.config.data(using: .utf8)
|
let xrayConfigData = xrayConfig.config.data(using: .utf8)
|
||||||
|
|
||||||
guard let xrayConfigData else {
|
guard let xrayConfigData else {
|
||||||
xrayLog(.error, message: "Can't encode config to data")
|
xrayLog(.error, message: "Can't encode config to data")
|
||||||
completionHandler(XrayErrors.xrayConfigIsWrong)
|
completionHandler(XrayErrors.xrayConfigIsWrong)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
let jsonDict = try JSONSerialization.jsonObject(with: xrayConfigData,
|
let jsonDict = try JSONSerialization.jsonObject(with: xrayConfigData,
|
||||||
options: []) as? [String: Any]
|
options: []) as? [String: Any]
|
||||||
|
|
||||||
guard var jsonDict else {
|
guard var jsonDict else {
|
||||||
xrayLog(.error, message: "Can't parse address and port for hevSocks")
|
xrayLog(.error, message: "Can't parse address and port for hevSocks")
|
||||||
completionHandler(XrayErrors.cantParseListenAndPort)
|
completionHandler(XrayErrors.cantParseListenAndPort)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
let port = 10808
|
let port = 10808
|
||||||
let address = "::1"
|
let address = "::1"
|
||||||
|
|
||||||
if var inboundsArray = jsonDict["inbounds"] as? [[String: Any]], !inboundsArray.isEmpty {
|
if var inboundsArray = jsonDict["inbounds"] as? [[String: Any]], !inboundsArray.isEmpty {
|
||||||
inboundsArray[0]["port"] = port
|
inboundsArray[0]["port"] = port
|
||||||
inboundsArray[0]["listen"] = address
|
inboundsArray[0]["listen"] = address
|
||||||
jsonDict["inbounds"] = inboundsArray
|
jsonDict["inbounds"] = inboundsArray
|
||||||
}
|
}
|
||||||
|
|
||||||
let updatedData = try JSONSerialization.data(withJSONObject: jsonDict, options: [])
|
let updatedData = try JSONSerialization.data(withJSONObject: jsonDict, options: [])
|
||||||
|
|
||||||
setTunnelNetworkSettings(settings) { [weak self] error in
|
setTunnelNetworkSettings(settings) { [weak self] error in
|
||||||
if let error {
|
if let error {
|
||||||
completionHandler(error)
|
completionHandler(error)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Launch xray
|
// Launch xray
|
||||||
self?.setupAndStartXray(configData: updatedData) { xrayError in
|
self?.setupAndStartXray(configData: updatedData) { xrayError in
|
||||||
if let xrayError {
|
if let xrayError {
|
||||||
completionHandler(xrayError)
|
completionHandler(xrayError)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Launch hevSocks
|
// Launch hevSocks
|
||||||
self?.setupAndRunTun2socks(configData: updatedData,
|
self?.setupAndRunTun2socks(configData: updatedData,
|
||||||
address: address,
|
address: address,
|
||||||
port: port,
|
port: port,
|
||||||
completionHandler: completionHandler)
|
completionHandler: completionHandler)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch {
|
} catch {
|
||||||
completionHandler(error)
|
completionHandler(error)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func stopXray(completionHandler: () -> Void) {
|
func stopXray(completionHandler: () -> Void) {
|
||||||
Socks5Tunnel.quit()
|
Socks5Tunnel.quit()
|
||||||
LibXrayStopXray()
|
LibXrayStopXray()
|
||||||
completionHandler()
|
completionHandler()
|
||||||
}
|
}
|
||||||
|
|
||||||
private func setupAndStartXray(configData: Data,
|
private func setupAndStartXray(configData: Data,
|
||||||
completionHandler: @escaping (Error?) -> Void) {
|
completionHandler: @escaping (Error?) -> Void) {
|
||||||
let path = Constants.cachesDirectory.appendingPathComponent("config.json", isDirectory: false).path
|
let path = Constants.cachesDirectory.appendingPathComponent("config.json", isDirectory: false).path
|
||||||
guard FileManager.default.createFile(atPath: path, contents: configData) else {
|
guard FileManager.default.createFile(atPath: path, contents: configData) else {
|
||||||
xrayLog(.error, message: "Can't save xray configuration")
|
xrayLog(.error, message: "Can't save xray configuration")
|
||||||
completionHandler(XrayErrors.cantSaveXrayConfig)
|
completionHandler(XrayErrors.cantSaveXrayConfig)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
LibXrayRunXray(nil,
|
LibXrayRunXray(nil,
|
||||||
path,
|
path,
|
||||||
Int64.max)
|
Int64.max)
|
||||||
|
|
||||||
completionHandler(nil)
|
completionHandler(nil)
|
||||||
xrayLog(.info, message: "Xray started")
|
xrayLog(.info, message: "Xray started")
|
||||||
}
|
}
|
||||||
|
|
||||||
private func setupAndRunTun2socks(configData: Data,
|
private func setupAndRunTun2socks(configData: Data,
|
||||||
address: String,
|
address: String,
|
||||||
port: Int,
|
port: Int,
|
||||||
completionHandler: @escaping (Error?) -> Void) {
|
completionHandler: @escaping (Error?) -> Void) {
|
||||||
let config = """
|
let config = """
|
||||||
tunnel:
|
tunnel:
|
||||||
mtu: 9000
|
mtu: 9000
|
||||||
socks5:
|
socks5:
|
||||||
port: \(port)
|
port: \(port)
|
||||||
address: \(address)
|
address: \(address)
|
||||||
udp: 'udp'
|
udp: 'udp'
|
||||||
misc:
|
misc:
|
||||||
task-stack-size: 20480
|
task-stack-size: 20480
|
||||||
connect-timeout: 5000
|
connect-timeout: 5000
|
||||||
read-write-timeout: 60000
|
read-write-timeout: 60000
|
||||||
log-file: stderr
|
log-file: stderr
|
||||||
log-level: error
|
log-level: error
|
||||||
limit-nofile: 65535
|
limit-nofile: 65535
|
||||||
"""
|
"""
|
||||||
|
|
||||||
let configurationFilePath = Constants.cachesDirectory.appendingPathComponent("config.yml", isDirectory: false).path
|
let configurationFilePath = Constants.cachesDirectory.appendingPathComponent("config.yml", isDirectory: false).path
|
||||||
guard FileManager.default.createFile(atPath: configurationFilePath, contents: config.data(using: .utf8)!) else {
|
guard FileManager.default.createFile(atPath: configurationFilePath, contents: config.data(using: .utf8)!) else {
|
||||||
xrayLog(.info, message: "Cant save hevSocks configuration")
|
xrayLog(.info, message: "Cant save hevSocks configuration")
|
||||||
completionHandler(XrayErrors.cantSaveHevSocksConfig)
|
completionHandler(XrayErrors.cantSaveHevSocksConfig)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
DispatchQueue.global().async {
|
DispatchQueue.global().async {
|
||||||
xrayLog(.info, message: "Hev socks started")
|
xrayLog(.info, message: "Hev socks started")
|
||||||
completionHandler(nil)
|
completionHandler(nil)
|
||||||
Socks5Tunnel.run(withConfig: configurationFilePath)
|
Socks5Tunnel.run(withConfig: configurationFilePath)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||